/* TERRA Lab · Where the rain goes. Forest scope around a paper-toned relief plate; gold is the deed line, water is the flight's blue. Square corners. */
:root {
  --forest-deep: #161e19; --forest: #1f2a23; --sand: #e8e2d6; --sand-2: rgba(232,226,214,.8);
  --sand-3: rgba(232,226,214,.62); --line: rgba(232,226,214,.18);
  --gold: #c6a76a; --water: #3e6276;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: Inter, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --descend: cubic-bezier(.22,1,.36,1);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--forest-deep); color: var(--sand); font: 400 14px/1.5 var(--sans); }
button { font: inherit; color: inherit; }
a { color: var(--gold); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.mono { font-family: var(--mono); }
.micro { margin: 0; font: 500 12px var(--mono); letter-spacing: .12em; color: var(--sand-3); text-transform: uppercase; }

.bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 6px 20px; border-bottom: 1px solid var(--line); }
.mark { font-weight: 500; letter-spacing: .22em; font-size: 15px; }
.lablink { display: inline-flex; align-items: center; min-height: 44px; color: var(--sand); text-decoration: none; }
.lablink span { margin-left: .5em; letter-spacing: .08em; font-weight: 400; color: var(--gold); }
.lablink:hover, .lablink:hover span { color: var(--gold); text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.exp { font-size: 11px; letter-spacing: .12em; color: var(--gold); border: 1px solid rgba(198,167,106,.45); padding: 2px 7px; }

/* three blocks: intro and reading beside the plate on a wide screen, stacked in reading order on a phone */
.rain { display: grid; gap: 20px 28px; padding: 24px 20px 40px; max-width: 1280px; margin: 0 auto;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 380px); grid-template-areas: "stage intro" "stage read"; align-items: start; }
.intro { grid-area: intro; display: flex; flex-direction: column; gap: 12px; }
.stagecol { grid-area: stage; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.read { grid-area: read; display: flex; flex-direction: column; gap: 16px; }
@media (max-width: 860px) {
  .rain { grid-template-columns: minmax(0, 1fr); grid-template-areas: "intro" "stage" "read"; padding: 16px 16px 32px; }
}

.eyebrow { margin: 0; font: 500 11px var(--mono); letter-spacing: .12em; color: var(--gold); text-transform: uppercase; }
h1 { margin: 0; font: 300 34px/1.1 var(--serif); letter-spacing: -.018em; }
.lede { margin: 0; font-size: 15px; line-height: 1.65; color: var(--sand-2); max-width: 44ch; }

.lands { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: 4px; }
.land { min-height: 52px; padding: 8px 10px; text-align: left; background: transparent; border: 1px solid var(--line); cursor: pointer; transition: border-color .18s var(--descend), background-color .18s var(--descend); }
.land:hover { border-color: rgba(232,226,214,.5); }
.land[aria-pressed="true"] { background: var(--forest); border-color: var(--gold); }
.land b { display: block; font-weight: 500; font-size: 13.5px; }
.land span { display: block; margin-top: 2px; font-size: 12px; line-height: 1.35; color: var(--sand-3); }
.land[disabled] { opacity: .5; cursor: progress; }

.stage { position: relative; width: 100%; aspect-ratio: 1; max-height: 82vh; background: #c9cfc1; border: 1px solid rgba(232,226,214,.14); overflow: hidden; user-select: none; -webkit-user-select: none; }
@media (min-width: 861px) { .stage { max-width: 82vh; } }
.stage > img, .stage > canvas, .stage > svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.stage > img { object-fit: fill; }
#paths { opacity: 0; transition: opacity .5s var(--descend); }
#paths.on { opacity: 1; }
.tapzone { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; background: transparent; border: 0; cursor: crosshair; touch-action: manipulation; }
.tapzone:focus-visible { outline-offset: -4px; }
.outlets { position: absolute; inset: 0; pointer-events: none; }
.outlet { position: absolute; transform: translate(-50%, -50%); font: 500 11px var(--mono); color: var(--forest-deep); background: rgba(232,226,214,.92); border: 1px solid var(--water); padding: 1px 5px; white-space: nowrap; }
.hint { position: absolute; top: 10px; left: 12px; font-size: 11px; letter-spacing: .1em; color: rgba(22,30,25,.72); pointer-events: none; transition: opacity .3s var(--descend); }
.hint.gone { opacity: 0; }
.north { position: absolute; top: 10px; right: 12px; font-size: 11px; letter-spacing: .08em; color: rgba(22,30,25,.72); pointer-events: none; }
.scale { position: absolute; left: 12px; bottom: 10px; display: flex; align-items: center; gap: 8px; font-size: 11px; color: rgba(22,30,25,.78); pointer-events: none; }
.scalebar { display: inline-block; height: 6px; border: 1px solid rgba(22,30,25,.7); border-top: 0; }
.loading { position: absolute; inset: 0; display: grid; place-items: center; font-size: 12px; letter-spacing: .14em; color: var(--sand-3); background: var(--forest-deep); }
.loading[hidden] { display: none; }

.controls { display: flex; flex-wrap: wrap; gap: 6px; }
.btn { min-height: 44px; padding: 0 16px; border: 1px solid var(--sand); background: var(--sand); color: var(--forest-deep); font-weight: 500; font-size: 13px; cursor: pointer; transition: background-color .18s var(--descend), color .18s var(--descend), border-color .18s var(--descend); }
.btn:hover, .btn:active { background: transparent; color: var(--sand); }
.btn.ghost { background: transparent; color: var(--sand); border-color: rgba(232,226,214,.35); }
.btn.ghost:hover, .btn.ghost:active { border-color: var(--sand); }
.btn.ghost[aria-pressed="true"] { border-color: var(--gold); color: var(--gold); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn[hidden] { display: none; }
.legend { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 12px; color: var(--sand-3); }
.sw { display: inline-block; width: 14px; height: 0; vertical-align: middle; }
.sw.parcel { border-top: 2px solid var(--gold); }
.sw.water { border-top: 2px solid #7fa3b6; }
.sw.pct { width: auto; height: auto; font-size: 10.5px; color: var(--forest-deep); background: var(--sand); padding: 0 4px; margin-left: 6px; }

.facts { margin: 0; font-size: 12px; letter-spacing: .1em; color: var(--sand-3); text-transform: uppercase; border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.figs { margin: 0; display: flex; flex-direction: column; gap: 14px; }
.figs dd { margin: 4px 0 0; font: 300 19px/1.4 var(--serif); color: var(--sand); }
.figs dd .n { font: 400 15px var(--mono); color: var(--sand); }
.notes { border-top: 1px solid var(--line); padding-top: 12px; }
.notes ul { margin: 8px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; line-height: 1.55; color: var(--sand-2); }
.notes li::marker { color: var(--gold); }
.cta { display: inline-flex; align-items: center; min-height: 44px; font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); text-decoration: none; }
.cta:hover, .cta:active { color: var(--sand); }

.foot { max-width: 1280px; margin: 0 auto; padding: 16px 20px 28px; border-top: 1px solid var(--line); font-size: 12px; letter-spacing: .04em; color: var(--sand-3); }
.foot a { display: inline-block; padding: 12px 0; }

@media (prefers-reduced-motion: reduce) {
  #paths, .land, .btn, .hint { transition: none; }
}
