/* ═══════════════════════════════════════════════════════════════════════════
   base.css — reset, document shell, shared primitives.
   ═══════════════════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;                 /* the canvas is the page */
  overscroll-behavior: none;
}

html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: var(--t-base);
  line-height: 1.5;
  letter-spacing: -0.006em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-variant-numeric: tabular-nums;
  touch-action: none;               /* the camera owns gestures */
}

h1, h2, h3, p, dl, dd, dt, ul, ol, figure {
  margin: 0;
  padding: 0;
}
ul, ol { list-style: none; }

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  margin: 0;
  padding: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

input {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  margin: 0;
  padding: 0;
}
input::placeholder { color: var(--ink-tertiary); }
input:focus { outline: none; }

kbd {
  font-family: var(--font-ui);
  font-size: 10.5px;
  font-weight: 500;
  line-height: 1;
  color: var(--ink-tertiary);
  background: rgba(20, 21, 26, 0.05);
  border-radius: 5px;
  padding: 4px 5px;
  min-width: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

svg { display: block; }

::selection {
  background: var(--bronze-wash);
  color: var(--ink);
}

/* ── Focus ────────────────────────────────────────────────────────────────
   Visible for keyboard users, invisible for pointer users. Never removed. */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--bronze);
  outline-offset: 3px;
  border-radius: var(--r-xs);
}

/* ── Canvas ─────────────────────────────────────────────────────────── */
#scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: var(--z-canvas);
  /* The canvas itself listens for pointer events; the camera rig binds here. */
  touch-action: none;
  cursor: grab;
}
#scene[data-grabbing='true'] { cursor: grabbing; }
#scene[data-over-node='true'] { cursor: pointer; }

/* ── Glass primitive ──────────────────────────────────────────────────────
   One class, used everywhere, so every pane in the interface is physically
   consistent. The ::before draws the top highlight that sells the material. */
.glass {
  position: relative;
  background: var(--glass-fill);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow:
    inset 0 0 0 1px var(--glass-ring),
    var(--shadow-2);
}
.glass::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(
    to bottom,
    var(--glass-highlight) 0%,
    rgba(255, 255, 255, 0) 42%
  );
  opacity: 0.6;
  mix-blend-mode: overlay;
}

/* Browsers without backdrop-filter get an opaque pane rather than mud. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass { background: var(--glass-fill-solid); }
}

/* ── Small shared pieces ────────────────────────────────────────────── */
.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  flex: none;
}
.dot--living {
  background: var(--evergreen-bright);
  box-shadow: 0 0 0 3px var(--evergreen-wash);
}
.dot--past {
  background: var(--bronze-bright);
  box-shadow: 0 0 0 3px var(--bronze-wash);
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Utility: a hairline eyebrow label, used by legend / panel / stats. */
.eyebrow {
  font-size: var(--t-xs);
  font-weight: 560;
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--ink-tertiary);
}
