/* PROTOTYPE — overpass.css: the Overpass page's tokens, type, base and layout (the direction's §4, §5 and §7,
   docs/superpowers/specs/2026-11-16-overpass-direction.md). Each component's own look lives in its CSS file under
   overpass/ (the module map: overpass/README.md).

   The one rule that carries the page: dark only ever means "what the radar sees". The hero's strip, the porthole and
   the explorer's instrument are dark; everything else is the light grey of the top of a cloud deck. The page has no dark
   theme: light and dark carry meaning here, so it keeps its overcast ground in every system theme. */

:root {
  color-scheme: light;

  /* ---- palette: six colours, each with one job ---- */
  --overcast: #E9EDF0;          /* body ground, lower sections */
  --cloudtop: #F9FBFC;          /* plates laid on photographs, the play disc, the pressed view button */
  --ink: #15224B;
  --ink-2: #46526F;             /* secondary text on light (6.6:1 on overcast) */
  --rule: #C7D0D9;              /* hairlines on light */
  --under: #0A1B33;             /* the instrument, the panel, the strip's ground before photos arrive */
  --under-2: #122B4B;           /* raised things inside the instrument: chips, the popover, inputs */
  --map-ground: #07142B;        /* the map's sea and the ground under the photos */
  --pale: #DDE8F4;              /* text on dark */
  --pale-2: #9DB2CB;            /* secondary text and axis labels on dark (7.9:1 on --under) */
  --rule-dark: rgba(255, 255, 255, .12);
  --water: #6FD3FF;             /* water with rain or a warning behind it, glowing on dark */
  --water-core: #EAFAFF;
  --water-pale: #BFE9FF;        /* water with nothing to back it; the stipple where backing cannot be checked */
  --water-ghost: rgba(196, 228, 255, .28);
  --water-ink: #1487C9;         /* the same water printed on light: marks only, never text */
  --steel: #8BA1C2;             /* usual water: outlined, never lit */
  --track: #D6006E;             /* on light: underlines, focus rings (marks and rings only, never small text) */
  --track-lit: #FF5FA8;         /* on dark: looks bars, the play head, focus rings, the welly's square */
  --note: #F7C6DD;              /* the satellite's annotations on dark */
  --doubt: #F5A524;             /* probable false alarms and spring: always a hatch, never a solid fill */
  --doubt-ink: #FFD9A0;         /* care lines on dark */
  --blind: rgba(157, 178, 203, .55);
  --pending: rgba(157, 178, 203, .4);
  --glow-water: 0 0 6px rgba(111, 211, 255, .8);

  /* ---- type ---- */
  --font-sans: 'Bricolage Grotesque', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-log: 'Libre Caslon Text', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
  --fs-hero: clamp(2.3rem, 4.75vw, 4.4rem);
  --fs-hero-phone: clamp(2.05rem, 9.6vw, 2.7rem);
  --fs-closing: clamp(2rem, 5.6vw, 4.6rem);
  --fs-h2: clamp(1.9rem, 3.5vw, 2.95rem);
  --fs-readout: clamp(1.6rem, 2.7vw, 2.45rem);
  --fs-card-title: 1.45rem;
  --fs-lede: 1.1rem;
  --fs-body: 1.0625rem;
  --fs-log-hero: 1.2rem;
  --fs-log: 1.04rem;
  --fs-ui: .86rem;
  --fs-key: .8rem;
  --fs-small: .76rem;
  --fs-micro: .7rem;
  --fs-axis: 11px;
  --fs-track-name: 11.5px;
  --fs-note: 12.5px;
  --lh-hero: .97;  --lh-head: 1.02;  --lh-body: 1.5;  --lh-log: 1.42;  --lh-tight: 1.25;
  --wdth-hero: 79%;  --wdth-head: 80%;  --wdth-readout: 79%;  --wdth-brand: 84%;
  --track-hero: -.018em;  --track-head: -.012em;

  /* ---- space ---- */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px;  --sp-4: 16px;  --sp-5: 24px;
  --sp-6: 32px; --sp-7: 48px; --sp-8: 64px;  --sp-9: 96px;
  --gut: clamp(16px, 4.4vw, 64px);
  --inset: 14px;
  --hit: 44px;
  --measure: 34em;

  /* ---- radii: windows have hard edges ---- */
  --r-plate: 0;  --r-cell: 2px;  --r-input: 8px;  --r-pill: 999px;  --r-round: 50%;

  /* ---- shadows: almost none ---- */
  --sh-pop: 0 18px 40px -22px rgba(7, 20, 43, .55);
  --sh-welly: drop-shadow(0 2px 3px rgba(0, 0, 0, .6));
  --halo-map: #07142B;

  /* ---- motion ---- */
  --t-quick: 160ms;  --t-hint-wait: 1400ms;  --t-hint: 500ms;  --t-flight-delay: 500ms;  --t-flight: 2600ms;
  --t-plant: 420ms;  --ease-plant: cubic-bezier(.2, 1.4, .4, 1);
  --t-fly: 900ms;  --t-pass-wait: 1500ms;  --t-pass: 1700ms;  --t-pass-gap: 1000ms;
  --tau-scrub: 130ms;  --tau-play: 300ms;  --t-settle: 520ms;  --t-burn: 600ms;  --t-end-hold: 1200ms;  --t-lights-in: 400ms;
  --ease-out: cubic-bezier(.2, .7, .2, 1);
  --ease-inout: cubic-bezier(.45, 0, .55, 1);

  /* ---- the lean: only the satellite, the log marks, the pause bars, the free ends of bars and gauges, the strip ---- */
  --lean: 13deg;
  --tan-lean: .2309;

  /* ---- icons: the water stroke and the cut colour inherit into <use> ---- */
  --ico-water: #1487C9;
  --ico-cut: #E9EDF0;
}
@media (max-width: 760px) {
  :root { --inset: 8px; --fs-body: 1rem; --fs-lede: 1rem; --fs-log-hero: 1.06rem; }
}

/* ---- base ---- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; background: var(--overcast); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--overcast); color: var(--ink);
  font-family: var(--font-sans); font-size: var(--fs-body); line-height: var(--lh-body);
  font-optical-sizing: auto; overflow-x: hidden;
}
[hidden] { display: none !important; }
button, input, select { font: inherit; color: inherit; }
a { color: inherit; }
p { margin: 0; }
h1, h2, h3 { font-family: var(--font-sans); margin: 0; text-wrap: balance; }
h2 { font-size: var(--fs-h2); font-weight: 700; font-stretch: var(--wdth-head); line-height: var(--lh-head); letter-spacing: var(--track-head); }
:focus-visible { outline: 3px solid var(--track); outline-offset: 3px; }
.inst :focus-visible, .hero-strip-ui :focus-visible { outline-color: var(--track-lit); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.ico { width: 1.25em; height: 1.25em; flex: none; display: inline-block; vertical-align: -.25em; }
.inst, .hero-strip-ui { --ico-water: #6FD3FF; --ico-cut: #0A1B33; }
.chip { --ico-cut: #122B4B; }
[aria-disabled="true"] { cursor: not-allowed; }

/* The satellite's own voice: a dry log in an English italic. Every entry starts with a mark leaning as it flies. */
.log { font-family: var(--font-log); font-style: italic; font-weight: 400; line-height: var(--lh-log); text-wrap: pretty; }
.log::before { content: ''; display: inline-block; width: 3px; height: .95em; margin: 0 .62em 0 .16em; vertical-align: -.12em; background: var(--track); transform: skewX(var(--lean)); }
.inst .log::before { background: var(--track-lit); }

/* The prototype line: on screen wherever the reader is. */
.proto { display: inline-block; font-size: .82rem; line-height: 1.3; color: var(--ink); background: rgba(249, 251, 252, .82); padding: 3px 9px; }

/* ---- the explorer: the heading row scrolls away; the instrument fills the screen ---- */
.xp { padding: clamp(20px, 2.2vw, 30px) 16px 30px; }
.xp-head { display: grid; grid-template-columns: minmax(0, auto) minmax(0, 1fr); gap: 8px 40px; align-items: end; padding: 0 clamp(0px, 3vw, 48px) 14px; }
.xp-head h2 { font-size: clamp(1.9rem, 2.6vw, 2.6rem); }
.xp-head p { max-width: 44em; color: var(--ink-2); font-size: 1rem; text-wrap: pretty; }
.xp-head .proto { justify-self: end; white-space: nowrap; color: var(--ink); }
.unbuilt { max-width: 46em; padding: 24px clamp(0px, 3vw, 48px); display: grid; gap: 14px; color: var(--ink-2); }
.unbuilt strong { color: var(--ink); }

.inst { position: relative; background: var(--under); color: var(--pale); scroll-margin-top: 12px; }
.inst > * { min-width: 0; }
.mapcol { position: relative; overflow: hidden; background: var(--map-ground); }
.readout { padding: 20px 0 0 24px; }
.pbody { padding: 0 0 16px 24px; min-height: 0; }
.keycol { padding: 20px 24px; display: flex; flex-direction: column; gap: 14px; min-height: 0; }
.keycol .never { margin-top: auto; }
.ov-search:empty { display: none; }
.trackrow { border-top: 1px solid var(--rule-dark); }
/* One details rail gives the map the remaining width, without a maximum map width.
   The rail scrolls as a whole, so selecting a square never squeezes the map. */
.pnl, .rail-head { display: contents; }
@media (min-width: 1180px) {
  .inst {
    display: grid;
    height: clamp(660px, calc(100svh - 24px), 1200px);
    grid-template-columns: minmax(0, 1fr) clamp(340px, 27vw, 420px);
    grid-template-rows: auto minmax(0, 1fr) 168px;
    grid-template-areas: "map search" "map pnl" "track track";
  }
  .mapcol { grid-area: map; }
  .rail-head { grid-area: search; display: block; padding: 18px 20px 14px; border-bottom: 1px solid var(--rule-dark); }
  .rail-head .ov-search { padding: 0; }
  .rail-head .show { margin-top: 14px; }
  .rail-head .show-sw { display: block; padding: 0; background: none; box-shadow: none; }
  .rail-head .show-l { display: block; padding: 0 0 5px; font-size: var(--fs-key); }
  .rail-head .show-o { display: flex; flex-wrap: wrap; gap: 2px; }
  .rail-head .show-sw button { padding: 6px 9px; background: rgba(255,255,255,.06); }
  .rail-head .show-sw button[aria-checked="true"] { background: var(--cloudtop); }
  .rail-head .show-d { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .pnl .logbook > div { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 12px; padding: 5px 0; border-bottom: 1px solid var(--rule-dark); }
  .pnl .logbook dd { font-size: var(--fs-key); font-weight: 500; }
  .pnl .logbook dt { font-size: var(--fs-small); }
  .pnl { grid-area: pnl; display: flex; flex-direction: column; min-height: 0; overflow-y: auto;
    scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.24) transparent; }
  .pnl:focus-visible { outline-offset: -3px; }
  .pnl > * { flex: none; }
  .pnl > .readout { padding: 20px 20px 0; }
  .pnl > .pbody { overflow: visible; padding: 0 20px 20px; }
  .pnl > .keycol { overflow: visible; margin-top: auto; padding: 16px 20px 20px; border-top: 1px solid var(--rule-dark); }
  .pnl > .keycol .never { margin-top: 0; }
  .trackrow { grid-area: track; display: grid; grid-template-columns: 380px minmax(0, 1fr); }
  .pnl .key-l { grid-template-columns: minmax(0, 1fr); }
  .pnl .card .rec { gap: 16px; }
  .pnl .card .rec-side { flex-basis: 100%; max-width: none; }
  .pnl .alm { grid-template-columns: auto repeat(12, 16px); gap: 3px; font-size: .7rem; }
  .pnl .ac, .pnl .alm-x { width: 16px; height: 16px; }
}

/* The long explanation is available on demand; its caution remains visible. */
.key-details { font-size: var(--fs-key); }
.key-details summary { cursor: pointer; font-weight: 650; color: var(--pale); padding: 8px 0; }
.key-details[open] summary { margin-bottom: 8px; }
.key-details .never { margin-top: 12px !important; }

@media (max-width: 1179px) {
  .xp-head { grid-template-columns: minmax(0, 1fr) auto; }
  .xp-head > p:not(.proto) { grid-column: 1 / -1; grid-row: 2; }
}

/* Tablet, 761 to 1179 px: stacked. Find a place, the map full width, the transport and the timeline, the panel, the key
   as two columns, the never line. */
@media (max-width: 1179px) {
  .inst { display: flex; flex-direction: column; }
  .ov-search { order: 1; padding: 14px 16px 0; }
  .mapcol { order: 2; height: clamp(360px, 58svh, 620px); }
  .trackrow { order: 3; }
  .rail-head > .show { order: 4; padding: 12px 16px 0; }
  .readout { order: 4; padding: 16px 16px 0; }
  .pbody { order: 5; padding: 0 16px 14px; }
  .keycol { order: 6; padding: 14px 16px 18px; border-top: 1px solid var(--rule-dark); }
  .pbody .log, .pbody .msent, .pbody .fact, .pbody .warn { max-width: 36rem; }
}
@media (min-width: 900px) and (max-width: 1179px) {
  .trackrow { display: grid; grid-template-columns: 380px minmax(0, 1fr); }
}

/* Phone, up to 760 px: the map and the timeline on one screen. The readout sits under the map, then one row of keys,
   the timeline, the speed and Storms row, the "Water shown" switch, the panel, the key, the never line. */
@media (max-width: 760px) {
  .xp { padding: 22px 0 24px; }
  .xp-head { grid-template-columns: 1fr; padding: 0 16px 12px; gap: 6px; }
  .xp-head .proto { justify-self: start; white-space: normal; }
  .inst { margin: 0; }
  .ov-search { order: 1; padding: 12px 12px 0; }
  .mapcol { order: 2; height: 52svh; min-height: 300px; }
  .readout { order: 3; padding: 12px 12px 4px; }
  .trackrow, .transport, .keycol { display: contents; }
  .tp-keys { order: 4; }
  .timeline { order: 5; }
  .tp-more { order: 6; }
  .rail-head > .show { order: 7; padding: 0 12px; }
  .pbody { order: 8; padding: 6px 12px 12px; }
  .key-details { order: 9; padding: 0 12px; }
  .key { padding: 0; }
  .keycol .never { order: 10; padding: 12px 12px 0; margin: 0; border-top: 1px solid var(--rule-dark); }
  .keycol .proto-dark { order: 11; margin: 10px 12px 16px; align-self: flex-start; }
}

/* Lower sections keep a comfortable reading width. */
.lower { max-width: calc(1180px + 2 * var(--gut)); padding: 0 var(--gut); }
.lower > * { min-width: 0; }
.sec { padding-top: clamp(40px, 6vw, 76px); }
.sec > .intro { margin-top: 10px; max-width: 46em; color: var(--ink-2); text-wrap: pretty; }
.sec-wait { margin-top: 18px; color: var(--ink-2); font-size: .95rem; }
@media (max-width: 760px) {
  .lower { display: block; }
  .lower > .proto-sticky { position: static; margin: 22px 0 0; }
}
