:root {
  --obsidian: #050403;
  --lacquer: #11100C;
  --gold: #C8A24A;
  --brass: #8A641E;
  --amber: #F0B35A;
  --sage: #6E7A54;
  --fern: #1E3024;
  --parchment: #EEE2C5;
  --smoke: #B8AE98;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  background: var(--obsidian);
}

body {
  margin: 0;
  color: var(--parchment);
  background:
    radial-gradient(circle at 84% 18%, rgba(138, 100, 30, 0.17), transparent 30vw),
    radial-gradient(circle at 6% 64%, rgba(30, 48, 36, 0.45), transparent 32vw),
    linear-gradient(120deg, var(--obsidian), var(--lacquer) 46%, #030201 100%);
  font-family: "Alegreya Sans", Inter, system-ui, sans-serif;
  overflow-x: hidden;
}

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 20;
  opacity: .16;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(238, 226, 197, .28) 0 1px, transparent 1px),
    radial-gradient(circle at 70% 80%, rgba(200, 162, 74, .18) 0 1px, transparent 1px);
  background-size: 7px 9px, 11px 13px;
  mix-blend-mode: screen;
}

.ritual-scroll { position: relative; }

.chamber {
  min-height: 100vh;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  padding: clamp(2rem, 6vw, 7rem);
  border-bottom: 1px solid rgba(200, 162, 74, .13);
}

.chamber::before {
  content: attr(data-chamber);
  position: absolute;
  top: 8vh;
  right: 8vw;
  color: rgba(200, 162, 74, .16);
  font: 700 clamp(2.8rem, 8vw, 8rem)/1 "Cinzel Decorative", Georgia, serif;
  letter-spacing: .16em;
}

.chamber::after {
  content: "";
  position: absolute;
  inset: 5vh 4vw;
  border: 1px solid rgba(200, 162, 74, .16);
  border-left-color: transparent;
  border-bottom-color: rgba(110, 122, 84, .18);
  pointer-events: none;
  z-index: -1;
}

.nav-ticks {
  position: fixed;
  left: 1.35rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 1.05rem;
}

.tick {
  width: 42px;
  height: 10px;
  border: 0;
  border-top: 1px solid rgba(238, 226, 197, .28);
  background: linear-gradient(90deg, rgba(200, 162, 74, .1), transparent);
  cursor: pointer;
  position: relative;
  transition: width .7s ease, border-color .7s ease, filter .7s ease;
}

.tick span {
  position: absolute;
  left: 50px;
  top: -8px;
  color: rgba(238, 226, 197, .38);
  font: 500 .62rem "Alegreya Sans", sans-serif;
  letter-spacing: .28em;
}

.tick.active {
  width: 78px;
  border-color: var(--amber);
  filter: drop-shadow(0 0 8px rgba(240, 179, 90, .8));
}

.vertical-fragment {
  position: absolute;
  left: -1.4rem;
  top: 7vh;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  color: rgba(200, 162, 74, .14);
  font: 700 clamp(5rem, 15vw, 16rem)/.78 "Cinzel Decorative", Georgia, serif;
  letter-spacing: .08em;
  white-space: nowrap;
  pointer-events: none;
}

.fragment-threshold { left: -2.2rem; top: 2vh; }
.fragment-vessel { left: auto; right: -2rem; transform: none; }
.fragment-global { color: rgba(238, 226, 197, .09); }

.brand-plaque {
  position: absolute;
  left: 17vw;
  top: 17vh;
  width: min(35rem, 62vw);
}

.eyebrow {
  margin: 0 0 1.2rem;
  color: var(--amber);
  font: 700 .72rem "Alegreya Sans", sans-serif;
  letter-spacing: .38em;
  text-transform: uppercase;
}

h1, h2 {
  margin: 0;
  font-family: "Cinzel Decorative", Georgia, serif;
  font-weight: 400;
  letter-spacing: .11em;
  text-transform: uppercase;
}

h1 {
  color: var(--gold);
  font-size: clamp(3.8rem, 9.7vw, 10.8rem);
  line-height: .82;
  text-shadow: 0 0 22px rgba(240, 179, 90, .17);
}

h2 {
  color: var(--gold);
  font-size: clamp(2.05rem, 4.3vw, 5.4rem);
  line-height: .95;
  transition: color 1.3s ease, text-shadow 1.3s ease;
}

.is-visible h2 { color: var(--parchment); text-shadow: 0 0 24px rgba(240, 179, 90, .18); }

.whisper, .ritual-plaque p:not(.eyebrow) {
  color: rgba(238, 226, 197, .78);
  font: italic 300 clamp(1.15rem, 1.7vw, 1.65rem)/1.55 "Cormorant Garamond", Georgia, serif;
}

.ritual-plaque {
  width: min(34rem, 74vw);
  padding: 1.8rem 2rem;
  background: linear-gradient(135deg, rgba(17, 16, 12, .88), rgba(5, 4, 3, .62));
  border: 1px solid rgba(200, 162, 74, .34);
  box-shadow: 0 24px 80px rgba(0,0,0,.45), inset 0 0 35px rgba(200, 162, 74, .04);
}

.ritual-plaque::before,
.ritual-plaque::after {
  content: "";
  position: absolute;
  width: 30px;
  height: 30px;
  border-color: var(--brass);
  border-style: solid;
  opacity: .7;
}

.ritual-plaque::before { border-width: 1px 0 0 1px; transform: translate(-1.15rem, -1.15rem); }
.ritual-plaque::after { border-width: 0 1px 1px 0; right: 1rem; bottom: 1rem; }

.threshold-leaf {
  position: absolute;
  right: -4vw;
  top: 3vh;
  width: min(72vw, 820px);
  height: auto;
  opacity: .9;
  transform: rotate(-7deg);
}

svg { overflow: visible; }

.draw-line {
  fill: none;
  stroke: var(--gold);
  stroke-width: 1.45;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1100;
  stroke-dashoffset: 1100;
  opacity: .86;
}

.is-visible .draw-line { animation: engrave 3.2s ease forwards; }
.is-visible .delay-1 { animation-delay: .35s; }
.is-visible .delay-2 { animation-delay: .7s; }
.is-visible .delay-3 { animation-delay: 1.05s; }
.is-visible .delay-4 { animation-delay: 1.4s; }
.is-visible .delay-5 { animation-delay: 1.75s; }

@keyframes engrave { to { stroke-dashoffset: 0; } }

.dotted, .tone-dot, .meridian-node {
  fill: var(--amber);
  opacity: .72;
  filter: drop-shadow(0 0 9px rgba(240, 179, 90, .75));
}

.candle {
  width: 28px;
  height: 54px;
  position: absolute;
  filter: drop-shadow(0 0 22px rgba(240, 179, 90, .8));
}

.candle::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 16px;
  width: 86px;
  height: 86px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(240,179,90,.34), rgba(200,162,74,.11) 38%, transparent 68%);
  animation: halo 5.5s ease-in-out infinite;
}

.flame {
  position: absolute;
  left: 8px;
  top: 0;
  width: 13px;
  height: 23px;
  background: radial-gradient(circle at 50% 70%, var(--parchment), var(--amber) 44%, rgba(138,100,30,.15) 72%);
  border-radius: 65% 35% 62% 38%;
  transform-origin: 50% 100%;
  animation: flame 2.7s ease-in-out infinite;
}

.wick {
  position: absolute;
  left: 13px;
  top: 22px;
  width: 2px;
  height: 24px;
  background: var(--brass);
}

.threshold-ember { right: 9vw; bottom: 9vh; }
.candle-orbit { right: 19vw; bottom: 15vh; }
.final-flame { left: 50%; top: 50%; transform: translate(-50%, -50%); }

@keyframes flame {
  0%,100% { transform: rotate(-3deg) scaleY(.94); opacity: .86; }
  50% { transform: rotate(4deg) scaleY(1.12); opacity: 1; }
}

@keyframes halo {
  0%,100% { transform: translate(-50%, -50%) scale(.84); opacity: .45; }
  50% { transform: translate(-50%, -50%) scale(1.2); opacity: .82; }
}

.deco-measure, .ingredient-strip, .quiet-footer {
  position: absolute;
  color: rgba(184, 174, 152, .62);
  font: 500 .7rem "Alegreya Sans", sans-serif;
  letter-spacing: .36em;
  text-transform: uppercase;
}

.deco-measure { left: 47vw; bottom: 7vh; transform: rotate(-90deg); transform-origin: left center; }
.ingredient-strip { right: 7vw; bottom: 9vh; }
.quiet-footer { left: 10vw; bottom: 6vh; }

.leaf-copy { position: absolute; right: 12vw; top: 15vh; }
.leaf-oracle { position: absolute; left: 19vw; bottom: 0; width: min(34vw, 440px); cursor: crosshair; }
.leaf-oracle svg { width: 100%; }
.resonance-ring {
  position: absolute;
  left: 52%;
  top: 45%;
  width: 190px;
  height: 190px;
  margin: -95px;
  border: 1px solid rgba(240, 179, 90, .58);
  border-radius: 50%;
  opacity: 0;
  transform: scale(.35);
  pointer-events: none;
}
.interactive-leaf.pulse .resonance-ring { animation: ringPulse 1.6s ease-out; }
@keyframes ringPulse { 0% { opacity: .8; transform: scale(.2); } 100% { opacity: 0; transform: scale(1.8); } }

.vessel { background: radial-gradient(circle at 65% 44%, rgba(30,48,36,.44), transparent 38vw); }
.bowl-engraving { position: absolute; left: 6vw; top: 17vh; width: min(62vw, 760px); }
.vessel-copy { position: absolute; right: 8vw; bottom: 13vh; }
.fork-lines { position: absolute; right: 18vw; top: 18vh; display: flex; gap: 22px; }
.fork-lines span { width: 1px; height: 180px; background: linear-gradient(var(--gold), transparent); box-shadow: 0 0 18px rgba(200,162,74,.45); }
.fork-lines span:nth-child(2) { height: 126px; margin-top: 28px; }
.fork-lines span:nth-child(3) { height: 92px; margin-top: 54px; }

.meridian { background: radial-gradient(circle at 20% 58%, rgba(138,100,30,.16), transparent 28vw); }
.meridian-field { position: absolute; inset: 10vh 0 auto 8vw; width: min(82vw, 930px); }
.meridian-field svg { width: 100%; }
.meridian-copy { position: absolute; right: 8vw; top: 21vh; }
.smoke {
  position: absolute;
  width: 35vw;
  height: 18vw;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(240,179,90,.13), rgba(184,174,152,.08) 42%, transparent 70%);
  filter: blur(18px);
  mix-blend-mode: screen;
  animation: smoke 11s ease-in-out infinite;
}
.smoke-a { left: 15vw; top: 8vh; }
.smoke-b { left: 38vw; top: 25vh; animation-delay: -4s; }
@keyframes smoke { 0%,100% { transform: translateX(-2vw) translateY(1vh); opacity: .22; } 50% { transform: translateX(4vw) translateY(-2vh); opacity: .58; } }

.planet-garden { position: absolute; left: 9vw; top: 8vh; width: min(63vw, 700px); aspect-ratio: 1; }
.planet-garden svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.planet-core {
  position: absolute;
  inset: 18%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 48% 48%, rgba(5,4,3,.98), rgba(30,48,36,.72) 55%, rgba(200,162,74,.12) 72%, transparent 73%),
    radial-gradient(circle, rgba(110,122,84,.2), transparent 65%);
  border: 1px solid rgba(200,162,74,.24);
  box-shadow: inset 0 0 55px rgba(0,0,0,.8), 0 0 80px rgba(30,48,36,.28);
}
.global-copy { position: absolute; right: 7vw; top: 19vh; }

.reveal {
  opacity: 0;
  transform: translateY(28px);
  filter: blur(8px);
  transition: opacity 1.7s ease, transform 1.7s ease, filter 1.7s ease;
}
.reveal.slow { transition-delay: .45s; }
.is-visible .reveal, .reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}

@media (max-width: 820px) {
  .chamber { padding: 5rem 1.4rem; }
  .nav-ticks { left: .5rem; }
  .tick span { display: none; }
  .brand-plaque, .leaf-copy, .vessel-copy, .meridian-copy, .global-copy {
    position: relative;
    left: auto;
    right: auto;
    top: auto;
    bottom: auto;
    width: calc(100vw - 3rem);
    margin: 7vh 0 0 1.4rem;
  }
  .threshold-leaf, .leaf-oracle, .bowl-engraving, .meridian-field, .planet-garden {
    position: relative;
    left: auto;
    right: auto;
    top: auto;
    bottom: auto;
    width: 84vw;
    margin: 8vh 0 0 10vw;
  }
  .deco-measure, .ingredient-strip, .quiet-footer { position: relative; left: auto; right: auto; bottom: auto; transform: none; margin: 3rem 0 0 1.5rem; }
}
