/* ─────────────────────────────────────────────────────────────────────────
   Base — reset, fonts, type classes, shell layout, boot reveal.
   Layout rules from 02 §6: hairlines only, no cards, no shadows on UI,
   enormous negative space. Focus rings are ink — never the browser blue.
   The call to action lives in page.css: it is `Start a project` sitewide.
   ───────────────────────────────────────────────────────────────────────── */

@font-face {
  font-family: 'Archivo';
  src: url('/assets/fonts/archivo-v25-latin-800.woff2') format('woff2');
  font-weight: 800; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Archivo';
  src: url('/assets/fonts/archivo-v25-latin-900.woff2') format('woff2');
  font-weight: 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('/assets/fonts/inter-v20-latin-regular.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('/assets/fonts/inter-v20-latin-500.woff2') format('woff2');
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('/assets/fonts/jetbrains-mono-v24-latin-regular.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('/assets/fonts/jetbrains-mono-v24-latin-700.woff2') format('woff2');
  font-weight: 700; font-style: normal; font-display: swap;
}

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

html { background: var(--page); }

body {
  background: var(--page);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--body-size);
  line-height: var(--body-leading);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

::selection { background: var(--ink); color: var(--page); }

/* The parked 3D scenes calibrated their whites against paper — every surface
   that can appear in one of their captures keeps it. Full white belongs to
   the delivered 2D page only.
   The header matters as much as the page: it is fixed at z-index 20, ABOVE
   the scene canvas, so a white header paints a hard band across every 3D
   frame — worth ~7.7% of the capture, which reads as blown highlights and
   wrecks the blend, silhouette, DOF and bloom measurements alike. */
html[data-scene],
html[data-scene] body,
html[data-scene] .site-header { background: var(--paper); }

a { color: inherit; text-decoration: none; }

:focus-visible { outline: 1px solid var(--ink); outline-offset: 3px; }

/* ── Type classes ──────────────────────────────────────────────────────── */

.display {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  letter-spacing: var(--display-tracking);
  line-height: var(--display-leading);
  font-size: var(--display-size);
  text-transform: none;
}

.body-copy { max-width: var(--body-max); }

.tech {
  font-family: var(--font-mono);
  font-size: var(--tech-size);
  font-variant-numeric: tabular-nums;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--eyebrow-size);
  letter-spacing: var(--eyebrow-tracking);
  text-transform: uppercase;
  color: var(--ink-60);
}

/* ── Canvas ────────────────────────────────────────────────────────────── */

#stage {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: var(--z-canvas);
  display: none;               /* only shown for ?scene=core|calibration */
}

body[data-scene] #stage { display: block; }

/* With a 3D scene requested, the 2D page steps aside so the machine can be
   inspected on the calibrated sweep without type over it. The FOOTER counts:
   it is a sibling of #page, not a child, so hiding only #page left it
   rendering over the scene and shifting as the canvas took its size. */
body[data-scene] #page,
body[data-scene] .site-footer { display: none; }

/* ── Boot: page hidden until calibration completes; a hairline progress
      rule, never a spinner. Everything fixed-position → zero layout shift. */

#boot-rule {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 1px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 200ms var(--ease-out), opacity 300ms var(--ease-out);
  z-index: var(--z-debug);
}

body[data-ready] #boot-rule { opacity: 0; }

#stage, .site-header, #conduit-progress {
  opacity: 0;
  transition: opacity var(--dur-reveal) var(--ease-out);
}

body[data-ready] #stage,
body[data-ready] .site-header,
body[data-ready] #conduit-progress { opacity: 1; }

/* ── Header ────────────────────────────────────────────────────────────── */

.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--s3) var(--s5);
  z-index: var(--z-header);
  /* Paper backdrop and a hairline, so scrolling content does not collide with
     the wordmark. A hairline is the only divider 02 §6 allows, and no shadow —
     shadows on UI are banned outright. */
  background: var(--page);
  border-bottom: var(--hairline);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand .bolt { display: block; width: 15px; height: 22px; color: var(--ink); }

.wordmark {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 15px;
  letter-spacing: var(--display-tracking);
  text-transform: uppercase;
  white-space: nowrap;
}

.wordmark .ai { color: var(--ink-60); }

.site-nav { display: flex; align-items: center; gap: var(--s4); }

.site-nav a.nav-link {
  font-family: var(--font-mono);
  font-size: var(--eyebrow-size);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
}

.site-nav a.nav-link:hover { border-bottom-color: var(--ink); }

@media (max-width: 720px) {
  .site-nav a.nav-link { display: none; }
  .site-header { padding: var(--s3) var(--s3); gap: 12px; }
  .site-header .cta { width: 128px; padding-inline: 8px; font-size: 9px; white-space: nowrap; }
  .site-header .wordmark { font-size: 14px; }
}

@media (max-width: 430px) {
  .site-header .cta { width: 92px; padding-inline: 8px; font-size: 0; }
  .site-header .cta::after { content: 'Start'; font: 10px var(--font-mono); letter-spacing: .08em; text-transform: uppercase; }
}

/* ── Conduit scroll indicator — a slim vertical conduit down the right
      margin that fills with current as the visitor descends (02 §5).      */

#conduit-progress {
  position: fixed;
  right: 22px;
  top: 50%;
  transform: translateY(-50%);
  width: 2px;
  height: 38vh;
  background: var(--graphite);
  z-index: var(--z-header);
}

#conduit-progress .fill {
  position: absolute;
  inset: 0;
  background: var(--leaf);
  transform: scaleY(0);
  transform-origin: top;
  will-change: transform;
}

@media (max-width: 720px) {
  #conduit-progress { right: 12px; height: 30vh; }
}

/* ── Debug HUD (behind ?debug=) ────────────────────────────────────────── */

.hud {
  position: fixed;
  left: var(--s3);
  bottom: var(--s3);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.7;
  color: var(--ink-60);
  white-space: pre;
  z-index: var(--z-debug);
  pointer-events: none;
}

/* ── Reduced motion ────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
