/* Reset, typographic baseline and accessibility primitives. */

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

* { margin: 0; }

html, body { height: 100%; }

body {
  font-family: var(--font-ui);
  font-size: var(--text-md);
  line-height: 1.5;
  color: var(--ink-base);
  background: var(--bg-deep);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow: hidden; /* the app shell manages its own scroll regions */
}

h1, h2, h3, h4 {
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: var(--tracking-tight);
  color: var(--ink-loud);
  text-wrap: balance;
}

button, input, select {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: none;
  cursor: pointer;
}

a {
  color: var(--accent);
  text-decoration-color: color-mix(in oklch, var(--accent) 40%, transparent);
  text-underline-offset: 0.2em;
}

a:hover { text-decoration-color: currentColor; }

ul, ol { list-style: none; padding: 0; }

/* ── numeric type ─────────────────────────────────────────────────────────
   Every figure in this app sits in a column that updates as the user scrubs
   through the week, so all of them are tabular and monospaced. */
.num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  letter-spacing: -0.01em;
}

/* ── micro-labels ──────────────────────────────────────────────────────── */
.eyebrow {
  font-size: var(--text-2xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  color: var(--ink-faint);
}

/* ── focus ────────────────────────────────────────────────────────────────
   A designed focus state, not the browser default: keyboard users get the same
   quality of feedback as pointer users. */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

:focus:not(:focus-visible) { outline: none; }

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

/* Skip link — the map traps a lot of tab stops, so an escape hatch matters. */
.skip-link {
  position: absolute;
  top: var(--space-2);
  left: var(--space-2);
  z-index: 200;
  padding: var(--space-2) var(--space-4);
  background: var(--bg-raised);
  color: var(--ink-loud);
  border: 1px solid var(--line-loud);
  border-radius: var(--radius-sm);
  transform: translateY(-200%);
  transition: transform var(--duration-fast) var(--ease-out-soft);
}

.skip-link:focus { transform: translateY(0); }

/* ── scrollbars ──────────────────────────────────────────────────────────── */
.scroll-region {
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--line-loud) transparent;
}

.scroll-region::-webkit-scrollbar { width: 10px; }
.scroll-region::-webkit-scrollbar-track { background: transparent; }
.scroll-region::-webkit-scrollbar-thumb {
  background: var(--line-mid);
  border: 3px solid transparent;
  background-clip: content-box;
  border-radius: 999px;
}
.scroll-region:hover::-webkit-scrollbar-thumb { background: var(--line-loud); background-clip: content-box; }

/* ── motion ───────────────────────────────────────────────────────────────
   Honour the OS setting: kill transforms and transitions, keep opacity so
   state changes remain perceptible. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
