﻿/* ─────────────────────────────────────────────────────────────
   Base — reset, typography, body canvas.
   ───────────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }

html {
  color-scheme: dark;
  background: var(--ink-0);
  font-size: 16px;
  /* Compositor hint: the page itself scrolls silk-smooth */
  scroll-behavior: smooth;
  text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.55;
  color: var(--fg);
  background:
    radial-gradient(1200px 800px at 85% -10%, var(--flame-glow-soft), transparent 60%),
    radial-gradient(900px 700px at 10% 110%, #6b2bff14, transparent 60%),
    var(--ink-0);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv11", "ss01", "ss03";
  letter-spacing: -0.002em;
  overflow-x: clip;
}

img, svg, video { max-width: 100%; display: block; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }
input, textarea, select { font: inherit; color: inherit; }

:focus-visible {
  outline: 2px solid var(--flame-400);
  outline-offset: 2px;
  border-radius: 6px;
}

::selection { background: var(--flame-500); color: #fff; }

/* Typography scale */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 680;
  letter-spacing: -0.032em;
  color: var(--fg-strong);
  margin: 0;
  line-height: 1.02;
}
h1 { font-size: var(--text-hero); font-weight: 720; letter-spacing: -0.04em; }
h2 { font-size: clamp(32px, 4.5vw, 56px); letter-spacing: -0.035em; }
h3 { font-size: var(--text-xl); font-weight: 620; line-height: 1.2; }

p { margin: 0; }
.muted { color: var(--fg-muted); }
.faint { color: var(--fg-faint); }
.mono  { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* Film-grain layer — painted once, GPU-composited, zero runtime cost */
.grain::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: var(--z-raised);
  opacity: 0.06;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)' opacity='0.9'/></svg>");
}

/* The orange light-well — one layer of depth for the whole page */
.ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(600px 600px at var(--mx, 50%) var(--my, 40%), var(--flame-glow-soft), transparent 70%);
  transition: background-position var(--d-slow) var(--ease-smooth);
}

/* Utilities */
.container { width: min(100% - 40px, var(--container)); margin-inline: auto; }
.container-wide { width: min(100% - 40px, var(--container-wide)); margin-inline: auto; }
.stack   > * + * { margin-top: var(--stack-gap, 16px); }
.row     { display: flex; gap: var(--row-gap, 12px); align-items: center; }
.col     { display: flex; flex-direction: column; gap: var(--col-gap, 12px); }
.grow    { flex: 1; }
.hide    { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Honour user preference */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
