/* ============================================================
   BASE — reset, layout primitives, and the signature page texture
   (film grain + faint grid + drifting accent glows).
   ============================================================ */

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: clip; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--f-sans);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.5;
  overflow-x: hidden;
  min-height: 100vh;
  position: relative;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
img, svg { display: block; max-width: 100%; }

/* ---- layout primitives ---- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); position: relative; z-index: 2; }
section { position: relative; padding: var(--pad-section) 0; }
.divider { height: 1px; background: var(--line); margin: 0; border: 0; }

/* ============================================================
   GLOBAL TEXTURE — grain overlay (the brand's grounding signature)
   ============================================================ */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1000;
  opacity: 0.18;
  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'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.5 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  animation: grain 2.4s steps(4) infinite;
}
@keyframes grain {
  0%, 100% { transform: translate(0,0); }
  25% { transform: translate(-3%, 2%); }
  50% { transform: translate(2%, -2%); }
  75% { transform: translate(-2%, -3%); }
}
:root[data-grain="off"] body::before { display: none; }

/* faint engineering grid, masked to a soft center vignette */
.bg-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(to right, var(--line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line) 1px, transparent 1px);
  background-size: 80px 80px;
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, black 30%, transparent 100%);
  mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, black 30%, transparent 100%);
  opacity: 0.7;
}

/* drifting accent glows */
.bg-glow { position: fixed; pointer-events: none; z-index: 0; border-radius: 50%; filter: blur(80px); opacity: 0.35; }
.bg-glow--lime { width: 540px; height: 540px; background: var(--accent); top: -240px; left: -200px; opacity: 0.10; }
.bg-glow--cyan { width: 460px; height: 460px; background: var(--signal-cyan); top: -160px; right: -220px; opacity: 0.07; }

@media (prefers-reduced-motion: reduce) {
  body::before { animation: none; }
}

/* ============================================================
   UTILITIES
   ============================================================ */
.muted { color: var(--text-mute); }
.dim { color: var(--text-dim); }
.accent { color: var(--accent); }
.italic { font-style: italic; }
.center { text-align: center; }
.mt-8 { margin-top: 32px; } .mt-12 { margin-top: 48px; } .mt-16 { margin-top: 64px; }
.mb-8 { margin-bottom: 32px; } .mb-12 { margin-bottom: 48px; }
