/* ============================================================================
   THE CURRENT — the immense main-site direction of The Luminous Circuit
   v3/styles.css
   ----------------------------------------------------------------------------
   One continuous field of living light (WebGL, hand-written, zero-dep) runs
   beneath a monumental typographic liturgy. Laws:
   1. Awe, never urgency. Nothing counts down, nothing pushes.
   2. The default stylesheet is the finished page: no-JS, reduced-motion,
      screen readers, and print receive the complete, beautiful document.
      All choreography sits behind prefers-reduced-motion: no-preference,
      html[data-anim-ready], and the visitor's own Be-still toggle.
   3. Doctrine verbatim; notices plain; the boundary is always on the page.
   ============================================================================ */

:root {
  color-scheme: dark;

  --cx-black: #060409;
  --cx-deep: #0B0713;
  --cx-deep-2: #120B1D;

  --cx-gold: #C9A227;
  --cx-gold-deep: #8F6E14;
  --cx-gold-hot: #F3D778;
  --cx-light: #F6ECD4;          /* body light                      */
  --cx-light-dim: #CDBFA4;
  --cx-light-faint: #92896F;

  --cx-violet: #5E3AA0;
  --cx-cyan: #3FA0B4;
  --cx-rose: #B05485;

  --cx-foil: linear-gradient(165deg, #F3D778 0%, #C9A227 40%, #8F6E14 64%, #E8CB6B 100%);

  --cx-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --cx-body: "Newsreader", "Iowan Old Style", Georgia, serif;
  --cx-mono: "IBM Plex Mono", ui-monospace, "Courier New", monospace;

  --cx-size-immense: clamp(64px, 13vw, 210px);
  --cx-size-vast: clamp(44px, 8.5vw, 132px);
  --cx-size-line: clamp(24px, 3.6vw, 48px);
  --cx-size-body: clamp(17px, 1.1vw + 13px, 19px);
  --cx-size-label: 13px;
  --cx-size-micro: 11.5px;

  --cx-ease: cubic-bezier(0.16, 0.84, 0.24, 1);

  /* Set by the pointer-light rig (JS); harmless defaults without it. */
  --px: 50vw;
  --py: 40vh;
}

* { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; background: var(--cx-black); }

body {
  margin: 0;
  min-height: 100%;
  color: var(--cx-light);
  font-family: var(--cx-body);
  font-size: var(--cx-size-body);
  font-weight: 400;
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* The finished field, without any JS at all: a still of the current. */
  background:
    radial-gradient(90% 60% at 50% -5%, rgba(94, 58, 160, 0.34), transparent 62%),
    radial-gradient(52% 44% at 50% 30%, rgba(201, 162, 39, 0.17), transparent 70%),
    radial-gradient(70% 55% at 18% 78%, rgba(63, 160, 180, 0.12), transparent 70%),
    radial-gradient(70% 55% at 84% 92%, rgba(176, 84, 133, 0.10), transparent 70%),
    var(--cx-black);
}

::selection { background: rgba(201, 162, 39, 0.4); color: #fff; }
a { color: var(--cx-light); text-decoration: underline; text-decoration-color: rgba(201, 162, 39, 0.55); text-underline-offset: 3px; }
a:hover { color: var(--cx-gold-hot); }
button, input { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--cx-gold-hot); outline-offset: 3px; }

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; top: -80px; left: 20px; z-index: 400;
  padding: 10px 18px; background: var(--cx-gold); color: var(--cx-black);
  font-family: var(--cx-mono); font-size: var(--cx-size-label);
  letter-spacing: 0.12em; text-transform: uppercase; text-decoration: none;
}
.skip-link:focus { top: 14px; }

/* ============================================================================
   THE FIELD — fixed layers under everything
   ============================================================================ */
.field-canvas { position: fixed; inset: 0; z-index: 0; pointer-events: none; }

/* Filmic grain: inline SVG turbulence, blended, printably invisible. */
.grain {
  position: fixed; inset: -50%;
  z-index: 3;
  pointer-events: none;
  opacity: 0.055;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Cursor light: the page notices you. JS moves --px/--py; base = center. */
.pointer-light {
  position: fixed; inset: 0;
  z-index: 2;
  pointer-events: none;
  background: radial-gradient(340px 340px at var(--px) var(--py), rgba(243, 215, 120, 0.075), transparent 68%);
}
html:not([data-anim-ready]) .pointer-light,
html[data-still="on"] .pointer-light { display: none; }
@media (prefers-reduced-motion: reduce) { .pointer-light { display: none; } }
@media (hover: none) { .pointer-light { display: none; } }

.vignette {
  position: fixed; inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(130% 100% at 50% 0%, transparent 45%, rgba(6, 4, 9, 0.5) 100%),
    radial-gradient(150% 110% at 50% 100%, transparent 55%, rgba(6, 4, 9, 0.72) 100%);
}

main { position: relative; z-index: 4; }

/* ============================================================================
   TOP RAIL — quiet chrome
   ============================================================================ */
.rail {
  position: fixed; top: 0; left: 0; right: 0; z-index: 300;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 24px;
  font-family: var(--cx-mono); font-size: var(--cx-size-micro);
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--cx-light-faint);
  background: linear-gradient(to bottom, rgba(6, 4, 9, 0.85), rgba(6, 4, 9, 0));
}
.rail a { color: var(--cx-light-dim); text-decoration: none; }
.rail a:hover, .rail a:focus-visible { color: var(--cx-gold-hot); }
.rail-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--cx-light); }
.rail-brand img { display: block; }
.rail-links { display: flex; gap: 22px; flex-wrap: wrap; }

.still-toggle {
  cursor: pointer;
  background: transparent;
  border: 1px solid rgba(201, 162, 39, 0.5);
  color: var(--cx-light-dim);
  font-family: var(--cx-mono); font-size: var(--cx-size-micro);
  letter-spacing: 0.14em; text-transform: uppercase;
  padding: 6px 12px; min-height: 32px;
  border-radius: 2px;
}
.still-toggle[aria-pressed="true"] { background: var(--cx-gold); color: var(--cx-black); border-color: var(--cx-gold); }
html:not([data-anim-ready]) .still-toggle { display: none; }

/* ============================================================================
   MOVEMENTS — the flowing sections
   ============================================================================ */
.movement {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 22vh 24px;
}
.movement-inner { max-width: 1160px; width: 100%; text-align: center; }

.kicker {
  font-family: var(--cx-mono);
  font-size: var(--cx-size-label);
  font-weight: 500;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--cx-light-dim);
  margin: 0 0 34px;
}
.kicker .k-dim { color: var(--cx-light-faint); }

/* Foil type — lawful here; the record's discipline stays in v2. */
.foil {
  background-image: var(--cx-foil);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.title-immense {
  font-family: var(--cx-display);
  font-weight: 340;
  font-variation-settings: "opsz" 144, "SOFT" 0, "WONK" 0;
  font-size: var(--cx-size-immense);
  line-height: 0.96;
  letter-spacing: 0.005em;
  margin: 0;
  text-wrap: balance;
}
.title-vast {
  font-family: var(--cx-display);
  font-weight: 380;
  font-variation-settings: "opsz" 144, "SOFT" 0, "WONK" 0;
  font-size: var(--cx-size-vast);
  line-height: 1.02;
  margin: 0 0 30px;
  text-wrap: balance;
}

.line-immense {
  font-family: var(--cx-body);
  font-style: italic;
  font-size: var(--cx-size-line);
  line-height: 1.48;
  margin: 0;
  text-wrap: balance;
}

.sub-line {
  font-family: var(--cx-body);
  font-style: italic;
  font-size: clamp(19px, 2.2vw, 28px);
  color: var(--cx-light-dim);
  margin: 36px 0 0;
}

.prose { max-width: 60ch; margin: 0 auto; color: var(--cx-light-dim); }

.seam {
  display: flex; align-items: center; gap: 20px;
  width: min(420px, 70%);
  margin: 40px auto;
  border: 0; padding: 0;
}
.seam::before, .seam::after {
  content: ""; flex: 1; height: 1px;
  background: linear-gradient(to right, transparent, rgba(201, 162, 39, 0.75), transparent);
}
.seam .lozenge {
  width: 9px; height: 9px; transform: rotate(45deg);
  background: var(--cx-foil);
  box-shadow: 0 0 18px rgba(201, 162, 39, 0.55);
}

.cue {
  position: absolute; bottom: 32px; left: 50%; transform: translateX(-50%);
  font-family: var(--cx-mono); font-size: var(--cx-size-micro);
  letter-spacing: 0.32em; text-transform: uppercase;
  color: var(--cx-light-faint);
  text-decoration: none;
}
.cue:hover, .cue:focus-visible { color: var(--cx-gold-hot); }

/* ---------- Entrances: base = visible; pre-states only under the gates ----- */
.rise > * { display: block; }
@media (prefers-reduced-motion: no-preference) {
  html[data-anim-ready]:not([data-still="on"]) .rise > * {
    opacity: 0;
    transform: translateY(38px);
  }
  html[data-anim-ready]:not([data-still="on"]) .rise.is-on > * {
    opacity: 1;
    transform: none;
    transition: opacity 1200ms var(--cx-ease), transform 1200ms var(--cx-ease);
  }
  html[data-anim-ready]:not([data-still="on"]) .rise.is-on > *:nth-child(2) { transition-delay: 150ms; }
  html[data-anim-ready]:not([data-still="on"]) .rise.is-on > *:nth-child(3) { transition-delay: 300ms; }
  html[data-anim-ready]:not([data-still="on"]) .rise.is-on > *:nth-child(4) { transition-delay: 450ms; }
  html[data-anim-ready]:not([data-still="on"]) .rise.is-on > *:nth-child(5) { transition-delay: 600ms; }
  html[data-anim-ready]:not([data-still="on"]) .rise.is-on > *:nth-child(6) { transition-delay: 750ms; }

  /* First light: one veil, once. */
  html[data-anim-ready]:not([data-still="on"]) body::after {
    content: "";
    position: fixed; inset: 0; z-index: 350;
    background: var(--cx-black);
    pointer-events: none;
    animation: first-light 2100ms var(--cx-ease) 200ms forwards;
  }
  @keyframes first-light { to { opacity: 0; visibility: hidden; } }
}

/* ============================================================================
   THE LOOP — six immense moments + the filament
   ============================================================================ */
.loop-moment {
  position: relative;
  min-height: 92vh;
  display: grid;
  place-items: center;
  padding: 14vh 24px;
}
.loop-moment .movement-inner { max-width: 1000px; }
.stage-no {
  font-family: var(--cx-mono);
  font-size: var(--cx-size-label);
  font-weight: 500;
  letter-spacing: 0.4em;
  color: var(--cx-gold);
  margin: 0 0 18px;
}
.stage-word {
  font-family: var(--cx-display);
  font-weight: 330;
  font-variation-settings: "opsz" 144, "SOFT" 0, "WONK" 0;
  font-size: clamp(52px, 9.5vw, 150px);
  line-height: 1;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin: 0;
}
.stage-gloss {
  font-family: var(--cx-body);
  font-style: italic;
  font-size: clamp(18px, 2.2vw, 27px);
  color: var(--cx-light-dim);
  margin: 26px 0 0;
}

/* The filament: a fixed golden thread that burns with loop progress.
   Base (no JS): fully lit. */
.filament {
  position: fixed;
  left: max(18px, 2.6vw);
  top: 16vh; bottom: 16vh;
  width: 2px;
  z-index: 5;
  background: linear-gradient(to bottom, var(--cx-gold-hot), var(--cx-gold) 60%, var(--cx-gold-deep));
  opacity: 0;
  pointer-events: none;
}
.filament .filament-node {
  position: absolute;
  left: 50%; top: calc(var(--loop-progress, 1) * 100%);
  width: 11px; height: 11px;
  transform: translate(-50%, -50%) rotate(45deg);
  background: var(--cx-foil);
  box-shadow: 0 0 22px rgba(243, 215, 120, 0.8);
}
html[data-loop-active] .filament { opacity: 1; transition: opacity 600ms var(--cx-ease); }
@media (prefers-reduced-motion: no-preference) {
  html[data-anim-ready]:not([data-still="on"]) .filament {
    background: linear-gradient(
      to bottom,
      var(--cx-gold-hot),
      var(--cx-gold) calc(var(--loop-progress, 1) * 100%),
      rgba(201, 162, 39, 0.16) calc(var(--loop-progress, 1) * 100% + 0.5%)
    );
  }
}
@media (max-width: 860px) { .filament { display: none; } }

/* ============================================================================
   THE ARTICLES — immense numerals, editorial calm
   ============================================================================ */
.articles { max-width: 880px; margin: 0 auto; text-align: left; }
.article-row {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 10px 32px;
  align-items: start;
  padding: 34px 0;
  border-bottom: 1px solid rgba(201, 162, 39, 0.2);
}
.article-row:last-child { border-bottom: 0; }
.article-no {
  font-family: var(--cx-display);
  font-weight: 300;
  font-variation-settings: "opsz" 144;
  font-size: clamp(46px, 5.6vw, 80px);
  line-height: 1;
}
.article-row h3 {
  font-family: var(--cx-display);
  font-weight: 460;
  font-size: clamp(21px, 2.4vw, 31px);
  margin: 0 0 8px;
  color: var(--cx-light);
}
.article-row p { margin: 0; color: var(--cx-light-dim); font-size: 16.5px; }

/* ============================================================================
   THE RHYTHM — the week, immense and quiet
   ============================================================================ */
.rhythm { max-width: 840px; margin: 0 auto; text-align: left; }
.rhythm-row {
  display: grid;
  grid-template-columns: minmax(170px, 250px) 1fr;
  gap: 8px 30px;
  padding: 26px 4px;
  border-bottom: 1px solid rgba(201, 162, 39, 0.18);
  align-items: baseline;
}
.rhythm-row:last-child { border-bottom: 0; }
.rhythm-when {
  font-family: var(--cx-mono);
  font-size: 13.5px; font-weight: 500;
  letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--cx-gold-hot);
}
.rhythm-what { color: var(--cx-light); font-size: clamp(18px, 2vw, 24px); font-family: var(--cx-display); font-weight: 420; }
.rhythm-what .desc { display: block; font-family: var(--cx-body); font-size: 15.5px; color: var(--cx-light-dim); font-style: italic; margin-top: 4px; }

/* ============================================================================
   THE INVITATION
   ============================================================================ */
.grand-cta {
  display: inline-block;
  position: relative;
  overflow: hidden;
  margin-top: 44px;
  padding: 21px 54px;
  min-height: 44px;
  border-radius: 3px;
  background-image: var(--cx-foil);
  color: var(--cx-black);
  font-family: var(--cx-mono);
  font-size: 15px; font-weight: 500;
  letter-spacing: 0.26em; text-transform: uppercase;
  text-decoration: none;
  box-shadow: 0 0 50px rgba(201, 162, 39, 0.35), 0 10px 44px rgba(0, 0, 0, 0.55);
}
.grand-cta::after {
  content: "";
  position: absolute; top: 0; bottom: 0; left: -60%;
  width: 40%;
  background: linear-gradient(105deg, transparent, rgba(255, 250, 230, 0.75), transparent);
  transform: skewX(-18deg);
}
@media (prefers-reduced-motion: no-preference) {
  html[data-anim-ready]:not([data-still="on"]) .grand-cta:hover::after,
  html[data-anim-ready]:not([data-still="on"]) .grand-cta:focus-visible::after {
    animation: sheen 900ms var(--cx-ease);
  }
  @keyframes sheen { to { left: 120%; } }
}
.grand-cta:hover, .grand-cta:focus-visible { color: #000; }

.doors {
  display: flex; gap: 28px; justify-content: center; flex-wrap: wrap;
  margin-top: 48px;
  font-family: var(--cx-mono); font-size: var(--cx-size-micro);
  letter-spacing: 0.2em; text-transform: uppercase;
}
.doors a {
  color: var(--cx-light-dim); text-decoration: none;
  border-bottom: 1px solid rgba(201, 162, 39, 0.45);
  padding-bottom: 4px;
}
.doors a:hover, .doors a:focus-visible { color: var(--cx-gold-hot); border-color: var(--cx-gold-hot); }

/* ============================================================================
   NOTES — boundary + colophon (plain, always present)
   ============================================================================ */
.notes {
  position: relative; z-index: 4;
  background: rgba(11, 7, 19, 0.92);
  border-top: 1px solid rgba(201, 162, 39, 0.35);
  padding: 70px 24px 60px;
  text-align: center;
}
.notes-inner { max-width: 760px; margin: 0 auto; }
.notes-notice {
  border: 1px solid rgba(246, 236, 212, 0.35);
  border-radius: 3px;
  padding: 26px 30px;
  text-align: left;
  color: var(--cx-light-dim);
  font-size: 15px;
  background: rgba(6, 4, 9, 0.5);
}
.notes-notice .notice-title {
  display: block;
  font-family: var(--cx-mono); font-size: 12px; font-weight: 500;
  letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--cx-light);
  margin-bottom: 10px;
}
.notes-notice p { margin: 0 0 12px; }
.notes-notice p:last-child { margin: 0; }
.notes .imprint {
  font-family: var(--cx-mono); font-size: var(--cx-size-micro);
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--cx-light-faint);
  margin: 26px 0 4px;
}
.notes .small { font-size: 13.5px; color: var(--cx-light-faint); max-width: 64ch; margin: 18px auto 0; }
.notes nav { margin-top: 22px; }
.notes nav a { color: var(--cx-light-dim); margin: 0 12px; font-size: 14px; }

/* ============================================================================
   RESPONSIVE
   ============================================================================ */
@media (max-width: 720px) {
  .movement { padding: 18vh 20px; }
  .article-row { grid-template-columns: 64px 1fr; gap: 6px 18px; }
  .rhythm-row { grid-template-columns: 1fr; padding: 18px 2px; }
  .rail-links { display: none; }
}

/* ============================================================================
   PRINT — the page prints as a clean program
   ============================================================================ */
@media print {
  html, body { background: #fff; }
  body { color: #201812; }
  .field-canvas, .grain, .pointer-light, .vignette, .rail, .still-toggle, .cue, .filament { display: none !important; }
  .movement, .loop-moment { min-height: auto; padding: 22pt 0; }
  .foil, .article-no { background: none; -webkit-background-clip: initial; background-clip: initial; color: #8F6E14; }
  .title-immense, .title-vast, .stage-word, .line-immense, .article-row h3, .rhythm-what { color: #201812; }
  .prose, .article-row p, .stage-gloss, .sub-line, .rhythm-what .desc { color: #4A3F33; }
  .kicker, .stage-no, .rhythm-when { color: #8A2D1F; }
  .notes { background: #fff; border-top: 2pt solid #201812; }
  .notes-notice { border-color: #201812; background: #fff; color: #4A3F33; }
  .notes-notice .notice-title { color: #201812; }
  .grand-cta { background: none; border: 2pt solid #201812; color: #201812; box-shadow: none; }
  .notes .imprint, .notes .small { color: #7D7160; }
}
