/*
  FareGate landing page styles.
  System font stack only — no web fonts, no CDN, zero dependencies.
  Transit / turnstile motif: high contrast, big confident type, "platform" signage feel.
  Full light/dark support via prefers-color-scheme.

  The :root layer below mirrors design/design-system/tokens.json verbatim
  (R5 DESIGN_DIRECTION §2): blue = payable, amber = earned (exactly once, §3),
  fare-card = structure, station-board dark = the fare itself.
*/

:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  /* fareNumeric on the web: monospaced tabular stack (tokens.json type.fareNumeric) */
  --font-fare: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas,
    "Liberation Mono", monospace;

  /* transit blue — the payable action (tokens.json transitBluePrimary) */
  --transit-blue: #1E5AA8;          /* FILL in both schemes (R1 §2.1 rule) */
  --transit-blue-pressed: #17497F;
  --transit-blue-text: #1E5AA8;     /* links/eyebrows; swaps to tintOnDark in dark */
  --on-transit-blue: #FFFFFF;

  /* ink (tokens.json ink.light) */
  --ink: #1B1E24;
  --ink-secondary: #565D68;

  /* fare-card stock (tokens.json fareCardNeutral.light) */
  --concourse: #F7F7F5;             /* page bg */
  --fare-card: #FFFFFF;             /* card/band surface */
  --hairline: #E6E6E2;

  /* station board — DARK IN BOTH SCHEMES (fareCardNeutral.dark): in light mode the
     board is "a window onto the platform at night" (R1 §5.1). */
  --board-bg: #0F0F12;
  --board-cell: #1C1C1E;
  --board-hairline: #3A3A3C;
  --board-ink: #F2F2F7;
  --board-ink-secondary: #A6ADB8;

  /* earned amber — tokens.json earnedTimeAccent.dark. Amber discipline (R1 §2.1):
     amber pixels iff time earned. On this page the budget is EXACTLY ONE instance:
     the hero board's earned figure (.cell-earned, §3). */
  --earned-amber: #FFB300;

  /* semantic (tokens.json semantic) — form status only */
  --success: #1E7A44;
  --warning: #B4510F;               /* error copy tone — no error red in v1 (R1 §2.1) */

  --focus: #1E5AA8;

  /* radius (tokens.json radius 2/12/16) */
  --radius-small: 2px;              /* plates: board cells, step numbers, stamp plate */
  --radius-card: 12px;              /* buttons, inputs, value cards, steps */
  --radius-frame: 16px;             /* board panel, poster, subpage panels */

  /* elevation (tokens.json elevation, web shadows) */
  --shadow-card: 0 2px 8px rgba(27, 30, 36, 0.08);
  --shadow-elevated: 0 6px 24px rgba(27, 30, 36, 0.12);

  /* motion — the turnstile family (tokens.json motion._web_mac_equivalents) */
  --ease-stamp: cubic-bezier(0.34, 1.30, 0.45, 1.00);   /* the ONLY overshoot */
  --ease-settle: cubic-bezier(0.22, 1.00, 0.36, 1.00);
  --ease-tick: cubic-bezier(0.00, 0.00, 0.20, 1.00);
  --dur-tick: 90ms;
  --dur-fade: 180ms;

  --max-width: 1080px;
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;
  --space-5: 4rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #F2F2F7;
    --ink-secondary: #A6ADB8;
    --concourse: #0F0F12;
    --fare-card: #1C1C1E;
    --hairline: #3A3A3C;
    --transit-blue-text: #6BA4EF;   /* tintOnDark — text/stroke only, NEVER a fill */
    --focus: #6BA4EF;
    --success: #45C486;
    --warning: #F08A4B;
    --shadow-card: none;            /* dark elevates by surface tier (tokens _darkRule) */
    --shadow-elevated: none;
    /* board vars unchanged — the board was already night */
  }
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  /* Offsets in-page anchor jumps (e.g. nav "how it works" link) so the target
     doesn't land hidden under the sticky header (landing-D6-01). */
  scroll-padding-top: 5rem;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--concourse);
  color: var(--ink);
  line-height: 1.5;
  font-size: 17px;
}

.wrap {
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--space-3);
}

h1, h2, h3 {
  line-height: 1.15;
  letter-spacing: -0.01em;
}

a {
  color: var(--transit-blue-text);
  /* W5a-3: transition lives on the base selector (not a:hover) so color animates
     symmetrically in BOTH directions — on hover-in AND on hover-out. A hover-only
     transition only runs while the :hover rule applies, so it snaps on hover-out. */
  transition: color var(--dur-fade) ease-in-out;
}

/* Skip link */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--transit-blue);
  color: var(--on-transit-blue);
  padding: var(--space-1) var(--space-2);
  z-index: 100;
  border-radius: 0 0 var(--radius-card) 0;
}

.skip-link:focus {
  left: 0;
}

/* Focus visibility */
a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

/* Header */
.site-header {
  border-bottom: 1px solid var(--hairline);
  position: sticky;
  top: 0;
  background: var(--concourse);
  z-index: 10;
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: var(--space-2);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  text-decoration: none;
  color: var(--ink);
}

/* The turnstile mark (§8 geometry), one source shared with favicon + poster.
   Two poles + a gate bar, one monochrome fill — tracks `color`. */
.wordmark-mark {
  width: 20px;
  height: 20px;
  flex: none;
  color: var(--transit-blue);
}

@media (prefers-color-scheme: dark) {
  .wordmark-mark {
    color: var(--transit-blue-text);   /* tint on dark — the mark is stroke/fill only here */
  }
}

.header-cta {
  text-decoration: none;
  font-weight: 600;
  color: var(--ink);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  padding: var(--space-1) var(--space-2);
  transition: border-color var(--dur-fade) ease-in-out;
}

.header-cta:hover {
  border-color: var(--ink-secondary);
}

/* Buttons */
.btn {
  display: inline-block;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  border-radius: var(--radius-card);
  padding: 0.85rem 1.5rem;
  border: none;
  cursor: pointer;
  text-align: center;
}

.btn-primary {
  background: var(--transit-blue);
  color: var(--on-transit-blue);
  transition: background-color var(--dur-fade) ease-in-out;
}

.btn-primary:hover {
  background: var(--transit-blue-pressed);
}

.btn-primary:active {
  transform: translateY(1px);
}

/* Hero */
.hero {
  padding-block: var(--space-5) var(--space-4);
  border-bottom: 1px solid var(--hairline);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
  align-items: center;
}

@media (min-width: 860px) {
  .hero-grid {
    grid-template-columns: 1.1fr 0.9fr;
  }
}

.hero-copy {
  /* D7: without this, the fare board's non-wrapping row (below) forces a
     min-content width on this grid item that the 1fr track inherits
     (CSS grid tracks default to minmax(auto,1fr); auto = min-content),
     dragging the whole hero into page-level horizontal overflow at narrow
     viewports / enlarged base font. min-width:0 lets the column shrink to
     the actual viewport instead; .fare-board's own overflow-x container
     (below) then absorbs whatever the row can't fit. */
  min-width: 0;
}

.hero-copy h1 {
  font-size: clamp(2.25rem, 5vw, 3.25rem);
  margin: 0 0 var(--space-3);
}

/* W5a-2: the promoted differentiator eyebrow — reuses .eyebrow's typography
   (styles.css .eyebrow, tokens only) plus the spacing needed above the H1. */
.hero-eyebrow {
  display: block;
  margin: 0 0 var(--space-2);
}

.hero-subhead {
  font-size: 1.15rem;
  color: var(--ink-secondary);
  max-width: 46ch;
}

.hero-actions {
  margin-top: var(--space-3);
}

.hero-microcopy {
  color: var(--ink-secondary);
  font-size: 0.9rem;
  margin-top: var(--space-1);
}

/* Hero station board — the page's protagonist (§3). A lit departure board on the
   light concourse; the earned figure is this page's ONE amber instance. */
.fare-board {
  display: inline-block;
  max-width: 100%;
  /* D7: the row below is a non-wrapping split-flap strip (wrapping it would
     break a numeral like "15:00" across two lines). At narrow viewports /
     enlarged base font, contain any residual overflow to this small board
     instead of letting it force the hero column's min-content width and
     leak into page-level horizontal scroll. The board content stays fully
     reachable (scrollable), never clipped. */
  overflow-x: auto;
  margin: 0 0 var(--space-3);
  padding: var(--space-2) var(--space-3);
  background: var(--board-bg);
  border: 1px solid var(--board-hairline);
  border-radius: var(--radius-frame);
  box-shadow: var(--shadow-card);
}

.board-row {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.cell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.10em 0.14em;
  background: var(--board-cell);
  border-radius: var(--radius-small);
  font-family: var(--font-fare);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: clamp(1.05rem, 4.2vw, 2.4rem);
  line-height: 1;
  color: var(--board-ink);
  overflow: hidden;                 /* masks the split-flap roll */
}

.board-gap {
  display: inline-block;
  width: 0.5em;
}

.cell-arrow {
  color: var(--board-ink-secondary);
}

/* The ONLY selector permitted to reference --earned-amber (the amber law, §3). */
.cell-earned {
  color: var(--earned-amber);
}

/* Split-flap settle — the page's one load animation (~960ms, ≤1.2s gate budget). */
.cell {
  animation: flap-in var(--dur-tick) var(--ease-tick) both;
  animation-delay: calc(var(--i) * 40ms + 120ms);
}

@keyframes flap-in {
  from { transform: translateY(-0.55em); opacity: 0; }
  to   { transform: translateY(0);       opacity: 1; }
}

.board-row {
  animation: board-stamp 240ms var(--ease-stamp) both;
  animation-delay: 720ms;
}

@keyframes board-stamp {
  from { transform: scale(1.04); }
  to   { transform: scale(1.0); }
}

/* Phone frame — device chrome (9:16, 32px bezel radius, deliberately off the token
   radii). Now houses the honest gate-open poster (§4), not a dashed TODO. */
.phone-frame {
  justify-self: center;
  width: min(280px, 70vw);
  aspect-ratio: 9 / 16;
  border-radius: 32px;
  border: 3px solid var(--hairline);
  background: var(--board-bg);
  padding: var(--space-2);
  display: flex;
}

/* The demo slot's inner well. Since 2026-07-16 it holds the 15s demo loop
   (video.demo-loop) per the slot's own drop-in instruction; the pre-video
   mark/title/fare/plate rules were deleted with their markup the same day. */
.poster {
  flex: 1;
  display: flex;
  overflow: hidden;
  background: var(--board-bg);
  border-radius: var(--radius-frame);
}

.demo-loop {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Section rhythm */
section {
  padding-block: var(--space-5);
}

/* Class-scoped so .prose headings no longer inherit this display size (§5.3 fix). */
.section-title {
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  margin-bottom: var(--space-3);
}

.how-it-works {
  border-bottom: 1px solid var(--hairline);
  background: var(--fare-card);
}

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-3);
  grid-template-columns: 1fr;
}

@media (min-width: 760px) {
  .steps {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Fare-card material — calm, no hover motion on non-interactive surfaces (§5.1). */
.step {
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  padding: var(--space-3);
  background: var(--fare-card);
  box-shadow: var(--shadow-card);
}

/* W5a-5: the how-it-works mark-family micro-diagrams (gate-closed / fare-card /
   passage-open). Decoration only (aria-hidden in markup); monochrome via
   currentColor — ZERO amber (LANG-2/HG-3). Same dark-scheme tint swap as
   .wordmark-mark (fill+stroke marks track the tint color, not the fill blue). */
.step-diagram {
  display: block;
  width: 30px;
  height: 30px;
  color: var(--transit-blue);
  margin-bottom: var(--space-1);
}

@media (prefers-color-scheme: dark) {
  .step-diagram {
    color: var(--transit-blue-text);
  }
}

/* Platform plate — steps 1·2·3 read as stations on a line (§5.1). */
.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius-small);
  background: var(--transit-blue);
  color: var(--on-transit-blue);
  font-family: var(--font-fare);
  font-weight: 700;
  margin-bottom: var(--space-2);
}

.step h3 {
  margin: 0 0 var(--space-1);
}

.step p {
  color: var(--ink-secondary);
  margin: 0;
}

/* Why FareGate — the W5b fidelity-proof still, framed as one calm artifact (frame radius + card
   shadow), sitting above the value cards. width/height attrs on the <img> reserve the 2:1 box
   (zero CLS); height:auto keeps it responsive. */
.why-proof {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  margin: 0 0 var(--space-3);
  /* Hairline + shadow, matching .value-card/.step/.phone-frame — the border is what gives the
     still edge definition on the DARK page, where --shadow-card resolves to none (Fable W5b
     caveat #4: without it, the light-biased still floated as a bright rectangle on near-black). */
  border: 1px solid var(--hairline);
  border-radius: var(--radius-frame);
  box-shadow: var(--shadow-card);
}

/* Why cards */
.cards {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

.value-card {
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  padding: var(--space-3);
  background: var(--fare-card);
  box-shadow: var(--shadow-card);
}

.value-card h3 {
  margin: 0 0 var(--space-1);
  font-size: 1.05rem;
}

.value-card p {
  margin: 0;
  color: var(--ink-secondary);
}

/* Who it's for */
.who {
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  background: var(--fare-card);
}

.who p {
  max-width: 62ch;
  color: var(--ink-secondary);
  font-size: 1.05rem;
}

/* Waitlist */
.waitlist-lede {
  color: var(--ink-secondary);
  margin-top: 0;
}

.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: flex-end;
  max-width: 640px;
}

.form-row label {
  flex-basis: 100%;
  font-weight: 600;
  font-size: 0.9rem;
}

#email {
  flex: 1 1 260px;
  font-family: inherit;
  font-size: 1rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-card);
  border: 1px solid var(--hairline);
  background: var(--fare-card);
  color: var(--ink);
}

.form-status {
  margin-top: var(--space-2);
  font-size: 0.95rem;
  min-height: 1.4em;
}

/* W5a-1: the no-JS fallback message — same tone as .waitlist-lede, no new tokens. */
.waitlist-noscript {
  color: var(--ink-secondary);
  margin-top: var(--space-2);
  max-width: 46ch;
}

/* Status colors re-tokened — no error red in v1 (R1 §2.1); tokens swap by scheme. */
.form-status[data-state="success"] {
  color: var(--success);
}

.form-status[data-state="error"] {
  color: var(--warning);
}

.form-status[data-state="pending"],
.form-status[data-state="soon"] {
  color: var(--ink-secondary);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--hairline);
  padding-block: var(--space-4);
  color: var(--ink-secondary);
  font-size: 0.9rem;
}

/* Subpage sections (privacy / contact) — padding only, no borrowed band chrome (§6). */
.subpage {
  padding-block: var(--space-5);
}

.prose {
  max-width: 48rem;
}

/* Prose type scale (§6) — binds heads to their paragraphs now the cascade is fixed. */
.prose h1 {
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  letter-spacing: -0.015em;
  margin: 0 0 1.25rem;
}

.prose h2 {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 2.25rem 0 0.5rem;
}

.prose p {
  max-width: 44rem;
}

/* Fare-card panel — one calm artifact on the station wall (§6). */
.prose-panel {
  background: var(--fare-card);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-frame);
  box-shadow: var(--shadow-card);
  padding: clamp(1.5rem, 4vw, 2.5rem);
}

.eyebrow {
  color: var(--transit-blue-text);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Validation stamp — the "last updated" date as a station-stamp plate (§6). */
.stamp-plate {
  display: inline-block;
  margin-bottom: var(--space-2);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
  color: var(--ink-secondary);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-small);
  padding: 2px 8px;
}

.stamp-date {
  font-family: var(--font-fare);
  font-variant-numeric: tabular-nums;
}

/* Station window (contact) — the support address as the page's one focal object (§7). */
.station-window {
  margin-block: var(--space-3);
  padding: var(--space-3);
  background: var(--fare-card);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-frame);
  box-shadow: var(--shadow-card);
}

.window-email {
  font-family: var(--font-fare);
  font-weight: 600;
  font-size: clamp(1.15rem, 3.2vw, 1.6rem);
  color: var(--transit-blue-text);
  overflow-wrap: anywhere;
}

.site-footer p {
  margin: 0 0 var(--space-1);
}

.footer-links a {
  color: inherit;
  text-decoration: underline;
}

/* All motion degrades to static final frames — nothing lost (§9). */
@media (prefers-reduced-motion: reduce) {
  .cell,
  .board-row {
    animation: none;
  }

  a,
  a:hover,
  .btn-primary,
  .header-cta {
    transition: none;
  }
}
