/* Research-paper layout for the Ouémé–Ogun water-balance study.
   Type: Satoshi (Fontshare). Spacing: 4 px base (4, 8, 12, 16, 24, 32, 48, 64, 96).
   Data colours were checked with a colour-vision-deficiency validator:
     water budget  evapotranspiration #1baf7a · river #2a78d6 · residual #9c3d17
     rain products CHIRPS v2.0 #6250d6 · CHIRPS v3.0 #c98500 · TAMSAT v3.1 #d55181 */

/* Satoshi's en dash is 0.93 em, almost its em-dash width, so every range ("2018–2024") reads as an
   em dash. The en dash alone is taken from a system sans; if none is found, Satoshi's is used. */
@font-face {
    font-family: 'Range Dash';
    src: url(fonts/range-dash.woff) format('woff'), local('Arial'), local('ArialMT'), local('Helvetica'), local('Roboto'), local('Roboto-Regular'),
         local('Liberation Sans'), local('LiberationSans'), local('DejaVu Sans'), local('DejaVuSans');
    unicode-range: U+2013;
    font-weight: 100 599;
}
@font-face {
    font-family: 'Range Dash';
    src: url(fonts/range-dash-bold.woff) format('woff'), local('Arial Bold'), local('Arial-BoldMT'), local('Helvetica Bold'), local('Helvetica-Bold'), local('Roboto Bold'), local('Roboto-Bold'),
         local('Liberation Sans Bold'), local('LiberationSans-Bold'), local('DejaVu Sans Bold'), local('DejaVuSans-Bold');
    unicode-range: U+2013;
    font-weight: 600 900;
}

:root {
    --bg: #ffffff;
    --ink: #111111;
    --ink-2: #474747;
    --ink-3: #6b6b6b;
    --rule: #e8e8e8;
    --rule-2: #d1d1d1;
    --fill: #f7f7f6;
    --focus: #1f5fd1;
    --air: #1baf7a;
    --river: #2a78d6;
    --river-fill: #1f66c2;
    --gap: #9c3d17;
    --p-chirps2: #6250d6;
    --p-chirps3: #c98500;
    --p-tamsat: #d55181;
    --font: 'Range Dash', 'Satoshi', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --math: Georgia, 'Times New Roman', serif;
    --bar-h: 56px;
    --main: 720px;
    --wide: 1180px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--bar-h) + 24px); -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font: 400 17px/1.65 var(--font);
    -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: underline; text-decoration-color: var(--rule-2); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-color: currentColor; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: 8px; z-index: 100; padding: 8px 12px; background: var(--ink); color: var(--bg); transform: translateY(-150%); }
.skip:focus { transform: none; }
/* Tabular figures only where digits must line up (tables, readouts, ticks). Satoshi's tabular 1 has
   serifs, which looks wrong in running text. */
td { font-variant-numeric: tabular-nums; }
var { font-family: var(--math); font-style: italic; font-size: 1.05em; }
code { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: 0.86em; overflow-wrap: anywhere; }
sub, sup { font-size: 0.72em; line-height: 0; }

/* ---------- Bar ---------- */
.bar {
    position: sticky; top: 0; z-index: 1000;
    height: var(--bar-h);
    display: flex; align-items: center; gap: 24px;
    padding: 0 24px;
    background: var(--bg);
    border-bottom: 1px solid var(--rule);
}
.bar-name { font-weight: 500; font-size: 15px; text-decoration: none; white-space: nowrap; }
.toc { display: flex; gap: 2px; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.toc::-webkit-scrollbar { display: none; }
.toc a { padding: 6px 10px; font-size: 14px; color: var(--ink-3); text-decoration: none; white-space: nowrap; border-radius: 6px; }
.toc a:hover { color: var(--ink); background: var(--fill); }
.toc a[aria-current="true"] { color: var(--ink); background: var(--fill); }

/* ---------- Article grid ---------- */
.article {
    display: grid;
    /* The text column is sized first, so on a narrow screen the side gutters shrink to nothing
       before the text does. */
    grid-template-columns:
        [full-start] minmax(20px, 1fr)
        [wide-start] minmax(0, calc((var(--wide) - var(--main)) / 2))
        [main-start] min(var(--main), 100% - 40px)
        [main-end] minmax(0, calc((var(--wide) - var(--main)) / 2))
        [wide-end] minmax(20px, 1fr) [full-end];
}
.article > * { grid-column: main; }
.article > .wide { grid-column: wide; }
.article > .full { grid-column: full; }

header.title { padding: 72px 0 40px; border-bottom: 1px solid var(--rule); margin-bottom: 40px; }
h1 { font-size: clamp(31px, 4.2vw, 44px); line-height: 1.12; font-weight: 700; letter-spacing: -0.022em; margin: 0; max-width: 20ch; }
.subtitle { font-size: clamp(18px, 2vw, 21px); line-height: 1.45; color: var(--ink-2); margin: 14px 0 0; }
/* author line and a journal-style article-information list: ruled rows, label left, value right */
.author { margin: 28px 0 0; font-size: 15px; color: var(--ink-3); display: flex; flex-wrap: wrap; gap: 2px 14px; }
.author strong { color: var(--ink); font-weight: 500; }
.info { margin: 20px 0 0; font-size: 14.5px; line-height: 1.5; border-top: 1px solid var(--rule); }
.info div { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 16px; padding: 7px 0; border-bottom: 1px solid var(--rule); }
.info dt { color: var(--ink-3); }
.info dd { margin: 0; color: var(--ink-2); }

h2 { font-size: 24px; line-height: 1.3; font-weight: 700; letter-spacing: -0.012em; margin: 64px 0 16px; }
h2 .n, h3 .n { color: var(--ink-3); font-weight: 500; margin-right: 10px; }
h3 { font-size: 18.5px; line-height: 1.4; font-weight: 700; margin: 36px 0 10px; }
p { margin: 0 0 16px; }
.abstract h2 { margin-top: 0; }
ul, ol { padding-left: 22px; margin: 0 0 16px; }
li { margin-bottom: 6px; }
.small { font-size: 14.5px; color: var(--ink-2); }
.cite { white-space: nowrap; }

/* equations */
.eq { margin: 20px 0 24px; padding-left: 32px; font-size: 17px; }
.eq div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: baseline; padding: 3px 0; }
.eq div > span:last-child { color: var(--ink-3); font-size: 15px; }

/* ---------- Figures and tables ---------- */
figure { margin: 32px 0 40px; }
figcaption { font-size: 14.5px; line-height: 1.55; color: var(--ink-2); text-align: left; margin-top: 12px; }
figcaption b { color: var(--ink); font-weight: 700; margin-right: 4px; }
/* Tables: the caption sits above, outside the scroller, so it never scrolls out of view on a phone. */
.tablefig { margin: 24px 0 36px; }
.tablefig figcaption { margin: 0 0 10px; }
/* A table wider than the screen scrolls sideways; a soft shadow on the cut edge shows there is more. */
.table-wrap {
    overflow-x: auto;
    background:
        linear-gradient(to right, var(--bg) 30%, rgba(255, 255, 255, 0)) left / 32px 100% no-repeat local,
        linear-gradient(to left, var(--bg) 30%, rgba(255, 255, 255, 0)) right / 32px 100% no-repeat local,
        radial-gradient(farthest-side at 0 50%, rgba(0, 0, 0, 0.12), transparent) left / 12px 100% no-repeat scroll,
        radial-gradient(farthest-side at 100% 50%, rgba(0, 0, 0, 0.12), transparent) right / 12px 100% no-repeat scroll;
}
.table-wrap[tabindex]:focus-visible { outline-offset: 4px; }
table { border-collapse: collapse; width: 100%; font-size: 15px; }
th { font-weight: 500; color: var(--ink-3); text-align: right; padding: 8px 12px; border-bottom: 1px solid var(--ink); font-size: 14px; line-height: 1.35; vertical-align: bottom; white-space: nowrap; }
td { text-align: right; padding: 9px 12px; border-bottom: 1px solid var(--rule); white-space: nowrap; }
th:first-child, td:first-child { text-align: left; padding-left: 0; }
th:last-child, td:last-child { padding-right: 0; }
td.text, th.text { text-align: left; white-space: normal; }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 8px; }

/* locator map */
#locator { width: 100%; height: auto; }
svg.locator text { paint-order: stroke; stroke-linejoin: round; }
.loc-sea { fill: #eaf0f6; }
.loc-edge { fill: none; stroke: #b9b9b9; stroke-width: 1; }
.loc-country { fill: #f4f4f3; stroke: #bdbdbd; stroke-width: 0.8; }
.loc-country.is-study { fill: #ebebea; }
.loc-basin { fill: #d6d6d4; stroke: var(--ink); stroke-width: 1.3; }
.loc-label { font: 500 12px var(--font); fill: #5c5c5c; letter-spacing: 0.12em; stroke: #ebebea; stroke-width: 3px; }
.loc-basin-label { font: 700 13.5px var(--font); fill: var(--ink); stroke: #d6d6d4; stroke-width: 3px; }
.loc-basin-label.is-out { stroke: #ebebea; }
.loc-small { font: 400 12.5px var(--font); fill: var(--ink-2); stroke: #ffffff; stroke-width: 3px; }
.loc-sea-label { font: italic 400 12.5px var(--font); fill: #5a6b7c; letter-spacing: 0.02em; }
.loc-tick { font: 400 11px var(--font); fill: var(--ink-3); }
.loc-tickline { stroke: #9a9a9a; }
.loc-gauge { fill: var(--ink); stroke: #ffffff; stroke-width: 1.2; }
.loc-town { fill: var(--ink); stroke: #ffffff; stroke-width: 1; }
.loc-scale { fill: none; stroke: var(--ink); stroke-width: 1.5; }
.loc-inset { fill: #ffffff; stroke: #b9b9b9; stroke-width: 1; }
.loc-inset-land { fill: #dcdcda; stroke: none; }
.loc-inset-frame { fill: none; stroke: var(--ink); stroke-width: 1.5; }
/* phone: the map is drawn at about half size, so its text is set larger in map units */
svg.locator.is-small text { stroke-width: 5px; }
svg.locator.is-small .loc-label { font-size: 20px; }
svg.locator.is-small .loc-basin-label { font-size: 23px; }
svg.locator.is-small .loc-small, svg.locator.is-small .loc-sea-label { font-size: 21px; }
svg.locator.is-small .loc-tick { font-size: 18px; }

/* ---------- Scroll-driven figure ---------- */
.scrolly { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 48px; }
.scrolly-map { position: sticky; top: calc(var(--bar-h) + 16px); height: calc(100vh - var(--bar-h) - 32px); min-height: 460px; }
.map { position: absolute; inset: 0; border: 1px solid var(--rule-2); background: #f3f3f2; }
.leaflet-container { background: #f3f3f2; font-family: var(--font); }
.legend { position: absolute; left: 12px; bottom: 12px; z-index: 800; width: min(300px, calc(100% - 24px)); background: var(--bg); border: 1px solid var(--rule-2); padding: 10px 12px; font-size: 14px; line-height: 1.4; }
.legend .t { font-weight: 500; }
.legend .s { color: var(--ink-3); font-size: 14px; margin: 2px 0 8px; }
.ramp { height: 8px; }
.ramp-ticks { display: flex; justify-content: space-between; font-size: 14px; color: var(--ink-3); margin-top: 3px; font-variant-numeric: tabular-nums; }
.steps { padding: 14vh 0 32vh; }
.step { min-height: 56vh; padding: 4px 0 4px 18px; border-left: 2px solid var(--rule); color: var(--ink-3); transition: color 0.2s ease, border-color 0.2s ease; }
.step + .step { margin-top: 14vh; }
.step.is-active { color: var(--ink); border-left-color: var(--ink); }
.step h3 { margin: 0 0 8px; font-size: 17.5px; color: inherit; }
.step p { font-size: 16.5px; }
.step p.small { font-size: 14px; color: inherit; margin-top: 8px; }
.bars7 { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; align-items: end; height: 92px; margin: 28px 0 0; }
.bars7 div { background: var(--gap); position: relative; min-height: 2px; border-radius: 2px 2px 0 0; }
.bars7 span { position: absolute; top: -19px; left: 0; right: 0; text-align: center; font-size: 14px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.bars7-axis { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; border-top: 1px solid var(--ink); font-size: 14px; color: var(--ink-3); text-align: center; padding-top: 4px; }

/* ---------- Interactive figures ---------- */
.interactive { display: grid; grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr); gap: 40px; align-items: start; border-top: 1px solid var(--ink); padding-top: 20px; }
.readout { display: flex; align-items: baseline; gap: 12px; margin: 0 0 8px; }
.readout .big { font-size: 38px; line-height: 1; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.readout .big small { font-size: 18px; font-weight: 500; color: var(--ink-3); margin-left: 3px; letter-spacing: 0; }
.readout .what { font-size: 14.5px; color: var(--ink-2); line-height: 1.45; }
.control { margin: 18px 0 0; }
.control label { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; font-weight: 500; }
.control output { font-variant-numeric: tabular-nums; font-weight: 500; white-space: nowrap; }
.control .hint { font-size: 14px; color: var(--ink-3); margin-top: 2px; line-height: 1.5; }
.control .label { font-size: 15px; font-weight: 500; margin-bottom: 8px; }
/* range sliders: a thin track, filled up to the value (--pct is set by app.js), and a round thumb */
input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 22px; margin: 6px 0 0; background: transparent; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(to right, var(--ink) var(--pct, 50%), var(--rule-2) var(--pct, 50%)); }
input[type="range"]::-moz-range-track { height: 4px; border-radius: 2px; background: var(--rule-2); }
input[type="range"]::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--ink); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; margin-top: -7px; border-radius: 50%; background: var(--bg); border: 2px solid var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12); }
input[type="range"]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--bg); border: 2px solid var(--ink); }
input[type="range"]:focus-visible { outline: none; }
input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--focus); }
input[type="range"]:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--focus); }
.control .scale-ends { display: flex; justify-content: space-between; font-size: 14px; color: var(--ink-3); font-variant-numeric: tabular-nums; margin-top: 2px; }
.buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.button { height: 32px; padding: 0 12px; border: 1px solid var(--rule-2); background: var(--bg); border-radius: 6px; font-size: 14px; cursor: pointer; transition: border-color 0.15s ease, background-color 0.15s ease; }
.button:hover { border-color: var(--ink); background: var(--fill); }
.button:active { background: var(--rule); }
.button.quiet { border-color: transparent; color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--rule-2); padding: 0 4px; }
.button.quiet:hover { background: none; color: var(--ink); text-decoration-color: currentColor; }
.status { margin-top: 12px; font-size: 15px; }
.status.ok { color: #0d6e43; font-weight: 500; }
.seg { display: inline-flex; border: 1px solid var(--rule-2); border-radius: 7px; padding: 2px; gap: 2px; max-width: 100%; overflow-x: auto; scrollbar-width: none; vertical-align: middle; }
.seg::-webkit-scrollbar { display: none; }
.seg button { border: 0; background: transparent; padding: 5px 10px; border-radius: 5px; font-size: 14px; color: var(--ink-2); cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.seg button:disabled { opacity: 0.45; cursor: not-allowed; }
.seg .swatch { margin-right: 0; }
.seg.fill { display: flex; width: 100%; }
.seg.fill button { flex: 1 1 0; justify-content: center; }
.field { display: inline-flex; align-items: center; gap: 10px; flex-wrap: nowrap; font-size: 14px; color: var(--ink-3); max-width: 100%; }
.field-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
#section { width: 100%; height: auto; }
svg.section text { font-family: var(--font); }
.sec-air { fill: #f7f7f6; }
.sec-laterite { fill: #d9b89c; }
.sec-saprolite { fill: #ece2cc; }
.sec-fissured { fill: #dedbd4; }
.sec-bedrock { fill: #736e67; }
.sec-fissure { stroke: #a9a296; stroke-width: 1.2; stroke-linecap: round; }
.sec-ground { stroke: var(--ink); stroke-width: 1.5; }
.sec-axis { stroke: var(--ink); stroke-width: 1; }
.sec-tick { font-size: 14px; fill: var(--ink-3); }
.sec-text { font-size: 14px; font-weight: 500; fill: var(--ink); }
.sec-on-dark { fill: #ffffff; }
.sec-note { font-size: 14px; fill: var(--ink-2); }
.sec-label { font-size: 15px; font-weight: 700; fill: var(--ink); }
.sec-rise { fill: var(--river-fill); fill-opacity: 0.14; }
.sec-hatch-line { stroke: var(--river-fill); stroke-width: 1.2; stroke-opacity: 0.45; }
.sec-warn { fill: #1f3f73; font-weight: 500; paint-order: stroke; stroke: #ffffff; stroke-width: 3px; }
.sec-wt { stroke: var(--river-fill); stroke-width: 2; stroke-dasharray: 7 5; }
.sec-need { stroke: var(--river-fill); stroke-width: 2; }
.sec-arrow { stroke: var(--river-fill); stroke-width: 2; fill: none; stroke-linejoin: round; stroke-linecap: round; }

/* stacked budget bar: rainfall is the bracket above, its uses are the segments below */
.budget { margin: 18px 0 12px; }
.budget-p { position: relative; height: 7px; margin-top: 24px; border: 1px solid var(--ink); border-bottom: 0; transition: width 0.2s ease; }
.budget-p span { position: absolute; left: -1px; bottom: 9px; font-size: 14px; color: var(--ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.stack { display: flex; height: 28px; margin-top: 3px; }
.stack div { height: 100%; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 500; color: #ffffff; white-space: nowrap; overflow: hidden; font-variant-numeric: tabular-nums; transition: width 0.2s ease; }
.stack div + div { box-shadow: inset 2px 0 0 var(--bg); }
.s-air { background: var(--air); color: #111111 !important; }
.s-river { background: var(--river-fill); }
.s-gap { background: var(--gap); }
.keylist { display: grid; gap: 4px; font-size: 14.5px; margin: 0; padding: 0; list-style: none; }
.keylist li { display: grid; grid-template-columns: 14px minmax(0, 1fr) auto; gap: 8px; align-items: baseline; margin: 0; }
.keylist i { width: 10px; height: 10px; border-radius: 2px; display: block; transform: translateY(1px); }
.keylist b { font-weight: 500; font-variant-numeric: tabular-nums; }

/* published-recharge scale */
.scale-row { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 20px; align-items: center; min-height: 52px; border-bottom: 1px solid var(--rule); }
.scale-name { font-size: 14.5px; line-height: 1.35; }
.scale-name span { display: block; color: var(--ink-3); font-size: 14px; }
.scale-plot { position: relative; }
.scale-grid { position: absolute; top: 0; bottom: 24px; left: 230px; right: 0; pointer-events: none; }
.scale-grid span { position: absolute; top: 0; bottom: 0; width: 1px; margin-left: -0.5px; background: var(--rule); }
.scale-row { position: relative; }
.scale-track { position: relative; height: 26px; }
.scale-range { position: absolute; top: 10px; height: 6px; background: #cfcfcc; border-left: 2px solid #6b6b6b; border-right: 2px solid #6b6b6b; }
.scale-tick { position: absolute; top: 3px; width: 3px; height: 20px; margin-left: -1.5px; background: var(--ink); }
.scale-val { position: absolute; top: 4px; font-size: 14px; color: var(--ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.scale-dot { position: absolute; top: 6px; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; border: 2px solid var(--bg); }
.scale-dot.is-on { box-shadow: 0 0 0 2px var(--ink); }
.scale-axis { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 20px; }
.scale-ticks { position: relative; height: 24px; font-size: 14px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.scale-ticks span { position: absolute; top: 4px; transform: translateX(-50%); }
.scale-ticks span:last-child { transform: translateX(-100%); }
.scale-ticks span:first-child { transform: none; }

/* ---------- Explorer ---------- */
.explorer-bar { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; padding: 14px 0; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--rule); margin: 8px 0 16px; }
.explorer { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 24px; }
.explorer-map { position: relative; height: min(70vh, 640px); min-height: 420px; }
.side h3 { margin: 0 0 2px; font-size: 16.5px; }
.side .when { font-size: 14px; color: var(--ink-3); margin: 0 0 4px; }
.side dl { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; margin: 8px 0 20px; font-size: 14.5px; }
.side dt { color: var(--ink-2); }
.side dd { margin: 0; text-align: right; font-weight: 500; font-variant-numeric: tabular-nums; }
.side .basin + .basin { border-top: 1px solid var(--rule); padding-top: 16px; }
.play { width: 32px; height: 32px; border: 1px solid var(--rule-2); border-radius: 6px; background: var(--bg); display: inline-grid; place-items: center; cursor: pointer; flex-shrink: 0; }
.play:hover { border-color: var(--ink); }
#ex-table tbody tr { cursor: pointer; }
.yr { border: 0; background: none; padding: 0; font: inherit; color: inherit; cursor: pointer; text-decoration: underline; text-decoration-color: var(--rule-2); text-underline-offset: 3px; }
.yr:hover { text-decoration-color: currentColor; }
.yr[aria-pressed="true"] { font-weight: 500; text-decoration-color: currentColor; }
#ex-table tbody tr:hover td { background: var(--fill); }
#ex-table tbody tr.is-on td { background: #eef3fc; }
#ex-table tr.avg td { font-weight: 500; border-top: 1px solid var(--ink-3); }

/* ---------- Leaflet bits ---------- */
.leaflet-tooltip.tip { background: var(--bg); color: var(--ink); border: 1px solid var(--rule-2); border-radius: 4px; box-shadow: none; font: 13px/1.45 var(--font); padding: 6px 9px; }
.leaflet-tooltip.tip::before { display: none; }
.basin-label { pointer-events: none; }
.basin-label div { transform: translate(-50%, -50%); display: inline-block; white-space: nowrap; background: var(--bg); color: var(--ink); border: 1px solid var(--rule-2); padding: 3px 8px; font: 500 13px/1.3 var(--font); }
.basin-label.at-n div { transform: translate(-50%, calc(-100% - 8px)); }
.basin-label.at-w div { transform: translate(calc(-100% - 10px), -50%); }
.basin-label div span { display: block; font-weight: 400; font-size: 14px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.basin-label.is-on div { border-color: var(--ink); }
.gauge-pin { pointer-events: none; }
.gauge-pin div { width: 10px; height: 10px; background: var(--ink); border: 2px solid var(--bg); border-radius: 50%; transform: translate(-50%, -50%); }
.gauge-pin span { position: absolute; left: 11px; top: 6px; white-space: nowrap; font: 500 12px var(--font); color: var(--ink); text-shadow: 0 0 2px #fff, 0 0 2px #fff, 0 0 2px #fff; }
.gauge-pin.is-on div { box-shadow: 0 0 0 3px var(--gap); }
.leaflet-control-attribution { font-size: 14px; }

/* ---------- Back matter ---------- */
.downloads { list-style: none; padding: 0; margin: 0 0 16px; }
.downloads li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px; align-items: baseline; padding: 10px 0; border-bottom: 1px solid var(--rule); margin: 0; }
.downloads li:first-child { border-top: 1px solid var(--rule); }
.downloads span { color: var(--ink-3); font-size: 14px; text-align: right; }
.citation { padding: 14px 16px; background: var(--fill); font-size: 15px; line-height: 1.6; margin: 0 0 16px; }
.citation p { margin: 0; overflow-wrap: break-word; }
.citation .button { margin-top: 10px; }
.changes li { margin-bottom: 10px; }
.note { border-top: 1px solid var(--rule); padding-top: 24px; margin-top: 48px; }
.note p { font-size: 16px; color: var(--ink-2); }
.refs { list-style: none; padding: 0; margin: 0; font-size: 14.5px; line-height: 1.55; color: var(--ink-2); overflow-wrap: break-word; }
.refs li { margin-bottom: 10px; padding-left: 24px; text-indent: -24px; }
footer { margin-top: 72px; padding: 24px 24px 48px; border-top: 1px solid var(--rule); font-size: 14px; color: var(--ink-3); }
footer .inner { max-width: var(--wide); margin: 0 auto; display: grid; gap: 6px; }
footer p { margin: 0; }
footer .sig { display: flex; flex-wrap: wrap; gap: 4px 28px; padding-bottom: 14px; margin-bottom: 8px; border-bottom: 1px solid var(--rule); font-size: 14px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); }
footer .sig a { text-decoration: none; }
footer .sig a:hover { text-decoration: underline; }

.snack { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 2000; background: var(--ink); color: var(--bg); padding: 8px 14px; border-radius: 6px; font-size: 14px; }

/* ---------- Charts (Figures 3 and 5) ---------- */
.chart { width: 100%; height: auto; overflow: visible; }
.chart text { font-family: var(--font); }
.chart-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 32px; }
.chart-pair .ch-legend { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px 20px; }
.ch-legend li { display: flex; align-items: center; gap: 8px; }
#ratiochart .ch-legend { display: flex; flex-wrap: wrap; gap: 4px 20px; margin-bottom: 8px; }
.ch-legend i.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ink-3); }
.ch-legend i.dash { width: 18px; height: 0; border-top: 1.5px dashed var(--ink-3); border-radius: 0; background: none; transform: none; }
.ch-title { font-size: 14px; font-weight: 700; fill: var(--ink); }
.ch-tick { font-size: 14px; fill: var(--ink-3); font-variant-numeric: tabular-nums; }
.ch-axis { font-size: 14px; fill: var(--ink-2); }
.ch-note { font-size: 14px; fill: var(--ink-2); }
.ch-label { font-size: 14px; font-weight: 500; }
.ch-grid { stroke: var(--rule); stroke-width: 1; }
.ch-zero { stroke: var(--ink); stroke-width: 1; }
.ch-base { stroke: var(--ink-3); stroke-width: 1.5; stroke-dasharray: 5 4; }
.ch-line { fill: none; stroke-width: 2; stroke-linejoin: round; }
.ch-et { stroke-dasharray: none; }
.ch-pt { stroke: var(--bg); stroke-width: 1.5; }
.ch-band { fill: #f1f1ef; }
.ch-band-dark { fill: #c9c9c6; }

/* ---------- Workflow (Figure 2) ---------- */
.flow { list-style: none; counter-reset: step; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; margin: 0; padding: 0; border-top: 1px solid var(--ink); }
.flow li { counter-increment: step; position: relative; margin: 0; padding: 14px 18px 16px 0; font-size: 14px; line-height: 1.45; color: var(--ink-2); }
.flow li + li { padding-left: 18px; border-left: 1px solid var(--rule); }
.flow li::before { content: counter(step); display: block; font-size: 14px; font-weight: 500; color: var(--ink-3); margin-bottom: 4px; font-variant-numeric: tabular-nums; }
.flow b { display: block; color: var(--ink); font-weight: 700; margin-bottom: 4px; font-size: 15px; }
.flow span { display: block; }
.rq { padding-left: 0; list-style: none; }
.rq li { margin-bottom: 8px; }
.kinds li { margin-bottom: 8px; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
    .toc { display: none; }
    .explorer { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
    .chart-pair { grid-template-columns: minmax(0, 1fr); }
    .flow { grid-template-columns: minmax(0, 1fr); }
    .flow li + li { padding-left: 0; border-left: 0; border-top: 1px solid var(--rule); }
    body { font-size: 16.5px; }
    header.title { padding-top: 48px; }
    .scrolly { grid-template-columns: minmax(0, 1fr); gap: 0; }
    .scrolly-map { top: var(--bar-h); height: 46vh; min-height: 300px; z-index: 1; }
    .steps { position: relative; z-index: 2; padding: 0 0 20vh; }
    .step { min-height: 0; margin: 0 0 54vh; padding: 14px 16px; background: var(--bg); border: 1px solid var(--rule-2); border-left-width: 2px; color: var(--ink); }
    .step + .step { margin-top: 0; }
    .step:first-child { margin-top: 36vh; }
    .step p { font-size: 15.5px; }
    .interactive { grid-template-columns: minmax(0, 1fr); gap: 24px; }
    .scale-row, .scale-axis { grid-template-columns: 116px minmax(0, 1fr); gap: 12px; }
    .scale-grid { left: 128px; }
    .legend { width: min(240px, calc(100% - 24px)); padding: 8px 10px; }
    .legend .s { display: none; }
}
@media (max-width: 560px) {
    .bar { padding: 0 16px; }
    .readout .big { font-size: 38px; }
    /* explorer controls: label above, buttons wrap instead of hiding off the edge */
    .explorer-bar { display: grid; gap: 12px; }
    .explorer-bar .field { display: grid; gap: 6px; }
    .explorer-bar .field-row { align-items: flex-start; }
    .explorer-bar .seg { display: flex; flex-wrap: wrap; overflow: visible; }
    .seg button { padding: 5px 8px; }
    .downloads li { grid-template-columns: minmax(0, 1fr); gap: 2px; }
    .downloads span { text-align: left; }
    .info div { grid-template-columns: 84px minmax(0, 1fr); gap: 10px; }
    td, th { padding-left: 8px; padding-right: 8px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; }
}
@media print {
    .bar, .site-header, .skip, .buttons, .explorer-bar, .citation .button, #explorer, .fig-tools, .to-top, dialog, #feedback { display: none !important; }
    body { font-size: 11pt; }
    .scrolly { display: block; }
    .scrolly-map { position: static; height: 100mm; }
    .step { min-height: 0; color: var(--ink); border: 0; padding: 4px 0; margin: 0; }
    .steps { padding: 0; }
    a { text-decoration: none; }
    figure, table { break-inside: avoid; }
}

/* header and summary of the trimmed page */
.kicker { font-size: 14px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 18px; font-weight: 500; }
.links { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 18px 0 0; font-size: 15px; }
.links a { font-weight: 500; }
.lede { font-size: 21px; line-height: 1.5; color: var(--ink); margin-bottom: 18px; }
@media (max-width: 560px) { .lede { font-size: 18.5px; } .basin-stats dd { font-size: 16.5px; } }

/* ---------- Site header: compact, sticky, with reading progress ---------- */
.site-header { position: sticky; top: 0; z-index: 1000; background: rgba(255, 255, 255, 0.96); border-bottom: 1px solid var(--rule); }
.site-inner { max-width: calc(var(--wide) + 40px); margin: 0 auto; padding: 0 20px; height: var(--bar-h); display: flex; align-items: center; gap: 28px; }
.site-id { font-weight: 700; font-size: 15px; text-decoration: none; white-space: nowrap; letter-spacing: -0.005em; }
.site-header .toc { margin-left: 0; flex: 1; }
.site-links { display: flex; gap: 4px; margin-left: auto; }
.site-links a { padding: 6px 10px; font-size: 14px; font-weight: 500; text-decoration: none; border-radius: 6px; transition: background-color 0.15s ease; }
.site-links a:hover { background: var(--fill); }
.toc a { transition: color 0.15s ease, background-color 0.15s ease; }
.progress { height: 2px; background: transparent; }
.progress span { display: block; height: 100%; width: 0; background: var(--ink); transform-origin: left; }
@media (max-width: 1080px) { .site-header .toc { display: none; } }
@media (max-width: 560px) { .site-inner { gap: 8px; padding: 0 12px; } .site-id { font-size: 14px; } .site-links a { padding: 6px 7px; font-size: 14px; } }

/* ---------- Figure 1: map with a catchment panel ---------- */
.map-pair { display: grid; grid-template-columns: minmax(0, 700px) minmax(0, 1fr); gap: 40px; align-items: start; }
.loc-basin { cursor: pointer; transition: fill 0.2s ease, stroke-width 0.2s ease; }
.loc-basin:hover { fill: #c9c9c6; }
.loc-basin.is-on { fill: #bcd3ee; stroke-width: 2; }
.loc-basin:focus-visible { outline: none; stroke: var(--focus); stroke-width: 2.5; }
.basin-info { border-top: 1px solid var(--ink); padding-top: 14px; font-size: 14.5px; position: sticky; top: calc(var(--bar-h) + 24px); }
.basin-info h3 { margin: 2px 0 10px; font-size: 19px; }
.bi-kicker { margin: 0; font-size: 14px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); font-weight: 500; }
.basin-info dl { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 7px 14px; margin: 0; }
.basin-info dt { color: var(--ink-3); }
.basin-info dd { margin: 0; }
.bi-hint { margin: 14px 0 0; font-size: 14px; color: var(--ink-3); }

/* ---------- Figure 2: catchment switch and key numbers ---------- */
.fig-bar { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }
.basin-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin: 0 0 18px; border-top: 1px solid var(--ink); }
.basin-stats div { padding: 10px 16px 10px 0; }
.basin-stats div + div { padding-left: 16px; border-left: 1px solid var(--rule); }
.basin-stats dt { font-size: 14px; color: var(--ink-3); }
.basin-stats dd { margin: 2px 0 0; font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
#rainchart .ch-legend { display: flex; flex-wrap: wrap; gap: 4px 20px; margin-bottom: 6px; }
#rainchart path.ch-line, #rainchart circle, #rainchart line { transition: d 0.45s ease, cy 0.45s ease, y1 0.45s ease, y2 0.45s ease; }

/* ---------- Equation 2: selectable terms ---------- */
.term { font: inherit; border: 1px solid var(--rule-2); background: var(--bg); border-radius: 6px; padding: 0 6px; cursor: pointer; transition: border-color 0.15s ease, background-color 0.15s ease; }
.term:hover { border-color: var(--ink); }
.term[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.eqx { margin: 4px 0 18px 32px; padding: 12px 0 0; border-top: 1px solid var(--rule); font-size: 15px; }
.eqx p { margin: 0 0 8px; }
.eqx-text { color: var(--ink-2); }
.eqx-bar { display: flex; height: 26px; margin: 10px 0; }
.eqx-bar div { display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 500; color: #fff; opacity: 0.45; transition: opacity 0.2s ease; overflow: hidden; white-space: nowrap; }
.eqx-bar div + div { box-shadow: inset 2px 0 0 var(--bg); }
.eqx-bar div.is-on { opacity: 1; }
.eqx-bar .s-air span { color: #111; }
.eqx-sum { font-size: 14px; color: var(--ink-2); }
.table-note { margin: 6px 0 0; }

/* ---------- Figure tools, dialogs ---------- */
.fig-tools { display: inline-flex; gap: 4px; margin-left: 8px; vertical-align: baseline; }
.tool { border: 0; background: none; padding: 0 4px; font: inherit; font-size: 14px; color: var(--ink-3); cursor: pointer; text-decoration: underline; text-decoration-color: var(--rule-2); text-underline-offset: 3px; transition: color 0.15s ease; }
.tool:hover { color: var(--ink); text-decoration-color: currentColor; }
dialog { border: 1px solid var(--rule-2); border-radius: 8px; padding: 20px 24px 24px; color: var(--ink); background: var(--bg); box-shadow: 0 12px 40px rgba(0, 0, 0, 0.14); }
dialog::backdrop { background: rgba(17, 17, 17, 0.35); }
dialog[open] { animation: dlg-in 0.18s ease-out; }
@keyframes dlg-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.viewer { width: min(1180px, calc(100vw - 32px)); max-height: calc(100vh - 32px); }
.viewer-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.viewer-title { margin: 0; font-weight: 700; font-size: 16px; }
.viewer-body svg { width: 100%; height: auto; max-height: calc(100vh - 220px); }
.viewer-body #scale, .viewer-body > div { width: 100%; }
.viewer-cap { font-size: 14.5px; color: var(--ink-2); margin: 12px 0 4px; max-width: 760px; }
.viewer-src { font-size: 14px; color: var(--ink-3); margin: 0; }
.drawer { margin: 0 0 0 auto; height: 100vh; max-height: 100vh; width: min(460px, 100vw); border-radius: 0; border-width: 0 0 0 1px; overflow-y: auto; }
.drawer[open] { animation: drawer-in 0.22s ease-out; }
@keyframes drawer-in { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.ds { margin: 0 0 18px; }
.ds div { padding: 12px 0; border-top: 1px solid var(--rule); }
.ds dt { font-weight: 700; }
.ds dd { margin: 2px 0 0; font-size: 14.5px; color: var(--ink-2); }
.ds-meta { display: block; font-size: 14px; color: var(--ink-3); margin-bottom: 3px; }

/* ---------- Feedback ---------- */
.feedback { border-top: 1px solid var(--rule); padding-top: 8px; margin-top: 56px; }
.feedback h2 { font-size: 19px; margin: 24px 0 12px; }
.reactions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.react[aria-pressed="true"] { border-color: var(--ink); background: var(--fill); }

/* ---------- Back to top ---------- */
.to-top { position: fixed; right: 20px; bottom: 20px; z-index: 900; width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid var(--rule-2); border-radius: 50%; background: var(--bg); color: var(--ink); cursor: pointer; transition: border-color 0.15s ease, transform 0.15s ease; }
.to-top:hover { border-color: var(--ink); transform: translateY(-2px); }

/* ---------- Sections fade and rise into view (off for reduced motion, set in app.js) ---------- */
.js-reveal .reveal, .js-reveal [data-reveal] { opacity: 0; transform: translateY(14px); transition: opacity 0.5s ease, transform 0.5s ease; }
.js-reveal .reveal.in, .js-reveal [data-reveal].in { opacity: 1; transform: none; }
a, .button, .seg button { transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, text-decoration-color 0.15s ease; }
.button:active, .seg button:active, .term:active { transform: translateY(1px); }

@media (max-width: 860px) {
    .map-pair { grid-template-columns: minmax(0, 1fr); gap: 16px; }
    .basin-info { position: static; }
    .basin-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .basin-stats div:nth-child(3) { padding-left: 0; border-left: 0; }
    .eqx { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
    dialog[open], .drawer[open] { animation: none; }
    .js-reveal .reveal, .js-reveal [data-reveal] { opacity: 1; transform: none; }
}

/* wide figures: drawings use the width, captions keep a reading measure */
.article > figure figcaption { max-width: 780px; }
#ratiochart, #scale { max-width: 980px; }
.eqx-p { font-size: 14px; color: var(--ink-3); border: 1px solid var(--rule-2); border-bottom: 0; height: 8px; margin-top: 18px; position: relative; }
.eqx-p { padding: 0; line-height: 0; text-indent: -9999px; }
.eqx-p.is-on { border-color: var(--ink); }
.eqx-bar { margin-top: 3px; }

/* ================= Refinement: balance, accent, type, motion ================= */
:root { --accent: #2f6fd6; --accent-ink: #1f56b0; --accent-soft: #eef4fd; --display: 'Zodiak', Georgia, 'Times New Roman', serif; }

/* one centre line: the text column is centred, wide figures centre on it, captions keep the text width */
.article > figure.wide figcaption, .article > figure figcaption { max-width: var(--main); margin-left: auto; margin-right: auto; }
.article > figure.wide > .fig-bar, .article > figure.wide > .basin-stats { max-width: none; }
header.title { text-align: center; padding: 88px 0 48px; }
header.title h1 { max-width: none; margin-left: auto; margin-right: auto; }
header.title .subtitle { margin-left: auto; margin-right: auto; }

/* justified body text with hyphenation, so both edges are even */
.article section > p, .article section li, .note p, .citation p, figcaption, .eqx-text { text-align: justify; hyphens: auto; -webkit-hyphens: auto; text-wrap: pretty; }
.article section > p.lede { text-align: left; hyphens: manual; }

/* display face for the major headings only; body stays Satoshi */
h1, .article h2, .cta-title { font-family: var(--display); font-weight: 700; letter-spacing: -0.01em; }
h1 { font-size: clamp(34px, 4.6vw, 54px); line-height: 1.08; }
.article h2 { font-size: 27px; }
.article h2 .n { font-family: var(--font); font-size: 0.7em; vertical-align: 0.12em; color: var(--accent); }
.article h3 .n { color: var(--accent); }

/* soft accent */
a { text-decoration-color: #c9d9f3; }
a:hover { text-decoration-color: var(--accent); }
.hl { color: var(--accent-ink); }
.toc a[aria-current="true"] { color: var(--accent-ink); background: var(--accent-soft); }
.toc a.toc-ex { color: var(--accent-ink); font-weight: 500; }
.progress span { background: var(--accent); }
.basin-info { border-top-color: var(--accent); }
.loc-basin.is-on { fill: #c4d8f3; }
.eq .term[aria-pressed="true"] { background: var(--accent-ink); border-color: var(--accent-ink); }
input[type="range"]::-webkit-slider-runnable-track { background: linear-gradient(to right, var(--accent-ink) var(--pct, 50%), var(--rule-2) var(--pct, 50%)); }
input[type="range"]::-moz-range-progress { background: var(--accent-ink); }
input[type="range"]::-webkit-slider-thumb { border-color: var(--accent-ink); }
.step.is-active { border-left-color: var(--accent); }
.scale-dot.is-on { box-shadow: 0 0 0 2px var(--accent-ink); }

/* summary: rain bar and three findings */
.lede { font-size: 23px; line-height: 1.45; }
.rain100 { margin: 28px 0 8px; }
.rain100-head { font-size: 14px; color: var(--ink-3); margin: 0 0 8px; }
.rain100-bar { display: flex; height: 38px; background: var(--fill); border-radius: 3px; overflow: hidden; }
.rain100-bar div { width: var(--w); display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; overflow: hidden; }
.rain100-bar div + div { box-shadow: inset 2px 0 0 var(--bg); }
.rain100-bar .s-air span { color: #111; }
.js-reveal .reveal .rain100-bar div, .js-reveal [data-reveal] .rain100-bar div { width: 0; transition: width 1.1s cubic-bezier(.2, .7, .2, 1); }
.js-reveal [data-reveal].in .rain100-bar div { width: var(--w); }
.js-reveal [data-reveal] .rain100-bar div:nth-child(2) { transition-delay: 0.25s; }
.js-reveal [data-reveal] .rain100-bar div:nth-child(3) { transition-delay: 0.5s; }
.rain100-key { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-wrap: wrap; gap: 4px 24px; font-size: 14.5px; }
.rain100-key li { display: flex; align-items: center; gap: 8px; margin: 0; }
.rain100-key i { width: 10px; height: 10px; border-radius: 2px; display: block; }
.rain100-key b { font-variant-numeric: tabular-nums; }
.rain100-note { font-size: 14px; color: var(--ink-3); margin: 6px 0 0; text-align: left; }
.findings { list-style: none; padding: 0; margin: 28px 0 14px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--rule); }
.findings li { margin: 0; padding: 16px 18px 4px 0; text-align: left; hyphens: manual; }
.findings li + li { padding-left: 18px; border-left: 1px solid var(--rule); }
.findings b { display: block; font-size: 21px; line-height: 1.2; margin-bottom: 6px; font-variant-numeric: tabular-nums; }
.findings .f-text { display: block; font-size: 14.5px; color: var(--ink-2); line-height: 1.5; text-align: left; hyphens: manual; }

/* study-area panel: catchment outline */
.bi-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.bi-shape { width: 84px; height: 84px; flex-shrink: 0; }
.bi-shape path { fill: var(--accent-soft); stroke: var(--accent-ink); stroke-width: 1.4; }
.basin-info h3, .basin-info dl, .bi-shape { transition: opacity 0.3s ease; }
.bi-hint .button.quiet { padding: 0 2px; height: auto; }

/* charts draw in when they enter view, and points follow */
.js-reveal .reveal .ch-line { stroke-dasharray: 2600; stroke-dashoffset: 2600; transition: stroke-dashoffset 1.5s ease, d 0.45s ease; }
.js-reveal .reveal.in .ch-line { stroke-dashoffset: 0; }
.js-reveal .reveal .ch-pt { opacity: 0; transition: opacity 0.4s ease 1s, cy 0.45s ease; }
.js-reveal .reveal.in .ch-pt { opacity: 1; }

/* explorer invitation */
.explore-cta { margin: 64px 0 24px; }
.cta-card { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 0; text-decoration: none; border: 1px solid #d4e1f6; border-radius: 10px; overflow: hidden; background: var(--accent-soft); }
.cta-card img { width: 100%; height: 100%; object-fit: cover; display: block; border-right: 1px solid #d4e1f6; }
.cta-text { display: flex; flex-direction: column; justify-content: center; gap: 10px; padding: 28px 30px; }
.cta-kicker { font-size: 14px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-ink); font-weight: 500; }
.cta-title { font-size: 28px; line-height: 1.15; color: var(--ink); }
.cta-body { font-size: 15px; color: var(--ink-2); line-height: 1.55; }
.cta-go { font-weight: 700; color: var(--accent-ink); margin-top: 6px; }
.explore-cta { grid-column: wide; }

/* explorer page */
.explore-page .ex-main { padding-top: 28px; }
.explore-page .ex-intro h1 { font-size: clamp(30px, 3.4vw, 40px); text-align: left; }
.explore-page .ex-intro p { text-align: left; }
.explore-page .ex-intro .back { margin: 0 0 14px; font-size: 14.5px; }
.explore-page .explorer-map { height: calc(100vh - 240px); min-height: 520px; }

/* personal note */
.note h2 { margin-top: 0; }
.note p { font-size: 17px; color: var(--ink-2); }
.note .sign { font-family: var(--display); font-size: 20px; color: var(--ink); text-align: left; }
.rc { font-size: 14px; color: var(--ink-3); font-variant-numeric: tabular-nums; margin-left: 2px; }
.rc:empty { display: none; }
.views { color: var(--ink-3); }

@media (max-width: 860px) {
    .findings { grid-template-columns: minmax(0, 1fr); }
    .findings li + li { padding-left: 0; border-left: 0; border-top: 1px solid var(--rule); }
    .cta-card { grid-template-columns: minmax(0, 1fr); }
    .cta-card img { border-right: 0; border-bottom: 1px solid #d4e1f6; max-height: 260px; }
    .article section > p, .article section li, figcaption { text-align: left; }
}
@media (max-width: 560px) { .lede { font-size: 19px; } header.title { padding-top: 52px; } }
@media (prefers-reduced-motion: reduce) {
    .rain100-bar div { width: var(--w) !important; transition: none !important; }
    .ch-line { stroke-dasharray: none !important; }
}

.site-header .toc { margin-left: auto; flex: 0 1 auto; }
.findings li { text-align: left; }
.toc a[aria-current="page"] { color: var(--accent-ink); background: var(--accent-soft); }

/* alignment pass: one centre line, even edges */
.article h2 .n, .article h3 .n { color: var(--ink); }
#ratiochart, #scale { margin-left: auto; margin-right: auto; }
.eqx { margin-left: 0; }
.explore-page .ex-intro { grid-column: wide; }
.explore-page .ex-intro p { max-width: var(--main); }
.explore-page .ex-intro h1 { margin-left: 0; }
figcaption { hyphens: manual; -webkit-hyphens: manual; }
.react-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.react-status { font-size: 14px; color: var(--accent-ink); }
.react[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); }
.react.is-other { opacity: 0.55; }
.react.pop { animation: react-pop 0.35s ease; }
@keyframes react-pop { 50% { transform: scale(1.08); } }
@media (prefers-reduced-motion: reduce) { .react.pop { animation: none; } }
.react-row { margin-bottom: 16px; }
.react-row .reactions { margin-bottom: 0; }
.explore-page .ex-intro h1 { margin-bottom: 10px; }

/* consistency with the portfolio: left-aligned text, portfolio blue */
:root { --accent: #1f5fae; }
.article section > p, .article section li, .note p, .citation p, figcaption, .eqx-text { text-align: left; hyphens: manual; -webkit-hyphens: manual; }

/* phones and tablets: title and section menu sit on two rows inside the white header; the menu fades at the right edge so it reads as scrollable */
@media (max-width: 1080px) {
  html { scroll-padding-top: calc(var(--bar-h) + 52px); }
  .site-header .site-inner { height: auto; min-height: var(--bar-h); flex-wrap: wrap; row-gap: 0; padding-top: 8px; }
  .site-header .toc { display: flex; flex: 1 0 100%; margin: 0 -12px; padding: 0 36px 6px 12px; -webkit-mask-image: linear-gradient(90deg, #000 86%, transparent); mask-image: linear-gradient(90deg, #000 86%, transparent); }
}

/* touch: sliders and checkboxes at least 24 px for a finger */
@media (pointer: coarse), (max-width: 760px) { input[type="range"] { min-height: 32px; } input[type="checkbox"] { width: 24px; height: 24px; } }

/* Leaflet's plus-lighter blend leaves light seams between map tiles at fractional zoom on a light basemap */
.leaflet-container img.leaflet-tile { mix-blend-mode: normal; }

/* Key terms: the same plain-language list as on the hydrology study */
.glossary { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(0, 2fr); gap: 0; margin: 0; border-top: 1px solid var(--rule); }
.glossary dt, .glossary dd { margin: 0; padding: 11px 0; border-bottom: 1px solid var(--rule); font-size: 15px; line-height: 1.5; }
.glossary dt { font-weight: 700; padding-right: 16px; }
.glossary dd { color: var(--ink-2); }
@media (max-width: 860px) { .glossary { grid-template-columns: 1fr; } .glossary dt { border-bottom: 0; padding-bottom: 0; } .glossary dd { padding-top: 3px; } }

/* End of the page, sized as on the hydrology study so that all six study sites end the same way */
#key-terms h2, #data-code h2 { font-size: 30px; }
.note h2, #feedback h2, h2#references, #references h2 { font-size: 26px; }
#feedback { border-top: 0; margin-top: 0; padding-top: 48px; }
#feedback h2 { margin: 8px 0 14px; }
.note { margin-top: 72px; padding-top: 28px; }
#data-code .button, #feedback .button { height: auto; min-height: 36px; padding: 6px 13px; font-size: 14px; border-radius: 8px; color: var(--ink); }
#feedback .react .rc { color: inherit; }
.refs { color: var(--ink); }
.refs li { padding-left: 1.5em; text-indent: -1.5em; margin: 0 0 9px; }
.react-note { margin: 10px 0 0; font-size: 13.5px; color: var(--ink-3); }
@media (max-width: 760px) { #key-terms h2, #data-code h2 { font-size: 27px; } #data-code .button, #feedback .button { min-height: 44px; } }
