/* Reset and element defaults.
 *
 * Only what the interface actually relies on — a full normalize would carry
 * rules for elements this page never renders.
 */

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  /* Grayscale antialiasing keeps light text on a dark background from looking
     bolder than it is; the default subpixel rendering thickens it. */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-synthesis: none;
}

/* ── Typography ── */
h1, h2, h3, h4 {
  font-weight: 600;
  line-height: var(--leading-tight);
  letter-spacing: -0.011em;   /* larger type needs slightly tighter tracking */
}
h1 { font-size: var(--text-3xl); letter-spacing: -0.021em; }
h2 { font-size: var(--text-xl); }
h3 { font-size: var(--text-lg); }
h4 { font-size: var(--text-md); }

p { line-height: var(--leading-relaxed); }

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease);
}
a:hover { color: var(--accent-hover); }

code, pre, .mono {
  font-family: var(--font-mono);
  font-size: 0.92em;
  font-variant-ligatures: none;
}

/* Tabular figures so numbers do not shift width as they update — a counter
   ticking during a run is otherwise visibly unstable. */
.tabular { font-variant-numeric: tabular-nums; }

/* ── Form elements ──
   Browsers do not inherit fonts into form controls; without this the inputs
   render in the platform UI font and look pasted in. */
input, textarea, select, button {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: none;
  cursor: pointer;
}
button:disabled { cursor: not-allowed; }

textarea {
  resize: vertical;
  min-height: 0;
}

/* ── Focus ──
   Visible only for keyboard navigation. A ring on every mouse click is noise;
   removing it entirely strands keyboard users. */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ── Selection ── */
::selection {
  background: var(--accent-subtle);
  color: var(--text-primary);
}

/* ── Scrollbars ──
   The default light scrollbar on a near-black page is the brightest thing on
   screen. WebKit and Firefox need separate declarations. */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--bg-active);
  border-radius: var(--radius-full);
  border: 2px solid var(--bg-base);
}
::-webkit-scrollbar-thumb:hover { background: var(--text-disabled); }
* { scrollbar-width: thin; scrollbar-color: var(--bg-active) transparent; }

/* ── Utilities ── */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

[hidden] { display: none !important; }
