/* Groundwater recharge hub. Light editorial surface, house palette. */
:root {
  --ink: #1b222c;
  --ink-soft: #3d4756;
  --muted: #5d6775;
  --line: #dde2e8;
  --line-soft: #eaeef2;
  --page-bg: #f4f6f8;
  --surface: #ffffff;
  --surface-alt: #f8fafb;
  --accent: #14507d;
  --accent-mid: #2f7ab0;
  --accent-wash: #eaf2f8;
  --open: #1a7f37;
  --closed: #8a6d1a;
  --wet: #2f7ab0;
  --dry: #b06a24;
  --earth: #8c7248;
  --aquifer: #cfe0ec;
  --shadow-sm: 0 1px 2px rgba(20, 34, 48, .06);
  --shadow: 0 2px 10px rgba(20, 34, 48, .07);
  --shadow-lg: 0 18px 50px rgba(15, 30, 45, .22);
  --radius: 10px;
  --ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --serif: Georgia, "Iowan Old Style", "Times New Roman", serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  font-family: var(--serif);
  color: var(--ink);
  background: var(--page-bg);
  -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none;
  -webkit-font-smoothing: antialiased;
}
body.locked { overflow: hidden; }

/* ---------- header ---------- */

.hero {
  background:
    radial-gradient(120% 150% at 88% -30%, #dceaf4 0%, rgba(220,234,244,0) 62%),
    linear-gradient(180deg, #ffffff 0%, #fbfcfd 100%);
  border-bottom: 1px solid var(--line);
  padding: 26px 26px 20px;
  position: relative;
  overflow: hidden;
}
.hero-inner { max-width: 1180px; margin: 0 auto; display: flex; align-items: flex-end; gap: 24px; flex-wrap: wrap; }
.hero-text { flex: 1 1 420px; min-width: 0; }
.hero h1 {
  margin: 0; font-size: 30px; line-height: 1.18; font-weight: 600; letter-spacing: -.012em;
}
.hero .sub { font-size: 15px; color: var(--muted); margin-top: 8px; line-height: 1.5; max-width: 620px; }
.hero-rule {
  max-width: 1180px; margin: 18px auto 0; height: 3px; border-radius: 2px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-mid) 38%, var(--aquifer) 78%, #f0e4cf 100%);
}

.btn-101 {
  font-family: var(--ui); font-size: 13.5px; font-weight: 600; letter-spacing: .01em;
  color: #fff; background: var(--accent); border: 1px solid var(--accent);
  border-radius: 999px; padding: 9px 18px; cursor: pointer; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 8px; box-shadow: var(--shadow-sm);
  transition: background .15s ease, transform .15s ease;
}
.btn-101:hover { background: #10456c; transform: translateY(-1px); }
.btn-101:focus-visible { outline: 3px solid var(--accent-mid); outline-offset: 2px; }
.btn-101 svg { display: block; }

/* ---------- nav ---------- */

#topnav {
  position: sticky; top: 0; z-index: 60;
  background: rgba(255,255,255,.94);
  backdrop-filter: saturate(150%) blur(8px);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.nav-inner {
  max-width: 1180px; margin: 0 auto; padding: 0 26px;
  display: flex; gap: 4px; flex-wrap: wrap; align-items: stretch;
}
#topnav a {
  font-family: var(--ui); font-size: 13px; letter-spacing: .01em;
  color: var(--ink-soft); text-decoration: none;
  padding: 12px 11px 10px; border-bottom: 2px solid transparent;
  transition: color .12s ease, border-color .12s ease;
}
#topnav a:hover { color: var(--accent); }
#topnav a.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }

/* ---------- layout ---------- */

main { max-width: 1180px; margin: 0 auto; padding: 26px 26px 40px; }
section { margin-bottom: 40px; scroll-margin-top: 62px; }

.eyebrow {
  font-family: var(--ui); font-size: 11px; font-weight: 700; letter-spacing: .13em;
  text-transform: uppercase; color: var(--accent-mid); margin-bottom: 6px;
}
h2 {
  font-size: 23px; line-height: 1.25; margin: 0 0 14px; font-weight: 600; letter-spacing: -.008em;
  padding-bottom: 10px; border-bottom: 1px solid var(--line);
}

.prose { font-size: 16px; line-height: 1.68; max-width: 74ch; color: var(--ink-soft); }
.prose p { margin: 0 0 13px; }
.prose p:last-child { margin-bottom: 0; }
.prose a { color: var(--accent); }
.prose strong { color: var(--ink); font-weight: 600; }

.lede { font-size: 17.5px; line-height: 1.6; color: var(--ink); }

/* ---------- conditions tiles ---------- */

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.tile {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 17px 15px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
}
.tile::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent-mid);
}
.tile .k {
  font-family: var(--ui); font-size: 11px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .09em;
}
.tile .v { font-size: 25px; margin-top: 7px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.tile .v.small { font-size: 16px; line-height: 1.4; }
.tile .v .open { color: var(--open); font-weight: 600; }
.tile .v .closed { color: var(--closed); font-weight: 600; }

/* ---------- panels ---------- */

.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px 20px 20px; margin-top: 18px;
}
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.panel-title { font-size: 15.5px; font-weight: 600; }
.panel-sub { font-family: var(--ui); font-size: 12px; color: var(--muted); }
.panel-note {
  font-family: var(--ui); font-size: 11.5px; color: var(--muted); line-height: 1.55;
  margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line-soft);
}

/* ---------- chart ---------- */

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 4px; }
.chip {
  font-family: var(--ui); font-size: 12px; color: var(--ink-soft);
  background: var(--surface-alt); border: 1px solid var(--line);
  border-radius: 999px; padding: 5px 12px; cursor: pointer;
  transition: all .12s ease;
}
.chip:hover { border-color: var(--accent-mid); color: var(--accent); }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.chip:focus-visible { outline: 3px solid var(--accent-mid); outline-offset: 2px; }

.chart-wrap { margin-top: 14px; }
.chart-wrap svg { display: block; width: 100%; height: auto; font-family: var(--ui); }
.legend { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 10px; font-family: var(--ui); font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }

.readout { font-family: var(--ui); font-size: 12.5px; color: var(--ink-soft); margin-top: 10px; min-height: 18px; }
.readout b { font-variant-numeric: tabular-nums; }

/* ---------- static fallback bars ---------- */

.chart-row { display: flex; align-items: center; margin: 9px 0; gap: 12px; }
.chart-label { flex: 0 0 160px; font-family: var(--ui); font-size: 12.5px; color: var(--muted); text-align: right; }
.chart-bars { flex: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.bar { display: block; height: 19px; border-radius: 3px; position: relative; min-width: 46px; }
.bar.wet { background: var(--wet); }
.bar.dry { background: var(--dry); }
.bar i {
  position: absolute; left: 8px; top: 0; line-height: 19px; font-style: normal;
  font-size: 11.5px; color: #fff; white-space: nowrap; font-family: var(--ui);
}

/* ---------- maps ---------- */

.map-frame {
  width: 100%; height: 620px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow); display: block;
}
.map-frame-short { height: 470px; }
.map-links {
  margin: 12px 0 0; font-family: var(--ui); font-size: 12.5px;
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
}
.map-links a[data-hash], .map-links a[href] {
  color: var(--accent); text-decoration: none; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface);
  border-radius: 999px; padding: 5px 12px; transition: all .12s ease;
}
.map-links a:hover { border-color: var(--accent-mid); background: var(--accent-wash); }
.map-caption { flex: 1 1 100%; color: var(--muted); line-height: 1.55; margin-top: 4px; }

/* ---------- cards ---------- */

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 16px; margin-top: 18px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 17px 19px 19px; display: block; text-decoration: none; color: var(--ink);
  box-shadow: var(--shadow-sm); transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.card:hover { border-color: var(--accent-mid); box-shadow: var(--shadow); transform: translateY(-2px); }
.card .t { font-size: 16.5px; font-weight: 600; color: var(--accent); line-height: 1.3; }
.card p { font-size: 13.5px; color: var(--muted); margin: 8px 0 0; line-height: 1.6; font-family: var(--ui); }

/* ---------- table ---------- */

.table-wrap { overflow-x: auto; margin: 18px 0 0; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); background: var(--surface); }
table.pathways { border-collapse: collapse; width: 100%; min-width: 720px; font-family: var(--ui); font-size: 13px; }
table.pathways th, table.pathways td { padding: 11px 13px; text-align: left; vertical-align: top; line-height: 1.55; border-bottom: 1px solid var(--line-soft); }
table.pathways th {
  background: var(--surface-alt); font-size: 11px; text-transform: uppercase;
  letter-spacing: .08em; color: var(--muted); font-weight: 700;
  border-bottom: 1px solid var(--line); position: sticky; top: 0;
}
table.pathways tbody tr:last-child td { border-bottom: none; }
table.pathways tbody tr:hover { background: var(--accent-wash); }
table.pathways td:first-child { font-weight: 600; color: var(--ink); }

/* ---------- cost figures ---------- */

.figs { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin-top: 18px; }
.fig {
  background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--accent-mid);
  border-radius: var(--radius); padding: 14px 17px 15px; box-shadow: var(--shadow-sm);
}
.fig .n { font-size: 25px; font-variant-numeric: tabular-nums; line-height: 1.1; color: var(--accent); }
.fig .l { font-family: var(--ui); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); margin-top: 8px; }
.fig .d { font-family: var(--ui); font-size: 12.5px; color: var(--ink-soft); margin-top: 7px; line-height: 1.55; }
.fig.warm { border-left-color: var(--dry); }
.fig.warm .n { color: var(--dry); }

/* ---------- key terms ---------- */

.terms-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 0 34px; margin-top: 18px; }
dl.terms { margin: 0; font-size: 14.5px; line-height: 1.62; }
dl.terms dt { font-weight: 700; margin-top: 15px; color: var(--ink); font-size: 15px; }
dl.terms dt:first-child { margin-top: 0; }
dl.terms dd { margin: 4px 0 0; color: var(--ink-soft); }

/* ---------- footer ---------- */

footer {
  border-top: 1px solid var(--line); background: var(--surface);
  padding: 20px 26px 30px; font-family: var(--ui); font-size: 12px; color: var(--muted); line-height: 1.75;
}
.footer-inner { max-width: 1180px; margin: 0 auto; }
footer b { color: var(--ink-soft); }
footer a { color: var(--accent); text-decoration: none; }
footer a:hover { text-decoration: underline; }
.disclaimer { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line-soft); }

/* ---------- Groundwater 101 overlay ---------- */

#primer { position: fixed; inset: 0; z-index: 200; display: none; }
#primer.open { display: block; }
.primer-scrim { position: absolute; inset: 0; background: rgba(16, 30, 44, .58); backdrop-filter: blur(3px); }
.primer-dialog {
  position: relative; max-width: 940px; margin: 4vh auto; max-height: 92vh;
  background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; overflow: hidden;
  animation: primer-in .28s cubic-bezier(.2,.7,.3,1);
}
@keyframes primer-in { from { opacity: 0; transform: translateY(14px) scale(.99); } to { opacity: 1; transform: none; } }

.primer-top {
  padding: 20px 26px 16px; border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #f7fafc 0%, #ffffff 100%);
  display: flex; align-items: flex-start; justify-content: space-between; gap: 18px;
}
.primer-top h2 { border: none; padding: 0; margin: 0; font-size: 22px; }
.primer-top .k {
  font-family: var(--ui); font-size: 11px; font-weight: 700; letter-spacing: .13em;
  text-transform: uppercase; color: var(--accent-mid); margin-bottom: 5px;
}
.primer-close {
  font-family: var(--ui); font-size: 20px; line-height: 1; color: var(--muted);
  background: none; border: 1px solid var(--line); border-radius: 8px;
  width: 34px; height: 34px; cursor: pointer; flex: none;
}
.primer-close:hover { color: var(--ink); border-color: var(--muted); }
.primer-close:focus-visible { outline: 3px solid var(--accent-mid); outline-offset: 2px; }

.primer-body { overflow-y: auto; padding: 22px 26px 8px; }
.primer-step { display: none; }
.primer-step.on { display: block; animation: step-in .22s ease; }
@keyframes step-in { from { opacity: 0; transform: translateX(8px); } to { opacity: 1; transform: none; } }
.primer-step h3 { font-size: 19px; margin: 0 0 10px; font-weight: 600; }
.primer-step .prose { font-size: 15.5px; max-width: none; }
.primer-figure {
  margin: 16px 0 4px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface-alt); padding: 10px;
}
.primer-figure svg { display: block; width: 100%; height: auto; font-family: var(--ui); }
.primer-figcap { font-family: var(--ui); font-size: 11.5px; color: var(--muted); margin-top: 8px; line-height: 1.55; }

.primer-jump {
  display: inline-flex; align-items: center; gap: 7px; margin-top: 16px;
  font-family: var(--ui); font-size: 13px; font-weight: 600; color: var(--accent);
  background: var(--accent-wash); border: 1px solid #cfe0ee; border-radius: 999px;
  padding: 7px 15px; cursor: pointer; text-decoration: none;
}
.primer-jump:hover { background: #dceaf4; }
.primer-jump:focus-visible { outline: 3px solid var(--accent-mid); outline-offset: 2px; }

.primer-foot {
  border-top: 1px solid var(--line); padding: 14px 26px; background: var(--surface-alt);
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
}
.primer-dots { display: flex; gap: 7px; }
.primer-dots button {
  width: 9px; height: 9px; border-radius: 50%; border: none; padding: 0; cursor: pointer;
  background: #c9d3dc; transition: all .15s ease;
}
.primer-dots button[aria-current="true"] { background: var(--accent); width: 24px; border-radius: 999px; }
.primer-dots button:focus-visible { outline: 3px solid var(--accent-mid); outline-offset: 3px; }
.primer-actions { display: flex; align-items: center; gap: 10px; font-family: var(--ui); }
.pbtn {
  font-family: var(--ui); font-size: 13.5px; font-weight: 600; border-radius: 8px;
  padding: 9px 17px; cursor: pointer; border: 1px solid var(--line); background: var(--surface); color: var(--ink-soft);
}
.pbtn:hover { border-color: var(--muted); color: var(--ink); }
.pbtn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.pbtn.primary:hover { background: #10456c; }
.pbtn:disabled { opacity: .4; cursor: default; }
.pbtn:focus-visible { outline: 3px solid var(--accent-mid); outline-offset: 2px; }
.pbtn.link { border: none; background: none; color: var(--muted); font-weight: 500; padding: 9px 4px; text-decoration: underline; }
.pbtn.link:hover { color: var(--ink); }

/* ---------- responsive ---------- */

@media (max-width: 820px) {
  .hero { padding: 20px 18px 16px; }
  .hero h1 { font-size: 24px; }
  .hero-inner { align-items: flex-start; }
  .nav-inner, main { padding-left: 18px; padding-right: 18px; }
  h2 { font-size: 20px; }
  .prose { font-size: 15.5px; }
  .map-frame { height: 460px; }
  .map-frame-short { height: 360px; }
  .chart-label { flex-basis: 96px; font-size: 11.5px; }
  .primer-dialog { margin: 0; max-height: 100vh; height: 100vh; border-radius: 0; }
  .primer-body { padding: 18px 18px 6px; }
  .primer-top, .primer-foot { padding-left: 18px; padding-right: 18px; }
  .primer-actions { flex: 1 1 100%; justify-content: flex-end; }
}

/* ---------- two-column split with a figures rail ---------- */

.split { display: grid; grid-template-columns: minmax(0, 1fr) 322px; gap: 36px; align-items: start; }
.split .prose { max-width: none; }
.rail { display: flex; flex-direction: column; gap: 12px; }
.rail-head {
  font-family: var(--ui); font-size: 11px; font-weight: 700; letter-spacing: .13em;
  text-transform: uppercase; color: var(--muted); padding-bottom: 8px; border-bottom: 1px solid var(--line);
}
.stat {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 13px 16px 14px; box-shadow: var(--shadow-sm);
}
.stat .n { font-size: 22px; line-height: 1.15; color: var(--accent); font-variant-numeric: tabular-nums; }
.stat.warm .n { color: var(--dry); }
.stat .l { font-family: var(--ui); font-size: 12.5px; color: var(--ink-soft); line-height: 1.5; margin-top: 6px; }
.stat .s { font-family: var(--ui); font-size: 11px; color: var(--muted); margin-top: 6px; }

@media (max-width: 1000px) {
  .split { grid-template-columns: 1fr; gap: 20px; }
  .rail { flex-direction: row; flex-wrap: wrap; }
  .rail-head { flex: 1 1 100%; }
  .stat { flex: 1 1 210px; }
}

/* print: one continuous document, no chrome (Session 2026-09-10) */
@media print{
  body{background:#fff;color:#000}
  .rt-nav,nav,.toc,.hero-nav,button,.btn,iframe{display:none!important}
  section,article,.card{break-inside:avoid;page-break-inside:avoid}
  a{color:#000;text-decoration:none}
  a[href^="http"]:after{content:" (" attr(href) ")";font-size:.85em;color:#444}
  *{-webkit-user-select:text!important;user-select:text!important}
}

/* section note beside an h2 (Session 2026-09-10) */
.h2-note{display:inline-block;margin-left:10px;font-size:.55em;font-weight:500;color:#5b6b7a;vertical-align:middle;letter-spacing:.02em}
