/* ============================================================
   RKIVERY. Shared stylesheet.
   ============================================================ */

:root {
  --bg: #faf7f2;
  --bg-soft: #f3eee5;
  --ink: #1a1a1a;
  --ink-soft: #4a4a4a;
  --rule: #e8e2d3;
  --accent: #C8553C;
  --accent-soft: rgba(200, 85, 60, 0.08);
  --max: 720px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: 'Fraunces', 'Times New Roman', serif;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.15;
  margin: 0 0 0.5em;
}
h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.2rem); margin-top: 0.5em; }
h3 { font-size: 1.15rem; font-weight: 600; }
p { margin: 0 0 1em; }

a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
a:hover { color: var(--ink); }

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
}

/* NAV */
nav {
  padding: 24px 0;
  border-bottom: 1px solid var(--rule);
}
nav .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.brand {
  font-family: 'Fraunces', serif;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  color: var(--ink);
}
.brand-mark {
  display: inline-block;
  width: 8px; height: 8px;
  background: var(--accent);
  border-radius: 50%;
  margin-right: 8px;
  vertical-align: 2px;
}
.nav-links { display: flex; gap: 22px; font-size: 0.82rem; letter-spacing: 0.04em; }
.nav-links a { text-decoration: none; color: var(--ink-soft); }
.nav-links a:hover { color: var(--ink); }
@media (max-width: 720px) {
  .nav-links { gap: 14px; font-size: 0.74rem; flex-wrap: wrap; justify-content: flex-end; }
}
@media (max-width: 480px) {
  nav .wrap { flex-direction: column; gap: 14px; align-items: flex-start; }
}

/* ACTIVE NAV LINK */
.nav-links a.active {
  color: var(--ink);
  font-weight: 500;
  position: relative;
}
.nav-links a.active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -6px;
  height: 2px;
  background: var(--accent);
}

/* HERO */
.hero {
  padding: 80px 0 60px;
  border-bottom: 1px solid var(--rule);
}
.eyebrow {
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 24px;
}
.hero-tag {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-size: 1.2rem;
  color: var(--accent);
  margin-top: 18px;
  margin-bottom: 0;
  letter-spacing: 0.005em;
}
.hero p.lede {
  font-size: 1.18rem;
  color: var(--ink-soft);
  margin-top: 20px;
  max-width: 540px;
}
.ctas {
  display: flex;
  gap: 14px;
  margin-top: 36px;
  flex-wrap: wrap;
}
.btn {
  display: inline-block;
  padding: 14px 24px;
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  border-radius: 2px;
  transition: all 0.15s;
  cursor: pointer;
  border: none;
  font-family: inherit;
}
.btn-primary {
  background: var(--ink);
  color: var(--bg);
}
.btn-primary:hover { background: var(--accent); color: var(--bg); }
.btn-secondary {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--ink);
}
.btn-secondary:hover { background: var(--ink); color: var(--bg); }

/* SECTION */
section { padding: 64px 0; border-bottom: 1px solid var(--rule); }
section.tight { padding: 48px 0; }

.section-eyebrow {
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 12px;
}

/* PAGE HEADER (for non-home pages) */
.page-header {
  padding: 60px 0 36px;
  border-bottom: 1px solid var(--rule);
}
.page-header .section-eyebrow { margin-bottom: 8px; }
.page-header h1 {
  font-family: 'Fraunces', serif;
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  font-weight: 500;
  margin: 6px 0 0;
}

/* MONO SECTION EYEBROW VARIANT */
.section-eyebrow.mono, .eyebrow.mono {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.18em;
}

/* HOW IT WORKS */
.steps { counter-reset: step; margin-top: 32px; }
.step {
  counter-increment: step;
  padding: 24px 0;
  border-top: 1px solid var(--rule);
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 16px;
}
.step:last-child { border-bottom: 1px solid var(--rule); }
.step::before {
  content: counter(step, decimal-leading-zero);
  font-family: 'Fraunces', serif;
  font-size: 1.5rem;
  color: var(--accent);
}
.step h3 { margin-bottom: 6px; }
.step p { color: var(--ink-soft); margin: 0; }

/* GET LIST */
.get-list { list-style: none; padding: 0; margin: 24px 0 0; }
.get-list li {
  padding: 14px 0 14px 22px;
  border-top: 1px solid var(--rule);
  color: var(--ink-soft);
  position: relative;
  line-height: 1.55;
}
.get-list li:last-child { border-bottom: 1px solid var(--rule); }
.get-list li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 23px;
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
}

/* WHY DIFFERENT */
.why { margin-top: 24px; }
.why-item {
  padding: 16px 0;
  border-top: 1px solid var(--rule);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  align-items: start;
}
.why-item:last-child { border-bottom: 1px solid var(--rule); }
.why-num {
  font-family: 'Fraunces', serif;
  font-size: 1.2rem;
  color: var(--accent);
  min-width: 32px;
}
.why-item h3 { margin-bottom: 4px; font-size: 1rem; }
.why-item p { color: var(--ink-soft); margin: 0; font-size: 0.95rem; }

/* SAMPLES */
.sample {
  background: var(--bg-soft);
  padding: 32px;
  margin-top: 32px;
  border-radius: 4px;
}
.sample-tag {
  display: inline-block;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
  font-weight: 500;
}
.sample h3 {
  font-family: 'Fraunces', serif;
  font-size: 1.4rem;
  font-weight: 500;
  margin-bottom: 8px;
}
.sample-meta {
  color: var(--ink-soft);
  font-size: 0.9rem;
  margin-bottom: 24px;
  font-style: italic;
}
.sample ol { padding: 0; margin: 0; list-style: none; counter-reset: pick; }
.sample-note {
  margin-top: 20px;
  padding: 16px;
  background: var(--bg);
  border-left: 3px solid var(--accent);
  font-size: 0.92rem;
  color: var(--ink-soft);
  font-style: italic;
}

/* ROUTE TAG (above each sample, transit-themed) */
.route-tag {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  padding: 5px 11px;
  background: rgba(200, 85, 60, 0.1);
  color: var(--accent);
  border-radius: 2px;
  margin-bottom: 14px;
  font-weight: 500;
}

/* SAMPLE ROUTE LIST — vertical track + stop markers */
.route-list {
  list-style: none;
  padding: 0 0 0 50px;
  margin: 24px 0 0;
  position: relative;
  counter-reset: stop;
}
/* .route-list::before (vertical track line) removed: stop number circles
   carry the sequence on their own; the track was cutting visually
   into adjacent content. */
.route-list li {
  counter-increment: stop;
  position: relative;
  padding: 14px 0;
  border-top: 1px solid var(--rule);
}
.route-list li:first-child { border-top: none; padding-top: 4px; }
.route-list li::before {
  content: counter(stop, decimal-leading-zero);
  position: absolute;
  left: -42px;
  top: 18px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}
.route-list li:first-child::before { top: 8px; }
.stop-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 4px;
  display: block;
}
.stop-title {
  font-weight: 600;
  margin-bottom: 4px;
  display: block;
}
.stop-detail {
  color: var(--ink-soft);
  font-size: 0.94rem;
  line-height: 1.55;
  display: block;
}

/* DOT GRID BG ON HERO */
.hero {
  background-image: radial-gradient(circle, rgba(200, 85, 60, 0.13) 1px, transparent 1.2px);
  background-size: 22px 22px;
  background-position: 11px 11px;
}

/* PAGE-LEVEL CTA BLOCK */
.cta-block {
  margin: 56px 0;
  padding: 36px 32px;
  background: var(--bg-soft);
  border-radius: 4px;
  text-align: center;
}
.cta-block h3 {
  font-family: 'Fraunces', serif;
  font-size: 1.4rem;
  font-weight: 500;
  margin: 0 0 14px;
}
.cta-block p {
  color: var(--ink-soft);
  margin-bottom: 22px;
}

/* FORM */
form { margin-top: 32px; }
fieldset { border: none; padding: 0; margin: 0 0 32px; }
legend {
  font-family: 'Fraunces', serif;
  font-size: 1.3rem;
  font-weight: 500;
  padding: 0;
  margin-bottom: 6px;
}
.legend-sub {
  color: var(--ink-soft);
  font-size: 0.9rem;
  margin-bottom: 20px;
  font-style: italic;
}
.field { margin-bottom: 22px; }
.field label {
  display: block;
  font-weight: 500;
  margin-bottom: 8px;
  font-size: 0.95rem;
}
.field .hint {
  color: var(--ink-soft);
  font-size: 0.85rem;
  margin-bottom: 8px;
  font-weight: 400;
}
.field input[type="text"],
.field input[type="email"],
.field input[type="number"],
.field textarea,
.field select {
  width: 100%;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 1rem;
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: 2px;
  color: var(--ink);
}
.field textarea { min-height: 80px; resize: vertical; }
.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: var(--accent);
}
.options { display: grid; gap: 8px; }
.options label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--rule);
  border-radius: 2px;
  background: var(--bg);
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 400;
  margin: 0;
  transition: all 0.1s;
}
.options label:hover { background: var(--bg-soft); }
.options input[type="radio"],
.options input[type="checkbox"] {
  margin-top: 3px;
  flex-shrink: 0;
}
.scale-options {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}
.scale-options label {
  justify-content: center;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 12px 4px;
  font-size: 0.82rem;
}
.scale-options input { margin: 0 0 4px; }

/* AI COMPARISON */
.vs-intro {
  color: var(--ink-soft);
  margin-top: 16px;
  max-width: 540px;
}
.query-card {
  background: var(--ink);
  color: var(--bg);
  padding: 28px;
  margin: 36px 0 28px;
  border-radius: 4px;
}
.query-tag {
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--bg-soft);
  margin-bottom: 12px;
  font-weight: 500;
  opacity: 0.75;
}
.query-card p {
  margin: 0;
  font-family: 'Fraunces', serif;
  font-size: 1.18rem;
  line-height: 1.45;
  font-style: italic;
}
.comparison {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
@media (max-width: 760px) {
  .comparison { grid-template-columns: 1fr; }
}
.vs-column {
  padding: 28px 24px;
  border-radius: 4px;
}
.vs-column.ai {
  background: #ededec;
  color: #555;
}
.vs-column.rkivery {
  background: var(--bg-soft);
  color: var(--ink);
}
.vs-label {
  font-family: 'Fraunces', serif;
  font-size: 1.4rem;
  font-weight: 500;
  margin-bottom: 4px;
}
.vs-sublabel {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 22px;
  opacity: 0.65;
}
.vs-list {
  padding: 0;
  margin: 0 0 20px;
  list-style: none;
}
.vs-list li {
  padding: 12px 0;
  border-top: 1px solid rgba(0,0,0,0.08);
  font-size: 0.92rem;
  line-height: 1.5;
}
.vs-list li:last-child { border-bottom: 1px solid rgba(0,0,0,0.08); }
.vs-list li strong { display: block; margin-bottom: 3px; font-weight: 600; font-size: 0.93rem; }
.vs-callout {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 2px solid rgba(0,0,0,0.12);
}
.vs-callout-header {
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 14px;
  opacity: 0.85;
}
.vs-callout ul {
  padding: 0;
  margin: 0;
  list-style: none;
}
.vs-callout li {
  padding: 10px 0;
  font-size: 0.9rem;
  line-height: 1.55;
  border-top: 1px solid rgba(0,0,0,0.07);
}
.vs-callout li:first-child {
  border-top: none;
  padding-top: 0;
}
.vs-callout li:last-child {
  padding-bottom: 0;
}
.vs-column.ai .vs-callout li { color: #555; }
.vs-column.rkivery .vs-callout li { color: var(--ink); }
.vs-closer {
  font-family: 'Fraunces', serif;
  font-size: 1.35rem;
  font-style: italic;
  text-align: center;
  margin: 40px auto 0;
  color: var(--ink);
  max-width: 520px;
  line-height: 1.4;
}
.vs-aside {
  margin-top: 16px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

/* FAQ */
.faq details {
  padding: 18px 0;
  border-top: 1px solid var(--rule);
}
.faq details:last-child { border-bottom: 1px solid var(--rule); }
.faq summary {
  cursor: pointer;
  font-weight: 500;
  font-size: 1rem;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  font-family: 'Fraunces', serif;
  font-size: 1.4rem;
  color: var(--accent);
  transition: transform 0.2s;
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p {
  margin: 12px 0 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

/* FOOTER */
footer {
  padding: 48px 0 80px;
  color: var(--ink-soft);
  font-size: 0.88rem;
}
footer p { margin-bottom: 8px; }

/* === DEPARTURES BOARD === */
.departures-board {
  background: #13111C;
  color: #f0eee8;
  padding: 26px 28px;
  border-radius: 4px;
  margin-top: 32px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  line-height: 1.4;
  letter-spacing: 0.04em;
  box-shadow: 0 16px 36px -14px rgba(0,0,0,0.25);
  overflow: hidden;
}
.board-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255,255,255,0.12);
  margin-bottom: 14px;
  gap: 16px;
}
.board-title {
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--accent);
  font-size: 0.86rem;
}
.board-meta {
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  color: rgba(240, 238, 232, 0.5);
  margin-top: 6px;
}
.board-clock {
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  color: rgba(240, 238, 232, 0.55);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  padding-top: 2px;
}
.board-row {
  display: grid;
  grid-template-columns: 56px 1fr 60px 90px 150px;
  gap: 14px;
  padding: 11px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  align-items: center;
}
.board-row-headers {
  opacity: 0.4;
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  border-bottom: none;
  padding-bottom: 8px;
  padding-top: 0;
}
.board-row:last-child { border-bottom: none; }
.board-row-pending { opacity: 0.55; }
.board-status {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 2px;
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
}
.status-shipped {
  background: rgba(200, 85, 60, 0.18);
  color: #E07856;
}
.status-pending {
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.5);
}
.board-num { color: rgba(255,255,255,0.5); }
.board-route { color: #f0eee8; }
.board-stops, .board-date { color: rgba(240, 238, 232, 0.7); }
.board-footer {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(255,255,255,0.08);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  color: rgba(240, 238, 232, 0.4);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
@media (max-width: 720px) {
  .board-row {
    grid-template-columns: 1fr 1fr;
    gap: 6px 14px;
    padding: 12px 0;
  }
  .board-row-headers { display: none; }
  .board-route { grid-column: 1 / -1; font-weight: 600; }
  .board-status { justify-self: end; }
  .departures-board { font-size: 0.72rem; padding: 22px 20px; }
  .board-header { flex-direction: column; gap: 8px; }
}

/* === FUN ENHANCEMENTS === */

/* Section eyebrow accent dot */
.section-eyebrow::before, .eyebrow::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  margin-right: 10px;
  vertical-align: 2px;
}

/* Brand mark gentle pulse */
.brand-mark {
  animation: pulse 4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.18); opacity: 0.7; }
}

/* Hover lift on interactive cards */
.btn, .sample, .vs-column, .query-card, .step, .why-item {
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.2s ease, color 0.2s ease;
}
.btn:hover { transform: translateY(-1px); }
.sample:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 32px -14px rgba(72, 30, 15, 0.16);
}
.vs-column:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 32px -14px rgba(72, 30, 15, 0.16);
}
.vs-column.ai:hover { background: #e3e2e1; }
.step:hover h3 { color: var(--accent); }
.why-item:hover h3 { color: var(--accent); }
.nav-links a { transition: color 0.2s; }

/* Reveal sections on scroll (progressively enhanced) */
.js-loaded section {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.75s ease-out, transform 0.75s ease-out;
}
.js-loaded section.in-view {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .js-loaded section,
  .js-loaded section.in-view {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .btn, .sample, .vs-column, .brand-mark { animation: none !important; transition: none !important; transform: none !important; }
}

/* Rkivery seal */
.rkivery-seal {
  width: 60px;
  height: 60px;
  color: var(--accent);
  opacity: 0.85;
  transition: opacity 0.3s ease, transform 0.4s cubic-bezier(.5,0,.25,1.4);
  display: block;
}
.rkivery-seal:hover {
  opacity: 1;
  transform: rotate(-7deg) scale(1.04);
}
.seal-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 18px;
  margin-top: 28px;
  padding-top: 8px;
}
.seal-line {
  flex: 0 1 70px;
  height: 1px;
  background: var(--rule);
}
.footer-seal {
  width: 70px;
  height: 70px;
  color: var(--accent);
  opacity: 0.9;
  margin-bottom: 18px;
  display: block;
}

/* SUCCESS MESSAGE */
.form-message {
  margin-top: 24px;
  padding: 20px;
  border-radius: 2px;
  display: none;
}
.form-message.success {
  background: #e8f0e3;
  color: #2d4a1e;
  display: block;
}
.form-message.error {
  background: #f3dada;
  color: #7a2020;
  display: block;
}

/* === CUSTOM CURSORS === */

/* Default: tiny terracotta suitcase */
body {
  cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 22 22'><path d='M 8 5 Q 8 3 11 3 Q 14 3 14 5' fill='none' stroke='%231a1a1a' stroke-width='1.4' stroke-linecap='round'/><rect x='3' y='6' width='16' height='12' rx='1.5' fill='%23C8553C' stroke='%231a1a1a' stroke-width='1.2'/><line x1='11' y1='6' x2='11' y2='18' stroke='%231a1a1a' stroke-width='0.7'/><circle cx='11' cy='12' r='1.2' fill='%231a1a1a'/></svg>") 11 11, default;
}

/* Hover on clickable elements: wine glass */
a, button, .btn, summary, [role="button"], .nav-links a, label.options, label.options *, .ctas a {
  cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='20' height='22' viewBox='0 0 20 22'><path d='M 5 3 L 15 3 L 13 11 Q 13 14 10 14 Q 7 14 7 11 Z' fill='%23C8553C' stroke='%231a1a1a' stroke-width='0.9'/><line x1='10' y1='14' x2='10' y2='20' stroke='%231a1a1a' stroke-width='0.9'/><line x1='6' y1='20' x2='14' y2='20' stroke='%231a1a1a' stroke-width='1' stroke-linecap='round'/></svg>") 10 3, pointer;
}

/* Inputs keep native text cursor */
input[type="text"], input[type="email"], input[type="number"], input[type="tel"], input[type="url"], textarea, select {
  cursor: text;
}

/* === DYNAMIC LAYER === */

/* Cross-page View Transitions (browser-native fade between pages) */
@view-transition {
  navigation: auto;
}
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.35s;
  animation-timing-function: ease-out;
}
::view-transition-old(root) {
  animation-name: viewFadeOut;
}
::view-transition-new(root) {
  animation-name: viewFadeIn;
}
@keyframes viewFadeOut {
  to { opacity: 0; transform: translateY(-6px); }
}
@keyframes viewFadeIn {
  from { opacity: 0; transform: translateY(8px); }
}

/* Hero: dot grid drifts slowly (calm but moving texture) */
.hero {
  animation: dotDrift 22s linear infinite;
  position: relative;
  overflow: hidden;
}
@keyframes dotDrift {
  from { background-position: 11px 11px; }
  to { background-position: 33px 33px; }
}

/* Hero: subtle bullet train silhouette occasionally crossing */
.bullet-train {
  position: absolute;
  bottom: 18px;
  left: -180px;
  width: 110px;
  height: 22px;
  fill: var(--accent);
  opacity: 0.18;
  pointer-events: none;
  animation: trainCross 32s linear infinite;
  animation-delay: 4s;
}
.bullet-train .train-window {
  fill: var(--bg);
  opacity: 0.7;
}
@keyframes trainCross {
  0% { transform: translateX(0); }
  35% { transform: translateX(calc(100vw + 250px)); }
  100% { transform: translateX(calc(100vw + 250px)); }
}

/* Departures board: rows stagger-fade-up on first paint */
.departures-board .board-row {
  opacity: 0;
  animation: boardRowIn 0.55s ease-out forwards;
}
.departures-board .board-row:nth-of-type(1) { animation-delay: 0.05s; }
.departures-board .board-row:nth-of-type(2) { animation-delay: 0.18s; }
.departures-board .board-row:nth-of-type(3) { animation-delay: 0.31s; }
.departures-board .board-row:nth-of-type(4) { animation-delay: 0.44s; }
.departures-board .board-row:nth-of-type(5) { animation-delay: 0.57s; }
.departures-board .board-row:nth-of-type(6) { animation-delay: 0.70s; }
.departures-board .board-row:nth-of-type(7) { animation-delay: 0.83s; }
.departures-board .board-row:nth-of-type(8) { animation-delay: 0.96s; }
@keyframes boardRowIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Departures board: status badge gentle pulse for shipped rows */
.status-shipped {
  animation: statusPulse 3.6s ease-in-out infinite;
}
@keyframes statusPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(224, 120, 86, 0); }
  50% { box-shadow: 0 0 0 4px rgba(224, 120, 86, 0.15); }
}

/* Departures board: hover tint on shipped rows */
.departures-board .board-row:not(.board-row-headers):not(.board-row-pending) {
  transition: background 0.2s ease;
}
.departures-board .board-row:not(.board-row-headers):not(.board-row-pending):hover {
  background: rgba(224, 120, 86, 0.04);
}

/* Sample route: stop markers stagger-pop when route enters viewport */
.route-list li::before {
  opacity: 0;
  transform: scale(0.4);
  transition: opacity 0.45s ease-out, transform 0.45s cubic-bezier(.5, 0, .25, 1.6);
}
.route-list.in-view li::before {
  opacity: 1;
  transform: scale(1);
}
.route-list.in-view li:nth-child(1)::before { transition-delay: 0.10s; }
.route-list.in-view li:nth-child(2)::before { transition-delay: 0.20s; }
.route-list.in-view li:nth-child(3)::before { transition-delay: 0.30s; }
.route-list.in-view li:nth-child(4)::before { transition-delay: 0.40s; }
.route-list.in-view li:nth-child(5)::before { transition-delay: 0.50s; }
.route-list.in-view li:nth-child(6)::before { transition-delay: 0.60s; }

/* Track-line draw-in animation removed alongside the track itself. */

/* CTA block hover */
.cta-block {
  transition: background 0.3s ease;
}
.cta-block:hover {
  background: rgba(200, 85, 60, 0.08);
}

/* === FLY-BYs: characters that move across pages === */

.has-flyby {
  position: relative;
  overflow: hidden;
}

/* Airplane on the Departures page (cousin of the bullet train) */
.airplane {
  position: absolute;
  top: 22px;
  left: -210px;
  width: 90px;
  height: auto;
  fill: var(--accent);
  opacity: 0.22;
  pointer-events: none;
  animation: planeCross 28s linear infinite;
  animation-delay: 6s;
  z-index: 0;
}
@keyframes planeCross {
  0% { transform: translateX(0); }
  40% { transform: translateX(calc(100vw + 260px)); }
  100% { transform: translateX(calc(100vw + 260px)); }
}

/* Faceless traveler silhouette (decorative, on the About page) */
.traveler-silhouette {
  position: absolute;
  top: 18px;
  right: 24px;
  width: 90px;
  height: auto;
  color: var(--accent);
  opacity: 0.9;
  pointer-events: none;
  display: block;
  animation: travelerLean 6s ease-in-out infinite;
  transform-origin: bottom center;
}
@keyframes travelerLean {
  0%, 100% { transform: rotate(0deg) translateY(0); }
  50% { transform: rotate(-1.5deg) translateY(-2px); }
}
@media (max-width: 600px) {
  .traveler-silhouette { display: none; }
}

/* Reduced motion: kill the dynamic layer too */
@media (prefers-reduced-motion: reduce) {
  .hero, .bullet-train, .departures-board .board-row,
  .status-shipped, .route-list li::before,
  .airplane, .traveler-silhouette {
    animation: none !important;
    transition: none !important;
    transform: none !important;
    opacity: 1 !important;
  }
}

/* ============================================================
   POSTMARK STAMP (hero, top-right, hand-stamped feel).
   ============================================================ */
.postmark {
  position: absolute;
  top: 28px;
  right: 28px;
  width: 130px;
  height: 90px;
  color: var(--accent);
  opacity: 0.7;
  transform: rotate(-7deg);
  pointer-events: none;
  z-index: 1;
}
@media (max-width: 720px) {
  .postmark {
    width: 104px;
    height: 72px;
    top: 22px;
    right: 18px;
    opacity: 0.6;
  }
}
@media (max-width: 480px) {
  .postmark {
    width: 80px;
    height: 56px;
    top: 14px;
    right: 12px;
    opacity: 0.5;
  }
}

/* ============================================================
   TICKET-STUB SAMPLE CARDS.
   Perforation line + two notches punched into the right edge,
   plus a vertical "stub" tab carrying the route number.
   The notch trick relies on the page background being var(--bg).
   ============================================================ */
.sample {
  --stub-width: 56px;
  --notch-radius: 9px;
  position: relative;
  background:
    radial-gradient(circle at calc(100% - var(--stub-width)) 0, var(--bg) var(--notch-radius), transparent calc(var(--notch-radius) + 0.6px)) top no-repeat,
    radial-gradient(circle at calc(100% - var(--stub-width)) 100%, var(--bg) var(--notch-radius), transparent calc(var(--notch-radius) + 0.6px)) bottom no-repeat,
    var(--bg-soft);
  padding-right: calc(28px + var(--stub-width));
}
.sample::after {
  content: "";
  position: absolute;
  right: var(--stub-width);
  top: var(--notch-radius);
  bottom: var(--notch-radius);
  width: 0;
  border-left: 1.5px dashed rgba(200, 85, 60, 0.32);
  pointer-events: none;
}
.sample-stub {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: var(--stub-width);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  pointer-events: none;
}
.sample-stub-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.22em;
  color: var(--accent);
  opacity: 0.75;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  text-transform: uppercase;
}
.sample-stub-num {
  font-family: 'Fraunces', serif;
  font-size: 1.35rem;
  font-weight: 500;
  color: var(--accent);
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  letter-spacing: 0.04em;
}
@media (max-width: 480px) {
  .sample {
    --stub-width: 40px;
    --notch-radius: 7px;
    padding: 24px;
    padding-right: calc(18px + var(--stub-width));
  }
  .sample-stub-label { font-size: 0.52rem; }
  .sample-stub-num { font-size: 1.1rem; }
  .sample-stub { gap: 10px; }
}

/* ============================================================
   FILED STAMP (booking form submission).
   The wrap is display:none until JS adds .is-active. The stamp
   itself starts huge and transparent, then slams down to size
   with a brief overshoot, like a real rubber stamp coming down.
   The submit handler in book.html sets the date text and then
   adds .is-stamped to trigger the animation.
   ============================================================ */
.filed-stamp-wrap {
  display: none;
  justify-content: center;
  align-items: center;
  margin-top: 20px;
  margin-bottom: 4px;
  height: 140px;
  pointer-events: none;
}
.filed-stamp-wrap.is-active {
  display: flex;
}
.filed-stamp {
  width: 220px;
  height: 130px;
  color: var(--accent);
  opacity: 0;
  transform: scale(2.4) rotate(-2deg);
  transform-origin: center;
}
.filed-stamp.is-stamped {
  animation: stampDown 0.45s cubic-bezier(0.4, 1.4, 0.5, 1) forwards;
}
@keyframes stampDown {
  0%   { opacity: 0; transform: scale(2.4) rotate(-2deg); }
  55%  { opacity: 1; transform: scale(0.92) rotate(-9deg); }
  100% { opacity: 1; transform: scale(1) rotate(-7deg); }
}
@media (prefers-reduced-motion: reduce) {
  .filed-stamp.is-stamped {
    animation: none;
    opacity: 1;
    transform: scale(1) rotate(-7deg);
  }
}
@media (max-width: 480px) {
  .filed-stamp-wrap { height: 110px; }
  .filed-stamp { width: 180px; height: 105px; }
}
