/* SIGWART_OS // base — tokens, fonts, reset, type, a11y
   ========================================================================== */

/* ---- fonts (vendored, latin subset) ---- */
@font-face {
  font-family: 'Orbitron';
  src: url('../lib/fonts/orbitron-latin-500-normal.woff2') format('woff2');
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Orbitron';
  src: url('../lib/fonts/orbitron-latin-800-normal.woff2') format('woff2');
  font-weight: 800; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('../lib/fonts/jetbrains-mono-latin-400-normal.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('../lib/fonts/jetbrains-mono-latin-700-normal.woff2') format('woff2');
  font-weight: 700; font-style: normal; font-display: swap;
}

/* ---- design tokens ---- */
:root {
  /* palette — void black + deep purple holographics */
  --bg-0: #030106;
  --bg-1: #070310;
  --bg-2: #0d0618;
  --ink-hi: #f2ecff;
  --ink: #c9b8ea;
  --ink-dim: #8d7fb0;
  --ink-faint: #4a3f66;
  --vio: #8a5cff;
  --vio-hot: #b47aff;
  --mag: #d24bff;
  --ind: #6a5cff;
  --cyn: #4be1ff;
  --wht: #efe4ff;

  --line: rgba(180, 150, 255, .16);
  --line-hot: rgba(190, 160, 255, .42);
  --glass: rgba(19, 11, 38, .28);
  --glass-hi: rgba(36, 22, 72, .34);
  --glow-vio: rgba(138, 92, 255, .32);

  /* z ladder */
  --z-gl: 0;
  --z-world: 10;
  --z-anchors: 15;
  --z-hud: 20;
  --z-fx: 25;
  --z-boot: 30;
  --z-cursor: 40;

  /* type */
  --font-display: 'Orbitron', 'Segoe UI', system-ui, sans-serif;
  --font-hud: 'JetBrains Mono', Consolas, monospace;

  /* motion */
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-io: cubic-bezier(.83, 0, .17, 1);
  --dur-s: .35s;
  --dur-m: .7s;
  --dur-l: 1.2s;

  /* hud spacing */
  --hud-pad: clamp(14px, 2.4vw, 30px);
}

/* ---- reset ---- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html {
  background: var(--bg-0);
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
  scrollbar-width: none;
}
body {
  background: var(--bg-0);
  color: var(--ink);
  font-family: var(--font-hud);
  font-size: 14px;
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100svh;
  overscroll-behavior-y: none;
}
/* native scrollbar hidden — the glowing descent conduit (left edge) IS the scrollbar */
::-webkit-scrollbar { width: 0; height: 0; display: none; }
::selection { background: rgba(138, 92, 255, .45); color: var(--ink-hi); }

img, svg, canvas, video { display: block; max-width: 100%; }
button {
  font: inherit; color: inherit; background: none; border: 0; padding: 0;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
a { color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }
h1, h2, h3, p, figure, dl, dt, dd, pre { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }

/* scroll lock while booting */
body[data-state="boot-idle"], body[data-state="boot-run"], body[data-state="reveal"] { overflow: hidden; }

/* ---- fixed GL canvas (layer 0) ---- */
#gl {
  position: fixed; inset: 0; z-index: var(--z-gl);
  width: 100%; height: 100%;
  pointer-events: none;
}

/* ---- typography utilities ---- */
.hud-label {
  font-family: var(--font-hud);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink-dim);
  font-variant-numeric: tabular-nums;
}
.hud-label b, .hud-label strong { font-weight: 700; color: var(--ink); }
.dim { color: var(--ink-faint); }
.ok { color: var(--vio-hot); text-shadow: 0 0 12px var(--glow-vio); }

/* ---- a11y ---- */
.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px;
  clip-path: inset(50%); overflow: hidden; white-space: nowrap;
}
.skip-link {
  position: fixed; top: -60px; left: 50%; transform: translateX(-50%);
  z-index: 50; padding: 10px 22px;
  background: var(--bg-2); border: 1px solid var(--line-hot);
  font-family: var(--font-hud); font-size: 12px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--ink-hi); transition: top .25s var(--ease-out);
}
.skip-link:focus-visible { top: 12px; }

:focus-visible {
  outline: 1px solid var(--vio-hot);
  outline-offset: 3px;
  border-radius: 2px;
}
:focus:not(:focus-visible) { outline: none; }

/* ---- reduced motion: kill decorative animation globally ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}
