:root {
  /* Warm grayscale + iOS system blue accent. The screenshots carry the colour;
     the chrome around them stays neutral so it doesn't fight the product UI. */
  --bg:          #f7f5f1;     /* warm paper-like off-white */
  --surface:     #ffffff;
  --text:        #111111;
  --muted:       #6b6862;     /* warm-tinged muted */
  --line:        #e8e4dc;     /* warm hairline */
  --accent:      #007aff;     /* matches the in-app iOS system blue */
  --accent-deep: #0056cc;
  --hero-bg:     #1a1a1a;     /* dark hero anchor */
  --hero-text:   #f5f3ee;     /* warm off-white on dark */
  --hero-muted:  #a8a39a;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
/* Anchor jumps land below the sticky topbar (height 56px), not behind it */
section[id] { scroll-margin-top: 56px; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
}

/* Keyboard-only skip link: hidden off-screen until focused, then slides in */
.skip-link {
  position: absolute;
  top: -48px;
  left: 8px;
  z-index: 100;
  padding: 8px 16px;
  background: var(--accent);
  color: white;
  text-decoration: none;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 600;
  transition: top 0.2s ease;
}
.skip-link:focus {
  top: 8px;
  color: white;
  outline: 2px solid white;
  outline-offset: 2px;
}

h1, h2, h3, h4 {
  font-family: -apple-system, "SF Pro Rounded", system-ui, sans-serif;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 0;
}
h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); line-height: 1.05; }
h2 { font-size: 1.7rem; margin-bottom: 1rem; }
h3 { font-size: 1.15rem; margin-bottom: 0.4rem; }
h4 { font-size: 1rem; margin-bottom: 0.3rem; }

a { color: var(--accent); }
a:hover { color: var(--accent-deep); }

.lang-only-en { display: none; }
html[lang="en"] .lang-only-nl { display: none; }
html[lang="en"] .lang-only-en { display: revert; }

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ===== Top bar ===== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(247, 245, 241, 0.85);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  font-size: 1rem;
  transition: opacity 0.15s ease;
  /* Force own compositor layer — without this, Safari re-paints the
     SVG icon during opacity transitions and it sub-pixel shifts. */
  will-change: opacity;
}
/* Suppress global a:hover blue — the wordmark + 'o' accent should stay
   intact. A small opacity drop is the only feedback. */
.brand:hover { color: var(--text); opacity: 0.7; }
.brand-icon { width: 28px; height: 28px; }
/* Blue 'o' accent in the wordmark — wheels-of-a-bike easter egg.
   Used sparingly: only in the topbar brand and footer copyright;
   body-text mentions stay mono so paragraphs don't get speckled.
   `.brand-text` wraps the wordmark so the topbar's flex container
   treats it as one item — without it, each <span class="brand-o">
   becomes its own flex item and inherits .brand's `gap: 10px`. */
.brand-text { display: inline; }
.brand-o { color: var(--accent); }
.nav-links { display: flex; gap: 22px; align-items: center; }
.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
}
.nav-links a:hover { color: var(--text); }
.lang-toggle {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px;
  font-size: 0.85rem;
  background: white;
}
.lang-toggle button {
  border: 0;
  background: transparent;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  color: var(--muted);
}
.lang-toggle button.active {
  background: var(--accent);
  color: white;
}

/* ===== Hero ===== */
.hero {
  background: var(--hero-bg);
  color: var(--hero-text);
  padding: 64px 0 80px;
}
.hero-grid {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 36px;
  align-items: center;
}
.hero-icon {
  width: 140px;
  height: 140px;
}
.hero h1 { color: var(--hero-text); }
.hero p.lead {
  margin-top: 14px;
  font-size: 1.2rem;
  color: var(--hero-muted);
  max-width: 540px;
}
.hero-cta {
  margin-top: 28px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: center;
}
.appstore-badge {
  display: inline-block;
  padding: 12px 22px;
  background: var(--accent);
  color: white !important;
  text-decoration: none;
  border-radius: 14px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.15s ease, background 0.15s ease;
}
.appstore-badge:hover { transform: translateY(-1px); background: var(--accent-deep); color: white !important; }
.appstore-badge small {
  display: block;
  font-size: 0.7rem;
  opacity: 0.85;
  font-weight: 400;
  margin-bottom: 2px;
}
/* ===== Sections ===== */
section.block {
  padding: 64px 0;
  border-bottom: 1px solid var(--line);
}
section.block:last-of-type { border-bottom: 0; }
section.block.on-white { background: white; }

/* Spacing for the App Store / email CTA paragraph below an intro */
.cta-row { margin-top: 18px; }

/* Tertiary metadata note (e.g. "last updated" date in the privacy page) */
.note-meta {
  color: var(--muted);
  font-size: 0.9rem;
}

/* ===== Features ===== */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  grid-auto-rows: 1fr;   /* every row the same height → no ragged card heights */
  gap: 28px;
  margin-top: 24px;
}
.feature {
  position: relative;
  padding: 22px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 14px;
}
/* Hero feature cards: subtle accent border + faint blue wash so a couple of
   cards lift off the grid without breaking the restrained brand. */
.feature.is-hero {
  border-color: var(--accent);
  background: rgba(0, 122, 255, 0.05);
}
/* "Nieuw / New" pill — only the genuinely new feature wears it. */
.badge-new {
  position: absolute;
  top: 16px;
  right: 16px;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: white;
  background: var(--accent);
  padding: 3px 9px;
  border-radius: 999px;
  line-height: 1.4;
}
.feature-icon {
  width: 36px;
  height: 36px;
  margin-bottom: 12px;
  color: var(--accent);
}

/* ===== How it works (flow) =====
   A numbered, scroll-revealed stepper. Each step alternates text / device
   on desktop and stacks on mobile. Reveal is opt-in via `.flow.js-reveal`
   (added by flow.js) so the content is never hidden without working JS. */
.flow {
  list-style: none;
  margin: 48px 0 0;
  padding: 0;
  display: grid;
  gap: 64px;
}
.flow-step {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 48px;
  align-items: center;
}
/* Alternate sides: even steps put the device on the left */
.flow-step:nth-child(even) {
  grid-template-columns: 260px 1fr;
}
.flow-step:nth-child(even) .flow-copy { order: 2; }
.flow-step:nth-child(even) .screenshot { order: 1; }

.flow-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 16px;
}
.flow-copy h3 { margin: 0 0 8px; }
.flow-copy p {
  margin: 0;
  color: var(--muted);
  max-width: 44ch;
}

/* Watch step: keeps the same two-column rhythm as the other steps, but the
   device column stacks the three Watch faces vertically (idle → on-route →
   off-route). Three small faces stack to roughly one phone screenshot's
   height, so the row stays balanced and the left/right zig-zag isn't broken
   by a full-width centered band the way it was when this was the last step. */
.flow-step.is-watch .watch-screenshots {
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-top: 0;
}
.flow-step.is-watch .watch-screenshot {
  flex: 0 0 auto;
  /* 3 faces (aspect 422/514) + 2×14px gap ≈ 541px = one phone screenshot in
     the 260px column (incl. the 10px bezel), so the stacked Watch set matches
     the phone steps. */
  width: 140px;
}

/* Reveal-on-scroll. Only applied once flow.js adds `.js-reveal`. */
.flow.js-reveal .flow-step {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.flow.js-reveal .flow-step.is-visible {
  opacity: 1;
  transform: none;
}

/* ===== Screenshots ===== */
.screenshot {
  width: 100%;
  /* Subtle metallic bezel: highlight top-left + bottom-right, deep black middle */
  background: linear-gradient(135deg, #2a2a2a 0%, #0d0d0d 28%, #0d0d0d 72%, #2a2a2a 100%);
  border-radius: 34px;
  padding: 10px;
  position: relative;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.05),
    0 0 0 1px rgba(0, 0, 0, 0.5),
    0 14px 36px -10px rgba(0, 0, 0, 0.22),
    0 4px 14px -4px rgba(0, 0, 0, 0.12);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.screenshot:hover {
  transform: translateY(-3px);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.05),
    0 0 0 1px rgba(0, 0, 0, 0.5),
    0 22px 48px -10px rgba(0, 0, 0, 0.30),
    0 6px 18px -4px rgba(0, 0, 0, 0.16);
}
.screenshot img {
  width: 100%;
  /* Put the device ratio on the IMG, not the bezel box. The bezel adds padding,
     so an aspect-ratio on .screenshot leaves the content box a different shape
     than the capture — object-fit: cover then crops the SIDES and eats the
     in-app side margins (e.g. the composer sheet looked edge-to-edge). Sizing
     the img to the real 1320×2868 capture ratio shows the whole frame, uncropped. */
  aspect-ratio: 1320 / 2868;
  object-fit: cover;
  display: block;
  border-radius: 24px;     /* inner = outer (34) − padding (10) → continuous curve */
  background: #000;
}
/* Opt-in soft inner shadow, only for captures where bright in-app content
   (a floating sheet over the map) reaches the rounded corners — it fades that
   content into the bezel so the corner doesn't read as a gap. Screens already
   black at the edges (nav, ride recap) deliberately don't get it. Add the
   `over-map` class to those .screenshot blocks in index.html. */
.screenshot.over-map::after {
  content: "";
  position: absolute;
  inset: 10px;             /* sits over the image, inside the 10px bezel */
  border-radius: 24px;     /* match the inner (image) radius */
  box-shadow: inset 0 0 16px 3px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}

/* Watch row sits under the iPhone screenshots — smaller, centered, no
   device bezel (Apple frowns on framing Watch shots). The black inside
   the captured Watch face provides its own visual edge. */
.watch-heading {
  text-align: center;
  margin-top: 56px;
  font-size: 1rem;
  color: var(--muted);
  font-weight: 600;
}
.watch-screenshots {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 24px;
  margin-top: 18px;
}
.watch-screenshot {
  flex: 0 1 180px;
  aspect-ratio: 422 / 514;
  background: #000;
  border-radius: 36px;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.5),
    0 12px 30px -10px rgba(0, 0, 0, 0.25);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.watch-screenshot:hover {
  transform: translateY(-3px);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.5),
    0 18px 40px -10px rgba(0, 0, 0, 0.30);
}
.watch-screenshot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Image-specific lang-only overrides. The .screenshot img / .watch-screenshot img
   rules above set `display: block` with higher specificity than the bare
   `.lang-only-*` utility class, so we re-state the hide/show at matching
   specificity to keep the wrong-language image hidden. */
.screenshot img.lang-only-en,
.watch-screenshot img.lang-only-en { display: none; }
html[lang="en"] .screenshot img.lang-only-nl,
html[lang="en"] .watch-screenshot img.lang-only-nl { display: none; }
html[lang="en"] .screenshot img.lang-only-en,
html[lang="en"] .watch-screenshot img.lang-only-en { display: block; }

/* ===== See it in action (tutorial clips) =====
   Dark band mirroring the hero: the clips are dark phone mockups on near-black,
   so a light background would leave a black rectangle floating. The recorded
   video already includes the device frame, so — unlike .screenshot — there's no
   metallic bezel here, just rounded corners + a drop shadow. */
.video-showcase {
  background: var(--hero-bg);
  color: var(--hero-text);
  border-bottom: 0;
}
.video-showcase h2 { color: var(--hero-text); }
.video-intro {
  margin: 0;
  color: var(--hero-muted);
  max-width: 540px;
}
/* Carousel: one clip at a time with page dots below. The `loop` and `ab`
   tutorials open on the same planner screen, so their near-identical posters
   read as a duplicate side by side — one-at-a-time avoids that. Progressive
   enhancement: without JS the clips just stack (all reachable) and the dots
   stay hidden; tutorials.js adds `.js-carousel`, which collapses the track to a
   single sliding slide and reveals the dots. */
.clip-carousel { margin-top: 36px; }
.clip-track {
  display: grid;
  gap: 32px;
  justify-items: center;
}
.clip-dots { display: none; }

.clip-carousel.js-carousel .clip-viewport { overflow: hidden; }
.clip-carousel.js-carousel .clip-track {
  display: flex;
  gap: 0;
  transition: transform 0.35s ease;
}
.clip-carousel.js-carousel .clip {
  flex: 0 0 100%;
  min-width: 0;
}
.clip-carousel.js-carousel .clip-dots {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 22px;
}

.clip { margin: 0; }
.clip-frame {
  position: relative;
  max-width: 300px;
  margin: 0 auto;
  border-radius: 26px;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.5),
    0 16px 40px -12px rgba(0, 0, 0, 0.55);
}
.clip video {
  width: 100%;
  display: block;
  aspect-ratio: 620 / 1174;   /* the recorded mockup frame */
  background: #000;
}
/* Full-frame play affordance over the poster: a centred ▶ disc. Click-to-play
   (tutorials.js) starts the clip; once it's playing the button goes transparent
   and click-through, so a click on the video pauses it and the ▶ returns. No
   native control bar is shown. The label text stays in the accessibility tree
   (screen readers) but collapses visually. */
.clip-play {
  position: absolute;
  inset: 0;
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
  background: transparent;
  font-size: 0;
  color: transparent;
  transition: opacity 0.2s ease;
}
.clip-play::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 66px;
  height: 66px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  transition: background 0.15s ease;
}
.clip-play::after {                /* white play triangle, nudged to look centred */
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-40%, -50%);
  border-style: solid;
  border-width: 11px 0 11px 18px;
  border-color: transparent transparent transparent #fff;
}
.clip-play:hover::before { background: rgba(0, 0, 0, 0.72); }
.clip.is-playing .clip-play {
  opacity: 0;
  pointer-events: none;
}
/* Fullscreen button: hidden with the poster, shown only while a clip plays.
   Native fullscreen brings back the full player (incl. the scrubber) for anyone
   who wants to go big or rewind — the inline view itself stays chrome-free. */
.clip-fs {
  position: absolute;
  right: 12px;
  top: 12px;                 /* top-right: clear of the app's own bottom controls */
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, background 0.15s ease;
}
.clip-fs svg { width: 20px; height: 20px; }
.clip-fs:hover { background: rgba(0, 0, 0, 0.72); }
/* Auto-hide like native controls: visible only while playing AND recently
   active (tutorials.js adds/removes .controls-active on a short idle timer). */
.clip.is-playing.controls-active .clip-fs {
  opacity: 1;
  pointer-events: auto;
}
.clip figcaption {
  margin-top: 16px;
  text-align: center;
  color: var(--hero-muted);
  font-size: 0.95rem;
  font-weight: 600;
}
/* Same specificity fix as .screenshot img: `.clip video` (0,1,1) would beat the
   bare `.lang-only-*` utility (0,1,0) and show both languages, so re-state the
   hide/show at matching-or-higher specificity. */
.clip video.lang-only-en { display: none; }
html[lang="en"] .clip video.lang-only-nl { display: none; }
html[lang="en"] .clip video.lang-only-en { display: block; }

/* Page dots. Each dot is a real <button> (a tab in the tablist); the tutorial
   name lives in an .sr-only span inside it for screen readers. */
.clip-dot {
  width: 11px;
  height: 11px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.28);
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}
.clip-dot:hover { background: rgba(255, 255, 255, 0.5); }
.clip-dot.is-current {
  background: var(--accent);
  transform: scale(1.15);
}
.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;
}

/* ===== Privacy / Support body ===== */
.body-text h3 { margin-top: 1.6em; }
.body-text h4 { margin-top: 1.2em; }
.body-text p, .body-text ul { margin: 0.6em 0; color: var(--text); }
.body-text ul { padding-left: 1.4em; }
.body-text strong { color: var(--text); }

.summary-card {
  margin-top: 16px;
  padding: 18px 22px;
  background: rgba(0, 0, 0, 0.04);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
}

/* ===== Footer ===== */
footer {
  padding: 36px 0 48px;
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}
footer a { color: var(--muted); }
footer .sep { margin: 0 10px; opacity: 0.5; }

/* ===== Responsive ===== */

/* Tablet portrait: tone down hero scale so it doesn't look desktop-sized */
@media (max-width: 900px) {
  .hero { padding: 56px 0 64px; }
  .hero-icon { width: 120px; height: 120px; }
  .hero-grid { grid-template-columns: 120px 1fr; gap: 28px; }
}

/* Phone: stack hero, hide section-anchor nav links, constrain screenshots */
@media (max-width: 600px) {
  .hero { padding: 48px 0 56px; }
  .hero-grid { grid-template-columns: 1fr; gap: 22px; }
  .hero-icon { width: 96px; height: 96px; }

  /* Drop in-page anchors (#features, #support) from the topbar — visitors
     scroll the page on mobile anyway. Privacy + lang-toggle stay. */
  .nav-links { gap: 14px; }
  .nav-links a[href*="#features"],
  .nav-links a[href*="#support"] {
    display: none;
  }

  /* Stack each flow step: copy on top, device below, centered and capped so a
     single tall phone doesn't dominate the page. Reset the alternating order. */
  .flow { gap: 44px; }
  .flow-step,
  .flow-step:nth-child(even) {
    grid-template-columns: 1fr;
    gap: 20px;
    text-align: center;
    justify-items: center;
  }
  .flow-step .flow-copy,
  .flow-step .screenshot { order: 0; }
  .flow-copy p { margin-inline: auto; }
  .flow-step .screenshot {
    max-width: 240px;
    width: 100%;
  }
}

/* Tutorial carousel: the phone gets a touch smaller on narrow screens */
@media (max-width: 460px) {
  .clip-frame { max-width: 240px; }
}

/* Narrow phone: tighter container gutters */
@media (max-width: 480px) {
  .container { padding: 0 18px; }
}

/* Respect users who've opted out of motion (vestibular issues, motion
   sickness, OS-level "Reduce Motion" toggle). Universal kill of
   transitions and animations rather than disabling them one-by-one
   so future additions are covered automatically. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}