@font-face {
  font-family: 'Archivo';
  src: url('/assets/fonts/archivo-500.woff2') format('woff2');
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}

:root {
  color-scheme: dark;
  /* Neutral graphite around the app's current night track photograph. */
  --ground: #242529;
  --ground-deep: #1b1c20;
  --surface: rgba(244, 244, 246, 0.06);
  --surface-strong: rgba(244, 244, 246, 0.11);
  --ink: #f4f4f6;
  --ink-soft: #cacacf;
  --quiet: #adaeb5;
  --edge: rgba(229, 237, 235, 0.16);
  --edge-strong: rgba(229, 237, 235, 0.31);
  --accent: #f4f4f6;
  --atmosphere-image: url('/assets/track-night-teal.webp');
  --radius-small: 12px;
  --radius-medium: 20px;
  --radius-large: 32px;
  --page-gutter: clamp(1.25rem, 4vw, 3rem);
  --page-width: 76rem;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--ground-deep);
}

body {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background: var(--ground-deep);
  color: var(--ink);
  font-family: 'Archivo', 'Helvetica Neue', Arial, sans-serif;
  font-weight: 500;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  position: fixed;
  z-index: -1;
  inset: 0;
  background:
    linear-gradient(rgba(27, 28, 32, 0.86), rgba(27, 28, 32, 0.88)),
    var(--atmosphere-image) center 22% / cover no-repeat;
  content: '';
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
}

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.shell {
  width: 100%;
  max-width: var(--page-width);
  margin-inline: auto;
  padding-left: max(var(--page-gutter), env(safe-area-inset-left));
  padding-right: max(var(--page-gutter), env(safe-area-inset-right));
}

.micro {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.16em;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  padding-top: env(safe-area-inset-top);
}

.wordmark {
  color: var(--ink);
  text-decoration: none;
}

.top-link {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  color: var(--ink-soft);
  font-size: 0.85rem;
  text-decoration: none;
}

.top-link:hover {
  color: var(--ink);
}

.top-nav {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2vw, 2rem);
}

.top-nav a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  color: var(--ink-soft);
  font-size: 0.85rem;
  text-decoration: none;
}

.top-nav a:hover {
  color: var(--ink);
}

/* Landing */

.landing-page::before {
  background:
    linear-gradient(110deg, rgba(36, 37, 41, 0.88), rgba(36, 37, 41, 0.84)),
    var(--atmosphere-image) center 22% / cover no-repeat;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(2.5rem, 6vw, 5.5rem);
  align-items: center;
  min-height: calc(100svh - 76px);
  padding-top: clamp(2.5rem, 6vh, 4.5rem);
  padding-bottom: clamp(4rem, 8vh, 6rem);
}

.hero-copy {
  position: relative;
  z-index: 1;
}

.hero h1 {
  max-width: 8.5ch;
  margin: 0;
  font-size: clamp(3.2rem, 8.2vw, 6.8rem);
  font-weight: 500;
  letter-spacing: -0.055em;
  line-height: 0.94;
}

.positioning {
  max-width: 32ch;
  margin: clamp(1.5rem, 4vh, 2.25rem) 0 0;
  color: var(--ink-soft);
  font-size: clamp(1.05rem, 1.6vw, 1.28rem);
  line-height: 1.55;
}

.hero-description {
  max-width: 47ch;
  margin: 1.25rem 0 0;
  color: var(--ink-soft);
  font-size: 0.98rem;
  line-height: 1.7;
}

.cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-top: clamp(2rem, 5vh, 3rem);
}

.store-badge {
  display: inline-flex;
  border-radius: 9px;
}

/*
 * `hidden` has to be said again here, because `display` above already beat it.
 *
 * The HTML attribute only works through the user agent rule `[hidden] {
 * display: none }`, and any author declaration outranks the user agent origin,
 * so `display: inline-flex` won and the Google Play badge kept rendering at
 * full size with the attribute sitting on it. Caught 2026-09-19 by screenshotting
 * the page rather than reading the markup: the fix that added `hidden` changed
 * nothing a visitor could see, and left the page saying "Available on iPhone"
 * with a Play button underneath, which is worse than before.
 */
.store-badge[hidden] {
  display: none;
}

.store-badge img {
  width: auto;
}

.store-badge.apple img {
  height: 48px;
}

/*
 * Google ships its badge with its own clear space baked into the file: the
 * artwork is 646 x 250 and the button inside it measures 564 x 168, so a naive
 * `height: 48px` would draw a button of 32 beside Apple's 48. Their brand terms
 * forbid cropping the file, so the height is scaled instead: 48 x 250 / 168.
 * Measured, not guessed, and it is why this number is not round.
 */
.store-badge.google img {
  height: 71px;
  margin: -11px -12px;
}

.story-proof {
  position: relative;
  min-width: 0;
  margin: 0;
}

.gallery-switcher {
  display: flex;
  min-width: 0;
  flex-direction: column;
  margin: 0;
  padding: 0;
  border: 0;
}

.gallery-switcher legend {
  padding: 0 0 0.8rem;
  color: var(--ink-soft);
  font-size: 0.78rem;
}

.gallery-switcher input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.gallery-controls {
  display: flex;
  order: 1;
  justify-content: center;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.gallery-controls label {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 0.9rem;
  border: 1px solid transparent;
  border-radius: 99px;
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 0.82rem;
}

.gallery-controls label:hover {
  background: var(--surface);
  color: var(--ink);
}

#story-run:checked ~ .gallery-controls label[for='story-run'],
#story-ride:checked ~ .gallery-controls label[for='story-ride'],
#story-hike:checked ~ .gallery-controls label[for='story-hike'] {
  border-color: var(--edge-strong);
  background: var(--surface-strong);
  color: var(--ink);
}

#story-run:focus-visible ~ .gallery-controls label[for='story-run'],
#story-ride:focus-visible ~ .gallery-controls label[for='story-ride'],
#story-hike:focus-visible ~ .gallery-controls label[for='story-hike'] {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.gallery-stage {
  order: 2;
  max-width: 24rem;
  margin-inline: auto;
  padding: clamp(0.5rem, 1vw, 0.8rem);
  border: 1px solid var(--edge);
  border-radius: calc(var(--radius-medium) + 0.5rem);
  background: rgba(239, 231, 212, 0.08);
  box-shadow: 0 1.5rem 3.5rem rgba(13, 17, 15, 0.22);
}

.gallery-panel {
  display: none;
}

#story-run:checked ~ .gallery-stage .panel-run,
#story-ride:checked ~ .gallery-stage .panel-ride,
#story-hike:checked ~ .gallery-stage .panel-hike {
  display: block;
}

.gallery-panel img {
  width: 100%;
  border-radius: var(--radius-medium);
}

.story-proof figcaption {
  max-width: 34rem;
  margin: 1rem auto 0;
  color: var(--ink-soft);
  font-size: 0.82rem;
  text-align: center;
}

.why {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem 3rem;
  padding-top: clamp(3rem, 8vh, 5rem);
  padding-bottom: clamp(3rem, 8vh, 5rem);
  border-top: 1px solid var(--edge);
}

.why h2,
.premium h2 {
  max-width: 15ch;
  margin: 0;
  font-size: clamp(2rem, 4.2vw, 3.6rem);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 1.06;
}

.why p,
.premium-copy p {
  max-width: 58ch;
  margin: 0;
  color: var(--ink-soft);
  font-size: clamp(1rem, 1.4vw, 1.15rem);
  line-height: 1.7;
}

.how {
  padding-bottom: clamp(4rem, 9vh, 7rem);
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  border-top: 1px solid var(--edge);
  padding-top: 1rem;
}

.section-head h2 {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.8rem;
  font-weight: 500;
}

.steps {
  display: grid;
  overflow: hidden;
  margin: clamp(2rem, 5vh, 3.5rem) 0 0;
  padding: 0;
  border: 1px solid var(--edge);
  border-radius: var(--radius-medium);
  background: var(--surface);
  list-style: none;
  backdrop-filter: blur(20px);
}

.step {
  display: grid;
  grid-template-columns: 2.25rem minmax(0, 1fr);
  gap: 1rem;
  padding: clamp(1.4rem, 3vw, 2rem);
}

.step + .step {
  border-top: 1px solid var(--edge);
}

.step .num {
  color: var(--accent);
  font-size: 0.82rem;
  line-height: 1.5rem;
}

.step h3 {
  margin: 0;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 500;
}

.step p {
  max-width: 35ch;
  margin: 0.55rem 0 0;
  color: var(--quiet);
  font-size: 0.92rem;
}

.premium {
  display: grid;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: stretch;
  padding-bottom: clamp(5rem, 12vh, 9rem);
}

.premium-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.6rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--edge);
}

.premium-copy a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  border-bottom: 1px solid var(--accent);
  color: var(--ink);
  text-decoration: none;
}

.premium-copy a:hover {
  color: var(--accent);
}

.premium-note {
  display: flex;
  min-height: 17rem;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  border: 1px solid var(--edge);
  border-radius: var(--radius-medium);
  background:
    linear-gradient(135deg, rgba(20, 21, 25, 0.36), rgba(20, 21, 25, 0.65)),
    var(--atmosphere-image) center 78% / cover;
}

.premium-note span {
  color: var(--ink-soft);
  font-size: 0.8rem;
}

.premium-note p {
  max-width: 14ch;
  margin: 0;
  font-size: clamp(1.5rem, 2.8vw, 2.5rem);
  letter-spacing: -0.035em;
  line-height: 1.08;
}

/* Legal and account pages */

.legal-page {
  position: relative;
}

.legal-shell {
  width: 100%;
  max-width: 51rem;
  margin-inline: auto;
  padding: clamp(3rem, 9vh, 6rem) max(1.25rem, env(safe-area-inset-right))
    calc(6rem + env(safe-area-inset-bottom)) max(1.25rem, env(safe-area-inset-left));
}

.legal-card {
  width: auto;
  min-width: 0;
  padding: clamp(1.5rem, 5vw, 3.5rem);
  border: 1px solid var(--edge);
  border-radius: var(--radius-large);
  background: rgba(33, 34, 38, 0.9);
  box-shadow: 0 2rem 5rem rgba(0, 0, 0, 0.26);
  backdrop-filter: blur(28px);
}

.legal-card .kicker {
  margin: 0 0 1.25rem;
  color: var(--accent);
  font-size: 0.75rem;
  letter-spacing: 0.16em;
}

.legal-card h1 {
  max-width: 14ch;
  margin: 0;
  font-size: clamp(2.4rem, 7vw, 4.4rem);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 0.98;
}

.legal-card .updated {
  margin: 1rem 0 2.75rem;
  color: var(--quiet);
  font-size: 0.86rem;
}

.legal-card h2 {
  margin: 2.75rem 0 0.85rem;
  color: var(--ink);
  font-size: 1.15rem;
  font-weight: 500;
  letter-spacing: -0.015em;
}

.legal-card h3 {
  margin: 1.6rem 0 0.65rem;
  color: var(--ink-soft);
  font-size: 0.95rem;
  font-weight: 500;
}

.legal-card p,
.legal-card li {
  color: var(--ink-soft);
  overflow-wrap: anywhere;
}

.legal-card p {
  max-width: 68ch;
}

.legal-card ul,
.legal-card ol {
  padding-left: 1.35rem;
}

.legal-card li {
  margin: 0.5rem 0;
}

.legal-card a {
  color: var(--accent);
  text-decoration-color: rgba(244, 244, 246, 0.4);
  text-underline-offset: 0.18em;
}

.legal-card code {
  color: var(--ink);
  font-family: inherit;
}

.legal-card .muted {
  color: var(--quiet);
}

.legal-card .note {
  margin: 1.75rem 0;
  padding: 1rem 1.1rem;
  border: 1px solid var(--edge);
  border-radius: var(--radius-small);
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.legal-card hr {
  margin: 3rem 0 0;
  border: 0;
  border-top: 1px solid var(--edge);
}

.legal-card footer {
  margin-top: 1.5rem;
  color: var(--quiet);
  font-size: 0.8rem;
}

/* Global footer */

.site-footer {
  border-top: 1px solid var(--edge);
  padding: clamp(2rem, 5vh, 3rem) 0 calc(env(safe-area-inset-bottom) + clamp(2rem, 5vh, 3rem));
}

.foot-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.6rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.foot-links a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  color: var(--quiet);
  text-decoration: none;
}

.foot-links a:hover {
  color: var(--ink);
}

.colophon-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  margin-top: clamp(1.5rem, 4vh, 2.5rem);
}

.colophon-line small {
  color: var(--quiet);
  font-size: 0.8rem;
}

.strava-attribution {
  margin: 0;
}

.strava-attribution img {
  width: 145px;
}

/* Redirect */

.redirect-page {
  display: grid;
  min-height: 100svh;
  place-items: center;
  padding: 1.5rem;
  text-align: center;
}

.redirect-card {
  width: min(100%, 28rem);
  padding: 2rem;
  border: 1px solid var(--edge);
  border-radius: var(--radius-medium);
  background: var(--surface);
  backdrop-filter: blur(20px);
}

.redirect-card .mark {
  color: var(--accent);
  font-size: 0.75rem;
  letter-spacing: 0.16em;
}

.redirect-card p {
  margin: 1rem 0 0;
  color: var(--ink-soft);
}

.redirect-card a {
  color: var(--ink);
  text-underline-offset: 0.2em;
}

@media (min-width: 56rem) {
  .hero {
    grid-template-columns: minmax(0, 1.06fr) minmax(0, 0.94fr);
  }

  .why {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .premium {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  }

  .steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .step {
    display: block;
    min-height: 14rem;
  }

  .step + .step {
    border-top: 0;
    border-left: 1px solid var(--edge);
  }

  .step h3 {
    margin-top: 3.5rem;
  }
}

@media (max-width: 35rem) {
  .top-nav .top-link {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
