/* ============================================================
   MERIDIAN — Base: fonts, reset, canvas, typography
   ============================================================ */

/* ---- Self-hosted variable fonts (no CDN, no tracking) ---- */
@font-face {
  font-family: "Inter";
  src: url("../fonts/Inter-var.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("../fonts/JetBrainsMono-var.woff2") format("woff2");
  font-weight: 100 800;
  font-display: swap;
}

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

/* The hidden attribute always wins, whatever display a class sets */
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
img, svg { display: block; max-width: 100%; }
input, button, textarea, select { font: inherit; color: inherit; }
a { color: inherit; }
fieldset { border: 0; padding: 0; min-width: 0; }
legend { padding: 0; }

body {
  min-height: 100vh;
  background-color: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color var(--dur-med) var(--ease-out);
}

/* Soft accent-tinted glow on the backdrop (follows the accent) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(900px 480px at 88% -10%, color-mix(in srgb, var(--accent) 9%, transparent), transparent 65%),
    radial-gradient(700px 420px at -8% 108%, color-mix(in srgb, var(--accent) 6%, transparent), transparent 65%);
}

/* ---- Typography ---- */
h1, h2, h3 {
  font-weight: 600;
  letter-spacing: -0.015em;
  text-wrap: balance;
  color: var(--ink);
}
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }

p { color: var(--ink-dim); max-width: 65ch; }
strong { color: var(--ink); font-weight: 600; }
::selection { background: color-mix(in srgb, var(--accent) 25%, transparent); }

/* Data voice: numbers, dates, identifiers */
.mono, code, kbd {
  font-family: var(--font-mono);
  font-size: 0.9em;
  letter-spacing: 0;
}

/* Small muted section label */
.label {
  font-size: var(--fs-micro);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-faint);
}

.hint { font-size: var(--fs-small); color: var(--ink-faint); }

/* ---- Focus & accessibility ---- */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-s);
}

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

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 8px;
  border: 2px solid var(--bg);
}
::-webkit-scrollbar-track { background: transparent; }

/* ---- Motion discipline ---- */
@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;
  }
}
