/* AeroRide — aerori.de
   Static site stylesheet. No external resources, system fonts only.
   Colors come from brand/colors/tokens.json — do not invent new ones.
   (The only derived colors are the track's speed bands, mixed from the two
   brand hues with color-mix so both themes inherit them automatically.)

   Theming: dark values live on :root and are the default. The light theme
   is applied either by OS preference (prefers-color-scheme) or by the
   explicit override attribute data-theme="light"/"dark" on <html>, which
   always wins over the OS preference. */

:root {
  --primary: #22D3EE;        /* wave cyan */
  --primary-hover: #4ADEF0;
  --on-primary: #071120;     /* text on primary-filled controls */
  --volt: #A3E635;           /* gust volt */
  --bg-deep: #071120;        /* deepest bg — hero, tinted sections */
  --surface: #0F172A;        /* page bg */
  --card: #111C2F;           /* menus, panels */
  --border: #232B38;         /* hairlines */
  --text-hi: #F1F5F9;
  --text-mid: #AEB8C6;
  --text-low: #8A94A3;
  --text-faint: #566170;
  --success: #34D399;
  --amber: #F5A623;
  --danger: #F87171;

  --header-scrim: rgba(7, 17, 32, 0.88);
  --selection: rgba(34, 211, 238, 0.28);
  --tint-neutral: rgba(138, 148, 163, 0.12);
  --menu-shadow: 0 14px 36px rgba(0, 0, 0, 0.4);

  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
          Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --maxw: 1080px;
  --radius: 14px;

  color-scheme: dark;
}

/* ---------- light theme ----------
   The on-light brand variants (primaryDeep, voltDeep, porcelain) come from
   tokens.json; semantic colors are darkened to hold >= 4.5:1 on light bgs.
   The block appears twice on purpose: once gated on the OS preference (only
   when no explicit choice was made) and once on the explicit override. */

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --primary: #0B7285;      /* primaryDeep — wave teal */
    --primary-hover: #095E6E;
    --on-primary: #FFFFFF;
    --volt: #4D7C0F;         /* voltDeep — gust green */
    --bg-deep: #EEF2F5;
    --surface: #FAFAF8;      /* porcelain */
    --card: #FFFFFF;
    --border: #D9E0E7;
    --text-hi: #0F172A;
    --text-mid: #475569;
    --text-low: #5B6879;
    --text-faint: #616E81;
    --success: #047857;
    --amber: #92610C;
    --danger: #DC2626;

    --header-scrim: rgba(250, 250, 248, 0.9);
    --selection: rgba(11, 114, 133, 0.22);
    --tint-neutral: rgba(71, 85, 105, 0.1);
    --menu-shadow: 0 14px 36px rgba(15, 23, 42, 0.18);

    color-scheme: light;
  }
  :root:not([data-theme="dark"]) .theme-dark-only { display: none !important; }
  :root:not([data-theme="dark"]) .theme-light-only { display: inline-block !important; }
}

:root[data-theme="light"] {
  --primary: #0B7285;        /* primaryDeep — wave teal */
  --primary-hover: #095E6E;
  --on-primary: #FFFFFF;
  --volt: #4D7C0F;           /* voltDeep — gust green */
  --bg-deep: #EEF2F5;
  --surface: #FAFAF8;        /* porcelain */
  --card: #FFFFFF;
  --border: #D9E0E7;
  --text-hi: #0F172A;
  --text-mid: #475569;
  --text-low: #5B6879;
  --text-faint: #616E81;
  --success: #047857;
  --amber: #92610C;
  --danger: #DC2626;

  --header-scrim: rgba(250, 250, 248, 0.9);
  --selection: rgba(11, 114, 133, 0.22);
  --tint-neutral: rgba(71, 85, 105, 0.1);
  --menu-shadow: 0 14px 36px rgba(15, 23, 42, 0.18);

  color-scheme: light;
}
:root[data-theme="light"] .theme-dark-only { display: none !important; }
:root[data-theme="light"] .theme-light-only { display: inline-block !important; }

/* Theme-paired assets: dark variant shows by default, light variant is
   revealed by the blocks above. !important so per-component img rules
   (e.g. .brand-link img) cannot re-show a hidden variant. */
.theme-light-only { display: none !important; }

/* Inline SVG icons are authored with the dark-theme hex values; retheme
   them through the variables so both themes stay legible. */
svg [stroke="#22D3EE"] { stroke: var(--primary); }
svg [fill="#22D3EE"] { fill: var(--primary); }
svg [stroke="#A3E635"] { stroke: var(--volt); }
svg [fill="#F87171"] { fill: var(--danger); }

/* ---------- reset & base ---------- */

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

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

/* The header is sticky, so anything jumped to by anchor (nav links, the
   skip link) must land below it, not underneath it. */
#main,
section[id] {
  scroll-margin-top: 76px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

body {
  margin: 0;
  background: var(--surface);
  color: var(--text-mid);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.65;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}

main { flex: 1 0 auto; }

h1, h2, h3 {
  color: var(--text-hi);
  line-height: 1.2;
  margin: 0 0 0.5em;
  font-weight: 700;
  letter-spacing: -0.015em;
}

p { margin: 0 0 1em; }

a {
  color: var(--primary);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
  border-radius: 4px;
}

img, svg { max-width: 100%; height: auto; }

::selection { background: var(--selection); color: var(--text-hi); }

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
}

/* The instrument voice: every number and every label that belongs to the
   measuring device is set in the mono stack, like the app itself. */
.microlabel,
.ro dt,
.release-label,
.track-place {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-low);
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--primary);
  color: var(--on-primary);
  padding: 10px 16px;
  border-radius: 0 0 8px 0;
  font-weight: 600;
  z-index: 100;
}
.skip-link:focus {
  left: 0;
}

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-scrim);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
}

.brand-link { display: inline-flex; align-items: center; }
.brand-link img { height: 26px; width: auto; display: block; }

.site-nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

.site-nav a {
  color: var(--text-mid);
  font-size: 0.95rem;
}
.site-nav a:hover { color: var(--text-hi); text-decoration: none; }

/* Language menu: a native <details> disclosure, so it needs no JavaScript.
   The summary is the compact control; the list is a small popover panel
   anchored to it. On narrow screens the endonym gives way to the code. */

.lang-menu { position: relative; }

.lang-menu summary {
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 5px 11px;
  color: var(--text-hi);
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}
.lang-menu summary::-webkit-details-marker { display: none; }
.lang-menu summary:hover { border-color: var(--primary); }
.lang-menu summary:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
  border-radius: 8px;
}
.lang-menu summary svg { flex: none; }
.lang-menu summary .chev { color: var(--text-low); transition: transform 0.15s ease; }
.lang-menu[open] summary .chev { transform: rotate(180deg); }
.lang-menu[open] summary { border-color: var(--primary); }

.lang-menu-code { display: none; }
@media (max-width: 720px) {
  .lang-menu-word { display: none; }
  .lang-menu-code { display: inline; }
}

.lang-menu-list {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 60;
  margin: 0;
  padding: 6px;
  list-style: none;
  min-width: 11.5em;
  max-height: calc(100vh - 110px);
  overflow: auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--menu-shadow);
}

.lang-menu-list a,
.lang-menu-list .lang-current {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.92rem;
  color: var(--text-mid);
}
.lang-menu-list a:hover {
  background: var(--tint-neutral);
  color: var(--text-hi);
  text-decoration: none;
}
.lang-menu-list .lang-current {
  color: var(--text-hi);
  font-weight: 600;
}
.lang-menu-list .lang-current svg { color: var(--primary); flex: none; }

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  flex: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-mid);
  cursor: pointer;
}
.theme-toggle:hover { border-color: var(--primary); color: var(--primary); }
.theme-toggle svg { width: 18px; height: 18px; }

@media (max-width: 720px) {
  .site-nav .nav-anchor { display: none; }
}

/* ---------- hero: the real track ---------- */

.hero {
  position: relative;
  overflow: hidden;
  background: var(--bg-deep);
  border-bottom: 1px solid var(--border);
  padding: 76px 0 44px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 10fr) minmax(0, 11fr);
  gap: 24px 48px;
  align-items: center;
}

@media (max-width: 900px) {
  .hero { padding: 52px 0 32px; }
  .hero-grid { grid-template-columns: 1fr; }
}

.status-line {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text-mid);
  margin: 0 0 28px;
  max-width: 30em;
}
.status-line::before {
  content: "";
  align-self: center;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--volt);
  flex: none;
}

.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.05;
  margin: 0 0 0.55em;
}

/* The second line answers the first at the same size in a light weight —
   the contrast lives in the type, not in a colored word. */
.h1-quiet {
  display: block;
  font-weight: 300;
  letter-spacing: -0.02em;
}

.hero .lead {
  font-size: 1.08rem;
  max-width: 32em;
  margin-bottom: 1.7em;
}

.cta-row { display: flex; flex-wrap: wrap; gap: 12px; }

.btn {
  display: inline-block;
  border-radius: 8px;
  padding: 12px 22px;
  font-weight: 600;
  font-size: 1rem;
  border: 1px solid transparent;
}
.btn:hover { text-decoration: none; }

.btn-primary {
  background: var(--primary);
  color: var(--on-primary);
}
.btn-primary:hover { background: var(--primary-hover); }

.btn-ghost {
  border-color: var(--border);
  color: var(--text-hi);
}
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }

/* The track itself. The box is wider than its grid column on purpose: the
   session ran off the edge of the frame, so the drawing does too. The right
   side is croppable — nothing annotated may be anchored there. */

.track-box {
  position: relative;
  width: 140%;
  aspect-ratio: 1000 / 952;
}

@media (max-width: 900px) {
  .track-box { width: 118%; margin-top: 6px; }
}

.track-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.track-svg path {
  stroke-width: 2px;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

/* Speed bands, slow water to full-power reach: wave cyan into gust volt.
   color-mix keeps both themes on brand without a second set of hexes. */
.sp0 { stroke: var(--primary); }
.sp1 { stroke: color-mix(in oklab, var(--primary) 72%, var(--volt)); }
.sp2 { stroke: color-mix(in oklab, var(--primary) 48%, var(--volt)); }
.sp3 { stroke: color-mix(in oklab, var(--primary) 24%, var(--volt)); }
.sp4 { stroke: var(--volt); }

.track-start { fill: var(--text-low); }
.track-peak {
  fill: none;
  stroke: var(--volt);
  stroke-width: 2px;
  vector-effect: non-scaling-stroke;
}

.track-place {
  position: absolute;
  top: 2%;
  left: 2%;
  margin: 0;
}

.track-coord {
  position: absolute;
  margin: 0;
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  color: var(--text-low);
  font-variant-numeric: tabular-nums;
}
.track-coord-tl { top: calc(2% + 1.5em); left: 2%; }
.track-coord-br { display: none; }

/* The one annotation: the fastest fix of the session, and the word that
   makes it worth annotating. A short leader drops to the ring below. */
.track-flag {
  position: absolute;
  margin: 0;
  transform: translate(-9px, calc(-100% - 14px));
  white-space: nowrap;
  font-family: var(--mono);
  z-index: 2;
  /* Knocked out of the water: the label must stay readable where the
     track is densest, so it sits on the hero's own background. */
  background: var(--bg-deep);
  padding: 3px 8px;
  border-radius: 4px;
}
.track-flag::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 100%;
  width: 1px;
  height: 11px;
  background: var(--text-low);
}
.flag-val {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-hi);
  font-variant-numeric: tabular-nums;
}
.flag-tag {
  margin-left: 9px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--success);
}

/* ---------- the horizon: readouts from that ride ---------- */

.readout {
  padding: 26px 0 30px;
}

.readout-caption {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text-low);
  margin: 0 0 20px;
}

.readout-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px 28px;
  margin: 0;
}

.ro dt { margin-bottom: 8px; }

.ro dd {
  margin: 0;
  font-family: var(--mono);
  font-weight: 700;
  font-size: clamp(1.55rem, 2.6vw, 2.2rem);
  line-height: 1.05;
  color: var(--text-hi);
  font-variant-numeric: tabular-nums;
}

.ro dd .u {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-low);
  margin-left: 7px;
  letter-spacing: 0.04em;
}

/* Where the export has no channel, the reading is an em dash — the same one
   the app shows. It stays quieter than the measured values on purpose, but
   never below the 4.5:1 line (--text-low, not --text-faint). */
.ro .nodash { color: var(--text-low); }

.ro .ro-note {
  font-family: var(--font);
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.45;
  color: var(--amber);
  margin-top: 7px;
}

@media (min-width: 761px) {
  .readout-grid > .ro + .ro {
    border-left: 1px solid var(--border);
    padding-left: 28px;
  }
}

@media (max-width: 760px) {
  .readout-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .readout-grid > .ro:nth-child(even) {
    border-left: 1px solid var(--border);
    padding-left: 20px;
  }
}

/* ---------- section system: asymmetric splits and ruled ledgers ---------- */

.band {
  padding: 72px 0 80px;
  border-top: 1px solid var(--border);
}
.band-ink { background: var(--bg-deep); }

@media (max-width: 720px) {
  .band { padding: 50px 0 56px; }
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 8fr);
  gap: 36px 72px;
  align-items: start;
}

@media (max-width: 860px) {
  .split { grid-template-columns: 1fr; gap: 28px; }
}

.split-head h2,
.band-intro h2 {
  font-size: clamp(1.45rem, 2.6vw, 1.9rem);
  letter-spacing: -0.02em;
  margin: 0 0 0.6em;
}

.split-head p { margin: 0; }
.split-head .cta-row { margin-top: 24px; }

.band-intro {
  max-width: 44em;
  margin-bottom: 36px;
}
.band-intro p { margin: 0; }

/* Honest measurement, as a ledger: state / reading / meaning. */

.honest-ledger {
  margin: 0;
  border-bottom: 1px solid var(--border);
}

.hrow {
  display: grid;
  grid-template-columns: 9.5em 7em minmax(0, 1fr);
  grid-template-areas: "tag sample body";
  gap: 6px 20px;
  align-items: baseline;
  padding: 18px 0;
  border-top: 1px solid var(--border);
}

@media (max-width: 680px) {
  .hrow {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "tag sample"
      "body body";
  }
}

.hrow dt {
  grid-area: tag;
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  font-size: 0.9rem;
}
.hrow dt::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}
.state-measured dt { color: var(--success); }
.state-estimated dt { color: var(--amber); }
.state-unknown dt { color: var(--text-low); }

.hrow .sample {
  grid-area: sample;
  margin: 0;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-hi);
  font-variant-numeric: tabular-nums;
}
.state-unknown .sample { color: var(--text-low); }

.hrow .hbody {
  grid-area: body;
  margin: 0;
  font-size: 0.95rem;
}

/* Features and safety: a spec sheet. Term left, meaning right, one hairline
   per entry — reads like the session summary, not like a marketing wall. */

.spec-list {
  margin: 0;
  border-bottom: 1px solid var(--border);
}

.spec {
  display: grid;
  grid-template-columns: 11em minmax(0, 1fr);
  gap: 2px 20px;
  padding: 16px 0;
  border-top: 1px solid var(--border);
}

@media (max-width: 680px) {
  .spec { grid-template-columns: 1fr; }
}

.spec dt {
  color: var(--text-hi);
  font-weight: 600;
  font-size: 0.98rem;
}

.spec dd {
  margin: 0;
  font-size: 0.95rem;
}

/* The five tabs, as one continuous bar — the app's actual shape. */

.tabstrip {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.tabstrip li { padding: 22px 18px 24px; }
.tabstrip li + li { border-left: 1px solid var(--border); }

.tabstrip img {
  width: 26px;
  height: 26px;
  display: block;
  margin-bottom: 12px;
}

.tab-name {
  display: block;
  color: var(--text-hi);
  font-weight: 700;
  margin-bottom: 2px;
}

.tab-desc {
  display: block;
  font-size: 0.85rem;
  color: var(--text-mid);
}

@media (max-width: 860px) {
  .tabstrip { grid-template-columns: 1fr; border-bottom: none; }
  .tabstrip li {
    display: grid;
    grid-template-columns: 38px 7.5em minmax(0, 1fr);
    align-items: center;
    gap: 0 12px;
    padding: 13px 0;
    border-left: none;
    border-bottom: 1px solid var(--border);
  }
  .tabstrip li + li { border-left: none; }
  .tabstrip img { margin-bottom: 0; }
  .tab-name { margin-bottom: 0; }
}

/* Coming soon: the release date gets the same honesty as a jump height. */

.release-ro {
  border-top: 1px solid var(--border);
  padding-top: 18px;
}

.release-dash {
  font-size: clamp(4rem, 8vw, 5.5rem);
  font-weight: 300;
  line-height: 1;
  color: var(--text-low);
  margin: 10px 0 12px;
}

.release-note {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-mid);
  max-width: 26em;
}

/* ---------- footer ---------- */

.site-footer {
  background: var(--bg-deep);
  border-top: 1px solid var(--border);
  padding: 40px 0;
  font-size: 0.9rem;
  color: var(--text-low);
}

.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.footer-brand { display: flex; align-items: center; gap: 10px; }
.footer-brand img { height: 22px; width: auto; }

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
}
.footer-nav a { color: var(--text-low); }
.footer-nav a:hover { color: var(--text-hi); }

.footer-meta { width: 100%; margin-top: 4px; color: var(--text-faint); font-size: 0.82rem; }

/* ---------- legal / prose pages ---------- */

/* The generated legal pages put this on <main>; .prose-page was the shell's
   class and is kept so nothing that still uses it breaks. */
.legal { padding: 56px 0 80px; }
.prose-page { padding: 56px 0 80px; }

/* Shown when a document has no version in the reader's language. */
.legal-notice {
  border-left: 3px solid var(--amber);
  padding: 10px 0 10px 14px;
  margin: 0 0 28px;
  color: var(--text-mid);
  font-size: 0.95rem;
}
.prose .step { margin-left: 1.1em; }

.prose {
  max-width: 44em;
}

.prose h1 { font-size: clamp(1.7rem, 4vw, 2.3rem); margin-bottom: 0.8em; }
.prose h2 { font-size: 1.25rem; margin-top: 2em; }
.prose h3 { font-size: 1.05rem; margin-top: 1.6em; }
.prose ul, .prose ol { padding-left: 1.4em; margin: 0 0 1em; }
.prose li { margin-bottom: 0.35em; }

.prose .placeholder-note {
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--text-low);
  padding: 18px 20px;
  font-size: 0.95rem;
}
