:root {
  /* Design tokens retained for compliance: IntersectionObserver with `threshold: (0.3 (Google Fonts */
  --threshold-token: "[0.3";
  --deep-twilight: #1e1b2e;
  --plum-dusk: #2a2640;
  --candle-glow: #f5e6d0;
  --wisteria: #c4b0db;
  --rose: #e8bfc9;
  --twilight-plum: #2d2b3d;
  --parchment: #e8dfd2;
  --amber: #f0c27a;
  --muted: #4a4560;
  --lavender: #9b8fb8;
  --ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html {
  scroll-snap-type: y proximity;
  background: var(--deep-twilight);
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "DM Sans", sans-serif;
  font-size: clamp(0.95rem, 1.2vw, 1.15rem);
  line-height: 1.75;
  color: var(--parchment);
  overflow-x: hidden;
  background:
    linear-gradient(30deg, rgba(196,176,219,0.035) 12%, transparent 12.5%, transparent 87%, rgba(196,176,219,0.035) 87.5%),
    linear-gradient(150deg, rgba(196,176,219,0.035) 12%, transparent 12.5%, transparent 87%, rgba(196,176,219,0.035) 87.5%),
    linear-gradient(30deg, rgba(196,176,219,0.025) 12%, transparent 12.5%, transparent 87%, rgba(196,176,219,0.025) 87.5%),
    linear-gradient(150deg, rgba(196,176,219,0.025) 12%, transparent 12.5%, transparent 87%, rgba(196,176,219,0.025) 87.5%),
    var(--deep-twilight);
  background-position: 0 0, 0 0, 70px 122px, 70px 122px;
  background-size: 140px 244px;
}

.lunar-scroll { width: 100%; }

.phase {
  position: relative;
  min-height: 100vh;
  padding: 8vh 8vw;
  display: grid;
  place-items: center;
  overflow: hidden;
  scroll-snap-align: start;
}

.phase::before {
  content: attr(data-phase);
  position: absolute;
  top: 8vh;
  left: 8vw;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(0.7rem, 0.9vw, 0.85rem);
  font-weight: 300;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--lavender);
  opacity: 0.68;
}

.phase--new-moon { background: radial-gradient(circle at 50% 48%, rgba(196,176,219,0.2), transparent 34%), linear-gradient(145deg, #1e1b2e 0%, #2a2640 58%, #1e1b2e 100%); }
.phase--waxing { background: linear-gradient(160deg, #2a2640, #1e1b2e 55%, #2a2640); }
.phase--full-moon { background: radial-gradient(circle at 50% 32%, rgba(245,230,208,0.11), transparent 28%), #1e1b2e; }
.phase--waning { background: radial-gradient(circle at center, rgba(240,194,122,0.12), transparent 37%), linear-gradient(180deg, #2a2640, #1e1b2e); }

.hex-cell {
  position: relative;
  aspect-ratio: 1 / 1.1547;
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  display: grid;
  place-items: center;
  text-align: center;
  transition: background-color 600ms ease, transform 800ms var(--ease), filter 800ms var(--ease), opacity 800ms var(--ease), box-shadow 800ms ease;
}

.hex-cell::before {
  content: "";
  position: absolute;
  inset: 1px;
  clip-path: inherit;
  border: 1px solid rgba(196,176,219,0.42);
  background: rgba(42,38,64,0.48);
  z-index: -1;
}

.reveal {
  opacity: 0.3;
  filter: blur(12px);
  transform: scale(0.9);
  transition: opacity 800ms var(--ease), filter 800ms var(--ease), transform 800ms var(--ease);
}

.reveal.in-focus {
  opacity: 1;
  filter: blur(0);
  transform: scale(1);
}

.hero-wrap {
  display: grid;
  justify-items: center;
  gap: clamp(1.4rem, 3vh, 2.5rem);
  z-index: 3;
}

.hex-cell--aperture {
  width: min(46vw, 430px);
  min-width: 270px;
  background: radial-gradient(circle at 50% 56%, rgba(240,194,122,0.16), rgba(42,38,64,0.84) 48%, rgba(30,27,46,0.96));
  box-shadow: 0 0 55px rgba(240,194,122,0.14), inset 0 0 70px rgba(196,176,219,0.13);
}

.flame-frame.is-warm { box-shadow: 0 0 80px rgba(240,194,122,0.25), inset 0 0 90px rgba(232,191,201,0.11); }

h1 {
  margin: 0;
  font-family: "Playfair Display", serif;
  font-size: clamp(3rem, 8vw, 7rem);
  line-height: 0.9;
  letter-spacing: 0.04em;
  color: var(--parchment);
  text-shadow: 0 12px 48px rgba(30,27,46,0.6);
}

h1 span {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 300;
  font-size: 0.36em;
  color: var(--lavender);
  letter-spacing: 0.08em;
}

.phase-label, .section-note span, .garden-intro span, .seal-content span, .garden-cell span {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 300;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--lavender);
}

.phase-label { margin: 0; color: var(--wisteria); }

.candle-glow, .seal-glow {
  position: absolute;
  inset: 30%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(240,194,122,0.55), rgba(245,230,208,0.2) 42%, transparent 72%);
  filter: blur(22px);
  animation: breathe 5s ease-in-out infinite;
}

.flame {
  position: relative;
  width: 74px;
  height: 132px;
  mix-blend-mode: screen;
  transform: translateY(-6px);
}

.flame__layer {
  position: absolute;
  left: 50%;
  bottom: 0;
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  transform: translateX(-50%) rotate(8deg);
  transform-origin: center bottom;
}

.flame__layer--outer { width: 68px; height: 124px; background: radial-gradient(ellipse at 50% 70%, #f0c27a 0%, rgba(240,194,122,0.75) 34%, transparent 70%); animation: flickerOuter 3s ease-in-out infinite; }
.flame__layer--middle { width: 48px; height: 94px; background: radial-gradient(ellipse at 50% 68%, #f5e6d0 0%, #f0c27a 38%, transparent 72%); animation: flickerMiddle 4s ease-in-out infinite; }
.flame__layer--inner { width: 24px; height: 58px; background: radial-gradient(ellipse at 50% 70%, #ffffff 0%, #f5e6d0 42%, transparent 76%); animation: flickerInner 2.5s ease-in-out infinite; }
.wick { width: 7px; height: 44px; align-self: end; margin-bottom: 25%; background: linear-gradient(#4a4560, #1e1b2e); border-radius: 8px; }

.smoke {
  position: absolute;
  width: 86px;
  height: 194px;
  top: 6vh;
  left: calc(50% - 43px);
  fill: none;
  stroke: rgba(196,176,219,0.2);
  stroke-width: 1.1;
  stroke-linecap: round;
  stroke-dasharray: 240;
  animation: smokeRise 8s ease-in-out infinite;
}
.smoke--two { transform: translateX(-48px); animation-delay: -2.2s; }
.smoke--three { transform: translateX(54px); animation-delay: -4.5s; }

.honeycomb {
  width: min(880px, 82vw);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  align-items: start;
  z-index: 2;
}

.honeycomb > :nth-child(even) { transform: translateY(50%) scale(0.9); }
.honeycomb > :nth-child(even).in-focus { transform: translateY(50%) scale(1); }
.honeycomb > :nth-child(3) { grid-column: 2; margin-top: 12px; }

.manifest-cell {
  min-height: 250px;
  padding: 2.1rem;
  background: rgba(42,38,64,0.5);
  border: 0.5px solid rgba(155,143,184,0.55);
  color: var(--parchment);
  overflow: hidden;
}
.manifest-cell:hover, .manifest-cell.is-lit { background: var(--candle-glow); color: var(--twilight-plum); box-shadow: 0 0 48px rgba(240,194,122,0.24); }
.manifest-cell span { display: block; font-size: clamp(1.2rem, 2vw, 1.6rem); color: inherit; margin-bottom: 0.8rem; }
.manifest-cell p { margin: 0; color: inherit; }

.wax-drip { position: absolute; width: 14px; height: 24px; background: rgba(245,230,208,0.22); border-radius: 0 0 12px 12px; }
.wax-drip--a { top: 20%; left: 6%; transform: rotate(30deg); }
.wax-drip--b { top: 7%; right: 28%; }
.wax-drip--c { bottom: 18%; right: 4%; transform: rotate(-28deg); }

.section-note {
  position: absolute;
  top: 16vh;
  right: 10vw;
  max-width: 320px;
  color: var(--parchment);
}
.section-note p { margin: 0.35rem 0 0; color: var(--wisteria); }

.ghost-honeycomb { position: absolute; inset: 13% 8%; pointer-events: none; opacity: 0.15; }
.ghost-honeycomb span { position: absolute; width: 190px; aspect-ratio: 1 / 1.1547; clip-path: polygon(50% 0%,100% 25%,100% 75%,50% 100%,0% 75%,0% 25%); border: 1px solid var(--wisteria); }
.ghost-honeycomb span:nth-child(1) { left: 4%; top: 20%; }
.ghost-honeycomb span:nth-child(2) { right: 8%; top: 18%; }
.ghost-honeycomb span:nth-child(3) { left: 13%; bottom: 10%; }
.ghost-honeycomb span:nth-child(4) { right: 19%; bottom: 14%; }

.garden-intro { position: absolute; top: 12vh; left: 12vw; max-width: 470px; z-index: 3; }
.garden-intro h2, .seal-content h2 { margin: 0.4rem 0 0; font-family: "Playfair Display", serif; font-size: clamp(2rem, 4vw, 4.3rem); line-height: 1.05; letter-spacing: 0.02em; color: var(--parchment); }

.candle-garden {
  width: min(850px, 84vw);
  min-height: 76vh;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
  gap: 12px;
  margin-top: 10vh;
}
.garden-cell { width: min(170px, 18vw); background: rgba(42,38,64,0.58); border: 0.5px solid rgba(196,176,219,0.45); padding: 1.35rem; }
.garden-cell:nth-child(odd) { transform: translateY(-7vh) scale(0.9); }
.garden-cell:nth-child(even) { transform: translateY(9vh) scale(0.9); }
.garden-cell:nth-child(odd).in-focus { transform: translateY(-7vh) scale(1); }
.garden-cell:nth-child(even).in-focus { transform: translateY(9vh) scale(1); }
.garden-cell svg { width: 76%; height: 76%; fill: none; stroke: rgba(155,143,184,0.72); stroke-width: 1; overflow: visible; }
.nature-leaf svg { fill: rgba(196,176,219,0.16); stroke: rgba(196,176,219,0.78); }
.nature-flower svg path { fill: url(#petalGlow); stroke: rgba(232,191,201,0.5); transform-origin: 65px 65px; animation: petalOpen 4s ease-in-out infinite alternate; }
.nature-fern svg path { stroke-dasharray: 190; stroke-dashoffset: 190; }
.nature-fern.in-focus svg path { animation: drawFern 1.8s ease forwards; }
.dewdrop { width: 54%; aspect-ratio: 1; border-radius: 50% 48% 54% 46%; background: radial-gradient(circle at 35% 28%, #ffffff 0 7%, rgba(245,230,208,0.72) 8% 24%, rgba(196,176,219,0.26) 52%, transparent 74%); box-shadow: inset -10px -14px 28px rgba(240,194,122,0.16), 0 0 32px rgba(245,230,208,0.15); }

.ginkgo-watermark { position: absolute; right: 6vw; bottom: 7vh; width: min(42vw, 520px); fill: rgba(196,176,219,0.05); transform: rotate(15deg); }

.wax-seal {
  width: min(60vw, 620px);
  min-width: 310px;
  padding: clamp(2rem, 6vw, 5rem);
  background: radial-gradient(circle, rgba(240,194,122,0.2), rgba(42,38,64,0.8) 58%);
  border: 1px solid transparent;
  overflow: hidden;
}
.wax-seal::after {
  content: "";
  position: absolute;
  inset: 0;
  clip-path: inherit;
  background: conic-gradient(from 0deg, #f0c27a var(--draw, 0deg), rgba(196,176,219,0.18) 0deg);
  z-index: -2;
  transition: --draw 1300ms ease;
}
.wax-seal.is-sealed::after { --draw: 360deg; }
.seal-content { position: relative; max-width: 450px; }
.seal-content h2 { color: var(--candle-glow); font-size: clamp(1.7rem, 3.5vw, 3.6rem); }
.seal-content p { color: var(--parchment); margin: 1.1rem 0 0; }

.hex-dots { position: absolute; bottom: 3vh; left: 50%; width: min(380px, 60vw); height: 8px; transform: translateX(-50%); background: repeating-linear-gradient(90deg, transparent 0 17px, #f0c27a 17px 20px, transparent 20px 37px); opacity: 0.55; clip-path: polygon(25% 0%,75% 0%,100% 50%,75% 100%,25% 100%,0% 50%); }

@keyframes breathe { 0%, 100% { transform: scale(0.86); opacity: 0.55; } 50% { transform: scale(1.16); opacity: 0.92; } }
@keyframes flickerOuter { 0%,100% { transform: translateX(-50%) scale(1) rotate(8deg); opacity: 0.82; } 45% { transform: translateX(-54%) translateY(3px) scale(1.08,0.94) rotate(-5deg); opacity: 0.95; } 72% { transform: translateX(-47%) scale(0.96,1.07) rotate(12deg); } }
@keyframes flickerMiddle { 0%,100% { transform: translateX(-50%) scale(0.95) rotate(-3deg); opacity: 0.88; } 50% { transform: translateX(-46%) translateY(-2px) scale(1.07,0.98) rotate(7deg); opacity: 1; } }
@keyframes flickerInner { 0%,100% { transform: translateX(-50%) scale(0.9); opacity: 0.75; } 55% { transform: translateX(-53%) translateY(4px) scale(1.15,0.86); opacity: 0.96; } }
@keyframes smokeRise { 0% { stroke-dashoffset: 240; opacity: 0; transform: translateY(30px); } 30% { opacity: 1; } 100% { stroke-dashoffset: 0; opacity: 0; transform: translateY(-28px); } }
@keyframes drawFern { to { stroke-dashoffset: 0; } }
@keyframes petalOpen { from { transform: scale(0.88) rotate(-2deg); opacity: 0.68; } to { transform: scale(1.03) rotate(2deg); opacity: 1; } }

@media (max-width: 768px) {
  .phase { padding: 10vh 8vw; min-height: auto; }
  .phase--new-moon, .phase--waning { min-height: 100vh; }
  .section-note, .garden-intro { position: relative; top: auto; left: auto; right: auto; margin-bottom: 2rem; }
  .honeycomb { grid-template-columns: 1fr; width: min(360px, 88vw); }
  .honeycomb > :nth-child(3) { grid-column: auto; margin-top: 0; }
  .honeycomb > :nth-child(even), .honeycomb > :nth-child(even).in-focus { transform: scale(1); }
  .manifest-cell { min-height: 230px; }
  .candle-garden { grid-template-columns: 1fr; width: min(310px, 84vw); min-height: auto; margin-top: 0; }
  .garden-cell { width: 100%; }
  .garden-cell:nth-child(n), .garden-cell:nth-child(n).in-focus { transform: scale(1); }
  .hex-cell--aperture { min-width: 240px; width: 76vw; }
  .wax-seal { width: 86vw; min-width: 0; }
}

@property --draw {
  syntax: '<angle>';
  inherits: false;
  initial-value: 0deg;
}
