/* Ohver — ohver.app
   Tokens come from the app (Ohver/DesignSystem/Theme.swift + MapPalette.swift) so the site and
   the app read as one thing: basalt ground, bone text, the brand orange, and the difficulty ramp. */

:root {
  color-scheme: dark;

  --basalt: #0B0B0C;      /* app bg0 */
  --shelf: #111111;       /* app bg1 */
  --shelf-2: #161616;     /* app bg2 */
  --rule: #1F1F1F;        /* app border0 */
  --rule-2: #2B2925;      /* warm, like the index contours */
  --bone: #ECEAE4;        /* app text-0 */
  --dust: #A4A29B;        /* app text-1, lifted a touch for long-form contrast */
  --dim: #6F6B60;         /* contour-label grey */
  --signal: #F05A28;      /* app accent — also the "difficult" trail colour */
  --signal-hi: #FF7A45;

  /* MapPalette difficulty ramp */
  --easy: #5FB86B;
  --moderate: #F2B63C;
  --difficult: #F05A28;
  --extreme: #E5484D;
  --unrated: #6E7A86;

  --display: "Saira Condensed", "Arial Narrow", "Helvetica Neue", sans-serif;
  --body: "Public Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "DM Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --gutter: clamp(20px, 5vw, 72px);
  --measure: 66ch;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--basalt);
  color: var(--bone);
  font: 400 17px/1.62 var(--body);
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--signal-hi); }
:focus-visible { outline: 2px solid var(--signal-hi); outline-offset: 3px; border-radius: 3px; }

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 20;
  padding: 10px 14px; background: var(--bone); color: var(--basalt);
  font-weight: 600; border-radius: 6px; text-decoration: none;
}
.skip:focus { top: 12px; }

/* ---- Masthead ---------------------------------------------------------------------------- */

.masthead {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 22px var(--gutter);
}
.masthead--over { position: absolute; inset: 0 0 auto; z-index: 5; }
.masthead--solid { border-bottom: 1px solid var(--rule); }

.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; }
.brand img { width: 24px; }
.brand-word {
  font: 800 23px/1 var(--display);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--bone);
}
.brand:hover .brand-word { color: var(--bone); }

.masthead nav { display: flex; gap: 22px; }
.masthead nav a {
  font: 500 14px/1 var(--body);
  color: var(--dust);
  text-decoration: none;
}
.masthead nav a:hover, .masthead nav a[aria-current="page"] { color: var(--bone); }

/* ---- Hero -------------------------------------------------------------------------------- */

.hero {
  position: relative;
  isolation: isolate;
  min-height: min(100svh, 940px);
  display: grid;
  align-items: end;
  overflow: hidden;
}

.terrain { position: absolute; inset: 0; z-index: -1; }
.terrain svg { width: 100%; height: 100%; display: block; }
.terrain::after {
  /* Headline scrim on the left, fade into the page at the bottom. The trail side stays clear. */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(90deg, var(--basalt) 0%, rgba(11, 11, 12, 0.9) 28%, rgba(11, 11, 12, 0) 56%),
    linear-gradient(0deg, var(--basalt) 0%, rgba(11, 11, 12, 0) 26%),
    linear-gradient(180deg, rgba(11, 11, 12, 0.7) 0%, rgba(11, 11, 12, 0) 16%);
}

.contour-label {
  font: 400 5.2px var(--mono);
  fill: var(--dim);
  stroke: var(--basalt);
  stroke-width: 2.2px;
  paint-order: stroke;
  text-anchor: middle;
}

.trail-casing { fill: none; stroke: var(--basalt); stroke-width: 2.9; stroke-linecap: round; stroke-linejoin: round; }
.trail-line {
  fill: none; stroke: var(--difficult); stroke-width: 1.35;
  stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 3 1.75;    /* the app's trail dash, [2.2, 1.3] × line width */
}
.trail-reveal {
  fill: none; stroke: #fff; stroke-width: 8; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 1; stroke-dashoffset: 0;
}

.hero-copy {
  position: relative;
  padding: 150px var(--gutter) clamp(64px, 11vh, 120px);
  max-width: 760px;
}

.eyebrow {
  margin: 0;
  font: 500 12.5px/1.2 var(--mono);
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--signal-hi);
}

.hero h1 {
  margin: 18px 0 24px;
  font: 800 clamp(3.2rem, 7.6vw, 6.9rem)/0.86 var(--display);
  letter-spacing: -0.004em;
  text-transform: uppercase;
  text-wrap: balance;
}

.lede {
  margin: 0;
  max-width: 31em;
  font-size: clamp(1.06rem, 1.35vw, 1.22rem);
  line-height: 1.55;
  color: var(--dust);
}

.availability {
  display: inline-flex; align-items: center; gap: 12px;
  margin-top: 30px;
  padding: 11px 18px 11px 14px;
  border: 1px solid var(--rule-2);
  border-radius: 999px;
  background: rgba(17, 17, 17, 0.6);
  font: 500 14.5px/1.2 var(--body);
}
.availability svg { flex: none; }
.availability small { color: var(--dust); font-size: inherit; }

.map-credit {
  position: absolute; right: var(--gutter); bottom: 22px; z-index: 1;
  margin: 0; max-width: 34em;
  font: 400 11.5px/1.55 var(--mono);
  color: var(--dim);
  text-align: right;
}
.map-credit strong { font-weight: 500; color: var(--dust); }

/* Convoy riders — HTML over the SVG so labels stay legible at every size. Mirrors the app's
   DriverMarker: coloured avatar, 3px ring; a quiet rider's ring goes dashed and desaturates,
   a ghost fades, and both get a "last seen" caption. */
.riders { position: absolute; inset: 0; pointer-events: none; }
.rider {
  position: absolute; left: 0; top: 0;
  display: grid; justify-items: center; gap: 4px;
  transform: translate(-50%, -19px);
  opacity: 0;
}
.rider .disc {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--c);
  border: 3px solid #E0428C;
  box-shadow: 0 0 0 3px var(--basalt), 0 2px 6px rgba(0, 0, 0, 0.6);
  font: 700 15px/1 var(--body); color: #fff;
  transition: filter 0.9s ease, opacity 0.9s ease, border-style 0s;
}
.rider .tag {
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(11, 11, 12, 0.8);
  font: 600 12px/1.35 var(--body);
  white-space: nowrap;
}
.rider .seen {
  margin-top: -2px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(11, 11, 12, 0.8);
  font: 400 11px/1.35 var(--mono);
  color: var(--dust);
  opacity: 0;
  transition: opacity 0.7s ease;
}
.rider.is-quiet .disc { border-style: dashed; filter: saturate(0.15); }
.rider.is-ghost .disc { opacity: 0.55; }
.rider.is-quiet .seen { opacity: 1; }

/* Load sequence: the trail draws in, riders appear as the line reaches them, then the two
   out front drop out of signal and age into stale and ghost — the app's convoy, told once. */
.js .hero:not(.is-live) .trail-reveal { stroke-dashoffset: 1; }  /* hidden until the sequence starts */
.hero.is-live .trail-reveal { animation: reveal 2.4s cubic-bezier(0.55, 0.1, 0.25, 1) both; }
.hero.is-live .rider { animation: rider-in 0.5s ease-out both; animation-delay: var(--in); }
@keyframes reveal { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes rider-in { from { opacity: 0; translate: 0 6px; } to { opacity: 1; translate: 0 0; } }

@media (prefers-reduced-motion: reduce) {
  .hero.is-live .trail-reveal, .hero.is-live .rider { animation: none; }
  .rider { opacity: 1; }
  .rider .disc, .rider .seen { transition: none; }
}

/* ---- Sections ---------------------------------------------------------------------------- */

.band { padding: clamp(72px, 11vw, 136px) var(--gutter); }
.band + .band { border-top: 1px solid var(--rule); }

.band h2 {
  margin: 0;
  font: 800 clamp(2.1rem, 4.4vw, 3.6rem)/0.95 var(--display);
  text-transform: uppercase;
  letter-spacing: 0.002em;
  text-wrap: balance;
}
.band p { max-width: var(--measure); }

/* Riding areas */
.areas { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: clamp(36px, 7vw, 110px); align-items: start; }
.areas-intro p { margin: 22px 0 0; color: var(--dust); }
.register { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--rule-2); }
.register li {
  display: grid; grid-template-columns: 4.2em 1fr; gap: 16px; align-items: baseline;
  padding: 15px 0;
  border-bottom: 1px solid var(--rule);
}
.register abbr {
  font: 500 13px/1 var(--mono); letter-spacing: 0.08em; color: var(--dim);
  text-decoration: none; cursor: default;
}
.register span { font: 500 clamp(1.05rem, 1.6vw, 1.28rem)/1.35 var(--body); }
.data-credit { margin: 18px 0 0; font: 400 12.5px/1.55 var(--mono); color: var(--dim); }

/* Features */
.feature {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 330px);
  gap: clamp(36px, 8vw, 120px);
  align-items: center;
  max-width: 1120px;
  margin: 0 auto;
}
.feature + .feature { margin-top: clamp(80px, 12vw, 150px); }
.feature:nth-of-type(even) { grid-template-columns: minmax(220px, 330px) minmax(0, 1fr); }
.feature:nth-of-type(even) .feature-copy { order: 2; }
.feature-copy p { margin: 20px 0 0; color: var(--dust); font-size: 1.08rem; }

.phone {
  margin: 0;
  border-radius: 34px;
  padding: 9px;
  background: linear-gradient(160deg, #26241F, #121212 60%);
  box-shadow: 0 30px 60px -28px rgba(0, 0, 0, 0.9), inset 0 0 0 1px #34322C;
}
.phone img { border-radius: 26px; width: 100%; }

.legend { display: flex; flex-wrap: wrap; gap: 10px 20px; margin: 26px 0 0; padding: 0; list-style: none; }
.legend li { display: inline-flex; align-items: center; gap: 9px; font: 500 14px/1 var(--body); }
.legend svg { flex: none; }

.also { max-width: 1120px; margin: clamp(80px, 11vw, 140px) auto 0; padding-top: 28px; border-top: 1px solid var(--rule); }
.also p { margin: 0; max-width: none; color: var(--dust); }
.also strong { color: var(--bone); font-weight: 600; }

/* Safety */
.safety { background: var(--shelf); }
.safety-inner { max-width: 1120px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(28px, 6vw, 96px); align-items: start; }
.safety p { margin: 0 0 16px; color: var(--dust); font-size: 1.08rem; }
.safety p:last-child { margin-bottom: 0; }
.safety strong { color: var(--bone); }

/* ---- Footer ------------------------------------------------------------------------------ */

.site-foot {
  padding: 48px var(--gutter) 56px;
  border-top: 1px solid var(--rule);
  display: grid; grid-template-columns: auto 1fr; gap: 20px 48px; align-items: start;
  font-size: 14px; color: var(--dust);
}
.site-foot nav { display: flex; flex-wrap: wrap; gap: 8px 22px; justify-content: flex-end; }
.site-foot nav a { color: var(--bone); text-decoration: none; }
.site-foot nav a:hover { color: var(--signal-hi); }
.site-foot .fine { grid-column: 1 / -1; margin: 0; font: 400 12px/1.6 var(--mono); color: var(--dim); }

/* ---- Legal pages ------------------------------------------------------------------------- */

.legal { padding: clamp(56px, 8vw, 104px) var(--gutter) clamp(72px, 10vw, 128px); }
.legal-head { max-width: 1120px; margin: 0 auto clamp(40px, 6vw, 72px); }
.legal-head h1 {
  margin: 16px 0 14px;
  font: 800 clamp(2.9rem, 7vw, 5.6rem)/0.9 var(--display);
  text-transform: uppercase;
}
.updated { margin: 0; font: 400 13px/1.5 var(--mono); color: var(--dim); }
.legal-head .intro { margin: 26px 0 0; max-width: var(--measure); font-size: 1.12rem; color: var(--dust); }

.legal-body { max-width: 1120px; margin: 0 auto; display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: clamp(32px, 6vw, 88px); align-items: start; }

.toc { position: sticky; top: 24px; font-size: 14px; }
.toc summary { list-style: none; font: 500 12px/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--dim); margin-bottom: 14px; cursor: default; }
.toc summary::-webkit-details-marker { display: none; }
.toc ol { margin: 0; padding: 0; list-style: none; }
.toc li + li { margin-top: 9px; }
.toc a { color: var(--dust); text-decoration: none; }
.toc a:hover { color: var(--bone); }

.prose { max-width: var(--measure); min-width: 0; }
.prose h2 {
  margin: 56px 0 14px;
  scroll-margin-top: 24px;
  font: 700 1.55rem/1.1 var(--display);
  text-transform: uppercase;
  letter-spacing: 0.01em;
}
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin: 28px 0 8px; font: 600 1rem/1.3 var(--body); color: var(--bone); }
.prose p, .prose li { color: #CFCDC6; }
.prose p { margin: 0 0 14px; }
.prose ul { margin: 0 0 16px; padding-left: 1.2em; }
.prose li { margin: 0 0 9px; padding-left: 0.2em; }
.prose li::marker { color: var(--dim); }
.prose strong { color: var(--bone); font-weight: 600; }
.prose a { color: var(--bone); }
.prose a:hover { color: var(--signal-hi); }

.callout {
  margin: 20px 0 24px;
  padding: 18px 20px;
  border-left: 3px solid var(--signal);
  background: var(--shelf);
  border-radius: 0 8px 8px 0;
}
.callout p:last-child { margin-bottom: 0; }

.table-wrap { margin: 22px 0 26px; overflow-x: auto; border: 1px solid var(--rule-2); border-radius: 10px; }
.prose table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.prose th {
  text-align: left; padding: 12px 16px;
  background: var(--shelf);
  font: 500 11.5px/1.2 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim);
  border-bottom: 1px solid var(--rule-2);
}
.prose td { padding: 12px 16px; vertical-align: top; color: var(--dust); border-bottom: 1px solid var(--rule); }
.prose tr:last-child td { border-bottom: 0; }
.prose td:first-child { color: var(--bone); font-weight: 600; white-space: nowrap; }

.companion { margin-top: 64px; padding-top: 26px; border-top: 1px solid var(--rule); font-size: 15px; color: var(--dust); }

/* ---- Small screens ----------------------------------------------------------------------- */

@media (max-width: 860px) {
  .areas, .safety-inner { grid-template-columns: minmax(0, 1fr); }
  .feature, .feature:nth-of-type(even) { grid-template-columns: minmax(0, 1fr); }
  .feature:nth-of-type(even) .feature-copy { order: 0; }
  .feature .phone { max-width: 300px; }
  /* minmax(0, …), not 1fr: a bare 1fr column is as wide as its widest min-content, which here is the
     provider table's nowrap first column — it pushed the whole page wider than a phone. */
  .legal-body { grid-template-columns: minmax(0, 1fr); }
  .toc { position: static; padding: 16px 18px; border: 1px solid var(--rule-2); border-radius: 10px; }
  .toc summary { margin-bottom: 0; cursor: pointer; }
  .toc[open] summary { margin-bottom: 14px; }
  .site-foot { grid-template-columns: 1fr; }
  .site-foot nav { justify-content: flex-start; }
}

@media (max-width: 720px) {
  /* The map moves above the headline: a portrait crop of the trail, then the copy below it. */
  .hero { min-height: 0; display: block; }
  .terrain { position: relative; height: 78svh; max-height: 640px; min-height: 460px; }
  .terrain::after {
    background:
      linear-gradient(0deg, var(--basalt) 0%, rgba(11, 11, 12, 0) 30%),
      linear-gradient(180deg, rgba(11, 11, 12, 0.85) 0%, rgba(11, 11, 12, 0) 20%);
  }
  .hero-copy { padding: 8px var(--gutter) 64px; margin-top: -40px; }
  .map-credit { position: static; text-align: left; padding: 0 var(--gutter) 40px; }
  .masthead nav { gap: 16px; }
  .rider .disc { width: 32px; height: 32px; font-size: 13px; }
}
