/* Saddlebag site. Colours, type and radii come from the app's design system
   (cycling-mobile/docs/DESIGN.md): charcoal on canvas, the four effort tiers as the
   only hues, Schibsted Grotesk 800 for display and the system face for everything else. */

@font-face {
  font-family: "Schibsted Grotesk";
  src: url("/fonts/SchibstedGrotesk-ExtraBold.woff2") format("woff2");
  font-weight: 800;
  font-display: swap;
}

:root {
  --bg: #f6f3ee;
  --surface: #fefcfa;
  --surface2: #ebe7e1;
  --line: #d8d4cd;
  --line-strong: #b9b3ac;
  --ink: #221f1b;
  --ink-soft: #56524d;
  --ink-faint: #6a6560;
  --on-ink: #f7f5f1;
  --nylon: #110f0e;
  --nylon-surface: #1b1917;
  --nylon-ink: #f1eeea;
  --nylon-soft: #b4b1ab;

  --easy: #289f9f;
  --steady: #f8da58;
  --hard: #f28921;
  --too-hard: #c22826;
  --easy-ink: #076b6f;
  --hard-ink: #b0540e;

  --display: "Schibsted Grotesk", system-ui, sans-serif;
  --text: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --gutter: clamp(20px, 5vw, 64px);
  /* Content sits in a centred frame; bands and the route drawing still run edge to edge.
     Percentages resolve against each full-width section, so this is the side padding
     that centres a --frame-wide column. */
  --frame: 1280px;
  --pad: max(var(--gutter), calc((100% - var(--frame)) / 2));
  --measure: 34rem;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1.0625rem/1.55 var(--text);
  font-variant-numeric: tabular-nums;
}

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

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 4px; }

.skip {
  position: absolute; left: 12px; top: -48px; padding: 8px 14px;
  background: var(--ink); color: var(--on-ink); border-radius: 10px; z-index: 10;
}
.skip:focus { top: 12px; }

.display {
  font-family: var(--display);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.02;
  margin: 0;
  text-wrap: balance;
  /* tnum would also swap in this font's wide tabular period and comma */
  font-variant-numeric: normal;
}

/* Header and footer */

.site-header {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 8px 24px; padding: 20px var(--pad);
}
.lockup {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--display); font-weight: 800; letter-spacing: -0.03em;
  font-size: 1.375rem; text-decoration: none; font-variant-numeric: normal;
}
.site-header nav, .site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.site-header nav a { color: var(--ink-soft); text-decoration: none; font-size: 0.9375rem; }
.site-header nav a:hover { color: var(--ink); text-decoration: underline; }

/* Hero: copy and phone side by side on wide screens, the route drawn full width under
   the copy with the phone standing on it. Stacks to one column on narrow screens. */

.hero {
  --phone: clamp(220px, 25vw, 340px);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  padding-top: clamp(24px, 6vw, 72px);
}
.hero-copy { padding: 0 var(--gutter); }
.hero-copy > * { max-width: 46rem; }
.hero h1 { font-size: clamp(2.5rem, 8.5vw, 5.75rem); }
.lede { font-size: clamp(1.0625rem, 1.6vw, 1.3125rem); color: var(--ink-soft); max-width: var(--measure); margin: 24px 0 28px; }

.stores { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.badge { height: clamp(40px, 11vw, 52px); width: auto; }
.badge.soon { opacity: 0.45; }
.fine { color: var(--ink-faint); font-size: 0.875rem; margin: 14px 0 0; }

.hero-route { padding-top: clamp(96px, 14vw, 180px); }
.profile { display: block; width: 100%; height: clamp(150px, 26vw, 360px); }
.terrain { fill: var(--line); }
.climb-easy { fill: var(--easy); }
.climb-steady { fill: var(--steady); }
.climb-hard { fill: var(--hard); }
.climb-too-hard { fill: var(--too-hard); }

.profile-wrap { position: relative; }
.markers { list-style: none; margin: 0; padding: 0; position: absolute; inset: 0; pointer-events: none; }
.marker {
  position: absolute; left: var(--x); top: var(--y);
  width: 26px; height: 26px; margin: -34px 0 0 -13px;
  display: grid; place-items: center;
  background: var(--surface); border: 2px solid var(--easy-ink); border-radius: 50%;
  font-size: 0.8125rem; font-weight: 700; color: var(--easy-ink);
}
.marker-hard { border-color: var(--hard); color: var(--hard-ink); }

.verdict {
  position: absolute; left: calc(var(--x) - 13px); top: var(--y);
  margin-top: -34px; padding-bottom: clamp(48px, 8vw, 132px);
  translate: 0 -100%;
  display: flex; align-items: center; gap: 10px; white-space: nowrap;
  font-weight: 700; font-size: 1rem;
}
.verdict::after {
  content: ""; position: absolute; left: 12px; bottom: 0;
  width: 2px; height: clamp(40px, 7.4vw, 124px); background: var(--ink);
}

/* On narrow screens the phone follows the drawing, centred. */
.hero-phone { width: min(300px, 76vw); margin: 32px auto 0; }

@media (min-width: 900px) {
  .hero { grid-template-columns: var(--pad) minmax(0, 1fr) var(--phone) var(--pad); }
  .hero-copy { grid-column: 2; grid-row: 1; padding: 0 40px 0 0; }
  .hero-route { grid-column: 1 / -1; grid-row: 2; }
  .hero-phone { grid-column: 3; grid-row: 1 / 3; align-self: end; width: auto; margin: 0; position: relative; z-index: 1; }
}

/* The road keeps going under the phone into the facts strip. */
.facts { background: var(--ink); color: var(--on-ink); padding: 28px var(--pad); }
.facts dl {
  margin: 0; display: grid; gap: 20px 32px;
  grid-template-columns: repeat(auto-fit, minmax(min(13rem, 100%), 1fr));
}
.facts dt { font-weight: 700; }
.facts dd { margin: 2px 0 0; color: #cfcac3; font-size: 0.9375rem; }

/* Phones: a charcoal frame around each screenshot, so a canvas-coloured screen reads
   as a phone on the canvas page. Only the frame is drawn; no hardware details. */

.phone { margin: 0; }
.device {
  padding: clamp(5px, 2.6%, 11px);
  background: var(--ink);
  border-radius: clamp(28px, 15%, 54px) / clamp(28px, 7%, 54px);
}
.device img { border-radius: clamp(22px, 13%, 44px) / clamp(22px, 6%, 44px); }
.phone figcaption { margin-top: 12px; color: var(--ink-faint); font-size: 0.875rem; max-width: 22rem; }

.tier-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px 3px 8px; border-radius: 6px;
  font-size: 0.875rem; font-weight: 700; color: var(--ink);
}
.tier-badge svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tier-easy { background: var(--easy); }
.tier-steady { background: var(--steady); }
.tier-hard { background: var(--hard); }
.tier-too-hard { background: var(--too-hard); color: var(--on-ink); }

/* The route: each stop is a moment before the ride, in order, on one line */

.route {
  --rail: calc(var(--pad) + 6px);
  position: relative;
  padding: clamp(56px, 9vw, 120px) var(--pad) 0 calc(var(--pad) + 36px);
}
.route::before {
  content: ""; position: absolute; top: 0; bottom: 0; left: var(--rail);
  width: 2px; background: var(--ink);
}

.stop {
  position: relative;
  display: grid; gap: 40px;
  grid-template-columns: minmax(0, 1fr);
  padding-bottom: clamp(72px, 10vw, 140px);
}
/* Text and screenshots side by side only once both have room. */
@media (min-width: 1080px) {
  .stop { grid-template-columns: minmax(0, 28rem) minmax(0, 1fr); gap: clamp(40px, 5vw, 96px); align-items: start; }
  .stop-shots { justify-self: center; width: 100%; }
}

.stop-copy { max-width: var(--measure); }
.stop h2 { font-size: clamp(2rem, 4.2vw, 3.25rem); margin: 18px 0 20px; }
.stop h3 { font-size: 1.125rem; margin: 32px 0 6px; }
.stop p { color: var(--ink-soft); margin: 0 0 14px; }

/* A luggage tag: the app's section label, eyelet included, tied to the rail. */
.stop .tag {
  position: relative;
  display: inline-flex; align-items: center; gap: 8px;
  margin: 0; padding: 4px 12px 4px 26px;
  background: var(--surface2); border-radius: 6px 12px 12px 6px;
  color: var(--ink); font-size: 0.875rem; font-weight: 600;
}
.stop .tag::before {
  content: ""; position: absolute; left: 9px; top: 50%;
  width: 8px; height: 8px; margin-top: -4px;
  border-radius: 50%; background: var(--bg); box-shadow: inset 0 0 0 2px var(--ink);
}
.stop .tag::after {
  content: ""; position: absolute; right: 100%; top: 50%;
  width: 30px; height: 2px; background: var(--ink);
}

.tiers { margin: 28px 0 0; display: grid; gap: 10px; }
.tiers div { display: grid; grid-template-columns: 8.5rem 1fr; align-items: center; gap: 12px; }
.tiers dd { margin: 0; color: var(--ink-soft); font-size: 0.9375rem; }

.stop-shots { display: grid; gap: clamp(12px, 2.4vw, 24px); align-items: start; max-width: 340px; }
.stop-shots-pair { grid-template-columns: 1.2fr 1fr; max-width: 640px; }
.stop-shots-pair .phone-back { margin-top: clamp(32px, 7vw, 96px); }
.stop-shots-pack { grid-template-columns: 1.7fr 1fr; max-width: 560px; }
.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: clamp(10px, 2vw, 16px); }
/* Share cards on the share screen's own dark backing. */
.cards li { background: var(--nylon); padding: clamp(8px, 9%, 16px); border-radius: 18px; }
.cards img { border-radius: 10px; }

/* Very narrow: one phone a row, share cards side by side under the pack. */
@media (max-width: 520px) {
  .stop-shots-pair, .stop-shots-pack { grid-template-columns: minmax(0, 1fr); max-width: 340px; }
  .stop-shots-pair .phone-back { margin-top: 0; }
  .cards { grid-template-columns: 1fr 1fr; }
}

/* Privacy: the app's dark theme, Nylon */

.private { background: var(--nylon); color: var(--nylon-ink); padding: clamp(64px, 9vw, 120px) var(--pad); }
.private h2 { font-size: clamp(2.25rem, 5vw, 4rem); }
.private ul { list-style: none; padding: 0; margin: 36px 0 28px; display: grid; gap: 24px 48px; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); max-width: 72rem; }
.private li { color: var(--nylon-soft); }
.private strong { display: block; color: var(--nylon-ink); font-size: 1.125rem; margin-bottom: 4px; }
.private a { color: var(--nylon-ink); }

.closing { padding: clamp(64px, 9vw, 120px) var(--pad); }
.closing h2 { font-size: clamp(2.5rem, 6vw, 4.75rem); }
.closing .stores { margin-top: clamp(24px, 3vw, 36px); }
.closing p { color: var(--ink-soft); max-width: var(--measure); margin: 20px 0 0; }

.site-footer {
  display: flex; flex-wrap: wrap; align-items: center; gap: 16px 32px;
  padding: 28px var(--pad) 40px; border-top: 1px solid var(--line);
  color: var(--ink-faint); font-size: 0.875rem;
}
.site-footer .lockup { font-size: 1.125rem; color: var(--ink); }
.site-footer p { margin: 0 0 0 auto; }

@media (max-width: 760px) {
  .site-header nav { gap: 6px 16px; }
  .site-header nav a { font-size: 0.875rem; }
  .site-header .lockup { font-size: 1.25rem; }
  .verdict { font-size: 0.875rem; left: calc(var(--x) - 10px); margin-top: -26px; }
  .verdict::after { left: 9px; }
  .marker { width: 20px; height: 20px; margin: -26px 0 0 -10px; font-size: 0.6875rem; border-width: 1.5px; }
  .site-footer p { margin-left: 0; }
}

/* The one moment: the route draws itself left to right on load. */

@media (prefers-reduced-motion: no-preference) {
  .profile-draw { animation: draw 1.6s cubic-bezier(0.3, 0.6, 0.2, 1) both; }
  .marker, .verdict { animation: pop 0.4s ease-out both; animation-delay: calc(var(--d, 1.5s)); }
  .verdict { --d: 1.2s; }
  @keyframes draw { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
  @keyframes pop { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
}

/* Legal and support pages */

.doc { padding: clamp(24px, 6vw, 64px) var(--pad) clamp(64px, 9vw, 120px); }
.doc > * { max-width: 44rem; }
.doc h1 { font-size: clamp(2.5rem, 6vw, 4rem); }
.doc .updated { color: var(--ink-faint); font-size: 0.9375rem; margin: 12px 0 28px; }
.doc .lead { font-size: 1.1875rem; font-weight: 600; }
.doc h2 { font-family: var(--display); font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: normal; font-size: 1.5rem; margin: 44px 0 10px; }
.doc p, .doc li { color: var(--ink-soft); }
.doc ul { padding-left: 1.2em; }
.doc li { margin: 6px 0; }
.doc strong { color: var(--ink); }
