/* ============================================================
   AGORA COSMICA — VOICES IN THE DARK
   Audio first. Embers and typography in a near dark navy night.
   ============================================================ */

@import url('../../shared/brand.css');

:root {
  --night: #0C1133;
  --night-deep: #080B20;
  --ease: var(--ease-out-expo);
  --ease-soft: var(--ease-in-out-soft);
  --z-nebula: 4;
  --z-portrait: 8;
  --z-sky: 15;
  --z-dawn: 20;
  --z-embers: 25;
  --z-content: 40;
  --z-ui: 60;
  --z-fx: 85;
  --z-loader: 95;
  --z-cursor: 100;
}

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

html {
  background: var(--night);
  scrollbar-width: thin;
  scrollbar-color: rgba(212, 165, 57, 0.35) rgba(8, 11, 32, 0.9);
}
html.is-locked { overflow: hidden; }

body {
  background:
    radial-gradient(120% 90% at 50% 0%, #101743 0%, var(--night) 46%, #0A0E2B 100%);
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-weight: 300;
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: rgba(230, 188, 92, 0.28); color: #F4E9CB; }

a { color: var(--text-secondary); }

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

:focus { outline: none; }
:focus-visible {
  outline: 1px solid var(--gold-hover);
  outline-offset: 4px;
  border-radius: 2px;
}

@media (hover: hover) and (pointer: fine) {
  html.has-cursor, html.has-cursor a, html.has-cursor button { cursor: none; }
}

/* ---------- Loader ---------- */
#loader {
  position: fixed; inset: 0;
  z-index: var(--z-loader);
  display: grid; place-items: center;
  background:
    radial-gradient(120% 90% at 50% 0%, #101743 0%, var(--night) 46%, #0A0E2B 100%);
  transition: opacity 1s var(--ease-soft), visibility 1s;
}
#loader.is-done { opacity: 0; visibility: hidden; pointer-events: none; }
.loader-inner { display: grid; place-items: center; gap: 22px; text-align: center; }
.loader-mark { overflow: visible; }
.loader-ring {
  stroke-dasharray: 478;
  stroke-dashoffset: 478;
  transform-origin: 50% 50%;
  transform: rotate(-90deg);
  animation: ringdraw 2.4s var(--ease-soft) infinite;
  filter: drop-shadow(0 0 10px rgba(230, 188, 92, 0.35));
}
@keyframes ringdraw {
  0%   { stroke-dashoffset: 478; opacity: 0.4; }
  55%  { stroke-dashoffset: 0;   opacity: 1; }
  100% { stroke-dashoffset: -478; opacity: 0.4; }
}
.loader-title {
  font-size: 12px; letter-spacing: 0.42em; text-transform: uppercase;
  color: var(--text-secondary); font-weight: 400; padding-left: 0.42em;
}
.loader-line {
  font-family: var(--font-content); font-style: italic;
  font-size: var(--step--1); color: var(--text-tertiary);
}
@media (prefers-reduced-motion: reduce) {
  .loader-ring { animation: none; stroke-dashoffset: 0; opacity: 0.8; }
}

.noscript-panel {
  position: fixed; inset: 0; z-index: 99;
  display: grid; place-content: center; gap: 12px;
  background: var(--night);
  text-align: center; padding: 24px;
  font-size: var(--step-0);
}
.noscript-panel a { color: var(--gold-primary); }

/* ---------- Sky layers ---------- */
.nebula {
  position: fixed; inset: -12%;
  z-index: var(--z-nebula);
  pointer-events: none;
  background:
    radial-gradient(52% 44% at 24% 30%, rgba(180, 200, 255, 0.05) 0%, rgba(180, 200, 255, 0) 100%),
    radial-gradient(60% 52% at 78% 66%, rgba(42, 51, 116, 0.5) 0%, rgba(42, 51, 116, 0) 100%),
    radial-gradient(38% 30% at 62% 22%, rgba(230, 188, 92, 0.035) 0%, rgba(230, 188, 92, 0) 100%);
  will-change: transform;
}

#sky {
  position: fixed; inset: 0;
  z-index: var(--z-sky);
  width: 100%; height: 100%;
  pointer-events: none;
}

.dawnwash {
  position: fixed; inset: 0;
  z-index: var(--z-dawn);
  pointer-events: none;
  opacity: 0;
  background:
    radial-gradient(140% 110% at 50% 108%, rgba(42, 51, 116, 0.62) 0%, rgba(42, 51, 116, 0.18) 46%, rgba(42, 51, 116, 0) 78%);
}

/* Ghost portraits */
.portraits {
  position: fixed; inset: 0;
  z-index: var(--z-portrait);
  pointer-events: none;
  display: grid; place-items: center;
}
.portrait-slot {
  grid-area: 1 / 1;
  height: min(86vh, 120vw);
  aspect-ratio: 3 / 4;
  opacity: 0;
  transform: scale(1.015);
  transition: opacity 1.4s var(--ease-soft), transform 1.4s var(--ease-soft);
  -webkit-mask-image: radial-gradient(72% 66% at 50% 42%, rgba(0,0,0,0.9) 30%, rgba(0,0,0,0) 74%);
  mask-image: radial-gradient(72% 66% at 50% 42%, rgba(0,0,0,0.9) 30%, rgba(0,0,0,0) 74%);
}
.portrait-slot img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: grayscale(0.82) brightness(0.66) contrast(0.94);
}
.portrait-slot.is-in {
  opacity: 0.16;
  transform: scale(1.0);
  animation: portraitDrift 16s var(--ease-soft) infinite alternate;
}
@keyframes portraitDrift {
  from { transform: scale(1.0); }
  to   { transform: scale(1.05); }
}
.portrait-wash {
  position: absolute; inset: 0;
  background: rgba(12, 17, 51, 0.42);
}
@media (prefers-reduced-motion: reduce) {
  .portrait-slot.is-in { animation: none; }
}

/* ---------- Ember hit layer ---------- */
#embers { position: fixed; inset: 0; z-index: var(--z-embers); }
.ember-group {
  position: absolute; inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.8s var(--ease-soft);
}
.ember-group.is-live { opacity: 1; pointer-events: auto; }
.ember-hit {
  position: absolute; top: 0; left: 0;
  width: 48px; height: 48px;
  margin: -24px 0 0 -24px;
  border-radius: 50%;
  will-change: transform;
}
.ember-hit:focus-visible {
  outline: 1px solid rgba(246, 213, 92, 0.85);
  outline-offset: 3px;
  border-radius: 50%;
}

/* ---------- Masthead / rail / persistent UI ---------- */
.masthead {
  position: fixed; top: 26px; left: clamp(18px, 3.4vw, 44px);
  z-index: var(--z-ui);
  display: flex; align-items: center; gap: 13px;
  opacity: 0;
  transition: opacity 1.2s var(--ease-soft);
}
html.is-ready .masthead { opacity: 1; }
.mast-mark { filter: drop-shadow(0 0 8px rgba(230, 188, 92, 0.35)); }
.mast-word {
  font-size: 11.5px; letter-spacing: 0.34em; text-transform: uppercase;
  font-weight: 400; color: var(--text-secondary);
}

.rail {
  position: fixed; right: clamp(14px, 2.2vw, 30px); top: 50%;
  transform: translateY(-50%);
  z-index: var(--z-ui);
  display: flex; flex-direction: column; gap: 17px;
  opacity: 0; pointer-events: none;
  transition: opacity 1s var(--ease-soft);
}
html.is-unlocked .rail { opacity: 1; pointer-events: auto; }
.rail-tick { display: flex; align-items: center; gap: 10px; flex-direction: row-reverse; padding: 2px; }
.rail-dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: rgba(210, 210, 210, 0.35);
  transition: background 0.5s, box-shadow 0.5s, transform 0.5s var(--ease);
}
.rail-dot-ring { box-shadow: 0 0 0 3px rgba(212, 165, 57, 0.22); }
.rail-dot-hollow { background: none; border: 1px solid rgba(212, 165, 57, 0.55); width: 6px; height: 6px; }
.rail-name {
  font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--text-tertiary);
  opacity: 0; transform: translateX(6px);
  transition: opacity 0.45s var(--ease), transform 0.45s var(--ease);
  white-space: nowrap;
}
.rail-tick:hover .rail-name, .rail-tick:focus-visible .rail-name { opacity: 1; transform: none; }
.rail-tick.is-here .rail-dot {
  background: var(--gold-ui);
  box-shadow: 0 0 10px rgba(230, 188, 92, 0.6);
  transform: scale(1.35);
}
.rail-tick.is-here .rail-dot-hollow { background: none; }

.ticker {
  position: fixed; left: clamp(18px, 3.4vw, 44px); bottom: 22px;
  z-index: var(--z-ui);
  display: flex; align-items: center; gap: 11px;
  opacity: 0; transform: translateY(8px);
  transition: opacity 0.7s var(--ease-soft), transform 0.7s var(--ease);
  pointer-events: none;
  max-width: min(64vw, 460px);
}
.ticker.is-on { opacity: 1; transform: none; }
.eq { display: flex; align-items: flex-end; gap: 2.5px; height: 12px; }
.eq i {
  width: 2.5px; height: 100%;
  background: var(--gold-ui);
  border-radius: 2px;
  transform: scaleY(0.2);
  transform-origin: bottom;
  will-change: transform;
}
.ticker-text {
  font-size: 10.5px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--text-tertiary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.mute {
  position: fixed; right: 20px; bottom: 16px;
  z-index: calc(var(--z-ui) + 10);
  width: 46px; height: 46px;
  border-radius: 50%;
  display: grid; place-items: center;
  color: var(--text-secondary);
  border: 1px solid rgba(202, 202, 202, 0.18);
  background: rgba(12, 17, 51, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: color 0.4s, border-color 0.4s, box-shadow 0.4s;
  opacity: 0;
}
html.is-ready .mute { opacity: 1; transition: color .4s, border-color .4s, box-shadow .4s, opacity 1.2s var(--ease-soft); }
.mute:hover { color: var(--gold-hover); border-color: rgba(246, 213, 92, 0.5); box-shadow: 0 0 18px rgba(230, 188, 92, 0.18); }
.mute .mute-slash { opacity: 0; transition: opacity 0.3s; }
.mute[aria-pressed="true"] .mute-slash { opacity: 1; }
.mute[aria-pressed="true"] .mute-wave { opacity: 0.25; }

/* ---------- Shared text atoms ---------- */
.eyebrow {
  font-size: 11px; letter-spacing: 0.32em; text-transform: uppercase;
  color: var(--gold-ui); font-weight: 400;
}
.btn {
  display: inline-block;
  font-size: 12.5px; letter-spacing: 0.19em; text-transform: uppercase;
  font-weight: 400;
  color: var(--text-secondary);
  border: 1px solid rgba(202, 202, 202, 0.26);
  border-radius: 999px;
  padding: 15px 30px;
  text-decoration: none;
  transition: color 0.45s, border-color 0.45s, box-shadow 0.45s, background 0.45s, transform 0.45s var(--ease);
}
.btn:hover {
  color: var(--gold-hover);
  border-color: rgba(246, 213, 92, 0.55);
  box-shadow: 0 0 26px rgba(230, 188, 92, 0.14);
  transform: translateY(-1px);
}
.btn-gold { color: var(--gold-primary); border-color: rgba(230, 188, 92, 0.5); }
.btn-gold:hover { background: rgba(230, 188, 92, 0.07); }
.btn-primary {
  color: #0C1133; background: var(--gold-ui);
  border-color: var(--gold-ui);
  font-weight: 500;
}
.btn-primary:hover {
  color: #0C1133; background: var(--gold-hover); border-color: var(--gold-hover);
  box-shadow: 0 0 34px rgba(246, 213, 92, 0.3);
}

/* ---------- Overlays ---------- */
.ovl {
  position: fixed; inset: 0;
  z-index: var(--z-content);
  display: grid; place-items: center;
  text-align: center;
  padding: 24px;
  opacity: 0; visibility: hidden;
  pointer-events: none;
  transition: opacity 1s var(--ease-soft), visibility 1s;
}
.ovl.is-on { opacity: 1; visibility: visible; }
#ovl-dawn .btn { pointer-events: auto; }

/* Entry: title breathes at the top, the ember owns the center,
   the choice waits below. */
.entry-inner {
  width: 100%; height: 100%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: space-between;
  padding: 15vh 24px 10vh;
}
.entry-title {
  font-size: var(--step-1);
  font-weight: 300;
  letter-spacing: 0.5em; padding-left: 0.5em;
  text-transform: uppercase;
  color: var(--text-primary);
}
.entry-tagline {
  font-family: var(--font-content); font-style: italic;
  font-size: var(--step-0);
  color: var(--text-tertiary);
  margin-top: 16px;
}
.entry-choices { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; }
.entry-etiquette {
  font-size: 11px; letter-spacing: 0.14em;
  color: var(--text-tertiary);
  margin-top: 26px;
  opacity: 0.85;
}
#ovl-entry .btn { pointer-events: auto; }
#ovl-entry:not(.is-on) .btn { pointer-events: none; }

/* Poem */
.poem-inner { display: grid; gap: clamp(26px, 4.5vh, 44px); place-items: center; }
.poem { display: grid; gap: clamp(18px, 3.2vh, 30px); }
.poem-line {
  font-family: var(--font-content);
  font-style: italic;
  font-size: var(--step-3);
  line-height: 1.42;
  color: var(--text-primary);
  opacity: 0;
  transform: translateY(16px);
  filter: blur(7px);
  text-shadow: 0 0 var(--pg-r, 8px) rgba(230, 188, 92, var(--pg-a, 0.1));
  transition: opacity 1.7s var(--ease-soft), transform 1.7s var(--ease), filter 1.7s var(--ease-soft);
}
.poem-line.is-lit { opacity: 1; transform: none; filter: blur(0); }

.skip {
  position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%);
  z-index: var(--z-ui);
  font-size: 10.5px; letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--text-tertiary);
  padding: 10px 18px;
  opacity: 0;
  transition: opacity 0.8s, color 0.3s;
}
.skip.is-on { opacity: 0.75; }
.skip:hover { color: var(--gold-hover); }

.hint {
  position: fixed; bottom: 34px; left: 50%; transform: translateX(-50%);
  z-index: var(--z-content);
  font-size: 11px; letter-spacing: 0.26em; text-transform: uppercase;
  color: var(--text-tertiary);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 1.2s var(--ease-soft);
  pointer-events: none;
}
.hint.is-on { opacity: 0.9; animation: hintbreathe 3.6s var(--ease-soft) infinite; }
@keyframes hintbreathe {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 0.95; }
}
.hint-touch { bottom: 108px; }
@media (prefers-reduced-motion: reduce) {
  .hint.is-on { animation: none; opacity: 0.85; }
}

/* Whispers, the questions between constellations */
.ovl-passthru { pointer-events: none; }
.whisper {
  position: fixed; left: 50%; top: 50%;
  z-index: var(--z-content);
  transform: translate(-50%, -50%) translateY(22px);
  width: min(88vw, 30ch);
  text-align: center;
  font-family: var(--font-content); font-style: italic;
  font-size: var(--step-3);
  line-height: 1.45;
  color: var(--text-primary);
  text-shadow: 0 0 26px rgba(230, 188, 92, 0.12);
  opacity: 0; visibility: hidden;
  transition: opacity 1.1s var(--ease-soft), transform 1.1s var(--ease), visibility 1.1s;
  pointer-events: none;
}
.whisper.is-on { opacity: 1; visibility: visible; transform: translate(-50%, -50%); }
.whisper[data-q="intro"] {
  font-size: var(--step-1);
  color: var(--text-secondary);
}
#gather-kicker { font-size: var(--step-2); }
.gather-sub {
  display: inline-block;
  margin-top: 14px;
  font-size: var(--step-0);
  color: var(--text-tertiary);
}

/* Constellation labels */
.const-label {
  position: fixed;
  left: clamp(18px, 3.4vw, 44px);
  top: clamp(84px, 13vh, 130px);
  z-index: var(--z-content);
  text-align: left;
  opacity: 0; visibility: hidden;
  transform: translateY(14px);
  transition: opacity 0.9s var(--ease-soft), transform 0.9s var(--ease), visibility 0.9s;
  pointer-events: none;
}
.const-label.is-on { opacity: 1; visibility: visible; transform: none; }
.const-label h2 {
  font-size: var(--step-1);
  font-weight: 300;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--text-primary);
  margin-top: 10px;
}
.const-count {
  font-size: 11px; letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--text-tertiary);
  margin-top: 8px;
}

/* ---------- Figure caption ---------- */
#caption {
  position: fixed;
  left: clamp(18px, 3.4vw, 44px);
  bottom: clamp(86px, 13vh, 128px);
  z-index: var(--z-content);
  width: min(400px, calc(100vw - 36px));
  text-align: left;
  opacity: 0; visibility: hidden;
  transform: translateY(18px);
  transition: opacity 0.9s var(--ease-soft), transform 0.9s var(--ease), visibility 0.9s;
  pointer-events: none;
  padding-left: 18px;
  border-left: 1px solid rgba(230, 188, 92, 0.35);
}
#caption.is-on { opacity: 1; visibility: visible; transform: none; pointer-events: auto; }
.cap-meta {
  font-size: 10.5px; letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--text-tertiary);
}
.cap-name {
  font-family: var(--font-content);
  font-weight: 400;
  font-size: var(--step-2);
  line-height: 1.2;
  color: var(--text-primary);
  margin-top: 8px;
}
.cap-epithet {
  font-family: var(--font-content); font-style: italic;
  font-size: var(--step-0);
  color: var(--gold-primary);
  margin-top: 4px;
}
.cap-epithet:empty { display: none; }
.cap-wisdom {
  font-family: var(--font-content); font-style: italic;
  font-size: var(--step-0);
  line-height: 1.65;
  color: var(--text-secondary);
  margin-top: 14px;
  max-width: 34ch;
}
.cap-honesty {
  font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--text-tertiary);
  margin-top: 14px;
  display: flex; align-items: center; gap: 8px;
}
.cap-honesty::before {
  content: "";
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--gold-ui);
  box-shadow: 0 0 6px rgba(230, 188, 92, 0.8);
  flex: none;
}
.cap-audio { display: flex; align-items: center; gap: 12px; margin-top: 16px; }
.playbtn {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(230, 188, 92, 0.55);
  color: var(--gold-primary);
  display: grid; place-items: center;
  transition: color 0.35s, border-color 0.35s, box-shadow 0.35s;
  flex: none;
}
.playbtn:hover { color: var(--gold-hover); border-color: var(--gold-hover); box-shadow: 0 0 18px rgba(230, 188, 92, 0.25); }
.playbtn .ic-pause { display: none; }
.playbtn.is-playing .ic-pause { display: block; }
.playbtn.is-playing .ic-play { display: none; }
.cap-audio-label {
  font-size: 10.5px; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--text-tertiary);
}

/* ---------- Council ---------- */
#ovl-council {
  display: flex; flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: clamp(84px, 12vh, 120px) 24px clamp(66px, 9vh, 96px);
}
#ovl-council.is-on { pointer-events: auto; }
.council-top { text-align: center; }
.council-title {
  font-size: var(--step-2);
  font-weight: 300;
  letter-spacing: 0.24em; padding-left: 0.24em;
  text-transform: uppercase;
  color: var(--text-primary);
}
.council-sub {
  font-family: var(--font-content); font-style: italic;
  font-size: var(--step-1);
  color: var(--gold-primary);
  margin-top: 10px;
}
.council-members {
  display: none;
  font-size: 10.5px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--text-tertiary);
  margin-top: 14px;
}
.council-honesty {
  font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--text-tertiary);
  opacity: 0.8;
  margin-top: 7px;
}

#ring-names { position: fixed; inset: 0; pointer-events: none; }
.ring-name {
  position: absolute; left: 50%; top: 50%;
  font-size: 10.5px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--text-tertiary);
  white-space: nowrap;
  opacity: 0;
  transform: translate(-50%, -50%) translate(var(--rx, 0px), var(--ry, 0px));
  transition: opacity 1.1s var(--ease-soft), color 0.6s;
}
#ovl-council.is-convened .ring-name { opacity: 0.9; }

.council-bottom { display: grid; place-items: center; gap: 18px; width: 100%; }

/* The framing lines hang inside the ring, over the core,
   echoing the poem over the ember. */
.council-excerpt {
  position: fixed; inset: 0;
  display: grid; place-items: center;
  pointer-events: none;
}
.excerpt-line {
  grid-area: 1 / 1;
  width: min(84vw, 40ch);
  text-align: center;
  font-family: var(--font-content); font-style: italic;
  font-size: var(--step-1);
  line-height: 1.6;
  color: var(--text-primary);
  text-shadow: 0 0 22px rgba(230, 188, 92, 0.12);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 1.2s var(--ease-soft), transform 1.2s var(--ease);
}
.excerpt-line.is-on { opacity: 1; transform: none; }

.phases {
  list-style: none;
  display: flex; gap: clamp(16px, 3vw, 34px);
  flex-wrap: wrap; justify-content: center;
}
.phases li {
  font-size: 10.5px; letter-spacing: 0.26em; text-transform: uppercase;
  color: var(--text-tertiary);
  opacity: 0.45;
  transition: opacity 0.8s, color 0.8s, text-shadow 0.8s;
}
.phases li.is-now {
  opacity: 1;
  color: var(--gold-primary);
  text-shadow: 0 0 14px rgba(230, 188, 92, 0.4);
}

.council-controls { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; justify-content: center; }
.council-meta {
  font-size: 10.5px; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--text-tertiary);
}
.btn-quiet-alt {
  font-size: 10.5px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--text-tertiary);
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-color: rgba(158, 158, 158, 0.4);
  transition: color 0.35s;
  padding: 6px 2px;
}
.btn-quiet-alt:hover { color: var(--gold-hover); }

.council-progress {
  width: min(60vw, 300px); height: 1px;
  background: rgba(202, 202, 202, 0.16);
  position: relative;
  overflow: hidden;
}
.council-progress span {
  position: absolute; inset: 0;
  background: linear-gradient(90deg, var(--gold-deep), var(--gold-primary));
  transform: scaleX(0);
  transform-origin: left;
  box-shadow: 0 0 10px rgba(230, 188, 92, 0.5);
}

/* ---------- Dawn / Critical Window ---------- */
#ovl-dawn { align-items: center; }
.dawn-inner { display: grid; place-items: center; gap: 14px; max-width: 65ch; }
.dawn-line {
  font-family: var(--font-content);
  font-size: var(--step-0);
  font-style: italic;
  line-height: 1.7;
  color: var(--text-secondary);
  max-width: 46ch;
}
.dawn-line + .dawn-line { margin-top: 2px; }
.dawn-inner .eyebrow { margin-bottom: 10px; }
.cw-block {
  margin-top: clamp(54px, 10vh, 96px);
  display: grid; place-items: center; gap: 13px;
  opacity: 0; transform: translateY(22px);
  transition: opacity 1.2s var(--ease-soft), transform 1.2s var(--ease);
}
.cw-block.is-on { opacity: 1; transform: none; }
.cw-block h2 {
  font-size: var(--step-3);
  font-weight: 300;
  letter-spacing: 0.3em; padding-left: 0.3em;
  text-transform: uppercase;
  color: var(--text-primary);
}
.cw-line {
  font-family: var(--font-content); font-style: italic;
  font-size: var(--step-1);
  color: var(--text-secondary);
}
.cw-detail {
  font-size: 11.5px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--text-tertiary);
  margin-top: 2px;
}
.cw-block .btn { margin-top: 18px; }

/* ---------- Flow spacers ---------- */
#flow { position: relative; z-index: 1; pointer-events: none; }
.sp { height: calc(var(--h) * 1vh); }

/* ---------- Outro ---------- */
.outro {
  position: relative;
  z-index: var(--z-content);
  min-height: 100vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
  gap: 15px;
  padding: 18vh 24px 0;
}
.outro-poem {
  font-family: var(--font-content); font-style: italic;
  font-size: var(--step-2);
  color: var(--text-primary);
  text-shadow: 0 0 26px rgba(230, 188, 92, 0.14);
}
.outro-stat {
  font-size: var(--step-4);
  font-weight: 300;
  letter-spacing: 0.12em;
  color: var(--gold-primary);
  text-shadow: 0 0 44px rgba(230, 188, 92, 0.25);
  margin-top: 10px;
}
.outro-line {
  font-family: var(--font-content); font-style: italic;
  font-size: var(--step-0);
  color: var(--text-tertiary);
  max-width: 42ch;
}
.outro .btn-primary { margin-top: 30px; }
.outro-claim {
  font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--text-secondary);
  margin-top: 10px;
}
.outro-trust {
  font-size: 10.5px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--text-tertiary);
  margin-top: 4px;
}

.footer {
  margin-top: 15vh;
  padding: 44px 24px 40px;
  width: 100%;
  display: grid; place-items: center; gap: 15px;
  border-top: 1px solid rgba(202, 202, 202, 0.09);
}
.footer-mark { filter: drop-shadow(0 0 10px rgba(212, 165, 57, 0.3)); }
.footer-company {
  font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--text-tertiary);
}
.footer-nav { display: flex; gap: clamp(16px, 4vw, 34px); flex-wrap: wrap; justify-content: center; }
.footer-nav a {
  font-size: 11.5px; letter-spacing: 0.16em;
  color: var(--text-secondary);
  text-decoration: none;
  border-bottom: 1px solid rgba(202, 202, 202, 0.22);
  padding-bottom: 3px;
  transition: color 0.35s, border-color 0.35s;
}
.footer-nav a:hover { color: var(--gold-hover); border-color: rgba(246, 213, 92, 0.6); }
.footer-honesty {
  font-size: 10px; letter-spacing: 0.14em;
  color: var(--text-tertiary);
  opacity: 0.75;
  max-width: 65ch;
}

/* ---------- Texture ---------- */
.vignette {
  position: fixed; inset: 0;
  z-index: var(--z-fx);
  pointer-events: none;
  background: radial-gradient(118% 96% at 50% 46%, rgba(0, 0, 0, 0) 52%, rgba(5, 7, 22, 0.5) 100%);
}
.grain {
  position: fixed; inset: -80px;
  z-index: calc(var(--z-fx) + 1);
  pointer-events: none;
  opacity: 0.05;
  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.82' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 240px 240px;
  animation: grainShift 0.9s steps(2) infinite;
}
@keyframes grainShift {
  0%   { transform: translate3d(0, 0, 0); }
  25%  { transform: translate3d(-38px, 22px, 0); }
  50%  { transform: translate3d(24px, -30px, 0); }
  75%  { transform: translate3d(-16px, -42px, 0); }
  100% { transform: translate3d(30px, 34px, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .grain { animation: none; }
}

/* ---------- Custom cursor ---------- */
#cursor { display: none; }
@media (hover: hover) and (pointer: fine) {
  html.has-cursor #cursor {
    display: block;
    position: fixed; left: 0; top: 0;
    z-index: var(--z-cursor);
    pointer-events: none;
  }
  .cursor-dot {
    position: fixed; left: 0; top: 0;
    width: 5px; height: 5px;
    margin: -2.5px 0 0 -2.5px;
    border-radius: 50%;
    background: var(--gold-primary);
    box-shadow: 0 0 8px rgba(230, 188, 92, 0.8);
    will-change: transform;
  }
  .cursor-ring {
    position: fixed; left: 0; top: 0;
    width: 30px; height: 30px;
    margin: -15px 0 0 -15px;
    border-radius: 50%;
    border: 1px solid rgba(230, 188, 92, 0.45);
    will-change: transform;
    transition: border-color 0.3s;
  }
  html.cursor-hot .cursor-ring { border-color: rgba(246, 213, 92, 0.85); }
}

/* ---------- Small screens ---------- */
@media (max-width: 767px) {
  .rail { display: none; }
  .entry-choices { flex-direction: column; align-items: stretch; margin-top: 9vh; }
  .entry-title { margin-top: 9vh; }
  .const-label {
    left: 50%; top: 76px;
    transform: translateX(-50%) translateY(14px);
    text-align: center;
    width: max-content; max-width: 92vw;
  }
  .const-label.is-on { transform: translateX(-50%); }
  #caption {
    left: 16px; right: 16px;
    bottom: 78px;
    width: auto;
    padding: 16px 18px;
    border-left: none;
    border: 1px solid rgba(230, 188, 92, 0.2);
    border-radius: 10px;
    background: rgba(8, 11, 32, 0.72);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }
  .cap-wisdom { max-width: none; }
  .ticker { bottom: 18px; max-width: 58vw; }
  .hint-touch { bottom: 88px; }
  #ovl-council { padding-top: 70px; padding-bottom: 58px; }
  #ring-names { display: none; }
  .council-members { display: block; }
  .phases { gap: 14px; }
  .outro { padding-top: 14vh; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .ovl, .whisper, .const-label, #caption, .cw-block, .excerpt-line,
  .poem-line, .ticker, .hint, .portrait-slot {
    transition-duration: 0.25s;
    transform: none !important;
  }
  .whisper { transform: translate(-50%, -50%) !important; }
  .const-label { transform: translateY(0) !important; }
  @media (max-width: 767px) {
    .const-label { transform: translateX(-50%) !important; }
  }
  .btn, .btn:hover { transform: none; }
}
