/* Stormy Fans · site stylesheet
   Direction F, "Swiss Bulletin with weather icons". Tokens and rules follow
   docs/design-spec-v1.md section 3. Layout is mobile first: the base rules are
   the phone layout (board G), and the media queries widen it to desktop (board F). */

/* ---------------------------------------------------------------- tokens */

:root {
  --paper: #F7F6F2;
  --ink: #121212;
  --muted: #555550;        /* 6.9:1 on paper */
  --hairline: #D8D6CF;
  --red: #D52B1E;          /* 4.6:1 on paper; white on red 5.0:1 */
  --sun: #F4B400;          /* the logo's bolt; decorative only, never text */
  --field: #FFFFFF;
  --basin: #E4EAEF;        /* storm charts: open water, after NHC outlook maps */
  --basin-grid: #C9D3DC;
  --cone: #FFFFFF;
  --fog-rgb: 247, 246, 242;
  --on-red: #FFFFFF;
  --warn-1: #A6D07A;       /* levels 1, 4, and 5 are provisional (spec 12.1) */
  --warn-2: #F2D22E;
  --warn-3: #F29A2E;
  --warn-4: #D52B1E;
  --warn-5: #8B0D0D;

  --sans: "Hanken Grotesk", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;

  --gutter: 20px;
  --gap: 28px;
}

/* Night shift (decision D-018): the same paper and ink, after dark. It follows
   the system setting. Contrast on the dark paper: ink 15.1:1, muted 7.2:1, red 5.9:1. */
:root { color-scheme: light dark; }

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #141619;
    --ink: #ECEAE4;
    --muted: #A5A39C;
    --hairline: #34373C;
    --red: #FF5B4E;
    --field: #1C1F23;
    --basin: #18222C;
    --basin-grid: #2A3845;
    --cone: #2C3743;
    --fog-rgb: 58, 64, 70;
    --on-red: #141619;       /* dark text on the brighter red: 5.9:1 */
  }
  /* The icons are drawn for paper. Their charcoal and dark blues lift a little
     after dark, so they keep their edges against the night background. */
  .logo [fill="#3A4652"] { fill: #5B6A79; }
  [stroke="#1565C0"] { stroke: #6FA6EA; }
  [fill="#1565C0"] { fill: #6FA6EA; }
  [stroke="#4A5866"] { stroke: #9AA8B6; }
  .portrait img { filter: brightness(.92); }
}

/* ------------------------------------------------------------------ base */

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  border-top: 6px solid var(--red);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--red); }
a:focus-visible, summary:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }

p, h1, h2, h3, ul, ol, dl, dd, pre { margin: 0; }
ul, ol { padding: 0; list-style: none; }

[hidden] { display: none !important; }

.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.icon { flex-shrink: 0; display: block; }

.vh {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip { position: absolute; left: -9999px; top: 12px; z-index: 10; padding: 10px 14px; background: var(--ink); color: var(--paper); font-family: var(--mono); font-size: 13px; }
.skip:focus { left: 12px; }

/* Section heads in forecast discussion style: ".CURRENT CONDITIONS..." */
.sh {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.sh::before { content: "."; }
.sh::after { content: "..."; }
.sh-note { font-weight: 700; }

/* ---------------------------------------------------------------- frame */

.page {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--gutter) 32px;
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

main { display: flex; flex-direction: column; gap: var(--gap); }

.product {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-top: 12px;
  font-size: 10.5px;
  letter-spacing: .05em;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.product-issued, .product-page { display: none; }

.masthead { display: flex; flex-direction: column; gap: 12px; margin-bottom: -12px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand .logo { width: 46px; height: 46px; }
.wordmark { font-size: 38px; line-height: .95; font-weight: 700; letter-spacing: -.045em; }
.tagline { font-size: 11.5px; line-height: 1.5; font-weight: 500; letter-spacing: .02em; text-transform: uppercase; max-width: 22em; text-wrap: balance; }

.nav {
  display: flex;
  gap: 22px;
  margin: 0 calc(var(--gutter) * -1);
  padding: 0 var(--gutter);
  overflow-x: auto;
  white-space: nowrap;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--hairline);
  scrollbar-width: none;
}
.nav a {
  display: flex;
  align-items: center;
  min-height: 44px;
  flex-shrink: 0;
  text-decoration: none;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.nav a[aria-current="page"] { color: var(--red); font-weight: 700; border-bottom: 2px solid var(--red); margin-bottom: -1px; }

/* The day's advisory, under the navigation. */
.advisory-bar { display: flex; align-items: baseline; gap: 12px; margin-top: calc(var(--gap) * -.55); padding-bottom: 10px; border-bottom: 1px solid var(--hairline); font-size: 14px; line-height: 1.45; }
.advisory-tag { flex-shrink: 0; padding: 2px 7px; background: var(--warn-2); color: #121212; font-size: 10.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }

/* Footer: the station's particulars, the ATIS broadcast, and the product's end. */
.foot {
  display: grid;
  gap: 18px;
  padding-top: 14px;
  border-top: 2px solid var(--ink);
  color: var(--muted);
}
.foot-station { display: grid; grid-template-columns: repeat(3, auto); justify-content: start; gap: 4px 28px; font-size: 11px; letter-spacing: .05em; text-transform: uppercase; }
.foot-station > div { display: flex; flex-direction: column; gap: 3px; }
.foot-station dt { font-size: 10px; letter-spacing: .07em; }
.foot-station dd { color: var(--ink); font-weight: 500; }
.foot-station a { color: inherit; }

/* The ATIS letter sits in a square, like the warning levels, so it reads as a broadcast rather than metadata. */
.foot-atis { display: flex; align-items: center; gap: 12px; }
.atis-letter {
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 36px; height: 36px;
  border: 1.5px solid var(--ink); color: var(--ink);
  font-size: 18px; font-weight: 700;
}
.atis-text { display: flex; flex-direction: column; gap: 2px; }
.atis-label { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink); }
.atis-call { font-size: 13px; line-height: 1.4; }

.foot-end { padding-top: 10px; border-top: 1px solid var(--hairline); font-size: 11px; letter-spacing: .05em; text-transform: uppercase; }

/* ----------------------------------------------------- current conditions */

.conditions { display: grid; gap: var(--gap); }
.now { display: flex; flex-direction: column; gap: 10px; }
.now-figure { display: flex; align-items: center; gap: 16px; }
.numeral {
  font-size: 150px;
  line-height: .8;
  font-weight: 300;
  letter-spacing: -.06em;
  margin-left: -6px;
  font-variant-numeric: tabular-nums;
}
.now-icon { width: 96px; height: 96px; }
.label { font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.summary { font-size: 19px; line-height: 1.35; font-weight: 500; }

.observations dl { margin-top: 10px; border-top: 2px solid var(--ink); }
.observations dl > div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--hairline);
}
.observations dt { font-family: var(--mono); font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.observations dd { font-size: 24px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.observations small { font-size: 14px; font-weight: 500; letter-spacing: 0; }

.warnings ul { margin-top: 14px; }
.warnings li { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--hairline); }
.warnings li:first-child { border-top: 2px solid var(--ink); }
.warnings li p:last-child { font-size: 14.5px; line-height: 1.4; }
.level {
  width: 36px; height: 36px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700; color: #121212;   /* the warning colors are light in both themes */
}
.level-1 { background: var(--warn-1); }
.level-2 { background: var(--warn-2); }
.level-3 { background: var(--warn-3); }
.level-4 { background: var(--warn-4); color: #FFFFFF; }
.level-5 { background: var(--warn-5); color: #FFFFFF; }
.warn-title { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }

/* ------------------------------------------------------------- coded lines */

code, pre { font-family: var(--mono); }
.metar { display: block; font-size: 11px; line-height: 1.55; color: var(--muted); overflow-wrap: anywhere; }

.metar-strip { display: flex; flex-direction: column; gap: 8px; padding: 12px 0; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }
.metar-strip .metar { font-size: 13px; font-weight: 500; color: var(--ink); letter-spacing: .01em; }

/* ---------------------------------------------------------- precipitation */

.precip { display: flex; flex-direction: column; gap: 12px; }
.bars { display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); font-size: 10.5px; font-variant-numeric: tabular-nums; }
.bars li { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.bars .area { height: 80px; width: 100%; display: flex; align-items: flex-end; justify-content: center; border-bottom: 1px solid var(--ink); }
.bars .bar { width: 10px; height: var(--h); background: var(--ink); }
.bars .day { color: var(--muted); }
.bars .d-long { display: none; }
.bars .today .count, .bars .today .day { color: var(--red); font-weight: 700; }
.bars .today .bar { background: var(--red); }

/* ---------------------------------------------------------------- systems */

.systems > h2 { padding-bottom: 10px; border-bottom: 2px solid var(--ink); }
.sys-head { display: none; }

.sys {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "status date" "name name" "forecast forecast";
  gap: 8px 12px;
  padding: 16px 0;
  border-bottom: 1px solid var(--hairline);
  scroll-margin-top: 16px;
}
.sys-status { grid-area: status; display: flex; align-items: center; gap: 10px; }
.sys-status .icon { width: 36px; height: 36px; }
.sys-codes { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.status-name { font-size: 13px; color: var(--muted); }
.sys-name { grid-area: name; display: flex; flex-direction: column; gap: 4px; }
.sys-name h3 { font-size: 19px; line-height: 1.25; font-weight: 700; }
.sys-name h3 a { text-decoration: none; }
.sys-name h3 a:hover { text-decoration: underline; }
.sys-name p { font-size: 14px; line-height: 1.4; }
.sys-forecast { grid-area: forecast; display: flex; flex-direction: column; gap: 8px; font-size: 15px; line-height: 1.5; }
.sys-date { grid-area: date; align-self: center; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.sys-name .flag { font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }

.chip {
  display: inline-block;
  padding: 2px 7px;
  border: 1.5px solid var(--ink);
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}
.chip-solid { background: var(--ink); color: var(--paper); }
.chip-alert { background: var(--red); border-color: var(--red); color: var(--on-red); }
.chip-dashed { border-style: dashed; }

/* Key to codes */
.key { border-top: 2px solid var(--ink); border-bottom: 1px solid var(--hairline); margin-top: 28px; }
.key summary { min-height: 52px; display: flex; align-items: center; cursor: pointer; list-style: none; }
.key summary::-webkit-details-marker { display: none; }
.key summary::after { content: "... ▸"; }
.key[open] summary::after { content: "... ▾"; }
.key-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px 24px; padding: 4px 0 18px; font-size: 12px; color: var(--muted); }
.key-grid li { display: flex; align-items: flex-start; gap: 10px; }
.key-grid .icon { width: 26px; height: 26px; }
.key-grid li > span { display: flex; flex-direction: column; gap: 2px; }
.key-code { color: var(--ink); }
.key-meaning { font-family: var(--sans); font-size: 14px; }

/* ------------------------------------------------------ lower three columns */

.lower { display: grid; gap: var(--gap); }
.lower > section { display: flex; flex-direction: column; gap: 12px; padding-top: 12px; border-top: 2px solid var(--ink); }

.discussion p { font-size: 15px; line-height: 1.6; }
.discussion .lead { font-size: 11.5px; font-weight: 700; }
.discussion .sep { font-size: 11.5px; color: var(--muted); }
.aviation { display: flex; flex-direction: column; gap: 6px; }
.taf { font-size: 11px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.signoff { font-size: 11.5px; font-weight: 700; }

.tiers li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--hairline);
}
.tier, .free { font-size: 12px; font-weight: 700; text-transform: uppercase; }
.tiers .muted { grid-column: 1 / -1; font-size: 14px; }
.actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 16px;
  border: 1.5px solid var(--ink);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  text-align: center;
}
.btn:hover { color: var(--red); border-color: var(--red); }
.btn-solid { background: var(--ink); color: var(--paper); }
.btn-solid:hover { background: var(--red); border-color: var(--red); color: var(--on-red); }
.btn:disabled { opacity: .5; cursor: progress; }
.btn:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }
.btn[data-armed] { background: var(--red); border-color: var(--red); color: var(--on-red); }

.cleared li { display: flex; flex-direction: column; gap: 6px; padding: 12px 0; border-bottom: 1px solid var(--hairline); scroll-margin-top: 16px; }
.cleared-head { display: flex; align-items: center; gap: 10px; }
.cleared-head h3 { flex-grow: 1; font-size: 16px; font-weight: 700; }
.cleared-head h3 a { text-decoration: none; }
.cleared-head time { font-size: 11.5px; color: var(--muted); }
.cleared p { font-size: 14px; line-height: 1.45; }

/* ------------------------------------------------------------ page heads */

/* Pages other than the home page open with a large title and a lede. */
.page-head { display: flex; flex-direction: column; gap: 12px; }
.page-title { font-size: clamp(40px, 8vw, 84px); line-height: .95; font-weight: 700; letter-spacing: -.045em; }
.page-head .summary { max-width: 38em; }
.page-head .summary a { text-underline-offset: 4px; }

.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.systems > .section-head { padding-bottom: 10px; border-bottom: 2px solid var(--ink); }
.more { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; text-decoration: none; white-space: nowrap; }
.more:hover { color: var(--red); }
.home-systems .section-head .more { display: none; }
.home-systems .sys-list > li:nth-child(n+5) { display: none; }
.more-phone { padding: 14px 0 0; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.more-phone a { text-decoration: none; }

/* ------------------------------------------------------------------ forms */

/* Quiet fields on the paper: a thin ink-gray rule (6.9:1, above the 3:1
   minimum for field edges), white only inside, and a red focus ring. */
.form { display: flex; flex-direction: column; gap: 16px; max-width: 36em; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.field-label { font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.field-label .optional { margin-left: 4px; font-weight: 500; color: var(--muted); }
.field input, .field textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--muted);
  border-radius: 0;
  background: var(--field);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;          /* 16px keeps phones from zooming in on focus */
  line-height: 1.45;
  transition: border-color .12s;
}
.field input::placeholder, .field textarea::placeholder { color: #8C8B85; }
.field input:hover, .field textarea:hover { border-color: var(--ink); }
.field input:focus-visible, .field textarea:focus-visible { border-color: var(--ink); outline: 2px solid var(--red); outline-offset: 1px; }
.field textarea { min-height: 5.2em; max-height: 20em; resize: vertical; field-sizing: content; }
.count { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.count.over { color: var(--red); font-weight: 700; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.form-actions .btn { min-height: 44px; padding: 0 22px; }
.fineprint { flex: 1 1 14em; font-size: 12.5px; line-height: 1.45; }
.form-status { font-size: 14px; line-height: 1.45; }
.form-status:empty { display: none; }
.form-status.error { color: var(--red); font-weight: 500; }
.form-note { margin: 0; }
/* Turnstile stays invisible unless Cloudflare asks for a click. */
.turnstile { max-width: 400px; }
.turnstile:empty { display: none; }

/* The honeypot field sits off screen; people never see or fill it. */
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* A form behind a button: pilot reports on system pages. */
.compose > summary { display: inline-flex; list-style: none; width: auto; }
.compose > summary::-webkit-details-marker { display: none; }
.compose > summary::after { content: "+"; margin-left: 10px; font-size: 15px; line-height: 1; }
.compose[open] > summary::after { content: "−"; }
.compose[open] > summary { margin-bottom: 18px; }

/* ----------------------------------------------------------------- charts */

.chart-figure { display: flex; flex-direction: column; gap: 10px; margin: 0; }
/* One chart per layout width; phones get compact, tablets medium, desktops wide.
   The outlook has no compact form, so phones scroll its medium form sideways. */
.chart-variant { display: none; }
.chart-compact { display: block; }
.chart-scroll .chart-medium { display: block; min-width: 720px; }
.chart-caption { max-width: 60em; font-size: 11.5px; line-height: 1.55; color: var(--muted); }
.chart-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.chart-scroll:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }
.chart-scroll-hint { font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }

.chart { display: block; width: 100%; height: auto; overflow: visible; font-family: var(--mono); }
.chart .basin { fill: var(--basin); }
.chart .land { fill: var(--paper); stroke: var(--ink); stroke-width: 1; }
.chart .grid { stroke: var(--basin-grid); stroke-width: 1; }
.chart .threshold { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 2 4; }
.chart .frame { fill: none; stroke: var(--ink); stroke-width: 1; }
.chart text { fill: var(--ink); font-family: var(--mono); }
.chart .tick { letter-spacing: .04em; }
.chart .muted { fill: var(--muted); }
.chart .credit { fill: var(--muted); font-weight: 700; }
.chart .stamp { font-weight: 700; letter-spacing: .03em; }
.chart .title-box { fill: var(--field); stroke: var(--ink); stroke-width: 1; }
.chart .title-text { font-weight: 700; }
.chart .storm-name, .chart .storm-status { font-weight: 700; paint-order: stroke; stroke: var(--basin); stroke-width: 4px; stroke-linejoin: round; }
.chart .storm-status { font-weight: 500; fill: var(--muted); }
.chart .track-line { fill: none; stroke: var(--ink); stroke-width: 1.5; }
.chart .cone { fill: var(--cone); fill-opacity: .7; stroke: var(--ink); stroke-width: .75; stroke-opacity: .3; }
.chart .cone-line { stroke: var(--ink); stroke-width: 1.2; stroke-dasharray: 1 4; stroke-linecap: round; }
.chart .marker { fill: var(--paper); stroke: var(--ink); stroke-width: 1; }
.chart .marker-now { fill: var(--paper); stroke: var(--red); stroke-width: 2.5; }
.chart a.storm { cursor: pointer; }
.chart a.storm:hover .storm-name, .chart a.storm:focus-visible .storm-name { fill: var(--red); }
.chart a.storm:focus { outline: none; }
.chart a.storm:focus-visible .marker-now { stroke-width: 4; }

/* ---------------------------------------------------------- systems page */

.filters { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 0 4px; }
.filter {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 36px; padding: 0 12px;
  border: 1px solid var(--muted); background: transparent; color: var(--ink);
  font-family: var(--mono); font-size: 12px; font-weight: 700; letter-spacing: .04em;
  cursor: pointer;
}
.filter:hover { border-color: var(--ink); }
.filter[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.filter:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.filter-count { font-weight: 500; opacity: .75; }
.outlook { display: flex; flex-direction: column; gap: 12px; padding-top: 12px; border-top: 2px solid var(--ink); }

/* ---------------------------------------------------------- storm archive */

.season { display: flex; flex-direction: column; gap: 10px; }
.season-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 2px solid var(--ink); }
.season-stats > div { display: flex; flex-direction: column; gap: 2px; padding: 12px 0; border-bottom: 1px solid var(--hairline); }
.season-stats dt { font-family: var(--mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.season-stats dd { font-size: 34px; line-height: 1.05; font-weight: 300; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }

.archive-columns { display: grid; gap: var(--gap); }
.archive-group, .retired { display: flex; flex-direction: column; gap: 12px; padding-top: 12px; border-top: 2px solid var(--ink); }
.archive-item { display: flex; flex-direction: column; gap: 8px; padding: 14px 0; border-bottom: 1px solid var(--hairline); scroll-margin-top: 16px; }
.archive-head { display: flex; align-items: center; gap: 10px; }
.archive-head .icon { width: 32px; height: 32px; }
.archive-head h3 { font-size: 18px; font-weight: 700; line-height: 1.25; }
.archive-head h3 a { text-decoration: none; }
.archive-head h3 a:hover { text-decoration: underline; }
.archive-facts { font-size: 11.5px; line-height: 1.5; color: var(--muted); letter-spacing: .02em; }
.archive-item > p:not(.archive-facts) { font-size: 15px; line-height: 1.5; }

.retired-list li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 14px; align-items: baseline; padding: 12px 0; border-bottom: 1px solid var(--hairline); }
.retired-id { font-size: 12px; font-weight: 700; }
.retired-name { font-size: 17px; font-weight: 700; text-decoration: line-through; text-decoration-thickness: 1.5px; }
.retired-name:hover { color: var(--red); }
.retired-years { font-size: 12px; color: var(--muted); }
.retired-reason { grid-column: 2 / -1; font-size: 14.5px; color: var(--muted); }

/* ---------------------------------------------------------------- fan club */

.fanclub-intro, .station-intro { display: grid; gap: var(--gap); }
.membership, .subscribe, .station-details, .primer, .formats, .directory {
  display: flex; flex-direction: column; gap: 12px; padding-top: 12px; border-top: 2px solid var(--ink);
}
.tiers-wide li { grid-template-columns: 9em auto minmax(0, 1fr); align-items: baseline; }
.tiers-wide .muted { grid-column: auto; }
.feed-address code { display: inline-block; padding: 6px 10px; border: 1px solid var(--hairline); background: var(--field); font-size: 13px; overflow-wrap: anywhere; }
.subscribe .actions { grid-template-columns: minmax(0, 18em); }

.portrait { margin: 0; display: flex; flex-direction: column; gap: 8px; max-width: 300px; }
.portrait img { display: block; width: 100%; height: auto; border: 1px solid var(--ink); }
.portrait figcaption { font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }

.tipjar { display: flex; flex-direction: column; gap: 16px; padding-top: 12px; border-top: 2px solid var(--ink); scroll-margin-top: 16px; }
.tipjar-grid { display: grid; gap: 32px; }
.tipjar-form { display: flex; flex-direction: column; gap: 14px; }
.tipjar-lede { font-size: 19px; line-height: 1.35; font-weight: 500; }
.wall { display: flex; flex-direction: column; gap: 4px; }
.wall-head { padding-bottom: 8px; border-bottom: 1px solid var(--ink); font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.wall-list li { display: flex; flex-direction: column; gap: 6px; padding: 14px 0; border-bottom: 1px solid var(--hairline); }
.tip-body { margin: 0; padding-left: 14px; border-left: 3px solid var(--sun); font-size: 16px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.tip-meta { padding-left: 17px; font-size: 11.5px; color: var(--muted); }

/* ----------------------------------------------------------- station info */

.details > div { display: grid; grid-template-columns: 8.5rem minmax(0, 1fr); gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--hairline); }
.details dt { font-family: var(--mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding-top: 3px; }
.details dd { font-size: 16px; }
.primer-lede { max-width: 42em; font-size: 16px; line-height: 1.55; }
.primer-line { padding: 12px 0; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }
.primer-line .metar { font-size: 14px; font-weight: 500; color: var(--ink); }
.primer-table, .directory-table { width: 100%; border-collapse: collapse; font-size: 14.5px; line-height: 1.45; }
.primer-table th, .primer-table td, .directory-table th, .directory-table td { padding: 10px 12px 10px 0; border-bottom: 1px solid var(--hairline); text-align: left; vertical-align: top; }
.primer-table thead th, .directory-table thead th { font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; border-bottom: 2px solid var(--ink); }
.primer-table tbody th code { font-size: 13px; font-weight: 700; white-space: nowrap; }
.primer-table td.muted:empty::after { content: "·"; }

/* On phones each primer row stacks: the group, its meaning, then its reading here. */
.primer-table thead { display: none; }
.primer-table tr { display: block; padding: 12px 0; border-bottom: 1px solid var(--hairline); }
.primer-table th, .primer-table td { display: block; padding: 2px 0; border: 0; }
.primer-table td.muted:empty { display: none; }
.directory-table .obs { display: none; }
.format-list > div { display: grid; gap: 4px 20px; padding: 12px 0; border-bottom: 1px solid var(--hairline); }
.format-list dt { font-size: 13px; font-weight: 700; }
.format-list dd { font-size: 15px; line-height: 1.55; max-width: 44em; }
.format-list code, .primer-lede code { font-size: .9em; }
.directory-table a { text-decoration: none; font-weight: 600; }
.directory-table a:hover { text-decoration: underline; }
.station-page .key { margin-top: 0; }

/* ----------------------------------------------------------- system pages */

.crumbs { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.crumbs a { color: var(--ink); }
.system-head { display: grid; gap: 18px; }
.system-status { display: flex; align-items: center; gap: 16px; }
.system-icon { width: 72px; height: 72px; }
.system-title { display: flex; flex-direction: column; gap: 10px; }
.system-title h1 { font-size: clamp(38px, 8vw, 84px); line-height: .95; font-weight: 700; letter-spacing: -.045em; }
.system-title .flag { font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.system-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; }
.system-meta .tag { color: var(--muted); }

.track { display: flex; flex-direction: column; gap: 12px; }
.system-body { display: grid; gap: var(--gap); }
.system-body > section { display: flex; flex-direction: column; gap: 12px; padding-top: 12px; border-top: 2px solid var(--ink); }

/* Advisories: every observation, numbered like NHC advisories. */
.advisory { display: flex; flex-direction: column; gap: 6px; padding: 14px 0; border-bottom: 1px solid var(--hairline); font-size: 15px; line-height: 1.5; }
.advisory-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 11.5px; }
.advisory-number { font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.advisory-head time { color: var(--muted); font-variant-numeric: tabular-nums; }
.advisory-now .advisory-number { color: var(--red); }

/* Pilot reports: visitor comments, headed by a PIREP line. */
.pireps li { display: flex; flex-direction: column; gap: 6px; padding: 14px 0; border-bottom: 1px solid var(--hairline); }
.pirep-code { font-size: 11px; color: var(--muted); overflow-wrap: anywhere; }
.pirep-body { font-size: 15px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.pirep-meta { font-size: 11.5px; color: var(--muted); }
.reports .compose { padding-top: 6px; }

/* ------------------------------------------------------------ moderation */

.admin-head { display: flex; flex-direction: column; gap: 8px; }
.admin section > h2 { padding-bottom: 10px; border-bottom: 2px solid var(--ink); }
.queue-item { display: flex; flex-direction: column; gap: 8px; padding: 16px 0; border-bottom: 1px solid var(--hairline); }
.queue-kind { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.queue-body { max-width: 70ch; font-size: 16px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.queue-meta { font-size: 12px; color: var(--muted); }
.queue-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.queue-actions .btn { min-width: 10em; }
.queue-empty { padding: 16px 0; }

/* ------------------------------------------------------------------- 404 */

.lost { gap: var(--gap); }
.lost-code .metar { font-size: 13px; color: var(--muted); }
.lost-grid { display: grid; gap: 28px; align-items: center; }
.lost-text { display: flex; flex-direction: column; gap: 14px; }
.lost-title { font-size: clamp(56px, 12vw, 136px); line-height: .9; font-weight: 700; letter-spacing: -.05em; }
.lost-obs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 20px; margin-top: 6px; border-top: 2px solid var(--ink); }
.lost-obs > div { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--hairline); }
.lost-obs dt { font-family: var(--mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.lost-obs dd { font-size: 22px; font-weight: 600; letter-spacing: -.02em; }
.lost-obs small { font-size: 14px; font-weight: 500; }
.lost-count { font-size: 12.5px; letter-spacing: .03em; color: var(--muted); }
.lost-count strong { color: var(--ink); }
.traffic { display: flex; flex-direction: column; gap: 12px; padding-top: 12px; border-top: 2px solid var(--ink); }

/* Stormy in fog: soft paper-colored bands drift across the illustration. */
.lost-figure { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.fog-scene { position: relative; overflow: hidden; width: 100%; max-width: 440px; margin: 0 auto; }
.fog-scene img { display: block; width: 100%; height: auto; }
.fog {
  position: absolute; left: -40%; width: 180%; pointer-events: none;
  background:
    radial-gradient(closest-side, rgba(var(--fog-rgb), .98), rgba(var(--fog-rgb), .75) 55%, rgba(var(--fog-rgb), 0)) 0 0 / 22% 100% repeat-x,
    radial-gradient(closest-side, rgba(var(--fog-rgb), .9), rgba(var(--fog-rgb), 0)) 11% 40% / 22% 80% repeat-x;
  animation: fog-drift 16s ease-in-out infinite alternate;
}
.fog-high { top: 18%; height: 14%; opacity: .45; animation-duration: 23s; }
.fog-mid { top: 52%; height: 24%; opacity: .9; animation-duration: 17s; animation-direction: alternate-reverse; }
.fog-low { top: 66%; height: 40%; animation-duration: 12s; }
@keyframes fog-drift { from { transform: translateX(-8%); } to { transform: translateX(8%); } }
.lost-figure figcaption { font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); text-align: center; }

.lost-lower { display: grid; gap: var(--gap); }
.notam, .alternates { display: flex; flex-direction: column; gap: 12px; padding-top: 12px; border-top: 2px solid var(--ink); }
.notam-code { padding: 10px 12px; border: 1.5px dashed var(--ink); font-size: 13px; font-weight: 700; line-height: 1.5; overflow-wrap: anywhere; }
.notam p:last-child, .alternates > p { font-size: 15px; line-height: 1.5; }
.alternate-list li { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--hairline); }
.alternate-list a { font-size: 17px; font-weight: 700; text-decoration: none; }
.alternate-list a:hover { color: var(--red); text-decoration: underline; }
.alternate-list span { font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); text-align: right; }
.alternates .actions { grid-template-columns: minmax(0, 14em); }

/* ---------------------------------------------------------------- decoder */

/* Coded lines keep the phone's own long-press menu out of the way of the decoder. */
.metar, .taf code, .coded, .pirep-code { -webkit-touch-callout: none; }

/* The pilot briefing: a bottom sheet on phones, a side panel from 700px. */
.briefing {
  position: fixed; inset: auto 0 0 0; margin: 0; padding: 0;
  width: 100%; max-width: 100%; max-height: 86vh;
  border: 0; border-top: 6px solid var(--red);
  background: var(--paper); color: var(--ink);
  box-shadow: 0 -10px 32px rgba(18, 18, 18, .18);
  animation: briefing-up .22s ease-out;
}
.briefing::backdrop { background: rgba(18, 18, 18, .42); }
.briefing-inner { max-height: 86vh; overflow-y: auto; padding: 16px var(--gutter) 28px; display: flex; flex-direction: column; gap: 14px; }
.briefing-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.briefing-close {
  min-height: 40px; padding: 0 14px; border: 1px solid var(--ink); background: transparent; color: var(--ink);
  font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; cursor: pointer;
}
.briefing-close:hover { color: var(--red); border-color: var(--red); }
.briefing-close:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.briefing-title { font-size: 28px; line-height: 1.1; font-weight: 700; letter-spacing: -.025em; }
.briefing-title a { text-decoration: none; }
.briefing-title a:hover { text-decoration: underline; }
.briefing-note { font-size: 15px; line-height: 1.45; color: var(--muted); }
.briefing-line { padding: 10px 0; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }
.briefing-line code { font-size: 13px; font-weight: 500; line-height: 1.6; overflow-wrap: anywhere; }
.briefing-line mark { padding: 0 2px; background: var(--sun); color: var(--ink); }
.briefing-group { display: grid; grid-template-columns: 7.5em minmax(0, 1fr); gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--hairline); }
.briefing-code { font-size: 12.5px; font-weight: 700; line-height: 1.5; overflow-wrap: anywhere; }
.briefing-meaning { font-size: 15px; line-height: 1.45; }
.briefing-here { margin-top: 3px; font-size: 13.5px; line-height: 1.45; color: var(--muted); }
.briefing-log { display: flex; flex-direction: column; gap: 10px; padding-top: 4px; }
.briefing-count { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.briefing-new { color: var(--red); }
.logbook { display: flex; flex-wrap: wrap; gap: 4px; }
.logbook li { width: 14px; height: 14px; border: 1px solid var(--ink); }
.logbook li.found { background: var(--ink); }
.briefing-reward { padding-left: 12px; border-left: 3px solid var(--sun); font-weight: 600; line-height: 1.45; }
.briefing-hint { font-size: 13.5px; line-height: 1.45; }
.briefing-links a { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
@keyframes briefing-up { from { transform: translateY(24px); opacity: 0; } }
@keyframes briefing-in { from { transform: translateX(24px); opacity: 0; } }

/* Typing "decode" expands every line in place. */
.decoded { display: flex; flex-direction: column; gap: 4px; margin: 8px 0 4px; padding: 8px 0 8px 12px; border-left: 3px solid var(--sun); font-size: 13px; }
.decoded > div { display: grid; grid-template-columns: 8em minmax(0, 1fr); gap: 10px; }
.decoded code { font-size: 12px; font-weight: 700; overflow-wrap: anywhere; }
.decoded dd { line-height: 1.4; }
.decoded-here { color: var(--muted); }
.toast {
  position: fixed; left: 50%; bottom: 20px; z-index: 30;
  max-width: min(560px, calc(100vw - 32px)); padding: 10px 14px;
  background: var(--ink); color: var(--paper); font-size: 12px; line-height: 1.45;
  opacity: 0; transform: translate(-50%, 16px); pointer-events: none;
  transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.briefing-traffic { font-size: 13.5px; line-height: 1.45; }

/* Milestone celebration: a short fall of weather across the page. */
.celebration { position: fixed; inset: 0; z-index: 25; overflow: hidden; pointer-events: none; }
.celebration-piece { position: absolute; top: -40px; animation: weather-fall 1.6s cubic-bezier(.35, .1, .6, 1) forwards; }
.celebration-piece svg { display: block; }
@keyframes weather-fall {
  to { transform: translate(var(--drift), 110vh) rotate(var(--spin)); }
}

@media (prefers-reduced-motion: reduce) {
  .fog, .briefing { animation: none; }
  .toast { transition: none; }
  .celebration { display: none; }
}

/* ---------------------------------------------------------- tablet and up */

@media (min-width: 700px) {
  :root { --gutter: 40px; --gap: 36px; }
  body { border-top-width: 8px; }
  .product { font-size: 12.5px; padding-top: 28px; }
  .product-issued, .product-page { display: inline; }
  .masthead { flex-direction: row; align-items: flex-end; justify-content: space-between; gap: 32px; margin-bottom: 0; }
  .brand { gap: 20px; }
  .brand .logo { width: 88px; height: 88px; }
  .wordmark { font-size: clamp(64px, 8.4vw, 108px); line-height: .88; letter-spacing: -.05em; }
  .tagline { font-size: 14px; max-width: 16em; }
  .nav { gap: 28px; margin: 0; padding: 0; overflow: visible; }
  .nav a { min-height: 48px; font-size: 13px; }
  .sh { font-size: 13px; }

  .conditions { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 32px; }
  .warnings { grid-column: 1 / -1; }
  .numeral { font-size: 200px; margin-left: -8px; }
  .now-icon { width: 128px; height: 128px; }
  .summary { font-size: 21px; }
  .observations dd { font-size: 30px; }
  .observations small { font-size: 16px; }

  .metar-strip { flex-direction: row; align-items: baseline; gap: 24px; padding: 14px 0; }
  .metar-strip h2 { flex-shrink: 0; }
  .metar-strip .metar { font-size: 15px; }

  .bars { font-size: 12.5px; }
  .bars .area { height: 112px; }
  .bars .bar { width: 18px; }
  .bars .d-long { display: inline; }
  .bars .d-short { display: none; }

  .lower { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 40px; }
  .home-systems .section-head .more { display: inline; }
  .home-systems .sys-list > li:nth-child(n+5) { display: grid; }
  .more-phone { display: none; }
  .systems > .section-head { padding-bottom: 14px; }

  .chart-compact { display: none; }
  .chart-medium { display: block; }
  .chart-scroll .chart-medium { min-width: 0; }

  .season-stats { grid-template-columns: repeat(5, minmax(0, 1fr)); column-gap: 24px; }
  .season-stats dd { font-size: 44px; }
  .archive-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 40px; align-items: start; }
  .format-list > div { grid-template-columns: 13em minmax(0, 1fr); }
  .briefing { inset: 0 0 0 auto; width: min(480px, 100vw); height: 100vh; max-height: 100vh; border-top-width: 8px; border-left: 1px solid var(--ink); box-shadow: -10px 0 32px rgba(18, 18, 18, .16); animation-name: briefing-in; }
  .briefing-inner { height: 100%; max-height: 100vh; padding: 24px 28px 32px; }
  .lost-grid { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); column-gap: 40px; }
  .lost-lower { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 40px; align-items: start; }
  .details > div { grid-template-columns: 11rem minmax(0, 1fr); }
  .primer-table thead { display: table-header-group; }
  .primer-table tr { display: table-row; padding: 0; border: 0; }
  .primer-table th, .primer-table td { display: table-cell; padding: 10px 12px 10px 0; border-bottom: 1px solid var(--hairline); }
  .primer-table thead th { border-bottom: 2px solid var(--ink); }
  .primer-table td.muted:empty { display: table-cell; }
  .directory-table .obs { display: table-cell; }
  .tipjar-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); column-gap: 48px; align-items: start; }
  .portrait { max-width: none; }
  .chart-scroll-hint { display: none; }

  .system-head { grid-template-columns: auto minmax(0, 1fr); column-gap: 32px; align-items: start; }
  .system-status { flex-direction: column; align-items: flex-start; gap: 12px; }
  .system-icon { width: 112px; height: 112px; }
  .foot { grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 40px; }
  .foot-station { font-size: 12px; column-gap: 36px; }
  .foot-end { grid-column: 1 / -1; }
}

/* ----------------------------------------------------------------- desktop */

@media (min-width: 1100px) {
  :root { --gutter: 64px; }
  .brand .logo { width: 116px; height: 116px; }

  .conditions { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .warnings { grid-column: auto; }

  .sys-head, .sys {
    grid-template-columns: minmax(0, 2.1fr) minmax(0, 3fr) minmax(0, 4.4fr) 64px;
    grid-template-areas: "status name forecast date";
    column-gap: 24px;
  }
  .sys-head {
    display: grid;
    padding: 10px 0;
    border-bottom: 2px solid var(--ink);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
  }
  .sys-head span:last-child { text-align: right; }
  .systems > h2 { padding-bottom: 14px; border-bottom: 0; }
  .systems > .section-head { border-bottom: 0; }
  .sys { padding: 18px 0; align-items: start; }
  .sys-status { align-items: center; }
  .sys-status .icon { width: 40px; height: 40px; }
  .sys-codes { flex-direction: column; align-items: flex-start; gap: 5px; }
  .sys-name h3 { font-size: 18px; }
  .sys-name p { font-size: 14.5px; }
  .sys-forecast { font-size: 15.5px; }
  .metar { font-size: 12px; }
  .sys-date { align-self: start; text-align: right; font-size: 13px; }

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

  .chart-medium, .chart-scroll .chart-medium { display: none; }
  .chart-wide { display: block; }

  .system-icon { width: 128px; height: 128px; }
  .system-body { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); column-gap: 48px; align-items: start; }

  /* Fan Club and Station Info: text on the left, the portrait on the right. */
  .fanclub-intro { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 20em); grid-template-areas: "head head portrait" "tiers subscribe portrait"; column-gap: 40px; align-items: start; }
  .fanclub-intro .page-head { grid-area: head; }
  .fanclub-intro .membership { grid-area: tiers; }
  .fanclub-intro .subscribe { grid-area: subscribe; }
  .fanclub-intro .portrait { grid-area: portrait; }
  .station-intro { grid-template-columns: minmax(0, 1fr) minmax(0, 22em); grid-template-areas: "head portrait" "details portrait"; column-gap: 48px; align-items: start; }
  .station-intro .page-head { grid-area: head; }
  .station-intro .station-details { grid-area: details; }
  .station-intro .portrait { grid-area: portrait; }
  .tiers-wide li { grid-template-columns: 1fr auto; }
  .tiers-wide .muted { grid-column: 1 / -1; }
}
