/* ============================================================
   BASE — reset, typography, body defaults
   ------------------------------------------------------------
   minimal reset. type stack from tokens. no opinionated
   element styling beyond what's globally true.
   ============================================================ */

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

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  /* deeper antialiasing on dark bg — text rendering hint */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

img, svg, video {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--dur-fast) var(--easing);
}

a:hover {
  color: var(--text);
}

/* ---- type hierarchy ------------------------------------- */
/* display family on headings — saira condensed, tight tracking,
   feels mechanical and instrument-panel rather than literary. */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0;
  color: var(--text);
}

h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); }

p { margin: 0 0 var(--space-4); }

/* ---- mono label utility --------------------------------- */
/* core to the instrument-panel feel. uppercase, wide tracking,
   reserved for hierarchy labels and metadata strips. */
.mono-label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.mono-meta {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  color: var(--muted);
}

/* ---- selection ------------------------------------------ */
::selection {
  background: rgba(var(--brand-glow-rgb), 0.3);
  color: var(--text);
}

/* ---- focus ring — visible but on-brand ------------------ */
:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 2px;
}

/* ---- scrollbar — subtle, on-theme ----------------------- */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: var(--radius-pill);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}

/* ---- container utilities -------------------------------- */
.container {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--space-5);
}

.reading {
  max-width: var(--reading-max);
}
