@font-face { font-family: Alegreya; src: url(/fonts/alegreya-latin-500-normal.woff2) format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: Alegreya; src: url(/fonts/alegreya-latin-700-normal.woff2) format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: Alegreya; src: url(/fonts/alegreya-latin-500-italic.woff2) format("woff2"); font-weight: 500; font-style: italic; font-display: swap; }
@font-face { font-family: "Alegreya Sans"; src: url(/fonts/alegreya-sans-latin-400-normal.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Alegreya Sans"; src: url(/fonts/alegreya-sans-latin-500-normal.woff2) format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Alegreya Sans"; src: url(/fonts/alegreya-sans-latin-700-normal.woff2) format("woff2"); font-weight: 700; font-display: swap; }

:root {
  color-scheme: light;
  --sea: #DCE9EA;      /* chart water: the page itself */
  --land: #EEF2E0;     /* limestone and lichen */
  --water: #BCDAE3;    /* the river in a chart, and the ground beneath it */
  --plate: #F8FAF5;    /* the enamel of a staff gauge */
  --ink: #14363F;      /* bog water */
  --ink-2: #365762;
  --river: #1A5D7A;
  --deep: #134C68;
  --heather: #843A79;  /* top of the range: never red, this is not an alarm */
  --quiet: #5C6F75;
  --rule: rgba(20, 54, 63, .22);
  --serif: Alegreya, Georgia, serif;
  --sans: "Alegreya Sans", "Gill Sans", Calibri, sans-serif;
  --gutter: clamp(16px, 3.2vw, 44px);
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 16px; }
body { margin: 0; background: var(--sea); color: var(--ink); font: 400 1.125rem/1.5 var(--sans); font-variant-numeric: lining-nums; overflow-x: hidden; }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.12; margin: 0; letter-spacing: -.005em; }
p { margin: 0 0 .75em; }
a { color: var(--river); text-underline-offset: .16em; text-decoration-thickness: 1px; }
a:hover { color: var(--ink); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--heather); outline-offset: 2px; }
svg { display: block; }
ul { margin: 0; padding: 0; list-style: none; }
i { font-family: var(--serif); font-weight: 500; font-style: italic; }
button, input { font: inherit; color: inherit; }

.wrap { width: 100%; max-width: 1320px; margin-inline: auto; padding-inline: var(--gutter); }
.skip { position: absolute; left: 8px; top: -60px; background: var(--plate); padding: 8px 12px; z-index: 10; }
.skip:focus { top: 8px; }

.site-head { position: relative; z-index: 2; }
.home .wrap { max-width: 1760px; }
.head-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 14px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font: italic 500 1.65rem/1 var(--serif); }
.site-head nav { display: flex; gap: 20px; font-size: 1.03rem; }
.site-head nav a { color: var(--ink); }

.outage { background: var(--plate); border-block: 2px solid var(--heather); }
.outage p { margin: 0; padding-block: 10px; }

/* ------- Home hero: the map is the page ------- */
.hero { display: grid; grid-template-columns: minmax(340px, 30%) 1fr; column-gap: 8px; width: 100%; max-width: 1760px; margin-inline: auto; padding-left: var(--gutter); min-height: calc(100vh - 62px); }
.hero-text { padding-block: clamp(8px, 3vh, 40px) 24px; position: relative; z-index: 1; }
.hero h1 { font-size: clamp(2.4rem, 3.6vw, 4rem); line-height: 1.04; margin-bottom: .36em; }
.lede { font-size: 1.28rem; line-height: 1.38; color: var(--ink); margin-bottom: 1.3em; }
.finder { margin-bottom: 18px; position: relative; }
.finder label { display: block; font-weight: 500; margin-bottom: 4px; }
.finder-row { display: flex; gap: 8px; }
.finder input { flex: 1; min-width: 0; padding: 9px 12px; background: var(--plate); border: 1.5px solid var(--ink); border-radius: 0; min-height: 44px; }
.finder input::placeholder { color: var(--quiet); }
.quiet { background: none; border: 1.5px solid var(--ink); padding: 6px 14px; min-height: 44px; cursor: pointer; white-space: nowrap; border-radius: 0; }
.quiet:hover { background: var(--plate); }
.results:not(:empty) { background: var(--plate); border: 1.5px solid var(--ink); border-top: 0; }
.results li + li { border-top: 1px solid var(--rule); }
.results a { display: grid; grid-template-columns: 1fr auto; gap: 0 12px; padding: 7px 12px; color: var(--ink); text-decoration: none; }
.results a:hover, .results a:focus-visible { background: var(--water); }
.results small { grid-column: 1; font-size: .95rem; color: var(--ink-2); }
.results .lv { grid-column: 2; grid-row: 1 / span 2; align-self: center; font-variant-numeric: lining-nums tabular-nums; }
.results .empty { padding: 7px 12px; }

.reader { display: grid; grid-template-columns: 44px 1fr; background: var(--plate); margin-bottom: 18px; }
.reader[hidden] { display: none; }
.reader-staff { display: block; width: 44px; height: 100%; min-height: 136px; }
.reader-body { padding: 10px 14px 12px; min-width: 0; }
.reader-context { font-size: .98rem; color: var(--ink-2); margin: 0 0 2px; }
.reader-name { font: 500 1.5rem/1.12 var(--serif); margin: 0; }
.reader-name a { color: var(--ink); text-decoration: none; }
.reader-name a:hover { text-decoration: underline; }
.reader-water { margin: 0 0 6px; font-size: 1.05rem; }
.reader-level { font: 500 2rem/1.1 var(--serif); font-variant-numeric: lining-nums tabular-nums; margin: 0; }
.reader-note { margin: 2px 0 6px; font-size: 1rem; color: var(--ink-2); }
.reader-spark { width: 100%; height: 44px; }
.reader-spark .s-area { fill: var(--water); }
.reader-spark .s-line { fill: none; stroke: var(--deep); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.reader-open { font-size: 1.02rem; margin: 6px 0 0; }
.reader-stale .reader-level { color: var(--quiet); }

.hero-safety { font-size: 1.02rem; line-height: 1.4; margin: 0; }

.map-wrap { margin: 0; display: grid; grid-template-columns: 1fr minmax(210px, 250px); min-width: 0; padding-right: var(--gutter); align-items: end; }
.map-stage { position: relative; min-width: 0; height: 100%; }
#map { width: 100%; height: 100%; max-height: calc(100vh - 40px); min-height: 640px; touch-action: pan-y; user-select: none; -webkit-user-select: none; cursor: crosshair; --k: 1; }
#map.zoomed { touch-action: none; cursor: grab; }
#map:focus-visible { outline-offset: -3px; }
#marks a { cursor: pointer; }
.g path { stroke: var(--sea); stroke-width: .5; paint-order: stroke; }
.p0 path { fill: #7BB2C7; } .p1 path { fill: #4890AF; } .p2 path { fill: #1F6D8D; } .p3 path { fill: #134C68; } .p4 path { fill: var(--heather); }
.g-tidal path { fill: #8EA3A9; }
.g-short path { fill: #6F8A92; }
.g-stale path { fill: var(--land); stroke: #566A70; stroke-width: 1.1; }
#selected path { fill: var(--ink); stroke: var(--plate); stroke-width: 1.4; paint-order: stroke; pointer-events: none; }
#selected circle { fill: none; stroke: var(--ink); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.labels { pointer-events: none; }
.sea { font: italic 500 calc(25px / var(--k, 1)) var(--serif); fill: #3D7385; letter-spacing: .14em; }
.place circle { fill: var(--plate); stroke: var(--ink); stroke-width: 1.1; }
.place text { font: 500 calc(16.5px / var(--k, 1)) var(--sans); fill: var(--ink); paint-order: stroke; stroke: var(--land); stroke-width: 3px; stroke-linejoin: round; }
.zoom { position: absolute; right: 8px; top: 12px; display: grid; gap: 1px; background: var(--ink); border: 1.5px solid var(--ink); }
.zoom[hidden] { display: none; }
.zoom button { width: 44px; height: 44px; background: var(--plate); border: 0; font-size: 1.5rem; line-height: 1; cursor: pointer; }
.zoom button:hover { background: var(--water); }
.map-key { padding-bottom: 28px; font-size: 1rem; line-height: 1.38; }
.key-scale svg { margin-bottom: 6px; }
.k0 { fill: #7BB2C7; } .k1 { fill: #4890AF; } .k2 { fill: #1F6D8D; } .k3 { fill: #134C68; } .k4 { fill: var(--heather); }
.k-stale { fill: var(--land); stroke: #566A70; stroke-width: 1.2; }
.replay { margin-block: 12px; }
.replay[hidden] { display: none; }
.replay label { display: block; font-weight: 500; }
.replay output { font-weight: 400; }
.replay-row { display: flex; gap: 8px; align-items: center; margin-top: 4px; }
.replay input[type=range] { flex: 1; min-width: 0; accent-color: var(--deep); height: 44px; }
.map-status { color: var(--ink-2); margin: 10px 0 0; }

/* ------- Home below the fold ------- */
.band-safety { background: var(--plate); padding-block: 22px; }
.safety-text p { margin-bottom: .4em; }
.safety-text p:last-child { margin-bottom: 0; }
.safety-lead { font: 500 1.5rem/1.2 var(--serif); }
.band-safety .safety-text { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 8px 32px; align-items: baseline; }
.home-lists { display: grid; grid-template-columns: 1fr 1fr; gap: 32px clamp(32px, 5vw, 72px); padding-block: 44px 28px; }
h2 { font-size: 1.85rem; margin-bottom: .32em; }
.sect-note { color: var(--ink-2); margin-bottom: .75em; }
.rows { border-top: 1.5px solid var(--ink); }
.row { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; grid-template-areas: "s l v" "s l n"; gap: 0 12px; padding-block: 9px; border-bottom: 1px solid var(--rule); align-items: center; }
.mini { grid-area: s; }
.mini-plate { fill: var(--plate); stroke: var(--ink); stroke-width: 1; }
.mini-water { fill: #2A7A9B; }
.mini-top .mini-water { fill: var(--heather); }
.mini-dim .mini-plate { stroke: var(--quiet); }
.row-link { grid-area: l; display: block; color: var(--ink); text-decoration: none; min-width: 0; }
.row-link:hover .row-name { text-decoration: underline; }
.row-name { display: block; font-weight: 500; font-size: 1.1rem; line-height: 1.25; }
.row-water { display: block; font-size: 1rem; color: var(--ink-2); line-height: 1.25; }
.row-level { grid-area: v; text-align: right; font-weight: 500; font-variant-numeric: lining-nums tabular-nums; }
.row-note { grid-area: n; text-align: right; font-size: .97rem; color: var(--ink-2); white-space: nowrap; }
.row-stale .row-level { color: var(--quiet); font-weight: 400; }
.rows-cols { column-count: 2; column-gap: clamp(32px, 5vw, 72px); border-top: 0; }
.rows-cols .row { break-inside: avoid; }
.about-band { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 32px clamp(32px, 5vw, 72px); padding-block: 24px 56px; }
.county-list { columns: 3; column-gap: 28px; }
.county-list li { display: flex; justify-content: space-between; gap: 8px; break-inside: avoid; padding-block: 3px; border-bottom: 1px solid var(--rule); }
.county-list span { color: var(--ink-2); font-variant-numeric: lining-nums tabular-nums; }

/* ------- Station ------- */
.station-top { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 16px 40px; padding-block: 18px 24px; align-items: end; }
.crumbs { font-size: 1.02rem; color: var(--ink-2); margin-bottom: 8px; }
.station h1 { font-size: clamp(2.6rem, 6vw, 5rem); line-height: 1; }
.station-place { font: italic 500 clamp(1.25rem, 2.2vw, 1.7rem)/1.2 var(--serif); margin: .3em 0 0; }
.reading-num { font: 500 clamp(3.4rem, 8vw, 6.2rem)/1 var(--serif); font-variant-numeric: lining-nums tabular-nums; margin: 0 0 .1em; }
.reading-tag { display: block; font: 500 1.1rem/1.3 var(--sans); }
.reading-status, .reading-move { margin: 0; font-size: 1.14rem; line-height: 1.35; }
.reading-move { font-weight: 500; }
.st-late .reading-status { font-weight: 700; color: var(--ink); }
.st-stale .reading-num .num { color: var(--quiet); }
.st-stale .reading-status { font-weight: 700; background: var(--plate); padding: 8px 12px; border-left: 4px solid var(--heather); }

.chart-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 24px; margin-bottom: 8px; }
.chart-head h2 { margin: 0; font-size: 1.45rem; }
.ranges { display: flex; flex-wrap: wrap; gap: 0 4px; }
.ranges a { padding: 8px 10px; min-height: 40px; color: var(--ink); text-decoration: none; }
.ranges a:hover { text-decoration: underline; }
.ranges a[aria-current] { background: var(--ink); color: var(--plate); }
.chart-box { position: relative; max-width: 1800px; margin-inline: auto; touch-action: pan-y; }
.chart-box:focus-visible { outline-offset: -3px; }
.chart { width: 100%; height: auto; display: none; }
.chart-medium, .chart-narrow { display: none; }
@media (min-width: 1000px) { .chart-wide { display: block; } }
@media (min-width: 560px) and (max-width: 999.98px) { .chart-medium { display: block; } }
@media (max-width: 559.98px) { .chart-narrow { display: block; } }
.water { fill: var(--water); }
.band { fill: var(--deep); opacity: .16; }
.river { fill: none; stroke: var(--deep); stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.river-dot { fill: var(--deep); }
.grid { stroke: var(--ink); stroke-opacity: .13; stroke-width: 1; }
.plate { fill: var(--plate); }
.plate-block { fill: var(--ink); }
.plate-num { font: 500 15px var(--sans); fill: var(--ink); font-variant-numeric: lining-nums tabular-nums; paint-order: stroke; stroke: var(--plate); stroke-width: 3px; }
.plate-water { fill: #2A7A9B; opacity: .34; }
.plate-level { stroke: var(--deep); stroke-width: 2.4; }
.ref-high { stroke: var(--heather); stroke-width: 1.3; stroke-dasharray: 2 5; stroke-linecap: round; }
.ref-low { stroke: var(--ink-2); stroke-width: 1.1; stroke-dasharray: 2 5; stroke-linecap: round; }
.ref-label { font: 500 15px var(--sans); fill: var(--ink-2); font-variant-numeric: lining-nums; paint-order: stroke; stroke: var(--sea); stroke-width: 3px; stroke-linejoin: round; }
.ref-label-high { fill: var(--heather); }
.chart .ref-label:not(.ref-label-high) { stroke: var(--water); }
.tick { stroke: var(--ink); stroke-opacity: .4; }
.tick-label { font: 400 14.5px var(--sans); fill: var(--ink); font-variant-numeric: lining-nums; }
.now-halo { fill: var(--plate); opacity: .9; }
.now-dot { fill: var(--deep); }
.silence { fill: var(--plate); opacity: .55; }
.silence-label { font: 500 15px var(--sans); fill: var(--ink); }
.cross { stroke: var(--ink); stroke-width: 1; }
.cross-dot { fill: var(--plate); stroke: var(--ink); stroke-width: 2; }
.cross[hidden], .cross-dot[hidden] { display: none; }
.readout { position: absolute; top: 8px; background: var(--ink); color: var(--plate); padding: 4px 9px; font-size: 1rem; line-height: 1.25; pointer-events: none; white-space: nowrap; font-variant-numeric: lining-nums tabular-nums; }
.readout[hidden] { display: none; }
.chart-empty { padding-block: 36px; }

.under { background: var(--water); padding-block: 12px 40px; }
.under-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 28px clamp(32px, 5vw, 72px); }
.compare h2 { font-size: 1.85rem; }
.compare > p:not(.caveat):not(.coverage):not(.kind-note) { font: 500 1.28rem/1.34 var(--serif); font-variant-numeric: lining-nums; }
.caveat, .coverage, .kind-note { font-size: 1.05rem; }
.station-safety { background: var(--plate); padding: 18px 20px; align-self: start; font-size: 1.05rem; }
.station-safety .safety-text { margin-bottom: 12px; }
.below { padding-block: 36px 48px; }
.below-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 32px clamp(32px, 5vw, 72px); }
.below-grid h2 { font-size: 1.5rem; }
.below-grid .rows + p { margin-top: 10px; }
.facts dl { margin: 0 0 12px; display: grid; grid-template-columns: auto 1fr; gap: 2px 16px; border-top: 1.5px solid var(--ink); padding-top: 8px; font-variant-numeric: lining-nums; }
.facts dt { color: var(--ink-2); }
.facts dd { margin: 0; }
.ad { padding-block: 16px; margin-bottom: 24px; border-block: 1px solid var(--rule); }
.ad-label { font-size: .9rem; color: var(--ink-2); margin-bottom: 4px; }

/* ------- Plain pages: the column width sets the line length ------- */
.page { padding-block: 16px 56px; }
.page h1 { font-size: clamp(2.4rem, 5vw, 4rem); margin-bottom: .3em; }
.page-intro { font-size: 1.2rem; margin-bottom: 1.2em; }
.page-safety { margin-top: 1.6em; background: var(--plate); padding: 12px 16px; }
.prose-page { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 760px) minmax(0, 1fr); }
.prose-page > * { grid-column: 2; }
.prose { margin-bottom: 28px; }
.prose h2 { margin-top: .5em; font-size: 1.6rem; }
.prose blockquote { margin: 0 0 1em; padding: 12px 18px; background: var(--plate); font-size: 1.04rem; }
.prose blockquote li + li { margin-top: .5em; }

.site-foot { background: var(--ink); color: var(--plate); padding-block: 32px; font-size: 1.02rem; }
.site-foot a { color: #CFE6EE; }
.site-foot a:hover { color: #FFF; }
.site-foot :focus-visible { outline-color: #F2C6EA; }
.foot-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px clamp(32px, 5vw, 72px); }
.foot-source p:last-child { margin-bottom: 0; }

@media (max-width: 1240px) {
  .map-wrap { grid-template-columns: 1fr; }
  .map-key { padding: 8px 0 24px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 32px; }
  .map-status { grid-column: 1 / -1; }
  #map { max-height: none; height: auto; aspect-ratio: 1000 / 1300; min-height: 0; }
  .map-stage { height: auto; }
  .hero { min-height: 0; }
}
@media (max-width: 860px) {
  /* On a phone the map comes straight after the headline, with the reader right under it. */
  .hero { display: flex; flex-direction: column; padding-inline: 0; }
  .hero-text, .map-wrap { display: contents; }
  .hero h1 { order: 1; font-size: 2.65rem; padding: 4px var(--gutter) 0; }
  .lede { order: 2; font-size: 1.18rem; margin-bottom: .6em; padding-inline: var(--gutter); }
  .hero-safety { order: 3; margin: 0 var(--gutter) 6px; }
  .map-stage { order: 4; }
  .reader { order: 5; margin: 0 var(--gutter) 18px; }
  .finder { order: 6; margin: 0 var(--gutter) 18px; }
  .map-key { order: 7; padding-inline: var(--gutter); display: block; }
  .sea { font-size: calc(36px / var(--k, 1)); }
  .place text { font-size: calc(32px / var(--k, 1)); stroke-width: 5px; }
  .place circle { r: 4; }
  .place-town { display: none; }
  .band-safety .safety-text { display: block; }
  .home-lists, .about-band, .under-grid, .foot-grid, .station-top { grid-template-columns: minmax(0, 1fr); }
  .rows-cols { column-count: 1; }
  .county-list { columns: 2; }
  .station-top { align-items: start; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
