/* ═══════════════════════════════════════════════════════════════
   SADDLE — Landing v4
   "The page is one map."
   A single fixed WebGL survey renders the land, the route, the
   waypoints and the ink for the whole journey; the content beats
   are paper cards that travel over it. Material logic is the app's:
   parchment desk · warm-white paper · rose-gold leather · brass ink ·
   the app's own indigo route line.
   Light = "Saddle Soap" · Dark = "Greatcoat" (navy wool and brass).
   ═══════════════════════════════════════════════════════════════ */

/* ── Type: the app's own faces, self-hosted (CSP forbids CDNs).
   Source Serif 4 = editorial voice (titles, bylines).
   Source Sans 3  = every functional string.
   Subset from the same @expo-google-fonts packages the app ships. ── */
@font-face {
  font-family: 'Source Serif 4';
  src: url('assets/fonts/source-serif-4-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Source Serif 4';
  src: url('assets/fonts/source-serif-4-400-italic.woff2') format('woff2');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'Source Serif 4';
  src: url('assets/fonts/source-serif-4-600.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Source Serif 4';
  src: url('assets/fonts/source-serif-4-700.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Source Sans 3';
  src: url('assets/fonts/source-sans-3-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Source Sans 3';
  src: url('assets/fonts/source-sans-3-600.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Source Sans 3';
  src: url('assets/fonts/source-sans-3-700.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ── Tokens ──
   Light  = "Saddle Soap" (english-garden), the app's DEFAULT palette.
   Dark   = "Greatcoat", the app's navy-wool-and-brass night palette.
   Every hex below is the value the app actually resolves at runtime
   (theme/palettes/english-garden.ts · greatcoat.ts). The WebGL survey
   reads --paper / --ink / --route-a / --brass / --head straight out of
   here, so the map is themed by the same tokens as the type. */
:root {
  color-scheme: light;

  /* Surfaces — the desk and the paper laid on it. Base-to-raised
     contrast is deliberately shallow (~1.18:1): the field reads as a
     desk, the cards as paper resting on it. */
  --paper: #F0E8DB;
  --paper-2: #E6DCCA;
  --surface: #FDFBF5;

  /* Ink */
  --ink: #1A1614;
  --muted: #685854;
  --faint: #736056;
  --editorial: #4A3E38;

  /* Rules — rose-gold hairlines, never black-on-warm */
  --line: rgba(196, 146, 122, 0.28);
  --line-2: #DDCFBE;

  /* Brand — rose-gold leather + brass ink */
  --brand: #C4927A;
  --brass: #A8785E;
  --brass-2: #D4A896;
  --brass-3: #886022;
  --brass-tint: rgba(196, 146, 122, 0.14);
  --rust: #886022;

  /* The survey */
  --contour: rgba(26, 22, 20, 0.13);
  --route-a: #5568B6;
  --route-b: #3F4E8C;
  --head: #8B6914;
  --rec: #A04640;
  --start: #4A8F5A;

  /* Dark band (privacy) — the app's Slate surface */
  --band-bg: radial-gradient(620px 340px at 16% 0%, rgba(212, 175, 55, 0.16), transparent 70%), linear-gradient(160deg, #222224, #161618);
  --band-ink: #F4F3F2;
  --band-muted: rgba(244, 243, 242, 0.66);
  --band-line: rgba(244, 243, 242, 0.16);

  --nav-bg: rgba(240, 232, 219, 0.84);

  /* Elevation — cloud-soft and palette-warm (shadow ink #4A3E38),
     never black on a warm field. Mirrors theme/shadows.ts. */
  --shadow-sm: 0 4px 20px rgba(74, 62, 56, 0.09);
  --shadow-md: 0 12px 40px rgba(74, 62, 56, 0.14);

  /* Shape — squared hardware. Buttons 6px, cards 16px, shells 24px. */
  --r-btn: 6px;
  --r-card: 16px;
  --r-shell: 24px;

  --display: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --sans: 'Source Sans 3', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  /* The caps-label face. The app has no monospace voice — its labelCaps /
     overline / sectionKicker tiers are all Source Sans 3 SemiBold with
     wide tracking, so this points at the sans on purpose. */
  --mono: 'Source Sans 3', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;

  --gutter: clamp(1.25rem, 4.8vw, 4rem);
  --maxw: 1120px;
  --ease-expo: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-back: cubic-bezier(0.34, 1.56, 0.64, 1);
}

:root[data-theme='dark'] {
  color-scheme: dark;
  --paper: #12151C;
  --paper-2: #0C0F14;
  --surface: #1C2029;
  --ink: #F3F0E4;
  --muted: #C3BFB0;
  --faint: #8E8B7E;
  --editorial: #DDD8C6;
  --line: rgba(243, 240, 228, 0.15);
  --line-2: rgba(243, 240, 228, 0.26);
  --brand: #B18C3F;
  --brass: #B18C3F;
  --brass-2: #E0C273;
  --brass-3: #D4AF37;
  --brass-tint: rgba(177, 140, 63, 0.15);
  --rust: #D4AF37;
  --contour: rgba(243, 240, 228, 0.13);
  --route-a: #7B8DC9;
  --route-b: #5568B6;
  --head: #E9C563;
  --rec: #C47468;
  --start: #5BA86B;
  --band-bg: radial-gradient(620px 340px at 16% 0%, rgba(177, 140, 63, 0.16), transparent 70%), linear-gradient(160deg, #1C2029, #12151C);
  --band-ink: #F3F0E4;
  --band-muted: rgba(243, 240, 228, 0.62);
  --band-line: rgba(243, 240, 228, 0.15);
  --nav-bg: rgba(18, 21, 28, 0.84);
  --shadow-sm: 0 12px 30px -20px rgba(0, 0, 0, 0.6);
  --shadow-md: 0 24px 58px -32px rgba(0, 0, 0, 0.72);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    color-scheme: dark;
    --paper: #12151C;
    --paper-2: #0C0F14;
    --surface: #1C2029;
    --ink: #F3F0E4;
    --muted: #C3BFB0;
    --faint: #8E8B7E;
    --editorial: #DDD8C6;
    --line: rgba(243, 240, 228, 0.15);
    --line-2: rgba(243, 240, 228, 0.26);
    --brand: #B18C3F;
    --brass: #B18C3F;
    --brass-2: #E0C273;
    --brass-3: #D4AF37;
    --brass-tint: rgba(177, 140, 63, 0.15);
    --rust: #D4AF37;
    --contour: rgba(243, 240, 228, 0.13);
    --route-a: #7B8DC9;
    --route-b: #5568B6;
    --head: #E9C563;
    --rec: #C47468;
    --start: #5BA86B;
    --band-bg: radial-gradient(620px 340px at 16% 0%, rgba(177, 140, 63, 0.16), transparent 70%), linear-gradient(160deg, #1C2029, #12151C);
    --band-ink: #F3F0E4;
    --band-muted: rgba(243, 240, 228, 0.62);
    --band-line: rgba(243, 240, 228, 0.15);
    --nav-bg: rgba(18, 21, 28, 0.84);
    --shadow-sm: 0 12px 30px -20px rgba(0, 0, 0, 0.6);
    --shadow-md: 0 24px 58px -32px rgba(0, 0, 0, 0.72);
  }
}

/* ── Base ── */
* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: var(--paper);
}
@media (prefers-reduced-motion: no-preference) {
  /* Native smooth scrolling is disabled by the experience layer at
     runtime (it corrupts ScrollTrigger measurements); anchors are
     tweened instead. This rule is the no-JS fallback. */
  html { scroll-behavior: smooth; }
}

body {
  min-width: 320px;
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  overflow-x: hidden;
}

img, svg { display: block; }
svg { overflow: visible; }
a { color: inherit; }
button, input { font: inherit; }

::selection { background: rgba(196, 146, 122, 0.28); color: var(--ink); }

section[id], header[id], div[id] { scroll-margin-top: 5.5rem; }

:focus-visible {
  outline: 2px solid var(--brass-3);
  outline-offset: 2px;
  border-radius: var(--r-btn);
}
/* Programmatic anchor targets (tweened in-page scrolls): the focus
   move matters for keyboard users, a section-sized ring does not. */
[tabindex='-1']:focus-visible { outline: none; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ── Shared voices ──
   The app's three caps tiers: the smaller the label, the wider the
   track (sectionKicker 1.5px → labelCaps 2.0px → overline 2.5px).
   Canonical eyebrow paint is brass ink. */
.eyebrow {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--brass-3);
}
.eyebrow--bright { color: var(--brass-3); }

/* Titles are the editorial voice: serif, bold, tight. */
h1, h2 {
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-wrap: balance;
}

/* The byline voice — italic serif. Used for captions and subtitles,
   exactly as the app uses editorialCaption / editorialByline. */
.byline {
  font-family: var(--display);
  font-style: italic;
  color: var(--faint);
}

/* The brass rule that closes an editorial header (60×2px, fading). */
.brass-rule {
  width: 60px;
  height: 2px;
  border: 0;
  margin: 1.15rem 0 0;
  background: linear-gradient(90deg, var(--brand), transparent);
}
.brass-rule--center { margin-inline: auto; }

/* Page-end flourish: line · dot · line. The app closes every page and
   every polaroid caption with this mark; it is the closing punctuation
   of the brand. */
.flourish {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 3rem;
}
.flourish span {
  display: block;
  width: 32px;
  height: 1px;
  background: color-mix(in srgb, var(--brand) 42%, transparent);
}
.flourish i {
  display: block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--brand) 60%, transparent);
}

.wp-tag {
  font-family: var(--mono);
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

/* ── Buttons ── */
.btn {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: 3.25rem;
  padding: 0.95rem 1.6rem;
  border: 1px solid transparent;
  /* Squared hardware — the app's buttons are 6px, not pills. */
  border-radius: var(--r-btn);
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  transition: transform 0.28s var(--ease-expo), box-shadow 0.28s ease, border-color 0.28s ease, background 0.28s ease;
}
.btn svg { width: 1rem; height: 1rem; transition: transform 0.28s var(--ease-expo); }
.btn:hover svg { transform: translateX(2px); }
.btn:hover .btn-chev { transform: translateY(2px); }
/* The saddle-leather button: the app's 135° brand sweep taken to its DEEP
   and DARK stops. The app's light stop (#C4927A) carries a white label at
   only 2.71:1 — fine at the app's control size, an AA failure at this
   site's 11.5px caps. Deep→dark keeps the cognac family and clears 5.5:1. */
.btn-primary {
  color: #FFFFFF;
  background: linear-gradient(135deg, #886048, #6B4A38);
  box-shadow: 0 5px 22px rgba(136, 96, 72, 0.28);
}
.btn-primary:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, #96684F, #7A5540);
  box-shadow: 0 10px 30px rgba(136, 96, 72, 0.34);
}
.btn-primary:active { transform: translateY(0); background: linear-gradient(135deg, #6B4A38, #55392B); }
:root[data-theme='dark'] .btn-primary { color: #12151C; background: linear-gradient(135deg, #E0C273, #C09A45); }
:root[data-theme='dark'] .btn-primary:hover { background: linear-gradient(135deg, #EBD9A0, #D4AF37); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .btn-primary { color: #12151C; background: linear-gradient(135deg, #E0C273, #C09A45); }
  :root:not([data-theme='light']) .btn-primary:hover { background: linear-gradient(135deg, #EBD9A0, #D4AF37); }
}
.btn-ghost {
  color: var(--ink);
  border-color: var(--line-2);
  background: color-mix(in srgb, var(--surface) 42%, transparent);
}
.btn-ghost:hover { transform: translateY(-2px); border-color: var(--brass); }

/* ── Nav ── */
.site-nav {
  position: fixed;
  inset-inline: 0;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid transparent;
  transition: background 0.35s ease, border-color 0.35s ease;
}
.site-nav.scrolled {
  border-bottom-color: var(--line);
  background: var(--nav-bg);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
}
.nav-inner {
  width: min(100%, var(--maxw));
  margin: 0 auto;
  padding: 0.85rem var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}
.brand, .footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--ink);
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.14rem;
  line-height: 1;
  letter-spacing: -0.02em;
  text-decoration: none;
}
.brand-mark, .footer-brand img { border-radius: 8px; }
.nav-links {
  display: flex;
  gap: 1.7rem;
  margin-left: auto;
}
.nav-links a {
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.25s ease;
}
.nav-links a:hover { color: var(--ink); }
.nav-actions { display: flex; align-items: center; gap: 0.6rem; }
.theme-toggle {
  display: inline-grid;
  place-items: center;
  width: 2.35rem;
  height: 2.35rem;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  transition: color 0.25s ease, border-color 0.25s ease, transform 0.25s var(--ease-expo);
}
.theme-toggle:hover { color: var(--brass); border-color: var(--brass); transform: translateY(-1px); }
.theme-icon { width: 0.95rem; height: 0.95rem; }
.theme-icon--sun { display: none; }
:root[data-theme='dark'] .theme-icon--moon { display: none; }
:root[data-theme='dark'] .theme-icon--sun { display: block; }
:root[data-theme='light'] .theme-icon--moon { display: block; }
:root[data-theme='light'] .theme-icon--sun { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .theme-icon--moon { display: none; }
  :root:not([data-theme='light']) .theme-icon--sun { display: block; }
}
.nav-cta {
  display: inline-flex;
  align-items: center;
  min-height: 2.35rem;
  padding: 0.55rem 1.05rem;
  border-radius: var(--r-btn);
  color: var(--paper);
  background: var(--ink);
  font-family: var(--mono);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background 0.25s ease, transform 0.25s var(--ease-expo);
}
.nav-cta:hover { background: var(--brass-3); color: #FFF8E4; transform: translateY(-1px); }
:root[data-theme='dark'] .nav-cta:hover { color: #221806; background: var(--brass-2); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .nav-cta:hover { color: #221806; background: var(--brass-2); }
}

/* ═══ The journey ═══
   One relative container; the map layer is fixed behind it and the
   beats scroll over the living survey. */
.journey {
  position: relative;
  z-index: 1;
}

.map-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.map-canvas { width: 100%; height: 100%; }

/* Static fallback contours (no WebGL / no JS): quiet, bottom-weighted. */
.map-fallback {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  color: var(--contour);
}
.map-fallback path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.1;
}
.map-fallback .c1 { opacity: 0.9; }
.map-fallback .c2 { opacity: 0.62; }
.map-fallback .c3 { opacity: 0.4; }
.map-fallback .c4 { opacity: 0.22; }
html.map-on .map-fallback { display: none; }

/* Faint paper grain over the whole journey, under the type. */
.journey::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ── Beats ── */
.beat {
  position: relative;
  z-index: 1;
  display: grid;
  align-items: center;
  width: min(100%, var(--maxw));
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* Hero */
.beat--hero {
  min-height: 100svh;
  justify-items: center;
  padding-top: clamp(6.5rem, 12vh, 9rem);
  padding-bottom: clamp(5rem, 10vh, 7rem);
}
.hero-inner {
  position: relative;
  width: min(100%, 56rem);
  text-align: center;
}
/* Quiet text protection where the type crosses the survey beneath.
   Two pools: one under the title block, one under the actions + meta
   line (which otherwise sits outside the halo, struck by contours). */
.hero-inner::before {
  content: '';
  position: absolute;
  inset: -10% -14%;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(58% 52% at 50% 42%, color-mix(in srgb, var(--paper) 78%, transparent), transparent 74%),
    radial-gradient(46% 26% at 50% 86%, color-mix(in srgb, var(--paper) 74%, transparent), transparent 78%);
}
.hero-title {
  max-width: 16ch;
  margin: 1.1rem auto 0;
  font-size: clamp(3rem, 7.2vw, 6.1rem);
  line-height: 0.97;
}
.uword { position: relative; white-space: nowrap; }
.uword-svg {
  position: absolute;
  left: -3%;
  bottom: -0.14em;
  width: 106%;
  height: 0.26em;
  /* The draw-in is a clip wipe, not `pathLength` dash math: dashing
     drifts under non-scaling-stroke (Chromium measures the dash in
     screen space), leaving a stray tail visible before the draw and
     an undrawn gap after it. Negative vertical insets keep the round
     caps and the wave's overshoot out of the clip. */
  clip-path: inset(-40% 100% -40% -2%);
  animation: underlineIn 0.9s var(--ease-expo) 1.05s forwards;
}
.uword-svg path {
  fill: none;
  stroke: var(--rust);
  stroke-width: 3.5;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}
.hero-sub {
  max-width: 46ch;
  margin: 1.7rem auto 0;
  font-size: 1.09rem;
  line-height: 1.65;
  color: var(--muted);
  text-wrap: pretty;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.8rem;
  margin-top: 2.3rem;
}
.btn-chev { animation: bob 2.1s ease-in-out infinite; }
.hero-meta {
  margin-top: 3.1rem;
  font-family: var(--mono);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  /* Real claims, not furniture — muted, not faint, so the survey
     beneath never wins the contrast fight. */
  color: var(--muted);
}
.hero-meta span { margin-inline: 0.45rem; color: var(--brass); }

.h-load {
  opacity: 0;
  transform: translateY(24px);
  animation: riseIn 0.95s var(--ease-expo) forwards;
}
.hl-1 { animation-delay: 0.08s; }
.hl-2 { animation-delay: 0.18s; }
.hl-3 { animation-delay: 0.34s; }
.hl-4 { animation-delay: 0.48s; }
.hl-5 { animation-delay: 0.62s; }
.hl-6 { animation-delay: 0.78s; }

/* Survey plate: the painterly hero visual, mounted like a plate
   pasted into the field book — paper mat, hairline rule, a whisper
   of rotation so it reads as placed by hand, not templated. */
.hero-plate {
  width: min(100%, 46rem);
  margin: 3.2rem auto 0;
  padding: 0.55rem 0.55rem 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: var(--shadow-md);
  transform: rotate(-0.4deg);
}
.plate-media {
  position: relative;
  overflow: hidden;
  border-radius: 3px;
  aspect-ratio: 21 / 10;
  background: var(--paper-2);
}
.plate-media img,
.plate-media video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 62%;
}
.plate-media video {
  opacity: 0;
  transition: opacity 1.4s ease;
}
.plate-media video.is-playing { opacity: 1; }
.plate-caption {
  padding: 0.55rem 0.2rem 0.6rem;
  font-family: var(--display);
  font-style: italic;
  font-size: 0.82rem;
  letter-spacing: 0;
  color: var(--faint);
  text-align: center;
}
/* Night theme: dim the plate slightly so it sits with the GPS glow. */
:root[data-theme='dark'] .plate-media img,
:root[data-theme='dark'] .plate-media video {
  filter: brightness(0.88) saturate(0.94);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .plate-media img,
  :root:not([data-theme='light']) .plate-media video {
    filter: brightness(0.88) saturate(0.94);
  }
}

/* Surveyor's furniture: north arrow + scale bar, hero bottom corner. */
.hero-survey {
  position: absolute;
  left: var(--gutter);
  bottom: 1.7rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--mono);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
}
.survey-north { width: 0.55rem; height: 1.2rem; }
.survey-north path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.survey-scale {
  width: 64px;
  height: 6px;
  border: 1px solid currentColor;
  border-top: none;
  opacity: 0.8;
}

/* The gate: descent runway. One line mid-air, the barn tag at the
   bottom as the camera lands. */
.beat--gate {
  min-height: 175vh;
  align-content: space-between;
  justify-items: center;
  padding-top: 26vh;
  padding-bottom: 9vh;
  text-align: center;
}
.gate-line { position: relative; max-width: 30rem; }
.gate-line::before,
.gate-arrive::before {
  content: '';
  position: absolute;
  inset: -22% -18%;
  z-index: -1;
  background: radial-gradient(56% 56% at 50% 50%, color-mix(in srgb, var(--paper) 76%, transparent), transparent 74%);
}
.gate-big {
  margin-top: 0.9rem;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.9rem, 4.4vw, 3.2rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--ink);
  text-wrap: balance;
}
.gate-arrive { position: relative; }

/* Stops: one paper card per beat, docked to alternating sides so the
   route corridor beneath stays visible. */
.beat--stop { min-height: 92vh; }
.stop-card {
  width: min(100%, 26.5rem);
  padding: 1.6rem 1.7rem 1.7rem;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--surface);
  box-shadow: var(--shadow-md);
}
/* Waypoint plate: a painterly strip pasted at the head of each card,
   same field-book language as the hero plate. */
.stop-plate {
  margin: 0 0 1.15rem;
  overflow: hidden;
  aspect-ratio: 12 / 5;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper-2);
}
.stop-plate img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
:root[data-theme='dark'] .stop-plate img { filter: brightness(0.88) saturate(0.94); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .stop-plate img { filter: brightness(0.88) saturate(0.94); }
}

.stop-kicker {
  font-family: var(--mono);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--brass-3);
}
.stop-title {
  margin-top: 0.7rem;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.7rem, 3.2vw, 2.25rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
  color: var(--ink);
  text-wrap: balance;
}
.stop-copy {
  max-width: 38ch;
  margin-top: 0.85rem;
  color: var(--muted);
  line-height: 1.65;
  text-wrap: pretty;
}

/* Product vignettes (inside stop cards) */
.vignette {
  margin-top: 1.35rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
}
.vg-head {
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--faint);
}
.vg-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding-top: 0.75rem;
}
.vg-strong { font-weight: 700; font-size: 0.92rem; color: var(--ink); }
.vg-dim { font-size: 0.78rem; color: var(--muted); }
.vg-end { margin-left: auto; }
.vg-val {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brass-3);
}
.vg-foot {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.85rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
}
.vg-ico { width: 0.85rem; height: 0.85rem; color: var(--brass); flex: 0 0 auto; }
.vg-avatar {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 1.9rem;
  height: 1.9rem;
  border: 2px solid var(--surface);
  border-radius: 50%;
  color: var(--paper);
  background: var(--ink);
  font-size: 0.7rem;
  font-weight: 800;
}
.vg-stack { margin-left: -0.8rem; }
.vg-route { width: 100%; height: auto; margin-top: 0.85rem; }
.vg-route path { fill: none; stroke: var(--route-a); stroke-width: 3; stroke-linecap: round; }
.vg-route circle { fill: var(--brass); stroke: var(--surface); stroke-width: 3; }
.vg-pulse {
  flex: 0 0 auto;
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: var(--rec);
  animation: recPulse 1.8s ease-out infinite;
}

/* Home: arrival + payoff while the camera rises to the whole ride. */
.beat--home {
  min-height: 135vh;
  justify-items: center;
  text-align: center;
}
.home-inner { position: relative; }
.home-inner::before {
  content: '';
  position: absolute;
  inset: -18% -24%;
  z-index: -1;
  background: radial-gradient(58% 56% at 50% 50%, color-mix(in srgb, var(--paper) 78%, transparent), transparent 74%);
}
.home-inner h2 {
  margin-top: 0.9rem;
  font-size: clamp(2.25rem, 4.6vw, 3.7rem);
  line-height: 1;
}
.home-stats {
  margin-top: 0.8rem;
  font-family: var(--mono);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
}
.home-note {
  max-width: 44ch;
  margin: 1.5rem auto 0;
  font-size: 1rem;
  line-height: 1.65;
  color: var(--muted);
  text-wrap: pretty;
}

/* Gait readout. The three hues are the app's own gait ramp — this is a
   data encoding, so it is palette-independent by design. */
.gaits { width: min(100%, 26rem); margin: 1.7rem auto 0; }
.gait-bar {
  display: flex;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--brass-tint);
}
.gait-bar span { display: block; height: 100%; }
/* Widths live here, not in a style attribute: the production CSP is
   `style-src 'self'`, which blocks inline style attributes — as markup these
   bars would render at zero width. */
.g-walk { background: #7FA06F; width: 41%; }
.g-trot { background: #C7A24E; width: 38%; }
.g-canter { background: #BC5E55; width: 21%; }
.gait-key {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem 1.1rem;
  margin-top: 0.7rem;
  font-family: var(--mono);
  font-size: 0.63rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
  color: var(--faint);
}
.gait-key span { display: inline-flex; align-items: center; gap: 0.4rem; }
.gait-key i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}
.k-walk { background: #7FA06F; }
.k-trot { background: #C7A24E; }
.k-canter { background: #BC5E55; }

.home-inner .btn { margin-top: 1.9rem; }

/* ── Ride HUD ── */
.ride-hud {
  position: fixed;
  left: 1.1rem;
  bottom: 1.1rem;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow-sm);
  font-family: var(--mono);
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.4s ease, transform 0.4s var(--ease-expo);
}
.ride-hud.on { opacity: 1; transform: none; }
.ride-hud b { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.hud-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--rec);
  animation: recPulse 1.8s ease-out infinite;
}
.hud-div { width: 1px; height: 0.85rem; background: var(--line-2); }
.hud-ok { display: none; align-items: center; gap: 0.3rem; color: var(--brass-3); }
.hud-ok svg { width: 0.8rem; height: 0.8rem; }
.ride-hud.saved .hud-wpt { display: none; }
.ride-hud.saved .hud-ok { display: inline-flex; }
.ride-hud.saved .hud-dot { background: var(--brass); animation: none; }

/* ── Privacy band (opaque: closes the map) ── */
.privacy {
  position: relative;
  z-index: 2;
  padding: clamp(5.5rem, 10vw, 8.5rem) var(--gutter);
  background: var(--band-bg);
  overflow: hidden;
}
/* The band is always dark, whatever the page theme — so its brass has to
   be the POLISHED stop (#D4AF37), not the brass ink used on parchment.
   Brass ink on a dark surface fails AA. */
.privacy .eyebrow--bright { color: #D4AF37; }
.privacy .flourish span { background: rgba(212, 175, 55, 0.34); }
.privacy .flourish i { background: rgba(212, 175, 55, 0.55); }
/* Night scene under the tenets: the painting's edges already fall to
   pine-black, and a gradient keeps the type's contrast honest. */
.privacy::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(180deg, rgba(21, 27, 20, 0.94) 0%, rgba(21, 27, 20, 0.62) 48%, rgba(21, 27, 20, 0.38) 100%),
    url('assets/hero/private-backdrop.webp');
  background-size: cover, cover;
  background-position: center bottom, center bottom;
  background-repeat: no-repeat;
}
.privacy-inner { position: relative; z-index: 1; width: min(100%, var(--maxw)); margin: 0 auto; }
.privacy-inner h2 {
  color: var(--band-ink);
  font-size: clamp(2.25rem, 4.6vw, 3.7rem);
  line-height: 1;
  margin-top: 0.9rem;
}
.tenets {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1.5rem, 4vw, 3rem);
  margin-top: clamp(2.5rem, 5vw, 3.5rem);
}
.tenet {
  padding-top: 1.3rem;
  border-top: 1px solid var(--band-line);
}
.tenet h3 {
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--band-ink);
}
.tenet p {
  margin-top: 0.55rem;
  font-size: 0.92rem;
  line-height: 1.62;
  color: var(--band-muted);
  text-wrap: pretty;
}

/* ── Signup (opaque paper) ── */
.signup {
  position: relative;
  z-index: 2;
  padding: clamp(5.5rem, 10vw, 8.5rem) var(--gutter);
  background: var(--paper);
}
.signup-inner {
  width: min(100%, 34rem);
  margin: 0 auto;
  text-align: center;
}
.signup-inner h2 {
  margin-top: 0.9rem;
  font-size: clamp(2.25rem, 4.6vw, 3.7rem);
  line-height: 1;
}
.signup-sub {
  max-width: 38ch;
  margin: 1.1rem auto 0;
  color: var(--muted);
  line-height: 1.65;
}
.signup-card {
  margin-top: 2.2rem;
  padding: 1.35rem;
  border: 1px solid var(--line);
  border-radius: var(--r-shell);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  text-align: left;
}
.form { display: grid; gap: 0.95rem; }
.form-field { position: relative; }
.form-input {
  width: 100%;
  height: 3.6rem;
  padding: 1.24rem 1rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: var(--paper);
  caret-color: var(--brass);
  outline: none;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.form-input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brass-tint), 0 0 22px rgba(196, 146, 122, 0.18); }
.form-input[aria-invalid='true'] { border-color: #A04640; box-shadow: 0 0 0 4px rgba(160, 70, 64, 0.12); }
.form-label {
  position: absolute;
  left: 1rem;
  top: 1.12rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
  pointer-events: none;
  transform-origin: left top;
  transition: transform 0.22s var(--ease-expo), color 0.22s ease;
}
.form-input:focus + .form-label,
.form-input:not(:placeholder-shown) + .form-label {
  transform: translateY(-0.62rem) scale(0.8);
  color: var(--brass-3);
}
.form-submit {
  position: relative;
  min-height: 3.5rem;
  border: 0;
  border-radius: var(--r-btn);
  color: #FFFFFF;
  background: linear-gradient(135deg, #886048, #6B4A38);
  box-shadow: 0 5px 22px rgba(136, 96, 72, 0.28);
  cursor: pointer;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  transition: transform 0.28s var(--ease-expo), box-shadow 0.28s ease, opacity 0.2s ease;
}
.form-submit:hover:not(:disabled) { transform: translateY(-2px); background: linear-gradient(135deg, #96684F, #7A5540); box-shadow: 0 10px 30px rgba(136, 96, 72, 0.34); }
.form-submit:disabled { cursor: not-allowed; opacity: 0.75; }

/* Dark ("Greatcoat"): the CTA is a brass button — brass is a light
   metal, so the label goes dark. White on brass fails AA. */
:root[data-theme='dark'] .form-submit,
:root[data-theme='dark'] .success-ring {
  color: #12151C;
  background: linear-gradient(135deg, #E0C273, #C09A45);
}
:root[data-theme='dark'] .form-submit:hover:not(:disabled) { background: linear-gradient(135deg, #EBD9A0, #D4AF37); }
:root[data-theme='dark'] .spinner { border-color: rgba(18, 21, 28, 0.3); border-top-color: #12151C; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .form-submit,
  :root:not([data-theme='light']) .success-ring {
    color: #12151C;
    background: linear-gradient(135deg, #E0C273, #C09A45);
  }
  :root:not([data-theme='light']) .form-submit:hover:not(:disabled) { background: linear-gradient(135deg, #EBD9A0, #D4AF37); }
  :root:not([data-theme='light']) .spinner { border-color: rgba(18, 21, 28, 0.3); border-top-color: #12151C; }
}
.btn-loading { display: none; }
.form-submit.loading .btn-text { opacity: 0; }
.form-submit.loading .btn-loading {
  display: inline-flex;
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: center;
}
.spinner {
  width: 1.1rem;
  height: 1.1rem;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #FFFFFF;
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}
.form-note {
  font-size: 0.8rem;
  color: var(--faint);
  text-align: center;
}
/* The policy link must read as a link — inheriting --faint with no underline
   makes a required disclosure look like body text. */
.form-note a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.form-note a:hover { color: var(--brass-3); }
.form-error {
  display: none;
  padding: 0.8rem 0.95rem;
  border: 1px solid rgba(160, 70, 64, 0.28);
  border-radius: 10px;
  color: #A04640;
  background: rgba(176, 64, 46, 0.07);
  font-size: 0.88rem;
  text-align: center;
}
.form-error.show { display: block; animation: revealUp 0.32s var(--ease-expo); }
.form-success { display: none; padding: 1.8rem 0.5rem 1rem; text-align: center; }
.form-success.show { display: block; animation: revealUp 0.45s var(--ease-expo); }
.success-ring {
  display: grid;
  place-items: center;
  width: 3.8rem;
  height: 3.8rem;
  margin: 0 auto 1rem;
  border-radius: 50%;
  color: #FFFFFF;
  background: linear-gradient(135deg, #886048, #6B4A38);
}
.success-ring svg { width: 1.45rem; height: 1.45rem; }
.form-success h3 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.6rem;
  letter-spacing: -0.02em;
}
.form-success p { margin-top: 0.35rem; color: var(--muted); }

/* ── Footer (opaque) ── */
.footer {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
  padding: 2.6rem var(--gutter) 3.2rem;
  border-top: 1px solid var(--line);
  background: var(--paper);
}
@media (min-width: 1121px) {
  .footer { padding-inline: calc((100vw - var(--maxw)) / 2 + var(--gutter)); }
}
.footer-brand { font-size: 1rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 1.4rem; }
.footer-links a,
.footer p {
  font-family: var(--mono);
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
  text-decoration: none;
}
.footer-links a:hover { color: var(--brass-3); }

/* ── Reveals ── */
.js .reveal-on-scroll {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.72s var(--ease-expo), transform 0.72s var(--ease-expo);
}
.js .reveal-on-scroll.visible { opacity: 1; transform: none; }

/* ── Desktop weave: cards dock aside the route corridor ── */
@media (min-width: 900px) {
  .beat--left { justify-items: start; }
  .beat--right { justify-items: end; }
}
@media (max-width: 899px) {
  .beat--stop { justify-items: center; }
  .beat--stop { min-height: 88vh; }
}

@media (max-width: 767px) {
  .nav-links { display: none; }
  .tenets { grid-template-columns: 1fr; gap: 1.6rem; }
  .footer { flex-direction: column; text-align: center; }
}

@media (max-width: 560px) {
  .brand span { display: none; }
  .beat--hero { padding-top: 6.5rem; }
  .hero-plate { margin-top: 2.4rem; transform: none; }
  .plate-media { aspect-ratio: 16 / 10; }
  .hero-title { font-size: clamp(2.6rem, 12.5vw, 4rem); }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .btn { width: 100%; }
  .hero-meta span { margin-inline: 0.3rem; }
  .hero-survey { display: none; }
  .ride-hud { left: 50%; transform: translate(-50%, 10px); }
  .ride-hud.on { transform: translate(-50%, 0); }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
  }
  .h-load { opacity: 1; transform: none; animation: none; }
  .uword-svg { clip-path: none; animation: none; }
  .js .reveal-on-scroll { opacity: 1; transform: none; }
  .ride-hud { display: none; }
}

/* ── Keyframes ── */
@keyframes riseIn { to { opacity: 1; transform: none; } }
@keyframes underlineIn { to { clip-path: inset(-40% -4% -40% -2%); } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(4px); } }
@keyframes recPulse { 0% { box-shadow: 0 0 0 0 rgba(190, 74, 47, 0.4); } 100% { box-shadow: 0 0 0 9px rgba(190, 74, 47, 0); } }
@keyframes revealUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@keyframes spin { to { transform: rotate(360deg); } }
