:root {
  /* the Sol Niger world */
  --void: #000004;
  --ultramarine: #09073f;
  --cobalt: #2020d6;
  --violet: #8c74ff;
  --halo: #c4b4ff;
  --white: #f2eeff;
  /* the instrument layer (clean schematic) */
  --line: rgba(226, 232, 255, 0.82);
  --line-dim: rgba(226, 232, 255, 0.28);
  --label: rgba(226, 232, 255, 0.66);
  /* accents that break through */
  --ember: #f04028;
  --lotus: #eea2c8;

  --fell: 'IM Fell English', 'Iowan Old Style', Georgia, serif;
  --mono: 'IBM Plex Mono', ui-monospace, Menlo, monospace;
  --nav-h: 40px;
}

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

html { background: var(--void); }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }

body {
  margin: 0;
  background: var(--void);
  color: var(--white);
  font-family: var(--fell);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

a { color: inherit; }
:focus-visible { outline: 1px solid var(--halo); outline-offset: 3px; }

/* ---------- sections ---------- */

.sec { position: relative; }
.stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  width: 100%;
  overflow: hidden;
}
.stage-canvas { position: absolute; inset: 0; display: block; }

/* ---------- nav ---------- */

#nav {
  position: fixed;
  z-index: 50;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 0 20px;
  font: 400 11px/1 var(--mono);
  color: rgba(226, 232, 255, 0.72);
  text-shadow: 0 0 8px rgba(0, 0, 10, .9), 0 0 2px rgba(0, 0, 10, .7);
  transition: color .6s, opacity .8s, transform .5s cubic-bezier(.2, 1.6, .4, 1);
  transform-origin: 30% 0;
  pointer-events: none;
}
#nav > * { pointer-events: auto; }
#nav[data-tone="light"] { color: rgba(8, 8, 30, .75); text-shadow: 0 0 8px rgba(240, 240, 255, .9); }
#nav.hidden { opacity: 0; }
#nav.hidden > * { pointer-events: none; }

#nav-name { font: 500 12px/1 var(--mono); letter-spacing: 0.04em; text-decoration: none; white-space: nowrap; color: rgba(236, 240, 255, .95); }
#nav-sections { display: flex; gap: 18px; list-style: none; margin: 0; padding: 0; flex: 1; justify-content: center; }
#nav-sections a { text-decoration: none; opacity: .45; transition: opacity .3s; white-space: nowrap; padding: 6px 0; position: relative; }
#nav-sections a:hover, #nav-sections a.on { opacity: 1; }
#nav-sections a.on::after { content: ''; position: absolute; left: 0; right: 0; bottom: 1px; height: 1px; background: currentColor; }
#sun-readout { white-space: nowrap; font-variant-numeric: tabular-nums; }
#sound { all: unset; pointer-events: auto; cursor: pointer; opacity: .6; white-space: nowrap; padding: 6px 0; }
#sound:hover, #sound[aria-pressed="true"] { opacity: 1; }
#nav-progress {
  position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: currentColor; opacity: .35; transform-origin: 0 50%; transform: scaleX(0);
}

@media (max-width: 860px) {
  #nav { gap: 12px; padding: 0 12px; }
  #nav-sections, #sun-readout { display: none; }
  #nav-name { flex: 1; }
}

#flash { position: fixed; inset: 0; z-index: 60; pointer-events: none; opacity: 0; }

#page { will-change: transform; }

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}
