:root {
  --bg: 240 14% 4%;
  --ivory: 36 50% 92%;
  --gold: 43 56% 56%;
  --gold-bright: 43 64% 68%;
  --burgundy: 348 42% 32%;
  --act-tint: 0deg;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
body {
  background: radial-gradient(130% 90% at 50% -10%, #1a1633 0%, #0c0a18 45%, hsl(var(--bg)) 85%);
  color: hsl(var(--ivory));
  font-family: "Inter", sans-serif;
  font-weight: 300;
  line-height: 1.75;
  overflow-x: hidden;
}

#vignette {
  position: fixed; inset: 0; z-index: 2; pointer-events: none;
  background: radial-gradient(ellipse 80% 70% at 50% 45%, transparent 42%, hsl(var(--bg) / 0.52) 100%);
  transition: opacity 1.2s ease;
}
body.path-crisis #vignette {
  background: radial-gradient(ellipse 72% 68% at 50% 45%, transparent 32%, hsl(var(--bg) / 0.68) 100%);
}
body.act-myth #vignette { opacity: 0.88; }
body.act-cross #vignette { opacity: 1; }
body.act-turn #vignette { opacity: 0.94; }
body.act-home #vignette { opacity: 0.78; }

main { position: relative; z-index: 3; }
.scene {
  position: relative; min-height: 100svh; display: block; text-align: center;
  padding: 54vh 0 0; overflow: hidden; box-sizing: border-box;
}
.scene-tall { padding-top: 38vh; }

/* Gallery frame — art wordless above, text on pedestal below */
.art-stage {
  position: absolute; top: 0; left: 0; right: 0;
  height: 54vh; min-height: 300px; max-height: 580px;
  overflow: hidden; z-index: 0;
}
.scene-tall .art-stage { height: 38vh; min-height: 220px; max-height: 400px; }
.art-stage .art-stack {
  position: absolute; inset: 0; overflow: hidden;
  --art-bright: 0.88; --art-sat: 0.98; --art-hue: 0deg;
}
.art-fade {
  position: absolute; left: 0; right: 0; bottom: 0; height: 50%; z-index: 2;
  pointer-events: none;
  background: linear-gradient(to bottom, transparent 0%, hsl(var(--bg) / 0.25) 35%, hsl(var(--bg) / 0.88) 100%);
}
.art-painting {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: center center;
  will-change: transform;
  filter: brightness(var(--art-bright)) saturate(var(--art-sat)) hue-rotate(var(--art-hue)) contrast(1.03);
  backface-visibility: hidden; transform: scale(1);
}
.scene.in .art-painting { animation: kenPaint 32s ease-out forwards; }
@keyframes kenPaint {
  from { transform: scale(1); }
  to { transform: scale(1.04) translate3d(-0.25%, -0.2%, 0); }
}
.art-stack::after {
  content: "";
  position: absolute; inset: 0; pointer-events: none;
  mix-blend-mode: screen; opacity: 0.5;
  background: radial-gradient(ellipse 72% 58% at 50% 70%, rgba(255, 210, 120, 0.13) 0%, transparent 72%);
}
.art-stack[data-act="myth"]::after { opacity: 0.58; }
.art-stack[data-act="cross"]::after {
  opacity: 0.38;
  background: radial-gradient(ellipse 58% 48% at 50% 44%, rgba(255, 220, 150, 0.11) 0%, transparent 68%);
}
.art-stack[data-act="turn"]::after { opacity: 0.12; }
.art-stack[data-act="home"]::after {
  opacity: 0.62;
  background: radial-gradient(ellipse 75% 60% at 50% 68%, rgba(255, 218, 130, 0.16) 0%, transparent 70%);
}
.scene.turned .art-stack[data-act="turn"]::after { opacity: 0.55; }
.art-stack[data-act="cross"] { --art-bright: 0.72; --art-sat: 0.92; }
.art-stack[data-act="turn"] { --art-bright: 0.55; --art-sat: 0.7; }
.scene.turned .art-stack[data-act="turn"] { --art-bright: 0.82; --art-sat: 1.02; --art-hue: 8deg; }
.art-stack[data-act="home"] { --art-bright: 0.9; --art-sat: 1.05; --art-hue: 12deg; }

.text-stage {
  position: relative; z-index: 1; width: 100%;
  padding: 2vh 6vw 8vh;
  background: linear-gradient(to bottom, hsl(var(--bg)) 0%, hsl(var(--bg) / 0.97) 8%, hsl(var(--bg)) 100%);
  border-top: 1px solid hsl(var(--gold) / 0.08);
}
.scene-tall .text-stage { padding-top: 0.5vh; }

.inner { max-width: 700px; width: 100%; margin: 0 auto; }
.kicker {
  font-family: "Cinzel", serif; letter-spacing: 0.3em; text-transform: uppercase;
  font-size: 0.6rem; color: hsl(var(--gold) / 0.85); margin-bottom: 1.3rem;
}
h1 {
  font-family: "Cormorant Garamond", serif; font-weight: 500; line-height: 1.02;
  font-size: clamp(3rem, 9vw, 5.6rem); margin: 0.3rem 0;
}
p {
  font-size: clamp(1rem, 1.25vw, 1.13rem); color: hsl(var(--ivory) / 0.85);
  margin: 0 auto 1rem; max-width: 60ch;
}
p.intro { color: hsl(var(--ivory) / 0.92); }
em { color: hsl(var(--ivory) / 0.98); font-style: italic; }
.lift { color: hsl(var(--gold-bright)); font-style: italic; }
.land {
  font-family: "Cormorant Garamond", serif; font-style: italic;
  font-size: clamp(1.25rem, 2.5vw, 1.6rem); color: hsl(var(--gold-bright));
  margin-top: 1.3rem; line-height: 1.4;
}
.tag {
  font-family: "Cormorant Garamond", serif; font-style: italic;
  font-size: clamp(1.15rem, 2.6vw, 1.65rem); color: hsl(var(--gold-bright)); margin-top: 1rem;
}
.lede { color: hsl(var(--ivory) / 0.82); font-size: 1.06rem; max-width: 52ch; margin: 1.3rem auto 0; }
.mark {
  font-family: "Cinzel", serif; letter-spacing: 0.4em; text-transform: uppercase;
  font-size: 0.55rem; color: hsl(var(--gold) / 0.55); margin-top: 1.6rem;
}
.ornament {
  position: relative; width: 150px; height: 1px; margin: 1.5rem auto;
  background: linear-gradient(90deg, transparent, hsl(var(--gold)), transparent); opacity: 0.85;
}
.ornament::before {
  content: "\271E"; position: absolute; top: -13px; left: 50%; transform: translateX(-50%);
  font-size: 20px; color: hsl(var(--gold)); text-shadow: 0 0 14px hsl(var(--gold) / 0.5);
}
.scrollcue {
  margin-top: 2rem; font-family: "Cinzel", serif; font-size: 0.6rem;
  letter-spacing: 0.26em; text-transform: uppercase; color: hsl(var(--ivory) / 0.5);
  animation: bob 2.4s ease-in-out infinite;
}
@keyframes bob { 0%, 100% { transform: translateY(0); opacity: 0.5; } 50% { transform: translateY(6px); opacity: 0.9; } }

.reveal { opacity: 0; transform: translateY(28px); }
.scene.in .reveal { opacity: 1; transform: none; }

#exit {
  position: fixed; top: 0; left: 0; z-index: 8; margin: 1.2rem 1.4rem;
  font-family: "Cinzel", serif; font-size: 0.58rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: hsl(var(--ivory) / 0.45); text-decoration: none; transition: 0.3s;
}
#exit:hover { color: hsl(var(--gold)); }

#rail { display: none; }

#chapter-rail {
  position: fixed; right: 18px; top: 50%; transform: translateY(-50%); z-index: 6;
  display: flex; flex-direction: column; gap: 18px;
}
.chapter-dot {
  width: 10px; height: 10px; border-radius: 50%; border: none; padding: 0; cursor: pointer;
  background: hsl(var(--ivory) / 0.18); transition: 0.45s;
}
.chapter-dot.on {
  background: hsl(var(--gold-bright)); box-shadow: 0 0 14px hsl(var(--gold) / 0.85);
  transform: scale(1.55);
}
.chapter-dot:focus-visible { outline: 2px solid hsl(var(--gold-bright)); outline-offset: 3px; }

#sound {
  position: fixed; top: 0; right: 0; z-index: 7; margin: 1.2rem 1.4rem;
  font-family: "Cinzel", serif; font-size: 0.58rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: hsl(var(--ivory) / 0.5); background: none; border: 1px solid hsl(var(--ivory) / 0.2);
  border-radius: 2px; padding: 0.5em 0.9em; cursor: pointer; transition: 0.3s;
}
#sound:hover { color: hsl(var(--gold)); border-color: hsl(var(--gold) / 0.5); }

.fork { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 1.4rem 0 0.6rem; }
.fork-btn {
  font-family: "Cinzel", serif; font-size: 0.58rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: hsl(var(--gold)); background: hsl(var(--gold) / 0.05); border: 1px solid hsl(var(--gold) / 0.35);
  border-radius: 2px; padding: 0.75em 1.1em; cursor: pointer; transition: 0.35s;
}
.fork-btn:hover, .fork-btn.is-active {
  background: hsl(var(--gold) / 0.15); border-color: hsl(var(--gold) / 0.7);
  box-shadow: 0 0 24px hsl(var(--gold) / 0.2);
}

.gaugewrap { margin: 1.6rem auto; max-width: 440px; text-align: left; }
.gaugewrap label {
  display: block; font-size: 0.62rem; letter-spacing: 0.22em; text-transform: uppercase;
  color: hsl(var(--gold) / 0.8); margin-bottom: 0.4rem;
}
input[type="range"] { width: 100%; accent-color: hsl(var(--gold)); height: 3px; }
.readout {
  font-family: "Cormorant Garamond", serif; font-style: italic; color: hsl(var(--ivory) / 0.8);
  min-height: 1.5em; margin: 0.6rem 0 1.1rem; font-size: 1.05rem;
}
.oughtgauge { display: flex; align-items: center; gap: 0.8rem; }
.oughtbar { flex: 1; height: 8px; border-radius: 6px; background: hsl(var(--ivory) / 0.12); position: relative; overflow: hidden; }
.oughtbar i { position: absolute; left: 0; top: 0; bottom: 0; width: 0%; background: hsl(var(--burgundy)); transition: width 0.4s; }
.oughtval { font-size: 0.66rem; letter-spacing: 0.18em; text-transform: uppercase; color: hsl(var(--ivory) / 0.55); }

.evscale { max-width: 440px; margin: 1.2rem auto 0.8rem; text-align: left; }
.scale-track {
  height: 6px; border-radius: 4px; background: hsl(var(--ivory) / 0.12); overflow: hidden;
}
.scale-fill {
  height: 100%; width: 0%; border-radius: 4px;
  background: linear-gradient(90deg, hsl(var(--burgundy)), hsl(var(--gold)));
  transition: width 0.15s linear;
}
.scale-labels {
  display: flex; justify-content: space-between; margin-top: 0.45rem;
  font-size: 0.52rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: hsl(var(--gold) / 0.55);
}
.evcards { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin: 0.6rem 0 0.4rem; }
.ev {
  flex: 1; min-width: 170px; max-width: 210px; cursor: pointer;
  border: 1px solid hsl(var(--gold) / 0.4); border-radius: 4px; padding: 1rem 0.9rem;
  background: hsl(var(--gold) / 0.05); transition: 0.35s;
}
.ev:hover { background: hsl(var(--gold) / 0.13); transform: translateY(-3px); }
.ev.weighted { border-color: hsl(var(--gold) / 0.55); background: hsl(var(--gold) / 0.09); }
.ev.open { border-color: hsl(var(--gold-bright) / 0.75); background: hsl(var(--gold) / 0.14); box-shadow: 0 0 28px hsl(var(--gold) / 0.12); }
.ev h4 {
  font-family: "Cinzel", serif; font-weight: 600; font-size: 0.74rem; letter-spacing: 0.08em;
  color: hsl(var(--gold-bright)); margin-bottom: 0.5rem;
}
.ev p { font-size: 0.82rem; color: hsl(var(--ivory) / 0.75); opacity: 0; max-height: 0; overflow: hidden; transition: opacity 0.6s, max-height 0.6s; margin: 0; }
.ev.open p { opacity: 1; max-height: 520px; margin-top: 0.3rem; }
.ev .tap { font-size: 0.56rem; letter-spacing: 0.2em; text-transform: uppercase; color: hsl(var(--gold) / 0.6); }
.ev.open .tap { display: none; }

.hold {
  position: relative; width: 104px; height: 104px; margin: 1.4rem auto 0.6rem; border-radius: 50%;
  cursor: pointer; user-select: none;
  background: conic-gradient(hsl(var(--gold)) calc(var(--p, 0) * 1%), hsl(var(--ivory) / 0.12) 0);
}
.hold::after {
  content: "\271E"; position: absolute; inset: 6px; border-radius: 50%; background: hsl(var(--bg) / 0.88);
  display: flex; align-items: center; justify-content: center; font-size: 2rem; color: hsl(var(--gold));
  text-shadow: 0 0 var(--glow, 8px) hsl(var(--gold) / 0.7);
}
.holdcue { font-size: 0.58rem; letter-spacing: 0.22em; text-transform: uppercase; color: hsl(var(--ivory) / 0.45); }
#crosslight {
  position: fixed; inset: 0; z-index: 2; pointer-events: none;
  background: radial-gradient(circle at 50% 50%, hsl(var(--gold) / 0), transparent 60%); transition: background 0.4s;
}

.btn {
  display: inline-block; cursor: pointer; font-family: "Cinzel", serif; letter-spacing: 0.18em;
  text-transform: uppercase; font-size: 0.74rem; color: hsl(var(--gold)); text-decoration: none;
  padding: 0.9em 2.2em; border: 1px solid hsl(var(--gold) / 0.5); border-radius: 2px;
  background: hsl(var(--gold) / 0.05); transition: 0.35s; user-select: none;
}
.btn:hover { background: hsl(var(--gold) / 0.15); box-shadow: 0 0 36px hsl(var(--gold) / 0.24); transform: translateY(-2px); }

.creed {
  max-width: 58ch; margin: 1.4rem auto; padding: 1.2rem 1rem; text-align: left;
  border: 1px solid hsl(var(--gold) / 0.25); border-radius: 4px; background: hsl(var(--gold) / 0.04);
}
.creed .kicker { margin-bottom: 0.8rem; text-align: center; }
.creed p { font-size: 0.98rem; }

.doors { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 1.3rem; }
.door2 {
  font-family: "Cinzel", serif; font-size: 0.62rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: hsl(var(--gold)); text-decoration: none; padding: 0.85em 1.4em;
  border: 1px solid hsl(var(--gold) / 0.45); border-radius: 2px; background: hsl(var(--gold) / 0.05); transition: 0.3s;
}
.door2:hover { background: hsl(var(--gold) / 0.15); transform: translateY(-2px); }

.path-extra { display: none; }

/* Phase 6 — Ignition */
body.igniting { overflow: hidden; }
body:not(.walk-ready) main { visibility: hidden; }
#ignition {
  position: fixed; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center;
  background: #0c0a18; pointer-events: none;
}
#ignition.done { pointer-events: none; }
.ignition-star {
  font-size: 2.4rem; color: hsl(var(--gold-bright));
  text-shadow: 0 0 40px hsl(var(--gold) / 0.9), 0 0 80px hsl(var(--gold) / 0.5);
  z-index: 2;
}
.ignition-burst {
  position: absolute; width: 120px; height: 120px; border-radius: 50%;
  background: radial-gradient(circle, hsl(var(--gold-bright) / 0.7) 0%, transparent 70%);
  z-index: 1;
}

/* Phase 6 — Sound ritual */
.soundoffer {
  display: inline-block; margin-top: 1.2rem; font-family: "Cinzel", serif;
  font-size: 0.62rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: hsl(var(--gold)); background: hsl(var(--gold) / 0.06);
  border: 1px solid hsl(var(--gold) / 0.4); border-radius: 2px;
  padding: 0.85em 1.5em; cursor: pointer; transition: 0.35s;
}
.soundoffer:hover, .soundoffer.chosen {
  background: hsl(var(--gold) / 0.16); box-shadow: 0 0 28px hsl(var(--gold) / 0.22);
}

/* Phase 6 — Cross vigil */
.vigil-msg {
  position: absolute; inset: 0; z-index: 2; display: flex; align-items: center; justify-content: center;
  font-family: "Cinzel", serif; font-size: 0.7rem; letter-spacing: 0.5em; text-transform: uppercase;
  color: hsl(var(--ivory) / 0.35); opacity: 0; pointer-events: none; transition: opacity 1.2s;
}
.scene.cross-vigil { padding-top: 0; }
.scene.cross-vigil .art-stage { height: 100%; max-height: none; }
.scene.cross-vigil .text-stage { opacity: 0; pointer-events: none; }
.scene.cross-vigil .vigil-msg { opacity: 1; }
.scene.cross-vigil .art-stack { --art-bright: 0.62; --art-sat: 0.88; }
body.cross-vigil-active #vignette { opacity: 0.15 !important; }

/* Phase 6 — Share card */
.share-wrap { margin: 1.6rem 0 0.8rem; }
#share-preview { margin-top: 1rem; display: flex; justify-content: center; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; }
  .scrollcue, .holdcue { animation: none; }
  .scene.in .art-painting { animation: none; }
  .art-stack::after { display: none; }
}
.btn:focus-visible, .door2:focus-visible, #hold:focus-visible, .ev:focus-visible,
#sound:focus-visible, #rail a:focus-visible, .fork-btn:focus-visible { outline: 2px solid hsl(var(--gold-bright)); outline-offset: 3px; }
@media (max-width: 560px) {
  .scene { padding-top: 42vh; }
  .scene-tall { padding-top: 32vh; }
  .art-stage { height: 42vh; min-height: 200px; }
  .scene-tall .art-stage { height: 32vh; min-height: 160px; }
  .text-stage { padding: 1vh 7vw 7vh; }
  .ev { max-width: none; }
  #chapter-rail { right: 10px; }
}