/* Option A · Field Notebook — shared styles for the research story pages. */
:root {
  --bg: #FFF9F0; --ink: #243E35; --ink-2: #3B5148; --muted: #4A5E55; --muted-2: #5C6F66; --line: #E6DAC4; --panel: #FFFFFF; --paper-2: #F4EBDC;
  --data-bg: #F4EBDC; --data-grid: rgba(36,62,53,0.08); --data-ink: #2E6476;
  --accent: #A9533B; --accent-deco: #A9533B; --dark: #243E35; --on-dark: #FFF9F0; --on-dark-muted: #D8E2DA; --soft: #F0DEA0;
  --hilite: rgba(240,222,160,0.95); --tape-y: rgba(240,222,160,0.78); --tape-g: rgba(165,186,161,0.7);
  --map-ground: #F6EEDF; --map-line: #CDBFA6; --dot: #5E7F86; --dim: #DCD3C2; --hl: #A9533B;
  --burden-lo: #F3D5C8; --burden-hi: #A9533B;
  --risk-lo: #F6E7BE; --risk-hi: #A8701F;
  --cap-lo: #D3E2E3; --cap-hi: #2E6476;
  --out-neg: #B65A3F; --out-pos: #2E6476;
  --unc-lo: #EFE4CB; --unc-hi: #7A5C2E;
  --land: #FFFBF3; --soil-1: #E2CFAE; --soil-2: #C4A47C; --soil-3: #9C7E5C; --dry: #C98A2E;
  --veg: #6F9566; --water: #2E6476; --probe: #243E35; --plane-base: #9AA49C;
  --chart-mono: 'DM Sans', ui-sans-serif, system-ui, sans-serif; --chart-sans: 'DM Sans', ui-sans-serif, system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.6 'DM Sans', ui-sans-serif, system-ui, sans-serif; overflow-x: clip; }
a { color: var(--ink); }
a:hover { color: var(--accent); }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 32px; }
.mono { font-family: 'DM Sans', ui-sans-serif, system-ui, sans-serif; font-size: 12.5px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; }
.hand { font-family: 'Kalam', cursive; font-weight: 400; color: var(--accent); font-size: 20px; line-height: 1.25; }
.serif { font-family: 'Fraunces', Georgia, serif; }
.paper { background-image: radial-gradient(rgba(36,62,53,0.11) 1px, transparent 1.5px); background-size: 26px 26px; }
.hi { background-image: linear-gradient(transparent 58%, var(--hilite) 58%, var(--hilite) 92%, transparent 92%); }
.fig { display: inline-block; background: var(--bg); padding: 5px 10px; font-size: 12px; letter-spacing: 0.14em; font-weight: 700; text-transform: uppercase; }
.tape { position: absolute; z-index: 5; width: 112px; height: 30px; background: var(--tape-y); pointer-events: none; }

header.top { max-width: 1240px; margin: 0 auto; padding: 28px 32px 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
header.top .brand { font-family: 'Fraunces', Georgia, serif; font-style: italic; font-weight: 500; font-size: 28px; text-decoration: none; }
header.top .back { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-size: 15px; font-weight: 500; text-decoration: none; }

.hero { position: relative; padding: 64px 32px 72px; display: flex; flex-direction: column; gap: 22px; }
.hero::before { content: ''; position: absolute; z-index: -1; top: -160px; bottom: 0; left: calc(50% - 50vw); width: 100vw; background-image: radial-gradient(rgba(36,62,53,0.11) 1px, transparent 1.5px); background-size: 26px 26px; pointer-events: none; }
.hero .kicker { color: var(--muted-2); }
.hero h1 { margin: 0; font-family: 'Fraunces', Georgia, serif; font-weight: 400; font-size: clamp(48px, 7vw, 104px); line-height: 0.96; letter-spacing: -0.025em; max-width: 13ch; }
.squig { position: relative; white-space: nowrap; }
.squig svg { position: absolute; left: -2%; bottom: -0.14em; width: 104%; height: 0.3em; overflow: visible; }
.hero .q { margin: 0; font-family: 'Fraunces', Georgia, serif; font-style: italic; font-size: clamp(23px, 2.5vw, 33px); line-height: 1.25; color: var(--ink-2); max-width: 32ch; }
.hero .lede { margin: 0; font-size: 19px; line-height: 1.65; color: var(--muted); max-width: 62ch; }
.meta { margin: 14px 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 18px 32px; border-top: 1.5px solid var(--ink); padding-top: 18px; }
.meta dt { color: var(--muted-2); }
.meta dd { margin: 4px 0 0; font-size: 15px; line-height: 1.5; }
.scroll-cue { display: inline-flex; align-items: center; gap: 10px; margin-top: 6px; }

.scrolly { position: relative; max-width: 1480px; margin: 0 auto; padding: 32px 32px 0; display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 9fr); column-gap: 52px; }
.steps { grid-column: 1; grid-row: 1; }
.stage-wrap { grid-column: 2; grid-row: 1; position: sticky; top: 0; height: 100vh; align-self: start; display: flex; align-items: center; }
.frame { position: relative; width: 100%; background: var(--panel); padding: 10px; box-shadow: 0 1px 2px rgba(36,62,53,0.08), 0 22px 44px -20px rgba(36,62,53,0.38); }
.frame .tape.t1 { top: -15px; left: 9%; transform: rotate(-4deg); }
.frame .tape.t2 { top: -13px; right: 8%; transform: rotate(5deg); background: var(--tape-g); }
.stage { position: relative; width: 100%; height: min(78vh, 700px); background-color: var(--map-ground); background-image: radial-gradient(rgba(36,62,53,0.10) 1px, transparent 1.5px); background-size: 26px 26px; overflow: hidden; }
.stage canvas { display: block; width: 100%; height: 100%; }
.stage .status { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--muted); pointer-events: none; }
.legend { position: absolute; left: 14px; top: 14px; z-index: 2; display: flex; flex-direction: column; gap: 8px; background: color-mix(in srgb, var(--panel) 92%, transparent); border: 1px solid var(--line); border-radius: 4px; padding: 12px 14px; max-width: min(320px, calc(100% - 28px)); pointer-events: none; box-shadow: 0 10px 22px -18px rgba(36,62,53,0.5); }
.legend .title { font-weight: 600; font-size: 15px; line-height: 1.3; }
.legend .ramp { height: 10px; border-radius: 5px; }
.legend .ends { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); }
.legend .keys { display: flex; flex-direction: column; gap: 5px; font-size: 13px; line-height: 1.35; }
.legend .keys span { display: flex; align-items: center; gap: 8px; }
.legend .keys i { width: 12px; height: 12px; border-radius: 3px; flex: none; }
.legend .note { font-size: 13px; line-height: 1.45; color: var(--muted); }
.stage-foot { position: absolute; left: 14px; right: 14px; bottom: 12px; z-index: 2; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 6px 14px; color: var(--muted-2); pointer-events: none; }
.stage-foot .hand { font-size: 18px; }
.labels span { position: absolute; z-index: 3; transform: translate(-50%, calc(-100% - 10px)); background: var(--dark); color: var(--on-dark); font-size: 12px; line-height: 1.35; padding: 6px 9px; border-radius: 6px; white-space: nowrap; pointer-events: none; box-shadow: 0 8px 20px -10px rgba(0,0,0,0.5); }
.labels span b { display: block; font-size: 13px; }
.labels span.below { transform: translate(-50%, 10px); }
.labels span.code { background: transparent; color: var(--ink); box-shadow: none; padding: 0; font: 700 10.5px/1 'DM Sans', system-ui, sans-serif; letter-spacing: 0.08em; transform: translate(-50%, calc(-100% - 7px)); text-shadow: 0 0 3px var(--map-ground), 0 0 3px var(--map-ground), 0 0 2px var(--map-ground); }
.tip { position: absolute; z-index: 4; display: none; pointer-events: none; background: var(--dark); color: var(--on-dark); border-radius: 8px; padding: 9px 11px; font-size: 13px; line-height: 1.4; max-width: 280px; transform: translate(14px, -50%); box-shadow: 0 10px 28px -12px rgba(0,0,0,0.55); }
.tip b { display: block; font-size: 14px; }
.tip .sub { color: var(--on-dark-muted); }

.step { min-height: 100vh; display: flex; align-items: center; padding: 12vh 0; }
.step .card { max-width: 470px; display: flex; flex-direction: column; gap: 14px; opacity: 0.35; transition: opacity 0.4s; }
.step.is-active .card { opacity: 1; }
.step .kicker { color: var(--muted-2); }
.step h2 { margin: 0; font-family: 'Fraunces', Georgia, serif; font-weight: 400; font-size: clamp(30px, 3vw, 44px); line-height: 1.08; letter-spacing: -0.012em; }
.step p { margin: 0; color: var(--muted); }
.step b, .step strong { color: var(--ink); font-weight: 600; background-image: linear-gradient(transparent 58%, var(--hilite) 58%, var(--hilite) 92%, transparent 92%); }
.step .src { font-size: 13px; color: var(--muted-2); }
.step .hand { display: flex; align-items: flex-start; gap: 6px; margin-top: 2px; }
.step .hand svg { width: 34px; height: 28px; flex: none; transform: translateY(2px); }
.methods { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.methods .bar { display: flex; height: 16px; border-radius: 3px; overflow: hidden; }
.methods .bar span { display: block; height: 100%; }
.methods ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 14px; font-size: 13px; color: var(--muted); }
.methods li { display: flex; align-items: baseline; gap: 8px; }
.methods li i { width: 10px; height: 10px; border-radius: 2px; flex: none; transform: translateY(1px); }

/* Small charts inside step cards (drought story). */
.vbar { display: flex; flex-direction: column; gap: 8px; margin-top: 2px; }
.vbar .bar { display: flex; height: 16px; border-radius: 3px; overflow: hidden; }
.vbar .bar span { display: block; height: 100%; }
.vbar ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: var(--muted); }
.vbar li { display: flex; align-items: baseline; gap: 8px; }
.vbar li i { width: 10px; height: 10px; border-radius: 2px; flex: none; transform: translateY(1px); }
.vbar li b { background: none; font-variant-numeric: tabular-nums; }
.pairs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 2px; }
.pairs figure { margin: 0; display: flex; flex-direction: column; gap: 7px; }
.pairs figcaption { font-weight: 600; font-size: 14px; }
.pairs .row { display: grid; grid-template-columns: 62px minmax(0, 1fr); align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.pairs .track { height: 12px; background: color-mix(in srgb, var(--line) 70%, transparent); border-radius: 3px; overflow: hidden; }
.pairs .track span { display: block; height: 100%; border-radius: 3px; }
.pairs .val { font-variant-numeric: tabular-nums; color: var(--ink); font-weight: 600; }
.dotplot svg { display: block; width: 100%; height: auto; overflow: visible; }
.dotplot text { font: 12px 'DM Sans', system-ui, sans-serif; fill: var(--muted); }
.dotplot .t { font-size: 11px; font-variant-numeric: tabular-nums; }
.rmse { display: flex; flex-direction: column; gap: 9px; margin-top: 2px; }
.rmse .row { display: grid; grid-template-columns: 96px minmax(0, 1fr) 46px; align-items: center; gap: 10px; font-size: 14px; }
.rmse .track { position: relative; height: 14px; background: color-mix(in srgb, var(--line) 70%, transparent); border-radius: 3px; }
.rmse .track span { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; }
.rmse .med { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--ink); }
.rmse .num { font-variant-numeric: tabular-nums; font-weight: 600; text-align: right; }
.rmse .foot { font-size: 12.5px; color: var(--muted); }

section.block { padding: 112px 0 0; }
.block-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 10px 24px; border-top: 1.5px solid var(--ink); padding-top: 18px; margin-bottom: 32px; }
.block-head h2 { margin: 0; font-family: 'Fraunces', Georgia, serif; font-weight: 400; font-size: clamp(34px, 4vw, 54px); line-height: 1.04; letter-spacing: -0.01em; max-width: 22ch; }
.block-head .mono { color: var(--muted-2); }
.block-head .hand { font-size: 22px; }
.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(440px, 100%), 1fr)); background: var(--panel); box-shadow: 0 1px 2px rgba(36,62,53,0.08), 0 18px 36px -24px rgba(36,62,53,0.45); }
.layer-data { background-color: var(--data-bg); background-image: linear-gradient(var(--data-grid) 1px, transparent 1px), linear-gradient(90deg, var(--data-grid) 1px, transparent 1px); background-size: 24px 24px; padding: 32px; display: flex; flex-direction: column; gap: 16px; color: var(--data-ink); }
.layer-story { padding: 32px; display: flex; flex-direction: column; gap: 18px; }
.layer-story .kicker { color: var(--accent); }
.layer-data .kicker { color: var(--data-ink); }
.big { font-family: 'Fraunces', Georgia, serif; font-size: clamp(56px, 6.4vw, 92px); font-weight: 400; letter-spacing: -0.03em; line-height: 0.9; }
.pull { margin: 0; font-family: 'Fraunces', Georgia, serif; font-style: italic; font-size: clamp(24px, 2.4vw, 34px); line-height: 1.22; letter-spacing: -0.01em; }
.src { font-size: 13px; color: var(--muted); }
.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr)); gap: 18px; }
.chart { display: flex; flex-direction: column; gap: 8px; margin: 0; }
.chart canvas { width: 100%; aspect-ratio: 1 / 1; background: var(--panel); border-radius: 4px; display: block; }
.chart.wide canvas { aspect-ratio: 16 / 7; }
.chart figcaption { font-size: 13px; line-height: 1.45; }
.range { display: flex; flex-direction: column; gap: 8px; }
.range .track { position: relative; height: 40px; }
.range .line { position: absolute; left: 0; right: 0; top: 19px; height: 2px; background: var(--line); }
.range .span { position: absolute; top: 12px; height: 16px; background: color-mix(in srgb, var(--accent-deco) 22%, transparent); border-left: 2px solid var(--accent-deco); border-right: 2px solid var(--accent-deco); }
.range .pt { position: absolute; top: 10px; width: 20px; height: 20px; margin-left: -10px; border-radius: 50%; background: var(--accent-deco); border: 3px solid var(--panel); }
.range .ticks { display: flex; justify-content: space-between; color: var(--muted); }

.cards3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); gap: 22px; }
.stat { position: relative; background: var(--panel); padding: 26px; display: flex; flex-direction: column; gap: 10px; box-shadow: 0 1px 2px rgba(36,62,53,0.08), 0 16px 32px -22px rgba(36,62,53,0.5); }
.stat:nth-child(odd) { transform: rotate(-0.6deg); }
.stat:nth-child(even) { transform: rotate(0.5deg); }
.stat .big { color: var(--data-ink); font-size: clamp(52px, 5vw, 76px); }
.stat p { margin: 0; color: var(--muted); font-size: 16px; }
.stat .tag { color: var(--accent); }

.log { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.log li { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 6px 24px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.log .status { color: var(--accent); padding-top: 4px; }
.log .status.mine { color: var(--data-ink); }
.log p { margin: 0; font-size: 18px; line-height: 1.55; }
.log p span { display: block; font-size: 14px; color: var(--muted); margin-top: 4px; }

.fine { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(360px, 100%), 1fr)); gap: 32px; align-items: start; }
.fine details { border-top: 1px solid var(--line); padding: 14px 0; }
.fine summary { cursor: pointer; font-weight: 600; min-height: 32px; display: flex; align-items: center; }
.fine ul { margin: 10px 0 0; padding-left: 18px; color: var(--muted); font-size: 15px; }
.fine li + li { margin-top: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chips span { font-size: 13px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); }
.chips .full { background: var(--data-ink); color: var(--panel); border-color: var(--data-ink); }
.chips .desc { background: var(--data-bg); color: var(--data-ink); }
.chips .none { color: var(--muted); text-decoration: line-through; }
.table { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 14px; }
.table th, .table td { text-align: left; padding: 7px 8px 7px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { color: var(--muted); font-weight: 500; }

.dark { background: var(--dark); color: var(--on-dark); margin-top: 112px; }
.dark .wrap { padding-top: 96px; padding-bottom: 96px; display: flex; flex-direction: column; gap: 28px; }
.dark .pull { font-size: clamp(30px, 3.6vw, 50px); font-style: normal; font-weight: 300; max-width: 26ch; }
.dark p { margin: 0; color: var(--on-dark-muted); max-width: 70ch; }
.dark .mono { color: var(--soft); }
.dark .hand { color: var(--soft); font-size: 22px; }
.next { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr)); gap: 22px 32px; }
.next li { border-top: 1px solid color-mix(in srgb, var(--on-dark) 30%, transparent); padding-top: 14px; color: var(--on-dark); font-size: 17px; line-height: 1.5; }
.next li span { display: block; margin-bottom: 6px; font-family: 'Kalam', cursive; font-size: 20px; color: var(--soft); }

.cta { position: relative; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px 40px; padding: 40px; background: var(--paper-2); border: 1px solid var(--line); }
.cta .tape { top: -14px; left: 7%; transform: rotate(-4deg); }
.cta-text { display: flex; flex-direction: column; gap: 10px; max-width: 58ch; }
.cta .kicker { color: var(--muted-2); }
.cta h2 { margin: 0; font-family: 'Fraunces', Georgia, serif; font-weight: 400; font-size: clamp(34px, 4vw, 52px); line-height: 1.02; letter-spacing: -0.015em; }
.cta p { margin: 0; color: var(--muted); }
.cta-btn { display: inline-flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 26px; border-radius: 999px; background: var(--dark); color: var(--on-dark); font-weight: 600; text-decoration: none; }
.cta-btn:hover { color: var(--on-dark); opacity: 0.92; }
.credits { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr)); gap: 28px; }
.credit-card { position: relative; background: var(--panel); padding: 28px; display: flex; flex-direction: column; gap: 12px; box-shadow: 0 1px 2px rgba(36,62,53,0.08), 0 16px 32px -22px rgba(36,62,53,0.5); }
.credit-card:nth-child(odd) { transform: rotate(-0.5deg); }
.credit-card:nth-child(even) { transform: rotate(0.6deg); }
.credit-card h3 { margin: 0; font-family: 'Fraunces', Georgia, serif; font-weight: 500; font-size: 27px; line-height: 1.12; }
.credit-card p { margin: 0; color: var(--muted); font-size: 16px; }
.credit-card ul { margin: 0; padding-left: 18px; color: var(--muted); font-size: 15px; }
.credit-card li + li { margin-top: 6px; }
.credit-card .kicker { color: var(--muted-2); }
.ph { font-size: 0.95em; color: var(--accent); border-bottom: 1px dashed var(--accent); }
footer.end { max-width: 1240px; margin: 0 auto; padding: 72px 32px 120px; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 16px; color: var(--muted); }
footer.end .hand { font-size: 22px; }

.review-bar { position: fixed; right: 16px; bottom: 16px; z-index: 9999; display: flex; align-items: center; gap: 2px; padding: 5px; border-radius: 999px; background: rgba(17,17,17,0.88); box-shadow: 0 8px 24px rgba(0,0,0,0.28); font: 600 13px/1 system-ui, -apple-system, "Segoe UI", sans-serif; }
.review-bar span { color: #C9C9C9; font-weight: 500; padding: 0 8px 0 10px; }
.review-bar a { color: #FFFFFF; text-decoration: none; min-width: 38px; height: 38px; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; }
.review-bar a:hover { color: #FFFFFF; background: rgba(255,255,255,0.16); }
.review-bar a[aria-current="page"] { background: #FFFFFF; color: #111111; }
.in-frame .review-bar { display: none; }

@media (max-width: 979px) {
  .scrolly { display: flex; flex-direction: column; padding: 0 16px; }
  .stage-wrap { order: -1; position: sticky; top: 0; height: 56vh; z-index: 2; padding: 10px 0 8px; background: var(--bg); }
  .frame { height: 100%; padding: 6px; }
  .frame .tape { display: none; }
  .stage { height: 100%; }
  .steps { position: relative; z-index: 1; padding-bottom: 30vh; }
  .step { min-height: 70vh; align-items: flex-start; padding: 4vh 0 0; }
  .step .card { background: var(--panel); border-radius: 4px; padding: 18px; box-shadow: 0 1px 2px rgba(36,62,53,0.08), 0 14px 30px -18px rgba(36,62,53,0.45); opacity: 1; }
  .legend { padding: 8px 10px; }
  .legend .note, .legend .keys { display: none; }
  .stage-foot .hand { display: none; }
  .wrap, .hero, header.top { padding-left: 16px; padding-right: 16px; }
  .log li { grid-template-columns: 1fr; }
  .review-bar span { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .step .card { transition: none; }
}
