/* TERRA Lab · Where you stand. Forest scope by default, paper in field mode for reading in the sun.
   The relief plate is the rain lab's; gold is the deed line, water is the flight's blue. Square corners.
   Read while walking: body 14px and up, labels 12px and up, every control 48px. */
:root {
  --bg: #161e19; --panel: #1f2a23; --ink: #e8e2d6; --ink-2: rgba(232,226,214,.82);
  --ink-3: rgba(232,226,214,.64); --line: rgba(232,226,214,.18); --line-2: rgba(232,226,214,.38);
  --accent: #c6a76a; --accent-line: rgba(198,167,106,.5);
  --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;
}
:root[data-mode="field"] {
  --bg: #fafaf7; --panel: #efece4; --ink: #0b0b0b; --ink-2: rgba(11,11,11,.8);
  --ink-3: rgba(11,11,11,.64); --line: rgba(11,11,11,.14); --line-2: rgba(11,11,11,.4);
  --accent: #7e6333; --accent-line: rgba(126,99,51,.55);
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 400 15px/1.5 var(--sans); }
button { font: inherit; color: inherit; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mono { font-family: var(--mono); }
.micro { margin: 0; font: 500 12px var(--mono); letter-spacing: .12em; color: var(--ink-3); text-transform: uppercase; }

.bar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; padding: 4px 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: 48px; color: var(--ink); text-decoration: none; }
.lablink span { margin-left: .5em; letter-spacing: .08em; font-weight: 400; color: var(--accent); }
.lablink:hover, .lablink:hover span { color: var(--accent); text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.exp { font-size: 12px; letter-spacing: .12em; color: var(--accent); border: 1px solid var(--accent-line); padding: 2px 7px; }

/* intro and readout beside the map on a wide screen; on a phone: intro, map, readout */
.stand { display: grid; gap: 20px 32px; padding: 24px 20px 40px; max-width: 1320px; margin: 0 auto;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px); 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: 14px; min-width: 0; }
@media (max-width: 860px) {
  .stand { grid-template-columns: minmax(0, 1fr); grid-template-areas: "intro" "stage" "read"; padding: 16px 16px 32px; gap: 18px; }
}

.eyebrow { margin: 0; font: 500 12px var(--mono); letter-spacing: .12em; color: var(--accent); 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(--ink-2); max-width: 46ch; }

.lands { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: 4px; }
.land { min-height: 56px; 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: var(--line-2); }
.land[aria-pressed="true"] { background: var(--panel); border-color: var(--gold); }
.land b { display: block; font-weight: 500; font-size: 14px; }
.land span { display: block; margin-top: 2px; font-size: 12px; line-height: 1.35; color: var(--ink-3); }
.land[disabled] { opacity: .55; cursor: progress; }

.actions, .toggles { display: flex; flex-wrap: wrap; gap: 6px; }
.actions .btn { flex: 1 1 0; }
.btn { min-height: 48px; padding: 0 16px; border: 1px solid var(--ink); background: var(--ink); color: var(--bg); font-weight: 500; font-size: 14px; 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(--ink); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn.ghost:hover, .btn.ghost:active { border-color: var(--ink); }
.btn[aria-pressed="true"] { background: transparent; color: var(--accent); border-color: var(--gold); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn[hidden] { display: none; }

/* the map: a square window onto the plate, which can sit closer than the whole 4 km */
.stage { position: relative; width: 100%; aspect-ratio: 4 / 3; background: #c9cfc1; border: 1px solid var(--line); overflow: hidden; user-select: none; -webkit-user-select: none; touch-action: manipulation; cursor: crosshair; }
@media (min-width: 861px) { .stagecol { width: 100%; max-width: min(76vh, 820px); } .stage { aspect-ratio: 1; } }
.plate { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; }
.plate.glide { transition: transform .5s var(--descend); }
.plate > img, .plate > svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; }
.plate > img { object-fit: fill; }
.walker { position: absolute; width: 48px; height: 48px; margin: -24px 0 0 -24px; padding: 0; border: 0; background: transparent; cursor: grab; touch-action: none; z-index: 2; }
.walker:active { cursor: grabbing; }
.walker[disabled] { cursor: default; }
.walker:focus-visible { outline: 2px solid #0b0b0b; outline-offset: -2px; box-shadow: 0 0 0 2px #fafaf7 inset; }
.walker .dot { position: absolute; left: 50%; top: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px; background: #0b0b0b; border: 2px solid #fafaf7; }
.walker.live .dot { background: #1d3a48; }
.cone { position: absolute; left: -24px; top: -24px; width: 96px; height: 96px; pointer-events: none; transform-origin: 50% 50%; }
.cone path { fill: rgba(11,11,11,.26); stroke: rgba(11,11,11,.55); stroke-width: 1; }
.hint, .north, .scale { position: absolute; font-size: 12px; letter-spacing: .1em; color: #161e19; background: rgba(250,250,247,.82); padding: 2px 6px; pointer-events: none; z-index: 1; }
.hint, .north { top: 8px; }
.hint { left: 8px; max-width: calc(100% - 72px); transition: opacity .3s var(--descend); }
.hint.gone { opacity: 0; }
.north { right: 8px; }
.scale { left: 8px; bottom: 8px; display: flex; align-items: center; gap: 8px; letter-spacing: .04em; }
.scalebar { display: inline-block; height: 6px; border: 1px solid rgba(22,30,25,.75); border-top: 0; }
.loading { position: absolute; inset: 0; display: grid; place-items: center; padding: 20px; text-align: center; font-size: 12px; letter-spacing: .14em; color: var(--ink-3); background: var(--bg); z-index: 3; }
.loading[hidden] { display: none; }

.status { margin: 0; min-height: 1.5em; font-size: 14px; line-height: 1.5; color: var(--ink-2); }
.under { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; }
.pad { display: flex; gap: 6px; }
.step { width: 48px; height: 48px; padding: 0; border: 1px solid var(--line-2); background: transparent; font: 400 18px var(--mono); cursor: pointer; transition: border-color .18s var(--descend); }
.step:hover, .step:active { border-color: var(--ink); }
.step[disabled] { opacity: .45; cursor: not-allowed; }

/* the readout: large, plain, read at arm's length */
.where { margin: 0; font: 300 30px/1.18 var(--serif); letter-spacing: -.012em; }
.facts { margin: 0; font-size: 12px; letter-spacing: .1em; color: var(--ink-3); text-transform: uppercase; border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.rows { margin: 0; display: flex; flex-direction: column; gap: 14px; }
.rows dd { margin: 4px 0 0; font: 300 22px/1.35 var(--serif); color: var(--ink); }
.rows dd .n { font: 400 .8em var(--mono); white-space: nowrap; }
.rows dd .sub { display: block; margin-top: 4px; font: 400 14px/1.5 var(--sans); color: var(--ink-2); }
.toggles { border-top: 1px solid var(--line); padding-top: 14px; }
.privacy { margin: 0; font-size: 14px; line-height: 1.5; color: var(--ink-3); }
.notes ul { margin: 8px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; line-height: 1.55; color: var(--ink-2); }
.notes li::marker { color: var(--gold); }
.cta { display: inline-flex; align-items: center; min-height: 48px; font-size: 14px; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); text-decoration: none; }
.cta:hover, .cta:active { color: var(--ink); }

.foot { max-width: 1320px; margin: 0 auto; padding: 12px 20px 28px; border-top: 1px solid var(--line); font-size: 12px; letter-spacing: .04em; color: var(--ink-3); }
.foot a { display: inline-flex; align-items: center; min-height: 48px; }

@media (max-width: 860px) {
  .where { font-size: 26px; }
  .rows { gap: 12px; }
  .rows dd { font-size: 20px; line-height: 1.32; }
}
@media (prefers-reduced-motion: reduce) {
  .plate.glide, .land, .btn, .step, .hint { transition: none; }
}
