/* Stillwater — waterside reference system.
   Light chalk ground, deep-end blue-green ink, one coral buoy accent, two
   typefaces (Poppins for structure, Merriweather for prose), square corners,
   no shadows, no hover lift. All colour lives in custom properties. */

:root {
  --deep-end: #1E5C63;
  --shore-chalk: #F2F0EA;
  --coral-buoy: #E1654A;
  --shallows: #9FC9C4;
  --deep-end-ink: #0C3338;
  --gauge-rule: rgba(30, 92, 99, 0.18);
  --muted-ink: rgba(30, 92, 99, 0.72);
  --slab: #FBFAF7;
  --measure: 68ch;
  --rail-w: 260px;
  --step-0: 1rem;
  --step-1: 1.15rem;
  --step-2: 1.45rem;
  --step-3: 2rem;
  --step-4: 2.9rem;
  --sans: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --serif: 'Merriweather', Georgia, 'Songti SC', 'Noto Serif SC', serif;
  --rule: 1px solid var(--gauge-rule);
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--shore-chalk);
  color: var(--deep-end-ink);
  font-family: var(--serif);
  font-size: var(--step-1);
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .sw-sans {
  font-family: var(--sans);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.22;
  margin: 0 0 0.6em;
}

h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-2); }
h4 { font-size: var(--step-1); }

p { margin: 0 0 1.05em; }

a { color: var(--deep-end); text-decoration: none; border-bottom: 1px solid var(--shallows); }
a:hover { border-bottom-color: var(--coral-buoy); color: var(--deep-end-ink); }

ul, ol { margin: 0 0 1.05em; padding-left: 1.25em; }
li { margin-bottom: 0.4em; }

.sw-skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--deep-end); color: var(--shore-chalk);
  padding: 0.6em 1em; z-index: 40;
}
.sw-skip:focus { left: 0; }

/* ---------- masthead ---------- */

.sw-masthead {
  border-bottom: var(--rule);
  background: var(--shore-chalk);
  position: sticky;
  top: 0;
  z-index: 30;
}

.sw-masthead-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0.85rem 1.4rem;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1.2rem;
  align-items: center;
}

.sw-markline { display: flex; align-items: center; gap: 0.65rem; border: 0; }
.sw-markline img { display: block; width: 38px; height: 38px; }
.sw-markline span { font-family: var(--sans); font-weight: 600; font-size: 1.3rem; letter-spacing: 0.02em; color: var(--deep-end-ink); }
.sw-markline em { display: block; font-family: var(--sans); font-style: normal; font-size: 0.66rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted-ink); }

.sw-navlist { display: flex; flex-wrap: wrap; gap: 1.1rem; list-style: none; margin: 0; padding: 0; }
.sw-navlist a { border: 0; font-family: var(--sans); font-size: 0.86rem; letter-spacing: 0.03em; text-transform: uppercase; color: var(--muted-ink); padding-bottom: 2px; border-bottom: 2px solid transparent; }
.sw-navlist a:hover, .sw-navlist a[aria-current='page'] { color: var(--deep-end-ink); border-bottom-color: var(--coral-buoy); }

.sw-search { display: flex; align-items: center; gap: 0.5rem; border: 1px solid var(--gauge-rule); background: var(--slab); padding: 0.3rem 0.55rem; }
.sw-search input {
  border: 0; background: transparent; font-family: var(--sans); font-size: 0.86rem;
  color: var(--deep-end-ink); width: 170px; padding: 0.25rem 0.1rem;
}
.sw-search input:focus { outline: 2px solid var(--shallows); outline-offset: 1px; }
.sw-search button {
  border: 0; background: var(--deep-end); color: var(--shore-chalk); cursor: pointer;
  font-family: var(--sans); font-size: 0.76rem; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 0.34rem 0.7rem;
}
.sw-search button:hover { background: var(--coral-buoy); }

.sw-langswitch { font-family: var(--sans); font-size: 0.78rem; letter-spacing: 0.06em; white-space: nowrap; }

/* ---------- shell ---------- */

.sw-shell { max-width: 1180px; margin: 0 auto; padding: 0 1.4rem 4rem; }
.sw-shell-narrow { max-width: 880px; }
.sw-shell-rail { display: grid; grid-template-columns: minmax(0, 1fr) var(--rail-w); gap: 3rem; align-items: start; }

.sw-crumb { font-family: var(--sans); font-size: 0.76rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted-ink); padding: 1.2rem 0 0.4rem; }
.sw-crumb a { border: 0; color: var(--muted-ink); }
.sw-crumb a:hover { color: var(--coral-buoy); }

.sw-lede { font-size: 1.22rem; color: var(--muted-ink); max-width: var(--measure); }

.sw-byline { font-family: var(--sans); font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted-ink); margin: 0.4rem 0 1.4rem; }
.sw-byline time { color: var(--deep-end); }
.sw-byline a { border: 0; color: var(--deep-end); }

/* ---------- homepage gauge ---------- */

.sw-gauge {
  border-top: 3px solid var(--deep-end);
  border-bottom: var(--rule);
  padding: 1.6rem 0 1rem;
  margin-bottom: 2.4rem;
}
.sw-gauge-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 1rem; }
.sw-gauge-head h1 { margin: 0; font-size: var(--step-3); }
.sw-gauge-meta { font-family: var(--sans); font-size: 0.8rem; letter-spacing: 0.05em; color: var(--muted-ink); text-transform: uppercase; }
.sw-gauge-svg { display: block; width: 100%; height: auto; margin-top: 0.6rem; overflow: visible; }
.sw-gauge-tick, .sw-gauge-label, .sw-gauge-sub, .sw-rail-tick { font-family: var(--sans); font-size: 11px; fill: var(--muted-ink); }
.sw-gauge-value { font-family: var(--sans); font-size: 11px; font-weight: 600; fill: var(--deep-end-ink); }
.sw-gauge-sub { font-size: 9px; letter-spacing: 0.04em; }
.sw-gauge-slot .sw-gauge-bar { transition: opacity 0.12s linear; }
.sw-gauge-slot:hover .sw-gauge-bar { opacity: 0.72; }
.sw-gauge-slot.is-now .sw-gauge-label { fill: var(--coral-buoy); font-weight: 600; }
.sw-gauge-key { font-family: var(--sans); font-size: 0.78rem; color: var(--muted-ink); display: flex; flex-wrap: wrap; gap: 1.2rem; margin-top: 0.5rem; }
.sw-gauge-key b { font-weight: 600; color: var(--deep-end-ink); }

/* ---------- lanes (homepage water-type columns) ---------- */

.sw-lanes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; border-top: var(--rule); }
.sw-lane { border-right: var(--rule); padding: 1.2rem 1.4rem 1.6rem 0; }
.sw-lane:last-child { border-right: 0; }
.sw-lane-head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.6rem; border-bottom: 2px solid var(--deep-end); padding-bottom: 0.4rem; margin-bottom: 0.7rem; }
.sw-lane-head h2 { font-size: 1.05rem; margin: 0; letter-spacing: 0.02em; }
.sw-lane-count { font-family: var(--sans); font-size: 0.72rem; letter-spacing: 0.1em; color: var(--coral-buoy); }
.sw-lane-blurb { font-size: 0.82rem; line-height: 1.55; color: var(--muted-ink); margin-bottom: 0.9rem; }

.sw-diprow { display: block; border: 0; border-bottom: var(--rule); padding: 0.55rem 0; }
.sw-diprow:last-child { border-bottom: 0; }
.sw-diprow-name { display: block; font-family: var(--sans); font-size: 0.9rem; font-weight: 600; color: var(--deep-end-ink); }
.sw-diprow:hover .sw-diprow-name { color: var(--coral-buoy); }
.sw-diprow-meta { display: block; font-family: var(--sans); font-size: 0.74rem; color: var(--muted-ink); letter-spacing: 0.02em; }
.sw-diprow-temp { font-family: var(--sans); font-size: 0.74rem; color: var(--coral-buoy); font-weight: 600; }

/* ---------- index tables ---------- */

.sw-ledger { width: 100%; border-collapse: collapse; font-family: var(--sans); font-size: 0.86rem; }
.sw-ledger caption { text-align: left; font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted-ink); padding-bottom: 0.6rem; }
.sw-ledger th { text-align: left; font-weight: 600; font-size: 0.74rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted-ink); border-bottom: 2px solid var(--deep-end); padding: 0 0.6rem 0.4rem 0; }
.sw-ledger td { border-bottom: var(--rule); padding: 0.55rem 0.6rem 0.55rem 0; vertical-align: top; }
.sw-ledger tr:hover td { background: rgba(159, 201, 196, 0.18); }
.sw-ledger .num { text-align: right; font-variant-numeric: tabular-nums; }
.sw-ledger td.is-now { color: var(--coral-buoy); font-weight: 600; }
.sw-ledger a { border: 0; font-weight: 600; }

/* ---------- detail: metric cards ---------- */

.sw-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; border: var(--rule); margin: 1.4rem 0 1.8rem; }
.sw-metric { padding: 0.9rem 1rem; border-right: var(--rule); background: var(--slab); }
.sw-metric:last-child { border-right: 0; }
.sw-metric-label { display: block; font-family: var(--sans); font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted-ink); }
.sw-metric-value { display: block; font-family: var(--sans); font-size: 1.5rem; font-weight: 600; color: var(--deep-end-ink); line-height: 1.2; }
.sw-metric-note { display: block; font-family: var(--sans); font-size: 0.72rem; color: var(--muted-ink); }

.sw-caveat { border-left: 3px solid var(--coral-buoy); background: rgba(225, 101, 74, 0.06); padding: 0.85rem 1.1rem; margin: 1.4rem 0; font-size: 0.94rem; }
.sw-caveat h2, .sw-caveat h3 { font-size: 0.86rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--coral-buoy); margin: 0 0 0.3em; }

.sw-foldset { border: var(--rule); background: var(--slab); margin: 1.6rem 0; }
.sw-foldset > summary {
  cursor: pointer; padding: 0.8rem 1.1rem; font-family: var(--sans); font-weight: 600;
  font-size: 0.88rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--deep-end);
  list-style: none;
}
.sw-foldset > summary::-webkit-details-marker { display: none; }
.sw-foldset > summary::before { content: '▸ '; color: var(--coral-buoy); }
.sw-foldset[open] > summary::before { content: '▾ '; }
.sw-foldset > summary:hover { color: var(--coral-buoy); }
.sw-foldset-body { padding: 0 1.1rem 1rem; border-top: var(--rule); }

.sw-segment { border-top: var(--rule); padding-top: 1.3rem; margin-top: 1.8rem; scroll-margin-top: 90px; }
.sw-segment h2 { display: flex; align-items: baseline; gap: 0.7rem; }
.sw-segment h2 span { font-family: var(--sans); font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--coral-buoy); font-weight: 500; }

/* ---------- detail: right rail ---------- */

.sw-anchorrail { position: sticky; top: 88px; border-top: 3px solid var(--deep-end); padding-top: 0.9rem; }
.sw-anchorrail h2 { font-size: 0.76rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted-ink); }
.sw-anchorrail ul { list-style: none; margin: 0 0 1.4rem; padding: 0; }
.sw-anchorrail li { border-bottom: var(--rule); }
.sw-anchorrail a { display: block; border: 0; padding: 0.5rem 0 0.5rem 0.9rem; font-family: var(--sans); font-size: 0.86rem; color: var(--muted-ink); border-left: 3px solid transparent; }
.sw-anchorrail a:hover { color: var(--deep-end-ink); }
.sw-anchorrail a.is-current { color: var(--deep-end-ink); border-left-color: var(--coral-buoy); font-weight: 600; }

.sw-railblock { border: var(--rule); background: var(--slab); padding: 0.9rem 1rem 1rem; margin-bottom: 1.2rem; }
.sw-railblock h3 { font-size: 0.74rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted-ink); margin-bottom: 0.5rem; }
.sw-rail-chart { display: block; width: 100%; height: auto; }
.sw-rail-peak { font-family: var(--sans); font-size: 10.5px; font-weight: 600; fill: var(--coral-buoy); }
.sw-railblock dl { margin: 0; font-family: var(--sans); font-size: 0.8rem; }
.sw-railblock dt { color: var(--muted-ink); font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; margin-top: 0.6rem; }
.sw-railblock dd { margin: 0.1rem 0 0; }

.sw-figure { margin: 1.6rem 0; }
.sw-figure img { display: block; width: 100%; height: auto; border: var(--rule); background: var(--slab); }
.sw-figure figcaption { font-family: var(--sans); font-size: 0.76rem; color: var(--muted-ink); padding-top: 0.5rem; }

/* ---------- seasonal ---------- */

.sw-season-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 0; border: var(--rule); margin: 1.6rem 0 2.2rem; }
.sw-season-cell { border-right: var(--rule); border-bottom: var(--rule); padding: 0.85rem 1rem; background: var(--slab); }
.sw-season-cell.is-now { background: rgba(225, 101, 74, 0.08); }
.sw-season-cell a { border: 0; }
.sw-season-cell strong { display: block; font-family: var(--sans); font-size: 0.95rem; }
.sw-season-cell span { display: block; font-family: var(--sans); font-size: 0.74rem; color: var(--muted-ink); }

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

.sw-prose { max-width: var(--measure); }
.sw-prose h2 { margin-top: 1.9em; font-size: var(--step-2); }
.sw-prose h3 { margin-top: 1.5em; font-size: var(--step-1); }
.sw-prose table { width: 100%; border-collapse: collapse; font-family: var(--sans); font-size: 0.88rem; margin: 1.2rem 0; }
.sw-prose th, .sw-prose td { border-bottom: var(--rule); padding: 0.5rem 0.6rem 0.5rem 0; text-align: left; }
.sw-prose th { border-bottom: 2px solid var(--deep-end); font-size: 0.76rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted-ink); }
.sw-prose .sw-updated { font-family: var(--sans); font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--coral-buoy); }

.sw-crossref { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1.2rem; margin: 2rem 0; }
.sw-crossref a { display: block; border: var(--rule); border-top: 3px solid var(--deep-end); padding: 0.9rem 1rem; background: var(--slab); }
.sw-crossref strong { display: block; font-family: var(--sans); font-size: 0.95rem; margin-bottom: 0.25rem; }
.sw-crossref span { font-family: var(--sans); font-size: 0.78rem; color: var(--muted-ink); }
.sw-crossref a:hover { border-top-color: var(--coral-buoy); }

/* ---------- colophon ---------- */

.sw-colophon { border-top: 3px solid var(--deep-end); margin-top: 3rem; background: var(--slab); }
.sw-colophon-inner { max-width: 1180px; margin: 0 auto; padding: 1.8rem 1.4rem 2.4rem; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.6rem; }
.sw-colophon h3 { font-size: 0.74rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted-ink); }
.sw-colophon ul { list-style: none; margin: 0; padding: 0; font-family: var(--sans); font-size: 0.86rem; }
.sw-colophon li { margin-bottom: 0.35rem; }
.sw-colophon a { border: 0; }
.sw-colophon p { font-family: var(--sans); font-size: 0.82rem; color: var(--muted-ink); }
.sw-colophon-legal { grid-column: 1 / -1; border-top: var(--rule); padding-top: 1rem; font-size: 0.78rem; }
.sw-colophon-notice { grid-column: 1 / -1; margin: 0; font-family: var(--sans); font-size: 0.76rem; line-height: 1.5; color: var(--muted-ink); }

.sw-footnote { font-family: var(--sans); font-size: 0.78rem; color: var(--muted-ink); border-top: var(--rule); padding-top: 0.8rem; margin-top: 2rem; }

.sw-empty { border: 1px dashed var(--shallows); padding: 1.4rem; font-family: var(--sans); color: var(--muted-ink); }

/* ---------- mobile ---------- */

@media (max-width: 980px) {
  .sw-shell-rail { grid-template-columns: minmax(0, 1fr); gap: 1.4rem; }
  .sw-lanes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sw-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sw-metric:nth-child(2) { border-right: 0; }
  .sw-metric:nth-child(1), .sw-metric:nth-child(2) { border-bottom: var(--rule); }
  .sw-anchorrail {
    position: sticky; top: 62px; z-index: 20;
    background: var(--shore-chalk); border-top: 0; border-bottom: var(--rule);
    margin: 0 -1.4rem; padding: 0.2rem 1.4rem;
  }
  .sw-anchorrail h2, .sw-railblock { display: none; }
  .sw-anchorrail ul { display: flex; gap: 1.2rem; overflow-x: auto; margin: 0; }
  .sw-anchorrail li { border-bottom: 0; }
  .sw-anchorrail a { border-left: 0; border-bottom: 2px solid transparent; padding: 0.6rem 0; }
  .sw-anchorrail a.is-current { border-left: 0; border-bottom-color: var(--coral-buoy); }
}

@media (max-width: 700px) {
  :root { --step-4: 2.1rem; --step-3: 1.6rem; }
  .sw-masthead-inner { grid-template-columns: 1fr auto; row-gap: 0.6rem; }
  .sw-navlist { grid-column: 1 / -1; order: 3; gap: 0.8rem; }
  .sw-search input { width: 120px; }
  .sw-lanes { grid-template-columns: minmax(0, 1fr); }
  .sw-lane { border-right: 0; border-bottom: var(--rule); padding-right: 0; }
  .sw-ledger th:nth-child(4), .sw-ledger td:nth-child(4) { display: none; }
}

@media print {
  .sw-masthead, .sw-anchorrail, .sw-colophon { display: none; }
  body { background: #fff; }
}
