/* Tokens follow the TourenUp Trips app ("Trailhead" v2 — tourenup-trips/design/v2.ts):
   lime is for primary CTAs only; the page has no safety/warning UI, so no reds.
   Two deliberate differences from the app: --text-3 stays #6B6F67 (the app's
   #858585 is 3.7:1 on white, under WCAG AA), and outline controls use --line-strong,
   darker than the app's #EDEEEF ghost border, so they read on white. */
:root{
  --lime:#C3E54B; --lime-hover:#9EC81A; --lime-pressed:#7BA010; --on-lime:#16200A;
  --ink:#18181B; --text-2:#5F635B; --text-3:#6B6F67; --nav-link:#3F423C;
  --olive:#687C22; --olive-dark:#232A0C; --tile-bg:#FBFEE7;
  --surface-2:#F7F7F5; --surface-3:#F4F4F2;
  --line:#EDEEEF; --line-2:#E4E6E1; --line-3:#CFD2CB; --line-strong:#A3A69F;
  --night-top:#1A2010; --night-bottom:#070903; --on-night:#F4F4EF;
  --on-dark:#C9CCC0; --on-dark-2:#A9AE9C;
  --terrain:#9A9D96; --side-track:#A3A69F;
  --font-sans:Inter, system-ui, -apple-system, sans-serif;
  --gutter:clamp(20px,5vw,80px);
  --nav-h:64px;
  --target:44px;
  --ring:rgba(24,24,27,0.5);
}
*{ box-sizing:border-box; }
html{ scroll-behavior:smooth; background:#FFFFFF; }
body{
  margin:0; color:var(--ink); font-family:var(--font-sans); font-size:17px; line-height:1.55; -webkit-font-smoothing:antialiased;
  background-color:#FFFFFF;
  background-image:linear-gradient(rgba(0,0,0,0.025) 1px,transparent 1px),linear-gradient(90deg,rgba(0,0,0,0.025) 1px,transparent 1px);
  background-size:48px 48px;
}
a{ color:var(--ink); }
:focus-visible{ outline:4px solid var(--ring); outline-offset:2px; }
.sr-only{ position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
/* Numbers and readouts: Inter with tabular figures, as in the app (no mono face). */
.num{ font-variant-numeric:tabular-nums; }

/* Buttons (app Btn: pill, Inter 700, ≥44px) */
.btn{ display:inline-flex; align-items:center; justify-content:center; min-height:var(--target); font-family:var(--font-sans); font-weight:700; font-size:16px; padding:15px 26px; border-radius:100px; text-decoration:none; transition:background-color 150ms, border-color 150ms, transform 150ms, opacity 150ms; }
.btn:active{ transform:scale(0.97); opacity:0.88; }
.btn-lime{ background:var(--lime); color:var(--on-lime); }
.btn-lime:hover{ background:var(--lime-hover); color:var(--on-lime); }
.btn-lime:active{ background:var(--lime-pressed); }
.btn-outline{ padding:14px 26px; border:1px solid var(--line-strong); color:var(--ink); }
.btn-outline:hover{ border-color:var(--ink); color:var(--ink); }
.btn-sm{ font-size:15px; padding:0 18px; }
.btn-row{ display:flex; flex-wrap:wrap; gap:12px; }

/* Nav */
.nav{ position:sticky; top:0; z-index:20; height:var(--nav-h); display:flex; align-items:center; justify-content:space-between; gap:24px; padding:0 clamp(20px,4vw,56px); background:rgba(255,255,255,0.92); -webkit-backdrop-filter:blur(8px); backdrop-filter:blur(8px); border-bottom:1px solid var(--line); }
/* The app has no logo asset; this matches its text wordmark (Inter 800). */
.wordmark{ font-weight:800; font-size:20px; letter-spacing:-0.03em; text-decoration:none; color:var(--ink); }
.nav-links{ display:none; align-items:center; gap:32px; font-size:15px; }
.nav-links a, .footer-links a{ display:inline-flex; align-items:center; min-height:var(--target); text-decoration:none; color:var(--nav-link); }
.nav-links a:hover, .footer-links a:hover{ color:var(--ink); }
.nav-actions{ display:flex; align-items:center; gap:12px; }
.nav .btn{ white-space:nowrap; }
@media (min-width:900px){ .nav-links{ display:flex; } }
/* Narrow phones: tighten the nav so the longest translated CTA still fits
   at 360px; below that the hero CTA is right there, so drop the nav one. */
@media (max-width:389px){
  .nav{ gap:12px; }
  .nav-actions{ gap:8px; }
  .nav-actions .btn-sm{ padding:0 12px; }
  .lang-btn{ padding:0 10px 0 12px; gap:6px; }
}
@media (max-width:359px){ .nav-actions .btn{ display:none; } }

/* Mobile menu (home pages, below 900px): section links + languages. */
.menu-btn{ display:none; align-items:center; justify-content:center; flex:none; width:var(--target); height:var(--target); padding:0; border:1px solid var(--line-strong); border-radius:100px; background:#FFFFFF; color:var(--ink); cursor:pointer; transition:border-color 150ms; }
.menu-btn:hover{ border-color:var(--ink); }
.menu-btn svg{ width:20px; height:20px; }
.menu-btn .i-close, .menu-btn[aria-expanded="true"] .i-open{ display:none; }
.menu-btn[aria-expanded="true"] .i-close{ display:block; }
.menu{ position:absolute; top:100%; left:0; right:0; z-index:25; max-height:calc(100svh - var(--nav-h)); overflow-y:auto; padding:4px var(--gutter) 24px; background:#FFFFFF; border-bottom:1px solid var(--line); box-shadow:0 16px 24px rgba(24,24,28,0.08); }
.menu[hidden]{ display:none; }
.menu-links a{ display:flex; align-items:center; min-height:52px; border-bottom:1px solid var(--line); font-size:17px; font-weight:700; color:var(--ink); text-decoration:none; }
.menu-langs-label{ margin:20px 0 10px; }
.menu-langs{ display:flex; flex-wrap:wrap; gap:8px; margin:0; padding:0; list-style:none; }
.menu-langs a{ display:inline-flex; align-items:center; min-height:var(--target); padding:0 16px; border:1px solid var(--line-2); border-radius:100px; font-size:15px; font-weight:600; color:var(--ink); text-decoration:none; }
.menu-langs a[aria-current]{ border-color:var(--ink); background:var(--surface-3); }
@media (max-width:899px){
  .nav--home .menu-btn{ display:inline-flex; }
  .nav--home .lang{ display:none; }
}
@media (min-width:900px){ .menu{ display:none; } }

/* Language dropdown (nav + footer) */
.lang{ position:relative; }
.lang-btn{ display:flex; align-items:center; gap:8px; height:var(--target); padding:0 12px 0 14px; border:1px solid var(--line-strong); border-radius:100px; background:#FFFFFF; color:var(--ink); font-family:var(--font-sans); font-size:15px; font-weight:600; cursor:pointer; transition:border-color 150ms; }
.lang-btn:hover{ border-color:var(--ink); }
.lang-btn svg{ width:16px; height:16px; }
.lang-menu{ position:absolute; top:52px; right:0; z-index:30; min-width:200px; margin:0; padding:6px; list-style:none; background:#FFFFFF; border:1px solid var(--line-2); border-radius:16px; box-shadow:0 8px 24px rgba(24,24,28,0.12); display:flex; flex-direction:column; }
.lang-menu[hidden]{ display:none; }
.lang--up .lang-menu{ top:auto; bottom:52px; }
.lang-menu a{ display:flex; align-items:center; gap:14px; min-height:var(--target); padding:10px 12px; border-radius:10px; color:var(--ink); font-size:15px; line-height:normal; text-decoration:none; }
.lang-menu a:hover, .lang-menu a[aria-current]{ background:var(--surface-3); }
.lang-code{ width:28px; font-weight:700; }
.lang-name{ flex:1; }
.lang-check{ font-weight:700; }

/* 01 — Hero: sticky frame, the tulip strip is driven by scroll progress */
section[id]{ scroll-margin-top:var(--nav-h); }
.hero{ position:relative; height:200vh; }
@media (max-width:899px){ .hero{ height:180vh; } }
.hero-frame{ position:sticky; top:var(--nav-h); height:calc(100vh - var(--nav-h)); height:calc(100svh - var(--nav-h)); display:flex; flex-direction:column; overflow:hidden; }
.hero-text{ flex:1 1 auto; min-height:0; overflow:hidden; display:flex; flex-direction:column; justify-content:center; gap:clamp(12px,3vh,28px); width:100%; max-width:calc(1280px + 2 * var(--gutter)); margin:0 auto; padding:clamp(8px,2vh,16px) var(--gutter) clamp(12px,3vh,24px); }
.hero-heading{ display:flex; flex-direction:column; gap:12px; }
@media (max-width:499px){ .hero-text{ gap:clamp(12px,2.2vh,28px); } }
/* Background video: the area above the strip, 50% opacity over the white page. */
.hero .kicker{ color:var(--olive-dark); } /* app's dark olive: --olive drops to ~2:1 over the footage */
.hero-media{ position:absolute; top:0; left:0; right:0; bottom:270px; overflow:hidden; pointer-events:none; }
.hero-video{ display:block; width:100%; height:100%; object-fit:cover; opacity:0.5; }
/* Light wash behind the text so the subheading keeps ≥4.5:1 over the footage's
   darkest frames (measured); the right side of the video stays at plain 50%. */
.hero-media::after{ content:''; position:absolute; inset:0; background:linear-gradient(90deg,rgba(255,255,255,0.6) 0%,rgba(255,255,255,0.5) 40%,rgba(255,255,255,0) 70%); }
@media (max-width:899px){ .hero-media::after{ background:rgba(255,255,255,0.45); } }
.hero-text{ position:relative; z-index:1; }
.hero-pause{ position:absolute; top:12px; right:var(--gutter); z-index:2; display:inline-flex; align-items:center; justify-content:center; width:var(--target); height:var(--target); padding:0; border:1px solid var(--line-strong); border-radius:100px; background:rgba(255,255,255,0.9); color:var(--ink); cursor:pointer; transition:border-color 150ms; }
.hero-pause[hidden]{ display:none; }
.hero-pause:hover{ border-color:var(--ink); }
.hero-pause svg{ width:18px; height:18px; }
.hero-pause .i-play, .hero-pause.is-paused .i-pause{ display:none; }
.hero-pause.is-paused .i-play{ display:block; }
.hero h1{ margin:0; font-weight:800; font-size:clamp(30px,min(5.4vw,7.5vh),80px); line-height:1.02; letter-spacing:-0.03em; max-width:16ch; text-wrap:balance; }
.hero-sub{ margin:0; max-width:620px; font-size:clamp(17px,1.35vw,20px); color:var(--nav-link); text-wrap:pretty; } /* darker than --text-2: sits on video */
.strip{ position:relative; flex:none; height:270px; border-top:1px solid var(--line); overflow:hidden; }
/* nowrap + tight gap keep the readout on one line on phones (the prototype
   wrapped once ODO passed 10 km); "/ 16" drops below 360px for the longer
   translated TULIP labels. Readout values are Inter 800, like the app's ODO/CAP. */
.readout{ position:absolute; top:12px; left:max(var(--gutter), calc((100% - 1280px) / 2)); right:0; z-index:3; display:flex; gap:clamp(10px,3vw,28px); font-size:15px; font-weight:500; color:var(--text-3); white-space:nowrap; }
@media (max-width:359px){ .readout-of{ display:none; } }
.readout-cue{ display:none; align-items:center; margin:0 var(--gutter) 0 auto; color:var(--text-3); transition:opacity 300ms; }
.readout-cue svg{ width:18px; height:18px; animation:cue-bob 1.6s ease-in-out infinite; }
.strip.is-scrolled .readout-cue{ opacity:0; }
@media (min-width:700px){ .readout-cue{ display:inline-flex; } }
@media (min-width:1440px){ .readout{ right:calc((100% - 1280px) / 2); } .readout-cue{ margin-right:0; } }
@keyframes cue-bob{ 0%,100%{ transform:translateY(0); } 50%{ transform:translateY(3px); } }
.readout b{ font-weight:800; color:var(--ink); }
.marker{ position:absolute; left:22%; top:40px; bottom:0; width:0; border-left:1px dashed rgba(24,24,27,0.5); z-index:2; }
.strip-mask{ position:absolute; inset:0; -webkit-mask-image:linear-gradient(90deg,transparent 0,#000 8%,#000 88%,transparent 100%); mask-image:linear-gradient(90deg,transparent 0,#000 8%,#000 88%,transparent 100%); }
.track{ position:absolute; top:0; left:0; height:100%; will-change:transform; }
.tulip{ position:absolute; top:44px; width:128px; height:150px; border:1px solid var(--line-2); border-radius:16px; background:var(--surface-2); display:flex; flex-direction:column; opacity:0.42; transition:opacity 150ms, border-color 150ms; }
.tulip.is-on{ opacity:1; border-color:var(--ink); }
.tulip-row{ display:flex; justify-content:space-between; padding:6px 8px 0; font-size:15px; font-weight:600; }
.tulip-row:last-child{ padding:0 8px 6px; color:var(--text-3); }
.tulip-num{ color:var(--text-3); }
.tulip-dist{ font-weight:800; }
.tulip-haz{ font-weight:800; color:var(--ink); }
.tulip svg{ flex:1; min-height:0; width:100%; display:block; }
.tulip .side{ stroke:var(--side-track); stroke-width:3; stroke-linecap:round; }
.tulip .route{ fill:none; stroke:var(--ink); stroke-width:5; stroke-linecap:round; stroke-linejoin:round; }
.tulip .ink{ fill:var(--ink); }
.terrain{ position:absolute; left:0; top:194px; display:block; }
.terrain .fill{ fill:rgba(24,24,27,0.04); }
.terrain .line{ fill:none; stroke:var(--terrain); stroke-width:1.5; }
.terrain .tick{ stroke:var(--line-3); stroke-width:1; }
.terrain .dot{ fill:var(--ink); }
/* Reduced motion, too short for the sticky frame, or (.is-static, set by
   /site/home.js) the hero text doesn't fit above the strip for this language and
   screen: plain hero, static strip on tulip 01 — text is never clipped. */
@media (prefers-reduced-motion: reduce), (max-height: 600px){
  .hero{ height:auto; }
  .hero-frame{ position:relative; top:auto; height:auto; min-height:calc(100vh - var(--nav-h)); min-height:calc(100svh - var(--nav-h)); }
  .readout-cue{ display:none; }
}
.hero.is-static{ height:auto; }
.hero.is-static .hero-frame{ position:relative; top:auto; height:auto; min-height:calc(100vh - var(--nav-h)); min-height:calc(100svh - var(--nav-h)); }
.hero.is-static .readout-cue{ display:none; }
@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior:auto; }
  .btn, .tulip{ transition:none; }
  .btn:active{ transform:none; }
}

/* Sections 02–05 */
.section{ padding:clamp(80px,10vw,140px) var(--gutter); border-top:1px solid var(--line); }
.container{ max-width:1280px; margin:0 auto; }
.stack{ display:flex; flex-direction:column; gap:48px; }
.intro{ display:flex; flex-direction:column; gap:20px; max-width:760px; }
/* App eyebrow style (Inter 800, uppercase, tracked), kept at the site's 15px floor. */
.kicker{ font-weight:800; font-size:15px; letter-spacing:0.08em; text-transform:uppercase; color:var(--olive); }
h1, h2, h3{ overflow-wrap:break-word; }
h2{ margin:0; font-weight:800; font-size:clamp(30px,3.6vw,52px); line-height:1.08; letter-spacing:-0.025em; text-wrap:balance; }
.lead{ margin:0; font-size:clamp(17px,1.3vw,19px); color:var(--text-2); text-wrap:pretty; }

/* 02 — Roadbook (phones get a tighter crop of the cockpit) */
.shot-figure{ display:flex; flex-direction:column; gap:24px; margin:0; }
.shot-wide{ border-radius:20px; overflow:hidden; background:#0A0E03; }
.shot-wide img{ display:block; width:100%; height:auto; }
/* Rally terms the copy uses, for riders new to roadbooks. */
.legend{ display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:16px 32px; margin:0; }
.legend div{ display:flex; flex-direction:column; gap:4px; }
.legend dt{ font-weight:800; font-size:15px; letter-spacing:0.08em; text-transform:uppercase; }
.legend dd{ margin:0; font-size:16px; color:var(--text-2); text-wrap:pretty; }

/* 03 — The fit (radii: app card 16, chip/tile 12) */
.fit-grid{ display:flex; flex-wrap:wrap; gap:16px; }
.card{ min-width:0; background:#FFFFFF; border:1px solid var(--line-2); border-radius:16px; display:flex; flex-direction:column; }
.card--list{ flex:1 1 480px; }
.card--rules{ flex:1 1 440px; padding:16px; gap:20px; }
.feature{ display:flex; gap:18px; align-items:flex-start; padding:24px; }
.card--list .feature:not(:last-child){ border-bottom:1px solid var(--line); }
/* Group sits at the bottom so its title lines up with "Local rules". */
.card--list .feature:last-child{ margin-top:auto; }
.card--rules .feature{ padding:0 8px 8px; margin-top:auto; }
/* App lime tile: lime wash, olive glyph, no border. */
.tile{ width:48px; height:48px; flex:none; border-radius:12px; background:var(--tile-bg); display:flex; align-items:center; justify-content:center; color:var(--olive); }
.tile svg{ width:24px; height:24px; }
.feature-text{ display:flex; flex-direction:column; gap:6px; min-width:0; }
h3{ margin:0; font-weight:800; font-size:20px; letter-spacing:-0.01em; }
.feature p{ margin:0; font-size:16px; color:var(--text-2); text-wrap:pretty; }
.shot-crop{ aspect-ratio:1170/600; border-radius:12px; border:1px solid var(--line); overflow:hidden; }
.shot-crop img{ display:block; width:100%; height:100%; object-fit:cover; }

/* 04 — Coach */
.coach{ display:flex; flex-wrap:wrap; gap:clamp(40px,6vw,96px); align-items:flex-start; }
.coach-text{ flex:1 1 520px; min-width:0; display:flex; flex-direction:column; gap:20px; }
.coach-text .lead{ max-width:640px; }
.coach-grid{ display:grid; grid-template-columns:repeat(auto-fit,minmax(200px,1fr)); gap:12px; margin-top:24px; }
/* Whole card links to the coach's Instagram (app list row: tile + text). */
.coach-card{ display:flex; align-items:center; gap:14px; min-width:0; padding:14px 16px; border:1px solid var(--line-2); border-radius:16px; background:#FFFFFF; color:var(--ink); text-decoration:none; transition:border-color 150ms; }
.coach-card:hover{ border-color:var(--ink); }
.coach-card .tile{ width:40px; height:40px; }
.coach-card .tile svg{ width:20px; height:20px; }
.coach-who{ display:flex; flex-direction:column; min-width:0; }
.coach-name{ font-weight:700; font-size:16px; }
.coach-handle{ font-size:15px; color:var(--text-3); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.coach-shot{ flex:0 1 320px; min-width:240px; margin:0 auto; }
@media (max-width:519px){ .coach-shot{ flex-basis:100%; max-width:390px; } }
.coach-shot img{ display:block; width:100%; height:auto; border-radius:20px; border:1px solid var(--line-2); }

/* 05 — Get the app: the app's dark ride field */
.get{ padding:0 var(--gutter) clamp(64px,8vw,120px); }
.get-block{ --ring:rgba(255,255,255,0.5); display:flex; flex-direction:column; gap:24px; padding:clamp(40px,7vw,96px) clamp(24px,6vw,88px); border-radius:20px; background:linear-gradient(135deg,var(--night-top) 0%,var(--night-bottom) 100%); color:var(--on-night); }
.get-block .kicker{ color:var(--on-dark-2); }
.get-block h2{ font-size:clamp(34px,4.6vw,68px); line-height:1.04; }
.get-block .lead{ max-width:620px; color:var(--on-dark); text-wrap:wrap; }
.get-block .btn-row{ margin-top:8px; }
.btn-outline-dark{ border-color:rgba(255,255,255,0.35); color:var(--on-night); }
.btn-outline-dark:hover{ border-color:#FFFFFF; color:#FFFFFF; }
/* 320px phones: room for the longest translated button labels on one line. */
@media (max-width:359px){
  .get-block{ padding-left:20px; padding-right:20px; }
  .get-block .btn{ padding-left:20px; padding-right:20px; }
}

/* Footer */
.footer{ padding:24px var(--gutter); border-top:1px solid var(--line); }
.footer-inner{ display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:16px 32px; font-size:15px; color:var(--text-3); }
.footer-links{ display:flex; flex-wrap:wrap; gap:0 24px; }

/* Legal pages (privacy policy, legal notice) */
.doc{ padding:clamp(40px,6vw,80px) var(--gutter) clamp(64px,8vw,120px); }
.doc-inner{ max-width:760px; margin:0 auto; overflow-wrap:break-word; hyphens:auto; }
.doc .back{ display:inline-flex; align-items:center; min-height:var(--target); font-size:15px; font-weight:600; color:var(--nav-link); text-decoration:none; }
.doc .back:hover{ color:var(--ink); }
.doc h1{ margin:8px 0; font-weight:800; font-size:clamp(30px,4vw,44px); line-height:1.08; letter-spacing:-0.025em; }
.doc h2{ margin:40px 0 10px; font-size:22px; line-height:1.25; letter-spacing:-0.01em; }
.doc h3{ margin:24px 0 6px; font-size:17px; letter-spacing:0; }
.doc p, .doc li{ font-size:16px; color:var(--nav-link); }
.doc .lead{ font-size:17px; color:var(--nav-link); }
.doc a{ color:var(--olive); text-underline-offset:2px; }
.doc a:hover{ color:var(--ink); }
.doc ul{ padding-left:22px; }
.doc li{ margin:6px 0; }
.doc .eff, .doc .muted{ font-size:15px; color:var(--text-3); }
.doc .eff{ margin:0 0 28px; hyphens:manual; }
.doc .note{ margin:20px 0; padding:18px 20px; background:var(--tile-bg); border:1px solid var(--line-2); border-radius:16px; }
.doc .note ul{ margin:8px 0 0; }
.doc table{ display:block; width:100%; overflow-x:auto; margin:12px 0 4px; border-collapse:collapse; }
.doc th, .doc td{ padding:10px 12px; border-bottom:1px solid var(--line); font-size:15px; text-align:left; vertical-align:top; }
.doc th{ font-weight:800; color:var(--olive); white-space:nowrap; }
.doc .facts{ display:grid; grid-template-columns:minmax(120px,max-content) 1fr; gap:10px 24px; margin:24px 0; }
.doc .facts dt{ font-weight:800; font-size:15px; color:var(--ink); }
.doc .facts dd{ margin:0; font-size:16px; color:var(--nav-link); }
@media (max-width:519px){ .doc .facts{ grid-template-columns:1fr; gap:2px; } .doc .facts dd{ margin-bottom:12px; } }
