@font-face {
  font-family: 'Outfit';
  src: url('fonts/outfit-latin.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --primary: #e0500a;
  --primary-bright: #ff7a33;
  --primary-soft: rgba(224, 80, 10, 0.16);
  --bg: #0b0d13;
  --bg-alt: #12141b;
  --panel: #151822;
  --border: rgba(255, 255, 255, 0.12);
  --text: #f8f9fa;
  --muted: #a3aab2;
  --map-line: rgba(255, 255, 255, 0.07);
  --scrim: rgba(11, 13, 19, 0.92);
  --bar: rgba(224, 80, 10, 0.32);
  --hill: #14141d;
}

:root[data-theme='light'] {
  --primary-bright: #e0500a;
  --bg: #f8f9fa;
  --bg-alt: #ffffff;
  --panel: #ffffff;
  --border: #e4e7ea;
  --text: #1a1a1a;
  --muted: #5f666e;
  --map-line: rgba(0, 0, 0, 0.08);
  --scrim: rgba(248, 249, 250, 0.92);
  --bar: rgba(224, 80, 10, 0.2);
  --hill: #e4e7ea;
}

* { box-sizing: border-box; margin: 0; }

html { scroll-behavior: smooth; scroll-padding-top: 88px; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Outfit', system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { line-height: 1.08; font-weight: 800; letter-spacing: -0.02em; text-wrap: balance; }
h2 { font-size: clamp(32px, 5vw, 56px); }

:focus-visible { outline: 2px solid var(--primary-bright); outline-offset: 3px; border-radius: 6px; }

.wrap { width: min(1200px, 100% - 40px); margin-inline: auto; }

.skip { position: absolute; left: 12px; top: -60px; z-index: 30; padding: 10px 16px; background: var(--primary); color: #fff; border-radius: 8px; }
.skip:focus { top: 12px; }

/* Loader, matched by web/index.html while the app starts */
.loader { display: none; position: fixed; inset: 0; z-index: 100; place-items: center; background: var(--bg); transition: opacity 0.35s, visibility 0.35s; }
.js .loader { display: grid; }
.loader.done { opacity: 0; visibility: hidden; }
.spinner { width: 56px; height: 56px; border: 4px solid var(--primary-soft); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Header */
.header { position: fixed; inset: 0 0 auto; z-index: 20; transition: background 0.25s, border-color 0.25s; border-bottom: 1px solid transparent; }
.header.scrolled { background: var(--scrim); backdrop-filter: blur(14px); border-color: var(--border); }
.nav { display: flex; align-items: center; gap: 28px; height: 76px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 24px; font-weight: 800; letter-spacing: -0.02em; }
.brand b { font-weight: inherit; }
.brand span { color: var(--primary-bright); }
.nav-links { display: flex; gap: 26px; margin-left: auto; color: var(--muted); font-weight: 500; font-size: 16px; }
.nav-links a { transition: color 0.15s; }
.nav-links a:hover { color: var(--text); }
.nav-actions { display: flex; align-items: center; gap: 10px; }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 0 22px; border: 0; border-radius: 10px; background: var(--primary); color: #fff; font: 700 16px 'Outfit', system-ui, sans-serif; cursor: pointer; transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1), background 0.2s; }
.btn:hover { background: #f05a10; transform: translateY(-2px); }
.btn-large { min-height: 58px; padding: 0 32px; font-size: 18px; }
.btn-link { display: inline-flex; align-items: center; gap: 8px; min-height: 58px; font-weight: 700; }
.btn-link span { transition: transform 0.2s; }
.btn-link:hover span { transform: translateY(4px); }

.theme-toggle { width: 46px; height: 46px; border: 1px solid var(--border); border-radius: 10px; background: transparent; color: var(--text); font-size: 18px; cursor: pointer; }

/* Hero: the live ride map */
.hero { position: relative; min-height: 100svh; display: flex; align-items: center; padding: 120px 0 210px; overflow: hidden; }
.hero-map { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, var(--bg) 8%, transparent 62%), linear-gradient(0deg, var(--bg), transparent 22%); pointer-events: none; }
.hero-copy { position: relative; z-index: 1; }
.eyebrow, .km { color: var(--primary-bright); font-size: 15px; font-weight: 700; letter-spacing: 0.04em; }
h1 { max-width: 13em; margin: 14px 0 20px; font-size: clamp(44px, 8vw, 92px); line-height: 1; }
h1 em { font-style: normal; color: var(--primary-bright); }
.lead { max-width: 30em; color: var(--muted); font-size: clamp(18px, 2.2vw, 22px); line-height: 1.45; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; margin-top: 32px; }
.hero-note { position: absolute; z-index: 1; right: 32px; bottom: 190px; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #e03131; animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.3; } }

/* Touring riders crossing the foot of the hero */
.hero-ride { position: absolute; inset: auto 0 0; z-index: 1; }
.hero-hills { display: block; width: 100%; height: 56px; margin-bottom: -2px; fill: var(--hill); }
.bike-parts { position: absolute; }
.hero-road { height: 118px; overflow: hidden; }
.hero-group { position: absolute; left: 0; bottom: 2px; width: 480px; height: 90px; overflow: visible; transform: translateX(-520px); animation: hero-ride 24s linear infinite; }
.hero-group-late { animation-delay: -12s; }
.hero-group-far { bottom: 44px; width: 317px; height: 59px; animation-duration: 34s; animation-delay: -8s; }
@keyframes hero-ride { to { transform: translateX(calc(100vw + 40px)); } }
.spokes { transform-box: fill-box; transform-origin: center; animation: spin 0.4s linear infinite; }

/* The route that runs through the page */
.journey { position: relative; }
.rail { position: absolute; left: max(20px, calc(50% - 600px)); top: 0; bottom: 0; width: 2px; background: var(--border); }
.rail-fill { position: absolute; inset: 0 0 auto; height: 100%; background: var(--primary-bright); transform: scaleY(var(--progress, 0)); transform-origin: top; }

.chapter { padding: clamp(64px, 10vw, 128px) 0; }
.chapter-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(32px, 6vw, 88px); align-items: center; }
.chapter-copy { padding-left: 36px; }
.chapter-copy h2 { margin: 12px 0 18px; }
.chapter-copy > p:last-child { color: var(--muted); font-size: 19px; max-width: 34em; }

.bleed { margin-bottom: clamp(48px, 7vw, 88px); }
.bleed img { width: 100%; height: clamp(260px, 44vw, 560px); object-fit: cover; background: var(--panel); }

/* Try-it panels */
.demo { padding: 28px; background: var(--panel); border: 1px solid var(--border); border-radius: 16px; }
.demo-label { color: var(--primary-bright); font-size: 14px; font-weight: 700; }
.demo h3 { margin: 4px 0 18px; font-size: 24px; }
.demo-note { margin-top: 12px; color: var(--muted); font-size: 15px; }

.poll-option { position: relative; display: flex; justify-content: space-between; width: 100%; min-height: 52px; margin-bottom: 10px; padding: 0 16px; align-items: center; overflow: hidden; border: 1.5px solid var(--border); border-radius: 10px; background: transparent; color: var(--text); font: 600 17px 'Outfit', system-ui, sans-serif; cursor: pointer; }
.poll-option[aria-pressed='true'] { border-color: var(--primary-bright); }
.poll-bar { position: absolute; inset: 0 auto 0 0; width: var(--share, 0%); background: var(--bar); transition: width 0.4s cubic-bezier(0.2, 0.8, 0.2, 1); }
.poll-text, .poll-count { position: relative; }

.split-total { font-size: 44px; font-weight: 800; line-height: 1; margin-bottom: 18px; }
.riders { display: flex; flex-wrap: wrap; gap: 8px; }
.riders label { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border: 1.5px solid var(--border); border-radius: 10px; cursor: pointer; font-weight: 600; }
.riders label:has(input:checked) { border-color: var(--primary-bright); background: var(--primary-soft); }
.riders input { accent-color: var(--primary); width: 18px; height: 18px; }
.split-result { margin-top: 16px; color: var(--muted); }
.split-result strong { color: var(--text); font-size: 22px; }

.facts { list-style: none; padding: 0; }
.facts li { padding: 20px 0; color: var(--muted); border-top: 1px solid var(--border); }
.facts li:last-child { border-bottom: 1px solid var(--border); }
.facts strong { display: block; color: var(--text); font-size: 20px; }

/* Marketplace */
.market { padding: clamp(64px, 10vw, 128px) 0; background: var(--bg-alt); border-block: 1px solid var(--border); }
.market-head { display: grid; grid-template-columns: 1.3fr 1fr; gap: 24px 64px; align-items: end; margin-bottom: 48px; }
.market-head p { color: var(--muted); font-size: 19px; }
.market-photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.market-photos figure { position: relative; overflow: hidden; }
.market-photos img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; background: var(--panel); transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1); }
.market-photos figure:hover img { transform: scale(1.04); }
.market-photos figcaption { position: absolute; left: 20px; bottom: 16px; color: #fff; font-size: 22px; font-weight: 800; text-shadow: 0 1px 12px rgba(0, 0, 0, 0.8); }
.vault { margin-top: 40px; color: var(--muted); font-size: 19px; }
.vault strong { color: var(--text); }

/* Download: the stores are the next stop, dark in both themes like the login scene */
.arrival { position: relative; overflow: hidden; padding-top: clamp(72px, 10vw, 128px); color: #fff; background: linear-gradient(180deg, #1a1020, #7a2c14 62%, #c8461a); }
.arrival-sun { position: absolute; right: 8%; bottom: 40px; width: clamp(180px, 26vw, 340px); aspect-ratio: 1; border-radius: 50%; background: #ffd27a; opacity: 0.9; }
.arrival-grid { position: relative; display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px clamp(32px, 6vw, 88px); align-items: center; padding-bottom: clamp(56px, 8vw, 96px); }
.arrival .km { color: #ffd27a; }
.arrival h2 { margin: 12px 0 18px; }
.arrival-lead { max-width: 30em; color: #f3ded2; font-size: 19px; }

.stores { display: grid; gap: 14px; padding: 0; list-style: none; }
.store { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 16px; padding: 18px 20px; border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 16px; background: rgba(11, 13, 19, 0.72); backdrop-filter: blur(10px); }
.store svg { fill: #fff; }
.store p { line-height: 1.2; }
.store small { display: block; color: #c4c9cf; font-size: 14px; }
.store strong { font-size: 22px; font-weight: 800; }
.store-status { display: inline-flex; align-items: center; gap: 8px; color: #ffd27a; font-size: 14px; font-weight: 700; white-space: nowrap; }
.store-status .live-dot { background: #ffd27a; }

.road { position: relative; background: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.5) 0 44px, transparent 44px 104px) 0 50% / 104px 3px repeat-x, #17131c; border-top: 2px solid rgba(255, 122, 51, 0.6); animation: road-slide 1.6s linear infinite; }
.arrival-road { height: 72px; }
@keyframes road-slide { to { background-position-x: -104px, 0; } }
.convoy { position: absolute; top: 24px; left: -30%; display: flex; flex-direction: row-reverse; gap: 22px; animation: convoy-ride 14s linear infinite; }
.convoy-late { top: 46px; animation-delay: -7s; }
.convoy i { width: 12px; height: 6px; border-radius: 3px; background: #fff; box-shadow: 16px 0 14px 3px rgba(255, 210, 122, 0.55), -8px 0 8px rgba(255, 59, 48, 0.9); }
@keyframes convoy-ride { to { left: 110%; } }

/* FAQ */
.faq { padding: clamp(64px, 10vw, 128px) 0; }
.faq-grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: 32px 64px; }
details { border-top: 1px solid var(--border); }
details:last-child { border-bottom: 1px solid var(--border); }
summary { display: flex; justify-content: space-between; gap: 16px; padding: 20px 0; font-size: 20px; font-weight: 700; cursor: pointer; list-style: none; }
summary::-webkit-details-marker { display: none; }
summary::after { content: '+'; color: var(--primary-bright); font-size: 26px; line-height: 1; transition: transform 0.2s; }
details[open] summary::after { transform: rotate(45deg); }
details p { padding-bottom: 20px; color: var(--muted); }

/* Closing call to action */
.cta { position: relative; display: grid; align-items: center; min-height: 70vh; overflow: hidden; background: #0b0d13; }
.cta img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cta::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(11, 13, 19, 0.92), rgba(11, 13, 19, 0.15)); }
.cta-copy { position: relative; z-index: 1; color: #fff; }
.cta-copy h2 { max-width: 12em; margin-bottom: 28px; }

/* Footer */
.footer { padding: 32px 0; border-top: 1px solid var(--border); color: var(--muted); font-size: 15px; }
.footer-row { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; justify-content: space-between; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.footer a:hover { color: var(--text); }

/* Legal pages */
.legal { padding: 128px 0 64px; max-width: 720px; }
.legal h1 { font-size: 44px; margin-top: 0; }
.legal h2 { font-size: 22px; margin-top: 32px; letter-spacing: 0; }
.legal p { color: var(--muted); margin-top: 6px; }

/* Scroll reveal only runs when the script is there to finish it */
.js .reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.7s, transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1); }
.js .reveal.seen { opacity: 1; transform: none; }

@media (max-width: 900px) {
  .nav-links { display: none; }
  .nav-actions { margin-left: auto; }
  .chapter-grid, .market-head, .faq-grid, .arrival-grid { grid-template-columns: 1fr; }
  .arrival-sun { opacity: 0.35; }
  .hero::after { background: linear-gradient(0deg, var(--bg) 12%, transparent 80%), linear-gradient(90deg, var(--scrim), transparent 90%); }
  .hero-note { display: none; }
  .hero { padding-bottom: 170px; }
  .hero-road { height: 84px; }
  .hero-group { width: 288px; height: 54px; }
  .hero-group-far { bottom: 32px; width: 192px; height: 36px; }
  .chapter-copy { padding-left: 24px; }
  .chapter-grid > .demo, .chapter-grid > .facts { margin-left: 24px; }
  .market-photos { grid-auto-flow: column; grid-template-columns: none; grid-auto-columns: 74%; overflow-x: auto; scroll-snap-type: x mandatory; padding-inline: 20px; }
  .market-photos figure { scroll-snap-align: center; }
  body { font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .spinner { animation: spin 3s linear infinite !important; }
  .hero-group { animation: none; transform: translateX(30vw); }
  .hero-group-late { transform: translateX(65vw); }
  .js .reveal { opacity: 1; transform: none; }
}
