/*
  PROJECT FORGE — Visual language
  ----------------------------------------------------------------------------
  Typography is the primary design element. Hierarchy is built from spacing,
  weight and scale — not from color. Color is spent only on meaning, and the
  single accent (a pale instrument cyan) appears rarely, so that when it
  appears, it is read (FORGE-002, Part 7).

  System fonts only. No external requests of any kind.
*/

/* ------------------------------------------------------------------ *
 * Design tokens
 * ------------------------------------------------------------------ */
:root {
  /* Surface — deep space, not black paint. A cool near-black. */
  --bg:            #0b0e12;

  /* Type — soft white down to muted grays. Never pure #fff. */
  --text:          #e8ebee;
  --text-dim:      #a3acb4;   /* secondary prose */
  --text-faint:    #828b93;   /* small labels, meta (kept AA-legible) */

  /* Hairlines — structure drawn in the faintest possible light. */
  --line:          rgba(255, 255, 255, 0.09);
  --line-strong:   rgba(255, 255, 255, 0.16);

  /* Three accents, and only three, for the whole page. They are meant to read
     like light passing through glass — never saturated, never neon — and they
     are rare, so that colour feels valuable when it appears.
       primary   soft electric blue   — links, activation, the energy front
       secondary deep cyan            — structure: ids, the flow spine
       highlight subtle violet        — reserved for the single rarest moments */
  --blue:          #6fa8ff;
  --cyan:          #57c3d4;
  --violet:        #9d8cf5;
  /* Warm gold is spent on one meaning only: Reality — the world being
     observed — never as ornament. It appears as light, like the last of the
     sun on an instrument's brass. */
  --gold:          #e6b877;

  /* Glass-light tints (low-alpha forms used for glow and fills). */
  --blue-glow:     rgba(111, 168, 255, 0.55);
  --blue-quiet:    rgba(111, 168, 255, 0.40);
  --cyan-quiet:    rgba(87, 195, 212, 0.34);
  --violet-glow:   rgba(157, 140, 245, 0.45);

  /* `--accent` remains the primary accent alias so existing rules read cleanly. */
  --accent:        var(--blue);
  --accent-quiet:  var(--blue-quiet);

  /* Type families. Sans carries the interface; a system serif is reserved
     for the two large statements, giving them an inscribed, archival weight.
     Monospace is the instrument's register — labels, ids, the boot lines. */
  --sans:  ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --serif: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;
  --mono:  ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  /* A generous vertical rhythm for sections. Whitespace is a material here. */
  --section-y: clamp(6rem, 15vh, 12rem);

  /* Motion. Slow and deliberate; nothing bounces, nothing spins. */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ------------------------------------------------------------------ *
 * Reset & base
 * ------------------------------------------------------------------ */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  /* The page body must never scroll horizontally, at any width. */
  overflow-x: hidden;
  font-family: var(--sans);
  font-size: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  line-height: 1.65;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* Numbers should never dance (FORGE-003, Part 8). */
  font-variant-numeric: tabular-nums;
}

/* Honor a user who prefers stillness: disable smooth scroll and all motion. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* Lock the page while the boot sequence plays (JS adds this on <html>). */
.booting { overflow: hidden; }

/* ------------------------------------------------------------------ *
 * Accessibility — skip link & focus
 * ------------------------------------------------------------------ */
/* Offset vertically (not off to the left) so the link can never widen the
   page; it drops into view on keyboard focus. */
.skip-link {
  position: fixed;
  left: 1rem;
  top: -4rem;
  padding: 0.65rem 1rem;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  z-index: 100;
  transition: top 0.2s var(--ease);
}
.skip-link:focus {
  top: 1rem;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ------------------------------------------------------------------ *
 * Shared type helpers
 * ------------------------------------------------------------------ */
.dim { color: var(--text-dim); }

/* Small uppercase label — the instrument's caption register. */
.section-label {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--text-faint);
  font-weight: 400;
  margin: 0;
}

.section-label {
  text-align: center;
  margin-bottom: clamp(3rem, 7vh, 5rem);
}

/* ------------------------------------------------------------------ *
 * Reveal-on-scroll
 * The hidden state is scoped to `.anim`, which the main script adds only
 * when motion is welcome. If the script never runs, nothing is hidden.
 * ------------------------------------------------------------------ */
.anim .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 1s var(--ease), transform 1s var(--ease);
  will-change: opacity, transform;
}
.anim .reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ================================================================== *
 * AMBIENT — the Nordic night behind everything
 * A near-still environment: distant stars, two faint light shafts (a whisper
 * of the Bifröst), and a slow atmospheric fog. It sits behind all content,
 * ignores the pointer, and is felt only after several seconds. Motion pauses
 * entirely under prefers-reduced-motion (via the global rule).
 * ================================================================== */
.ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
/* Content sits above the ambient field. */
main,
.footer { position: relative; z-index: 1; }

/* Everything continuous is gated behind `.alive`, which forge.js adds only
   when motion is welcome. Under reduced motion the class is absent, so the sky,
   nebula and shafts are all still present — just perfectly still. A `.paused`
   class (set when the tab is hidden) freezes every animation to save battery. */
.paused *,
.paused *::before,
.paused *::after { animation-play-state: paused !important; }

/* -- Star field -------------------------------------------------------- *
   forge.js generates hundreds of real stars across three depth layers. This
   CSS fallback draws a faint static sky when JavaScript is unavailable, and is
   retired (background removed) the moment the generated field is built. */
.ambient__stars { position: absolute; inset: -55% -10%; opacity: 0.9; }
:root:not(.stars-js) .ambient__stars {
  background-repeat: repeat;
  background-image:
    radial-gradient(1.4px 1.4px at 15% 22%, rgba(238, 246, 255, 0.95), transparent 60%),
    radial-gradient(1.1px 1.1px at 62% 42%, rgba(206, 224, 255, 0.75), transparent 60%),
    radial-gradient(1.7px 1.7px at 84% 74%, rgba(234, 244, 255, 0.9), transparent 60%),
    radial-gradient(1.1px 1.1px at 34% 88%, rgba(200, 220, 255, 0.65), transparent 60%),
    radial-gradient(1.5px 1.5px at 47% 12%, rgba(238, 246, 255, 0.85), transparent 60%),
    radial-gradient(1px 1px at 8% 60%, rgba(210, 228, 255, 0.6), transparent 60%);
  background-size: 300px 300px, 250px 250px, 380px 380px, 320px 320px, 270px 270px, 210px 210px;
}
/* Generated depth layers; each parallaxes at its own rate (forge.js). */
.ambient__starlayer { position: absolute; inset: -55% -10%; will-change: transform; }
.star { position: absolute; border-radius: 50%; opacity: var(--o, 0.6); }
/* A minority of stars twinkle or drift — never both — each on its own clock,
   so the sky never pulses in unison. Motion only under `.alive`. */
.alive .star--tw { animation: star-twinkle var(--d, 10s) ease-in-out var(--delay, 0s) infinite; }
.alive .star--dr { animation: star-drift var(--d, 60s) ease-in-out var(--delay, 0s) infinite alternate; }
@keyframes star-twinkle { 0%, 100% { opacity: var(--o); } 50% { opacity: calc(var(--o) * 0.32); } }
@keyframes star-drift  { to { transform: translate3d(var(--dx, 0), var(--dy, 0), 0); } }

/* -- Nebula: diffuse light that slowly evolves ------------------------- *
   Softness comes from the radial gradients themselves — no `filter: blur`,
   which is far too costly to animate on large surfaces at high DPI. */
.ambient__nebula { position: absolute; inset: 0; will-change: transform; }
.ambient__nebula::before,
.ambient__nebula::after {
  content: "";
  position: absolute;
  border-radius: 50%;
}
.ambient__nebula::before {
  width: 88vw; height: 74vh; left: -12vw; top: -18vh;
  background: radial-gradient(closest-side, rgba(56, 102, 178, 0.08), transparent 78%);
}
.ambient__nebula::after {
  width: 66vw; height: 58vh; right: -12vw; top: 6vh;
  background: radial-gradient(closest-side, rgba(138, 120, 232, 0.06), transparent 78%);
}
.alive .ambient__nebula::before { animation: nebula-a 74s ease-in-out infinite alternate; }
.alive .ambient__nebula::after  { animation: nebula-b 98s ease-in-out infinite alternate; }
@keyframes nebula-a { 0% { transform: translate3d(-2%, -1%, 0); opacity: 0.6; } 100% { transform: translate3d(3%, 2%, 0); opacity: 1; } }
@keyframes nebula-b { 0% { transform: translate3d(2%, 1%, 0); opacity: 1; } 100% { transform: translate3d(-3%, -2%, 0); opacity: 0.55; } }

/* -- Vertical light shafts: moonlight across dark stone, not neon ------ */
.ambient__shafts { position: absolute; inset: 0; will-change: transform; }
.ambient__shafts::before,
.ambient__shafts::after {
  content: "";
  position: absolute;
  top: -45%;
  height: 190%;
  width: 34vw;
  opacity: 0.5;
}
/* Wide, gradient-soft bands — moonlight, no blur filter. */
.ambient__shafts::before {
  left: 14%;
  background: linear-gradient(90deg, transparent, rgba(111, 168, 255, 0.045) 50%, transparent);
  transform: skewX(-6deg);
}
.ambient__shafts::after {
  right: 10%;
  background: linear-gradient(90deg, transparent, rgba(157, 140, 245, 0.035) 50%, transparent);
  transform: skewX(5deg);
}
.alive .ambient__shafts::before { animation: shaft-breathe 30s ease-in-out infinite; }
.alive .ambient__shafts::after  { animation: shaft-breathe 42s ease-in-out infinite 7s; }
@keyframes shaft-breathe { 0%, 100% { opacity: 0.28; } 50% { opacity: 0.62; } }

/* -- Page-wide breath: the light strengthens and weakens a percent or two */
.ambient__breath {
  position: absolute;
  inset: 0;
  background: radial-gradient(130% 100% at 50% 40%, rgba(122, 152, 214, 0.022), transparent 72%);
  opacity: 0.4;
}
.alive .ambient__breath { animation: page-breath 27s ease-in-out infinite; }
@keyframes page-breath { 0%, 100% { opacity: 0.25; } 50% { opacity: 1; } }

/* -- Fog: a second, deeper haze that drifts on a different, slower clock --- *
   Softness is gradient-native (no blur filter, which is ruinous to animate at
   this size). It sits between the nebula and the stars, giving the field a
   sense of atmosphere the stars hang inside of. */
.ambient__fog {
  position: absolute;
  inset: -10%;
  opacity: 0.5;
  background:
    radial-gradient(60% 42% at 22% 30%, rgba(70, 116, 190, 0.05), transparent 70%),
    radial-gradient(52% 46% at 78% 66%, rgba(96, 150, 205, 0.045), transparent 72%),
    radial-gradient(48% 40% at 50% 88%, rgba(120, 108, 200, 0.035), transparent 74%);
  will-change: transform, opacity;
}
.alive .ambient__fog { animation: fog-drift 120s ease-in-out infinite alternate; }
@keyframes fog-drift {
  0%   { transform: translate3d(-2%, 1%, 0) scale(1.02); opacity: 0.35; }
  100% { transform: translate3d(3%, -2%, 0) scale(1.06); opacity: 0.62; }
}

/* -- Constellation links: the canvas forge.js draws briefly-lit lines onto -- *
   It spans the field, above the stars, ignored by the pointer. When motion is
   unwelcome it is simply never drawn to. */
.ambient__links {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.9;
}

/* -- The Bifröst beam: information rising through reality ------------------ *
   A centred vertical column in three parts — a wide volumetric glow, a fine
   bright core, and a rising pulse that crosses it now and then. It reads as
   light, not paint: soft cyan over deep blue, with the rarest touch of violet
   at its base. It breathes, always; it is never dramatic. */
.ambient__beam {
  position: absolute;
  top: -8%;
  bottom: -8%;
  left: 50%;
  width: clamp(180px, 24vw, 420px);
  transform: translateX(-50%);
  will-change: opacity, transform;
  opacity: 0.9;
}
.ambient__beam > span {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  display: block;
}
/* The volumetric body: a soft vertical band, brightest toward the middle of
   its height, fading out at top and bottom so it has no visible ends. */
.ambient__beam-glow {
  width: 100%;
  background:
    linear-gradient(to bottom, transparent, rgba(87, 195, 212, 0.85) 34%, rgba(111, 168, 255, 0.85) 62%, transparent),
    radial-gradient(50% 60% at 50% 50%, rgba(87, 168, 220, 0.10), transparent 70%);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 30%, #000 70%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 30%, #000 70%, transparent);
  opacity: 0.16;
}
/* The fine core: a hairline of concentrated light down the exact centre. */
.ambient__beam-core {
  width: 2px;
  background: linear-gradient(
    to bottom,
    transparent,
    rgba(157, 140, 245, 0.35) 12%,
    rgba(120, 205, 224, 0.85) 42%,
    rgba(150, 200, 255, 0.9) 60%,
    rgba(111, 168, 255, 0.5) 82%,
    transparent
  );
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 14%, #000 86%, transparent);
          mask-image: linear-gradient(to bottom, transparent, #000 14%, #000 86%, transparent);
  opacity: 0.5;
  box-shadow: 0 0 12px rgba(111, 168, 255, 0.25);
}
/* The rising pulse: a soft node of light that travels up the core, slowly,
   at long irregular-feeling intervals. Only under welcomed motion. */
.ambient__beam-pulse {
  width: 3px;
  height: 22%;
  top: auto;
  bottom: 0;
  background: linear-gradient(to top, transparent, rgba(190, 230, 255, 0.9), transparent);
  border-radius: 2px;
  opacity: 0;
}
/* Continuous life, all gated behind `.alive`. Two independent slow cycles so
   the beam never looks the same twice: the glow breathes on ~24s, the core on
   ~31s, and the pulse rises on a long ~19s loop with a lull between passes. */
.alive .ambient__beam-glow { animation: beam-breath-glow 24s ease-in-out infinite; }
.alive .ambient__beam-core { animation: beam-breath-core 31s ease-in-out infinite; }
.alive .ambient__beam-pulse { animation: beam-rise 19s ease-in-out infinite; }
@keyframes beam-breath-glow {
  0%, 100% { opacity: 0.11; }
  50%      { opacity: 0.22; }
}
@keyframes beam-breath-core {
  0%, 100% { opacity: 0.40; }
  50%      { opacity: 0.62; }
}
@keyframes beam-rise {
  0%    { bottom: 0%;  opacity: 0; }
  6%    { opacity: 0.7; }
  40%   { opacity: 0.5; }
  52%   { bottom: 100%; opacity: 0; }
  100%  { bottom: 100%; opacity: 0; }   /* a long silence before the next rise */
}
/* When the boot sequence reaches "System ready.", the beam brightens as if
   charged, then settles — a single sacred swell, not a flash. */
.beam-charged .ambient__beam {
  opacity: 1;
  transition: opacity 2.4s var(--ease);
}
.beam-charged .ambient__beam-core {
  animation: beam-charge 2.6s var(--ease) forwards;
}
.beam-charged .ambient__beam-glow {
  animation: beam-charge-glow 2.6s var(--ease) forwards;
}
@keyframes beam-charge {
  0%   { opacity: 0.5; }
  35%  { opacity: 1; box-shadow: 0 0 26px rgba(150, 210, 255, 0.6); }
  100% { opacity: 0.6; box-shadow: 0 0 12px rgba(111, 168, 255, 0.25); }
}
@keyframes beam-charge-glow {
  0%   { opacity: 0.16; }
  35%  { opacity: 0.42; }
  100% { opacity: 0.18; }
}

/* -- Motes: microscopic suspended points, drifting on their own vectors --- */
.ambient__motes { position: absolute; inset: 0; }
.mote {
  position: absolute;
  width: var(--m, 2px);
  height: var(--m, 2px);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(198, 224, 255, 0.9), rgba(160, 200, 240, 0.15) 55%, transparent 72%);
  opacity: 0;
  will-change: transform, opacity;
}
.alive .mote {
  animation:
    mote-drift var(--md, 60s) linear var(--delay, 0s) infinite,
    mote-fade  var(--mf, 30s) ease-in-out var(--delay, 0s) infinite;
}
@keyframes mote-drift {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(var(--dx, 20px), var(--dy, -30px), 0); }
}
@keyframes mote-fade {
  0%, 100% { opacity: 0; }
  50%      { opacity: var(--mo, 0.5); }
}

/* -- Energy currents: field lines under the architecture, near the bottom -- *
   Pinned to the lower edge of the viewport, extremely faint, drawn as slowly
   flowing dashed strokes. The flow is a stroke-dashoffset drift; each line has
   its own tempo, so the field never pulses in unison. */
.ambient__currents {
  position: absolute;
  left: -5%;
  right: -5%;
  bottom: 0;
  width: 110%;
  height: min(34vh, 300px);
  opacity: 0.5;
}
.current {
  stroke-width: 1;
  stroke-dasharray: 3 26;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
  opacity: 0.5;
}
.alive .current { animation: current-flow linear infinite; }
.alive .current:nth-child(1) { animation-duration: 46s; opacity: 0.55; }
.alive .current:nth-child(2) { animation-duration: 62s; opacity: 0.40; }
.alive .current:nth-child(3) { animation-duration: 54s; opacity: 0.32; }
@keyframes current-flow { to { stroke-dashoffset: -290; } }

/* ================================================================== *
 * SOUND CONTROL — a discreet speaker, upper-right
 * Light-on-hover, never loud. Muted state dims it and reveals a hairline
 * slash. It sits above everything, including the boot overlay.
 * ================================================================== */
.sound {
  position: fixed;
  top: clamp(0.9rem, 2.4vw, 1.4rem);
  right: clamp(0.9rem, 2.4vw, 1.4rem);
  z-index: 60;
  width: 2.5rem;
  height: 2.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: var(--text-faint);
  background: rgba(11, 14, 18, 0.35);
  border: 1px solid var(--line);
  border-radius: 50%;
  cursor: pointer;
  -webkit-backdrop-filter: blur(4px);
          backdrop-filter: blur(4px);
  transition: color 0.5s var(--ease), border-color 0.5s var(--ease), opacity 0.5s var(--ease);
}
.no-js .sound { display: none; }   /* the control does nothing without JS */
.sound:hover,
.sound:focus-visible {
  color: var(--cyan);
  border-color: var(--cyan-quiet);
}
.sound__icon { display: block; overflow: visible; }
.sound__body { fill: currentColor; stroke: none; }
.sound__wave {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  transition: opacity 0.4s var(--ease);
}
/* The waves breathe faintly while sound is on — the instrument, audibly idling. */
.alive .sound:not(.is-muted) .sound__wave--1 { animation: wave-breath 3.6s ease-in-out infinite; }
.alive .sound:not(.is-muted) .sound__wave--2 { animation: wave-breath 3.6s ease-in-out infinite 0.5s; }
@keyframes wave-breath { 0%, 100% { opacity: 0.5; } 50% { opacity: 1; } }
.sound__slash {
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  opacity: 0;
  stroke-dasharray: 26;
  stroke-dashoffset: 26;
  transition: stroke-dashoffset 0.35s var(--ease), opacity 0.2s var(--ease);
}
.sound.is-muted { color: var(--text-faint); opacity: 0.72; }
.sound.is-muted .sound__wave { opacity: 0.12; }
.sound.is-muted .sound__slash { opacity: 1; stroke-dashoffset: 0; }

/* ================================================================== *
 * HERO
 * ================================================================== */
.hero {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 8rem 1.5rem 6rem;
}

.hero__inner {
  max-width: 46rem;
  width: 100%;
  /* Allow the flex item to shrink below its content's intrinsic width, so the
     large title wraps instead of forcing the page wider than the viewport. */
  min-width: 0;
  /* Settles and fades on scroll (forge.js parallax). */
  will-change: transform, opacity;
}

.hero__title {
  position: relative;
  margin: 0;
  font-weight: 500;
  font-size: clamp(2.4rem, 10vw, 6rem);
  line-height: 1.04;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  /* A hair of forward indent to balance the wide tracking's right edge. */
  text-indent: 0.14em;
  overflow-wrap: break-word;
  color: var(--text);
}

/* The title should feel carved rather than printed — polished metal catching
   a little light, not glowing. Two layers, both clipped to the letterforms:
   a cool vertical gradient (light top, dark bottom) reads as an engraved edge,
   and above it a faint diagonal highlight band that, once the page awakens,
   sweeps across once — light moving over a polished surface. Because the
   highlight is a *background*, it is painted only inside the glyphs and can
   never overflow the layout. Guarded by @supports so unsupported browsers
   keep the solid fill. */
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .hero__title {
    background-image:
      linear-gradient(115deg, transparent 38%, rgba(214, 232, 255, 0.55) 50%, transparent 62%),
      linear-gradient(180deg, #f5f8fb 0%, #d7dee7 44%, #eef3f8 58%, #c6cfd9 100%);
    background-size: 240% 100%, 100% 100%;
    background-position: 150% 0, 0 0;   /* highlight parked off to the right */
    background-repeat: no-repeat;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter:
      drop-shadow(0 1px 0 rgba(0, 0, 0, 0.55))
      drop-shadow(0 -1px 0 rgba(180, 205, 255, 0.10));
  }
  .booted .hero__title {
    animation: hero-sheen 3s var(--ease) 0.5s 1 forwards;
  }
}
@keyframes hero-sheen {
  from { background-position: 150% 0, 0 0; }
  to   { background-position: -60% 0, 0 0; }
}

.hero__subtitle {
  margin: 1.75rem 0 0;
  font-size: clamp(1.05rem, 2.6vw, 1.5rem);
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--text-dim);
}

.hero__creed {
  margin: clamp(3rem, 8vh, 5rem) auto 0;
  max-width: 34rem;
  font-size: clamp(1.02rem, 1.2vw, 1.15rem);
  line-height: 1.9;
}
.hero__creed span { display: block; }
.hero__creed .dim { margin: 0.35rem 0; }

.hero__status {
  margin: clamp(3rem, 8vh, 5rem) 0 0;
  font-family: var(--mono);
  font-size: 0.82rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.hero__more {
  margin: 2.75rem 0 0;
}

/* The single call to attention on the page — an anchor, not a button. */
.anchor {
  display: inline-flex;
  align-items: baseline;
  gap: 0.6em;
  color: var(--text);
  text-decoration: none;
  font-size: 0.98rem;
  letter-spacing: 0.02em;
  padding-bottom: 3px;
  border-bottom: 1px solid var(--line-strong);
  transition: color 0.5s var(--ease), border-color 0.5s var(--ease);
}
.anchor:hover,
.anchor:focus-visible {
  color: var(--accent);
  border-bottom-color: var(--accent-quiet);
}
.anchor__mark {
  font-size: 0.85em;
  transition: transform 0.6s var(--ease);
}
.anchor:hover .anchor__mark {
  transform: translateY(3px);
}

/* ================================================================== *
 * ARCHITECTURE STATEMENT — an emotional center, given room to breathe
 * ================================================================== */
.statement {
  padding: var(--section-y) 1.5rem;
  display: flex;
  justify-content: center;
}
.statement__quote {
  margin: 0;
  max-width: 30rem;
  text-align: center;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.6rem, 4.6vw, 2.85rem);
  line-height: 1.4;
  letter-spacing: 0.005em;
  color: var(--text);
}
.statement__quote span { display: block; }
/* Let each clause arrive a moment after the last. */
.anim .statement__quote.reveal span {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 1s var(--ease), transform 1s var(--ease);
}
.anim .statement__quote.reveal.is-visible span { opacity: 1; transform: none; }
.anim .statement__quote.reveal.is-visible span:nth-child(2) { transition-delay: 0.22s; }
.anim .statement__quote.reveal.is-visible span:nth-child(3) { transition-delay: 0.44s; }

/* ================================================================== *
 * ARCHITECTURE FLOW — a quiet vertical descent
 * ================================================================== */
.flow {
  padding: var(--section-y) 1.5rem;
}

.flow__list {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  max-width: 22rem;
  position: relative;
}

/* The spine: a single hairline the stages hang from. It illuminates downward
   once the flow enters view (scaleY from the top), like energy travelling
   through an instrument. */
.flow__list::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0.4rem;
  bottom: 0.4rem;
  width: 1px;
  transform: translateX(-50%) scaleY(0);
  transform-origin: top;
  background: linear-gradient(
    to bottom,
    var(--cyan-quiet),
    var(--blue-quiet) 88%,
    var(--blue)
  );
  transition: transform 2.6s var(--ease);
}
.anim .flow__list.reveal.is-visible::before,
.no-js .flow__list::before,
html:not(.anim) .flow__list::before { transform: translateX(-50%) scaleY(1); }

/* The energy front: a soft point of light that descends the spine, arriving
   at each stage just as it appears. Only under welcomed motion. */
.flow__list::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: var(--blue);
  /* Believable light — energy travelling beneath glass, not a neon bulb. */
  box-shadow:
    0 0 6px 1px rgba(111, 168, 255, 0.40),
    0 0 14px 4px rgba(87, 195, 212, 0.12);
  opacity: 0;
}
.anim .flow__list.reveal.is-visible::after {
  animation: flow-beam 2.6s var(--ease) forwards;
}
@keyframes flow-beam {
  0%   { top: 0%;   opacity: 0; }
  6%   { opacity: 0.85; }
  94%  { opacity: 0.85; }
  100% { top: 100%; opacity: 0; }
}

/* The spine keeps working after the first illumination: forge.js sends faint
   pulses down it at organic, randomised intervals. Each is a soft point of
   light descending under the glass. */
.flow__pulse {
  position: absolute;
  left: 50%;
  top: 0;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: var(--blue);
  box-shadow:
    0 0 6px 1px rgba(111, 168, 255, 0.38),
    0 0 13px 3px rgba(87, 195, 212, 0.10);
  opacity: 0;
  pointer-events: none;
}
@keyframes flow-pulse-travel {
  0%   { top: 0%;   opacity: 0; }
  12%  { opacity: 0.8; }
  88%  { opacity: 0.8; }
  100% { top: 100%; opacity: 0; }
}
/* The spine itself breathes, very slowly (opacity only — the draw uses scaleY). */
.alive .flow__list.is-visible::before { animation: spine-breath 15s ease-in-out infinite; }
@keyframes spine-breath { 0%, 100% { opacity: 0.82; } 50% { opacity: 1; } }

.flow__stage {
  position: relative;
  text-align: center;
  padding: clamp(1.5rem, 4vh, 2.4rem) 0;
}

.flow__dot {
  display: block;
  width: 7px;
  height: 7px;
  margin: 0 auto 0.9rem;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--line-strong);
}
/* The first stage — Reality — is the world being observed, and the one place
   the warm gold is spent: a small brass reading held in the dark. */
.flow__stage:first-of-type .flow__dot {
  border-color: rgba(230, 184, 119, 0.55);
  background: var(--gold);
  box-shadow:
    0 0 0 4px rgba(230, 184, 119, 0.06),
    0 0 8px 1px rgba(230, 184, 119, 0.30);
}
.alive .flow__stage:first-of-type .flow__dot { animation: node-breath 13s ease-in-out infinite 1s; }

/* The final stage — Readers — is where the light comes to rest, and the one
   place the rare violet is allowed to touch the blue. It breathes, slowly. */
.flow__stage:last-of-type .flow__dot {
  border-color: var(--blue-quiet);
  background: var(--blue);
  box-shadow:
    0 0 0 4px rgba(111, 168, 255, 0.07),
    0 0 8px 1px rgba(157, 140, 245, 0.28);
}
.alive .flow__stage:last-of-type .flow__dot { animation: node-breath 11s ease-in-out infinite 2s; }
@keyframes node-breath { 0%, 100% { opacity: 0.78; } 50% { opacity: 1; } }

.flow__name {
  display: block;
  font-size: clamp(1.15rem, 2.4vw, 1.5rem);
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text);
}
.flow__note {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-faint);
  letter-spacing: 0.01em;
}

/* Stagger each stage into view. */
.anim .flow__list.reveal .flow__stage {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}
.anim .flow__list.reveal.is-visible .flow__stage { opacity: 1; transform: none; }
/* Timed to the 2.6s energy front so each stage arrives as the light passes it. */
.anim .flow__list.reveal.is-visible .flow__stage:nth-child(1) { transition-delay: 0.15s; }
.anim .flow__list.reveal.is-visible .flow__stage:nth-child(2) { transition-delay: 0.58s; }
.anim .flow__list.reveal.is-visible .flow__stage:nth-child(3) { transition-delay: 1.00s; }
.anim .flow__list.reveal.is-visible .flow__stage:nth-child(4) { transition-delay: 1.42s; }
.anim .flow__list.reveal.is-visible .flow__stage:nth-child(5) { transition-delay: 1.84s; }
.anim .flow__list.reveal.is-visible .flow__stage:nth-child(6) { transition-delay: 2.24s; }

/* ================================================================== *
 * FOUNDING DOCUMENTS — archival records
 * ================================================================== */
.records {
  padding: var(--section-y) 1.5rem;
}
.records__grid {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  max-width: 60rem;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;                       /* hairline seams, like an engraved plate */
  background: var(--line);
  border: 1px solid var(--line);
}
.record {
  background: var(--bg);
  padding: clamp(1.75rem, 4vw, 2.5rem) 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  text-align: center;
}
.record__id {
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  color: var(--cyan);
  opacity: 0.8;
}
/* The cyan designations strengthen and weaken slowly, each on its own clock. */
.alive .record__id { animation: accent-breath 15s ease-in-out infinite; }
.alive .records__grid .record:nth-child(1) .record__id { animation-duration: 13s; animation-delay: -3s; }
.alive .records__grid .record:nth-child(2) .record__id { animation-duration: 17s; animation-delay: -8s; }
.alive .records__grid .record:nth-child(3) .record__id { animation-duration: 15s; animation-delay: -12s; }
.alive .records__grid .record:nth-child(4) .record__id { animation-duration: 19s; animation-delay: -6s; }
@keyframes accent-breath { 0%, 100% { opacity: 0.85; } 50% { opacity: 0.52; } }
.record__title {
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--text);
  letter-spacing: 0.01em;
}
.record__status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  margin-top: 0.25rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.record__tick {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--text-faint);
}

/* ================================================================== *
 * FIRST IMPLEMENTATION
 * ================================================================== */
.impl {
  padding: var(--section-y) 1.5rem;
}
.impl__body {
  max-width: 30rem;
  margin: 0 auto;
  text-align: center;
}
.impl__name {
  margin: 0;
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 500;
  letter-spacing: 0.01em;
}
.impl__state {
  margin: 1rem 0 0;
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.impl__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

/* Not a web-app progress bar — an activation channel. A thin engraved track,
   sharp-edged like a machine component, with faint tick divisions, through
   which a soft blue energy pulse slowly flows. No percentage: presence, not a
   number we cannot stand behind (FORGE-002 Principle 3). */
.impl__track {
  position: relative;
  margin: 2.1rem auto 0;
  width: min(20rem, 78vw);
  height: 8px;
  background: #0d1219;
  border: 1px solid var(--line);
  /* the engraving: recessed top, a whisper of light on the lower lip */
  box-shadow:
    inset 0 1px 2px rgba(0, 0, 0, 0.65),
    inset 0 -1px 0 rgba(255, 255, 255, 0.03);
  overflow: hidden;
}
/* Engraved tick divisions across the channel. */
.impl__track::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: repeating-linear-gradient(
    90deg,
    transparent 0 calc(10% - 1px),
    rgba(255, 255, 255, 0.05) calc(10% - 1px) 10%
  );
}
.impl__fill {
  position: relative;
  display: block;
  height: 100%;
  width: 42%;
  background: linear-gradient(90deg, var(--cyan-quiet), var(--blue));
  /* Light held under glass — a soft reflection, not a glow. */
  box-shadow: 0 0 6px rgba(111, 168, 255, 0.30);
  transform-origin: left;
}
/* The charged channel breathes, as if energy were held in reserve. */
.alive .impl__body.is-visible .impl__fill { animation: channel-breath 9s ease-in-out infinite; }
@keyframes channel-breath {
  0%, 100% { box-shadow: 0 0 5px rgba(111, 168, 255, 0.22); }
  50%      { box-shadow: 0 0 11px rgba(111, 168, 255, 0.45); }
}
/* A slow charge of light travelling through the filled channel. */
.impl__fill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(205, 226, 255, 0.55),
    transparent
  );
  transform: translateX(-100%);
}
.anim .impl__body.is-visible .impl__fill::after {
  animation: channel-pulse 3.4s var(--ease) infinite;
}
@keyframes channel-pulse {
  0%        { transform: translateX(-100%); }
  55%, 100% { transform: translateX(240%); }
}
/* The channel charges once when it enters view. */
.anim .impl__body.reveal .impl__fill { transform: scaleX(0); }
.anim .impl__body.reveal.is-visible .impl__fill {
  transform: scaleX(1);
  transition: transform 1.9s var(--ease) 0.2s;
}

.impl__caption {
  margin: 1.5rem 0 0;
  font-size: 0.95rem;
  color: var(--text-dim);
}

/* ================================================================== *
 * PHILOSOPHY — a single quote, alone
 * ================================================================== */
.philosophy {
  padding: clamp(8rem, 20vh, 16rem) 1.5rem;
  display: flex;
  justify-content: center;
}
.philosophy__quote {
  margin: 0;
  max-width: 34rem;
  text-align: center;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.7rem, 5vw, 3rem);
  line-height: 1.42;
  color: var(--text);
}
.philosophy__quote span { display: block; }
.philosophy__quote span + span { margin-top: 0.6rem; }

/* ================================================================== *
 * FOOTER
 * ================================================================== */
.footer {
  border-top: 1px solid var(--line);
  padding: clamp(4rem, 10vh, 7rem) 1.5rem clamp(3rem, 8vh, 5rem);
  text-align: center;
}
.footer__name {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.footer__line {
  margin: 1.25rem auto 0;
  max-width: 30rem;
  font-size: 0.95rem;
  color: var(--text-faint);
  line-height: 1.7;
}
.footer__mark {
  margin: 2.5rem 0 0;
  font-size: 0.8rem;
  color: var(--text-faint);
  letter-spacing: 0.04em;
}

/* ================================================================== *
 * BOOT SEQUENCE — a scientific terminal bringing systems online
 * An old instrument waking: lines typed in real time, dot-leaders resolving
 * to OK, a blinking cursor, each completed line dimming as the next takes the
 * light. It reads as laboratory equipment, never as a hacker console.
 * ================================================================== */
#boot {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 1;
  transition: opacity 1.1s var(--ease);
}
#boot.boot--out {
  opacity: 0;
  pointer-events: none;
}
/* Shown only for JS readers who welcome motion. Never for no-JS readers, and
   never for those who asked for stillness — decided before first paint by the
   inline head script, so the overlay cannot flash for either. */
.no-js #boot,
.reduce #boot { display: none !important; }

/* A faint screen vignette, so the overlay reads as a lit panel, not a void. */
#boot::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(120% 90% at 50% 45%, transparent 52%, rgba(0, 0, 0, 0.5));
}

.term {
  position: relative;
  z-index: 1;
  width: min(36rem, 90vw);
  font-family: var(--mono);
  font-size: clamp(0.72rem, 2.5vw, 0.9rem);
  line-height: 2.0;
  letter-spacing: 0.02em;
}

.term__line {
  white-space: pre;          /* preserve dot-leader alignment */
  color: var(--text-faint);
  opacity: 0.34;
  transition: opacity 0.8s var(--ease), color 0.8s var(--ease);
}
/* The current line takes the light — brighter, with a soft instrument glow. */
.term__line.is-active {
  opacity: 1;
  color: #e9f0fb;
  text-shadow: 0 0 10px rgba(111, 168, 255, 0.30);
}
/* The opening line and the arrival speak in the structural cyan / soft white. */
.term__line--head { color: var(--cyan); }
.term__line--head.is-active { color: var(--cyan); text-shadow: 0 0 10px var(--cyan-quiet); }

.term__dots { color: var(--text-faint); opacity: 0.7; }
.term__ok {
  color: var(--blue);
  text-shadow: 0 0 8px var(--blue-glow);
}

/* The arrival — "System ready." — is the single moment the rare violet joins
   the blue, the deepest note in the sequence. */
.term__line--ready { margin-top: 0.5rem; color: #eef2f8; }
.term__line--ready.is-active {
  color: #f2f5fa;
  text-shadow: 0 0 12px var(--violet-glow), 0 0 26px rgba(111, 168, 255, 0.22);
}

/* The cursor: a solid block that blinks like a real terminal (hard on/off,
   no fade), riding the end of the active line. */
.term__cursor {
  display: inline-block;
  width: 0.6em;
  height: 1.05em;
  margin-left: 0.06em;
  vertical-align: -0.16em;
  background: var(--blue);
  box-shadow: 0 0 8px var(--blue-glow);
  animation: term-blink 1.05s steps(1, end) infinite;
}
@keyframes term-blink {
  0%, 50%      { opacity: 1; }
  50.01%, 100% { opacity: 0; }
}

/* ------------------------------------------------------------------ *
 * Responsive — the phone is a distillation, not a compression accident
 * (FORGE-002 Principle 14).
 * ------------------------------------------------------------------ */
@media (max-width: 640px) {
  .records__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 380px) {
  .records__grid {
    grid-template-columns: 1fr;
  }
  .hero__title { letter-spacing: 0.1em; text-indent: 0.1em; }
}
