/* Datum (sage): tokens, type and the shared controls. One light look, set explicitly. Exploratory until a Figma design is signed off. */
:root {
  color-scheme: light;
  --bg: #EBECE6;
  --bg-a: rgba(235, 236, 230, 0.9);
  --paper: #F7F7F3;
  --paper-a: rgba(247, 247, 243, 0.94);
  --paper-2: #F3F4EF;
  --surface: #E5E8E2;
  --surface-2: #E3E6DF;
  --line-soft: #DEE2DB;
  --ink: #1E2624;
  --ink-2: #353D3A;
  --ink-3: #535A55;
  --muted: #6F766F;
  --faint: #9BA19A;
  --disabled: #BEC5BD;
  --accent: #3F6F8A;
  --accent-soft: rgba(63, 111, 138, 0.22);
  /* the boundary: a warm survey red that stands out on the sage map without shouting */
  --boundary: #D04A37;
  --boundary-ink: #A9392A;
  --boundary-soft: rgba(208, 74, 55, 0.05);
  --dark: #1E2624;
  --dark-text: #E1E6DF;
  --dark-muted: #9BA19A;
  --line: rgba(30, 38, 36, 0.1);
  --line-2: rgba(30, 38, 36, 0.14);
  --line-3: rgba(30, 38, 36, 0.22);
  --shadow: 0 0 0 1px rgba(30, 38, 36, 0.1), 0 12px 24px -18px rgba(30, 38, 36, 0.5);
  --shadow-lg: 0 22px 44px -30px rgba(30, 38, 36, 0.5);
  --font: 'Geist', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
html[data-page="landing"], html[data-page="landing"] body { height: auto; }
body { margin: 0; background: var(--bg); color: var(--ink-2); font: 400 14px/1.45 var(--font); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
#app { height: 100%; }
html[data-page="landing"] #app { height: auto; }
img { max-width: 100%; }
a { color: inherit; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3 { text-wrap: balance; }
[hidden] { display: none !important; }

.mono { font-family: var(--mono); letter-spacing: 0.02em; font-variant-numeric: tabular-nums; }
.cap { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.scroll { overflow: auto; scrollbar-width: thin; }
.scroll-x { overflow-x: auto; scrollbar-width: none; }
.scroll-x::-webkit-scrollbar { display: none; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.grow { flex: 1; }

a:focus-visible, button:focus-visible, input:focus-visible, [tabindex]:focus-visible { outline: 1.5px solid var(--accent); outline-offset: 2px; }
.globe-canvas:focus-visible, .model-canvas:focus-visible { outline: 1.5px solid var(--accent); outline-offset: -1px; }

/* buttons and links */
.btn { display: inline-flex; align-items: center; justify-content: space-between; gap: 12px; height: 44px; padding: 0 16px; border: 0; border-radius: 10px; background: var(--ink); color: var(--paper); font-weight: 500; text-decoration: none; white-space: nowrap; transition: background 0.15s; }
.btn:hover { background: var(--ink-2); }
.btn-sm { height: 38px; padding: 0 14px; font-size: 13.5px; gap: 10px; }
.btn-wide { width: 100%; }
.btn-ghost { display: inline-flex; align-items: center; height: 44px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line-3); background: transparent; color: var(--ink); text-decoration: none; }
.btn-ghost:hover { background: rgba(30, 38, 36, 0.05); }
.link { text-decoration: none; color: var(--ink-2); }
.link:hover { color: var(--accent); }
.link-btn { padding: 0; border: 0; background: none; font-size: 13px; color: var(--ink-2); text-decoration: underline; text-underline-offset: 2px; }
.link-btn:hover { color: var(--accent); }
.icon-btn { width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%; background: var(--bg); display: grid; place-items: center; color: var(--ink); }
.chip { flex: none; display: inline-flex; align-items: center; height: 32px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--line-3); background: transparent; font-size: 11.5px; letter-spacing: 0.04em; color: var(--ink); white-space: nowrap; }
.chip:hover { background: rgba(30, 38, 36, 0.05); }

/* segmented control */
.segs { display: inline-flex; gap: 3px; padding: 3px; border-radius: 10px; background: var(--bg); box-shadow: inset 0 0 0 1px rgba(30, 38, 36, 0.08); }
.seg { height: 30px; padding: 0 12px; border: 0; border-radius: 7px; background: transparent; color: var(--ink-3); font-family: var(--mono); font-size: 12px; white-space: nowrap; transition: background 0.15s, color 0.15s; }
.seg:hover { color: var(--ink); }
.seg.is-on { background: var(--ink); color: var(--paper); }

/* switch */
.switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch span { position: relative; flex: none; width: 26px; height: 16px; border-radius: 9px; background: var(--disabled); transition: background 0.15s; }
.switch span::after { content: ""; position: absolute; left: 2px; top: 2px; width: 12px; height: 12px; border-radius: 50%; background: var(--paper); transition: transform 0.18s var(--ease-out); }
.switch input:checked + span { background: var(--ink); }
.switch input:checked + span::after { transform: translateX(10px); }
.switch input:focus-visible + span { outline: 1.5px solid var(--accent); outline-offset: 2px; }

/* the search field and its results */
.search { position: relative; }
.field { position: relative; display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 14px; border-radius: 10px; background: var(--bg); color: var(--ink-3); cursor: text; }
.field:focus-within { box-shadow: 0 0 0 1.5px var(--ink); }
.field-icon { display: grid; place-items: center; flex: none; }
.search-input { flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; background: transparent; color: var(--ink); outline: none; font-size: 15px; }
.search-input::placeholder { color: var(--faint); }
.search-input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.btn-go { flex: none; height: 40px; padding: 0 18px; font-size: 14px; }
.results { display: flex; flex-direction: column; gap: 2px; }
.res { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 10px; cursor: pointer; color: var(--ink); }
.res[aria-selected="true"] { background: var(--surface); }
.res.is-info { cursor: default; color: var(--muted); }
.res-dot { flex: none; width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid currentColor; }
.res-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.res-name { font-size: 14.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.res-sub { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.res.is-info .res-sub { white-space: normal; }
.res-kind { font-family: var(--mono); font-size: 10px; letter-spacing: 0.07em; text-transform: uppercase; color: var(--faint); margin-right: 6px; }
.res-xy { flex: none; font-size: 11px; color: var(--faint); white-space: pre; }
.res-empty { margin: 6px 10px; font-size: 13px; color: var(--muted); }

/* tier marks: filled for lidar, thick for national models, hairline for the global model */
.tm { display: inline-block; flex: none; width: 9px; height: 9px; border: 1.5px solid var(--ink); }
.tier-lidar { background: var(--ink); }
.tier-national { border-width: 3px; }
.tier-global { border-width: 1px; }
.tier-demo { border-color: var(--boundary); background: var(--boundary); border-radius: 50%; }

.meter { height: 4px; border-radius: 2px; background: var(--line-soft); overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 2px; background: var(--boundary); transition: width 0.2s; }

.dt-fade { animation: fade 0.6s ease both; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.boot-error { margin: 40px 20px; font-size: 15px; color: var(--ink); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; } }
