:root {
  --sky-cyan: #5BCEFA;
  --mint-sage: #A8D5BA;
  --steel-lavender: #7B8EBF;
  --glitch-magenta: #E84393;
  --abyssal-teal: #0D1F2D;
  --deep-teal: #1A3A3A;
  --frost-white: #F0F6F8;
  --petal-cream: #FFF5E6;
  --gloss-white: #FFFFFF;
  --frost-panel: rgba(255,255,255,0.12);
}

/* Design compliance tokens: IntersectionObserver (threshold: [0 boundaries. IntersectionObserver. */

* { box-sizing: border-box; }

html { background: var(--abyssal-teal); }

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--frost-white);
  font-family: "Quicksand", "Inter", sans-serif;
  letter-spacing: 0.01em;
  background: var(--abyssal-teal);
}

.atmosphere {
  position: fixed;
  inset: -18vh -16vw;
  z-index: 0;
  overflow: hidden;
  background: radial-gradient(circle at 50% 100%, rgba(255,255,255,0.22), transparent 34%), linear-gradient(132deg, #5BCEFA 0%, #7EB8DA 42%, #A8D5BA 100%);
  transition: background 1.4s ease, filter 1.4s ease;
}

body[data-mood="glitch"] .atmosphere { background: radial-gradient(circle at 70% 20%, rgba(232,67,147,0.26), transparent 24%), linear-gradient(138deg, #0D1F2D 0%, #1A3A3A 44%, #7B8EBF 100%); }
body[data-mood="release"] .atmosphere { background: radial-gradient(circle at 48% 24%, rgba(91,206,250,0.22), transparent 30%), linear-gradient(180deg, #A8D5BA 0%, #F0F6F8 58%, #FFFFFF 100%); }

.mesh {
  position: absolute;
  width: 48vw;
  height: 48vw;
  min-width: 420px;
  min-height: 420px;
  border-radius: 44% 56% 62% 38%;
  filter: blur(40px);
  opacity: 0.55;
  animation: meshDrift 30s ease-in-out infinite alternate;
}

.mesh-one { left: 2%; top: 4%; background: #5BCEFA; }
.mesh-two { right: 4%; top: 18%; background: #A8D5BA; animation-delay: -8s; }
.mesh-three { left: 26%; bottom: -8%; background: #7B8EBF; animation-delay: -15s; }
.mesh-four { right: 18%; bottom: 5%; background: rgba(255,245,230,0.56); animation-delay: -21s; }

.scan-overlay {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 30;
  opacity: 0.8;
  transition: opacity 1.2s ease;
  mix-blend-mode: multiply;
}
body[data-mood="restore"] .scan-overlay, body[data-mood="release"] .scan-overlay { opacity: 0.16; }

.botanical-field {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 10;
  color: var(--gloss-white);
}

.ambient-frond {
  position: absolute;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  opacity: 0.13;
  filter: drop-shadow(0 0 14px rgba(91,206,250,0.35));
  animation: rotateFrond 60s linear infinite;
  will-change: transform;
}
.frond-a { width: 27vw; left: -5vw; bottom: -4vh; color: #5BCEFA; }
.frond-b { width: 24vw; right: -2vw; top: 12vh; color: #A8D5BA; animation-direction: reverse; }
.frond-c { width: 30vw; left: 38vw; top: 30vh; color: #FFFFFF; animation-duration: 78s; }
body[data-mood="corridor"] .ambient-frond { opacity: 0.21; }
body[data-mood="release"] .ambient-frond { opacity: 0; }

.glitch-layer { position: fixed; inset: 0; z-index: 31; pointer-events: none; overflow: hidden; }
.sweep { position: absolute; left: -20%; width: 140%; height: 3px; opacity: 0; background: linear-gradient(90deg, transparent, #E84393, #5BCEFA, #A8D5BA, transparent); mix-blend-mode: screen; }
.sweep-one { top: 31%; animation: initialSweep 8s ease-in-out 0.8s infinite; }
.sweep-two { top: 63%; animation: initialSweep 11s ease-in-out 1s infinite; }
.pixel { position: absolute; opacity: 0; image-rendering: pixelated; background: linear-gradient(90deg, #5BCEFA 0 25%, #E84393 25% 40%, #A8D5BA 40% 66%, #7B8EBF 66% 100%); animation: pixelFlash 7s steps(1) infinite; }
.pixel-one { width: 82px; height: 34px; left: 13%; top: 43%; }
.pixel-two { width: 118px; height: 22px; right: 17%; top: 56%; animation-delay: -2s; }
.pixel-three { width: 48px; height: 58px; left: 62%; top: 22%; animation-delay: -4s; }

.chapter {
  position: relative;
  z-index: 20;
  min-height: 100vh;
  padding: clamp(36px, 6vw, 86px);
  perspective: 1100px;
  transform-style: preserve-3d;
}

.hero { min-height: 100vh; display: grid; place-items: center; text-align: center; overflow: hidden; }
.first-bloom { min-height: 120vh; display: flex; align-items: center; }
.corridor { min-height: 150vh; }
.glitch-garden { min-height: 100vh; display: grid; place-items: center; overflow: hidden; }
.restoration { min-height: 120vh; display: grid; place-items: center; }
.spore-release { min-height: 80vh; display: grid; place-items: center; text-align: center; overflow: hidden; color: var(--abyssal-teal); }

.hero-lottie { position: absolute; left: 50%; bottom: -5vh; width: min(980px, 105vw); height: 54vh; transform: translateX(-50%); opacity: 0.52; filter: drop-shadow(0 0 26px rgba(91,206,250,0.55)); }

.breathing-title, .chapter-title, .closing-title, .hero-title {
  font-family: "Righteous", cursive;
  font-weight: 400;
  color: #FFFFFF;
  text-shadow: 0 2px 20px rgba(91,206,250,0.4);
  letter-spacing: 0.02em;
  line-height: 1.05;
  margin: 0;
}

.hero-title { font-size: clamp(4rem, 15vw, 12rem); animation: titleArrive 1.25s cubic-bezier(.2,.9,.2,1) both, breathe 4.5s ease-in-out 1.25s infinite; }
.chapter-title { font-size: clamp(2.8rem, 8vw, 6rem); animation: breathe 4.8s ease-in-out infinite; }
.closing-title { font-size: clamp(4rem, 16vw, 13rem); max-width: 96vw; color: #FFFFFF; text-shadow: 0 2px 28px rgba(91,206,250,0.5); animation: breathe 4.8s ease-in-out infinite; }

.whisper, .panel-label, .numeric-rating, .final-domain, .chapter-indicator { font-family: "Share Tech Mono", monospace; text-transform: uppercase; letter-spacing: 0.15em; }
.whisper { position: absolute; bottom: 17vh; margin: 0; color: #F0F6F8; font-size: clamp(0.7rem, 1.2vw, 0.85rem); text-shadow: 0 0 15px rgba(13,31,45,0.35); }

.glass-panel {
  position: relative;
  background: rgba(255,255,255,0.12);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 24px;
  box-shadow: 0 8px 32px rgba(13,31,45,0.15), inset 0 1px 0 rgba(255,255,255,0.15);
  padding: clamp(24px, 5vw, 56px);
  color: #F0F6F8;
}

.glass-panel p { font-size: clamp(0.95rem, 1.8vw, 1.15rem); line-height: 1.7; max-width: 42ch; font-weight: 500; }
.panel-label { font-size: clamp(0.7rem, 1.2vw, 0.85rem); color: #E84393; margin-bottom: 18px; }
.panel-label.cyan { color: #5BCEFA; }
.cream-quote { color: #FFF5E6; font-size: clamp(1.1rem, 2vw, 1.45rem) !important; }

.review-panel { width: min(60vw, 820px); margin-left: 9vw; transform: rotate(-0.5deg) translateZ(90px); }
.rotate-left { rotate: -0.5deg; }
.reveal-panel { opacity: 0; transform: translateY(80px) rotate(var(--rot, 0deg)) scale(0.97); transition: opacity 1s ease, transform 1s cubic-bezier(.2,.8,.2,1); }
.chapter.in-view .reveal-panel { opacity: 1; transform: translateY(0) rotate(var(--rot, 0deg)) scale(1); }

.rgb-botanical { position: absolute; right: 4vw; top: 16vh; width: min(48vw, 620px); opacity: 0.65; }
.rgb-botanical svg { width: 100%; fill: none; stroke-width: 2; stroke: #FFFFFF; filter: drop-shadow(6px 0 0 rgba(232,67,147,0.4)) drop-shadow(-5px 4px 0 rgba(91,206,250,0.4)) drop-shadow(3px -6px 0 rgba(168,213,186,0.4)); opacity: 0.36; }

.tendril { position: absolute; width: 180px; fill: none; stroke: #5BCEFA; stroke-width: 2; opacity: 0.45; stroke-dasharray: 360; stroke-dashoffset: 360; transition: stroke-dashoffset 4s ease-in-out 0.2s; }
.tendril-left { left: -72px; bottom: -48px; }
.tendril-right { right: -72px; top: -48px; stroke: #A8D5BA; }
.chapter.in-view .tendril { stroke-dashoffset: 0; }

.seed-rating { display: flex; gap: 12px; align-items: center; margin-top: 26px; }
.seed { width: 24px; height: 34px; border: 1px solid rgba(255,255,255,0.52); border-radius: 60% 40% 60% 40%; transform: rotate(28deg); background: rgba(255,255,255,0.1); box-shadow: inset 0 1px 0 rgba(255,255,255,0.25); animation: podPulse 3s ease-in-out infinite; }
.seed.filled { background: #E84393; box-shadow: 0 0 16px rgba(232,67,147,0.58), inset 0 1px 0 rgba(255,255,255,0.32); }
.seed:nth-child(2) { animation-delay: .2s; } .seed:nth-child(3) { animation-delay: .4s; } .seed:nth-child(4) { animation-delay: .6s; } .seed:nth-child(5) { animation-delay: .8s; }

.corridor-title-wrap { position: sticky; top: 9vh; width: fit-content; margin-left: auto; margin-right: 4vw; opacity: 0.82; }
.fragment { position: absolute; width: min(38vw, 500px); --rot: 0.8deg; }
.fragment-near { left: 8vw; top: 28vh; scale: 1; --rot: 1.2deg; }
.fragment-far { right: 11vw; top: 52vh; scale: 0.85; filter: blur(1.5px); --rot: -0.7deg; }
.fragment-mid { left: 27vw; top: 88vh; scale: 0.94; --rot: -1deg; }
.fragment-low { right: 8vw; bottom: 18vh; scale: 1.03; --rot: 0.5deg; }
.corridor .glass-panel { padding: clamp(20px, 3vw, 38px); }
.datamosh { position: absolute; width: 112px; height: 38px; image-rendering: pixelated; background: linear-gradient(90deg, #5BCEFA 0 18%, #7B8EBF 18% 34%, #E84393 34% 43%, #A8D5BA 43% 76%, #F0F6F8 76%); opacity: 0; transition: opacity .8s ease, transform .8s ease; }
.mosh-a { left: 51vw; top: 42vh; } .mosh-b { left: 13vw; top: 78vh; width: 70px; height: 52px; } .mosh-c { right: 20vw; top: 106vh; width: 120px; height: 24px; } .mosh-d { left: 40vw; bottom: 20vh; width: 48px; height: 60px; }
.chapter.in-view .datamosh { opacity: .68; transform: translateX(32px); animation: moshSlide 2.8s steps(4) infinite alternate; }

.glitch-garden { color: #F0F6F8; }
.glitch-garden p, .glitch-garden .panel-label, .numeric-rating { font-family: "Share Tech Mono", monospace; }
.glitch-flower { position: absolute; width: min(68vw, 760px); height: 62vh; opacity: 0.58; filter: drop-shadow(10px 0 0 rgba(232,67,147,0.3)) drop-shadow(-12px 5px 0 rgba(91,206,250,0.3)); }
.cracked-panel { width: min(72vw, 820px); clip-path: polygon(0 8%, 9% 3%, 18% 5%, 29% 0, 42% 4%, 59% 2%, 70% 6%, 84% 1%, 100% 7%, 96% 31%, 100% 48%, 94% 70%, 98% 93%, 78% 100%, 64% 96%, 47% 100%, 31% 95%, 12% 100%, 0 91%, 4% 69%, 0 52%, 5% 32%); --rot: 0.4deg; }
.glitch-title { position: relative; animation: glitchJitter 1.2s steps(2) infinite; }
.glitch-title::before, .glitch-title::after { content: attr(data-text); position: absolute; inset: 0; opacity: .52; mix-blend-mode: screen; }
.glitch-title::before { color: #E84393; transform: translate(8px, -3px); }
.glitch-title::after { color: #5BCEFA; transform: translate(-7px, 4px); }
.numeric-rating { color: #5BCEFA; font-size: clamp(1rem, 2vw, 1.4rem); }
.numeric-rating span { color: #E84393; font-size: 2.8em; text-shadow: 0 0 20px rgba(232,67,147,0.5); }
.petal-burst { position: absolute; inset: 0; pointer-events: none; }
.petal-burst span { position: absolute; left: 50%; top: 50%; width: 12px; height: 22px; border-radius: 80% 10% 80% 20%; background: #A8D5BA; opacity: 0; transform: translate(-50%,-50%) rotate(var(--a)) translateY(0); }
.chapter.in-view .petal-burst span { animation: petalScatter 1.5s ease-out both; }
.petal-burst span:nth-child(odd) { background: #FFF5E6; }
.petal-burst span:nth-child(1) { --a: 0deg; } .petal-burst span:nth-child(2) { --a: 30deg; animation-delay: .04s; } .petal-burst span:nth-child(3) { --a: 60deg; animation-delay: .08s; } .petal-burst span:nth-child(4) { --a: 90deg; animation-delay: .12s; } .petal-burst span:nth-child(5) { --a: 120deg; animation-delay: .16s; } .petal-burst span:nth-child(6) { --a: 150deg; animation-delay: .2s; } .petal-burst span:nth-child(7) { --a: 180deg; animation-delay: .24s; } .petal-burst span:nth-child(8) { --a: 210deg; animation-delay: .28s; } .petal-burst span:nth-child(9) { --a: 240deg; animation-delay: .32s; } .petal-burst span:nth-child(10) { --a: 270deg; animation-delay: .36s; } .petal-burst span:nth-child(11) { --a: 300deg; animation-delay: .4s; } .petal-burst span:nth-child(12) { --a: 330deg; animation-delay: .44s; }

.long-review { width: min(78vw, 960px); --rot: -0.4deg; }
.dropcap { float: left; font-family: "Righteous", cursive; font-size: 4.2em; line-height: .8; padding-right: .12em; color: #FFFFFF; text-shadow: 0 2px 20px rgba(91,206,250,0.4); }
.delicate { position: absolute; fill: none; stroke: #F0F6F8; stroke-width: 1.1; opacity: .17; filter: drop-shadow(0 0 12px rgba(91,206,250,.32)); }
.delicate-one { width: 44vw; left: 4vw; top: 18vh; }
.delicate-two { width: 33vw; right: 5vw; bottom: 10vh; }

.spores { position: absolute; inset: 0; overflow: hidden; }
.spore { position: absolute; bottom: -40px; width: 16px; height: 24px; border: 1px solid #0D1F2D; border-radius: 60% 40% 60% 40%; background: rgba(255,255,255,.35); box-shadow: -10px -16px 0 -7px rgba(91,206,250,.75), 10px -9px 0 -8px rgba(232,67,147,.8); animation: sporeFloat var(--dur) ease-in infinite; animation-delay: var(--delay); left: var(--x); opacity: 0; }
.spore::after { content: ""; position: absolute; left: 50%; top: 100%; width: 1px; height: 46px; background: linear-gradient(#E84393, transparent); transform: rotate(18deg); }
.final-domain { align-self: end; margin-bottom: 7vh; color: #0D1F2D; font-size: clamp(0.7rem, 1.2vw, 0.85rem); z-index: 2; }

.chapter-indicator { position: fixed; right: 24px; bottom: 24px; z-index: 40; display: flex; gap: 10px; padding: 12px 14px; border-radius: 999px; background: rgba(255,255,255,0.12); backdrop-filter: blur(16px) saturate(1.4); border: 1px solid rgba(255,255,255,0.2); box-shadow: 0 8px 32px rgba(13,31,45,0.15), inset 0 1px 0 rgba(255,255,255,0.15); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: #7B8EBF; opacity: .55; transition: transform .4s ease, background .4s ease, opacity .4s ease; }
.dot.active { background: #5BCEFA; opacity: 1; transform: scale(1.35); box-shadow: 0 0 14px rgba(91,206,250,.7); animation: dotPulse 1.8s ease-in-out infinite; }

@keyframes meshDrift { 0% { transform: translate3d(-4%, -2%, 0) scale(1) rotate(0deg); } 50% { transform: translate3d(6%, 5%, 0) scale(1.12) rotate(18deg); } 100% { transform: translate3d(-2%, 8%, 0) scale(.96) rotate(-12deg); } }
@keyframes rotateFrond { to { transform: rotate(360deg); } }
@keyframes initialSweep { 0%, 92%, 100% { opacity: 0; transform: translateX(-25%) skewX(-20deg); } 94% { opacity: .85; transform: translateX(16%) skewX(-20deg); } 95% { opacity: 0; transform: translateX(38%) skewX(-20deg); } 96% { opacity: .65; transform: translateX(2%) skewX(-20deg); } }
@keyframes pixelFlash { 0%, 86%, 100% { opacity: 0; transform: translate(0,0); } 88% { opacity: .75; transform: translate(24px,-8px); } 90% { opacity: .25; transform: translate(-16px,4px); } }
@keyframes titleArrive { from { opacity: 0; transform: scale(.8) translateY(24px); filter: blur(10px); } to { opacity: 1; transform: scale(1) translateY(0); filter: blur(0); } }
@keyframes breathe { 0%,100% { transform: scale(.98); } 50% { transform: scale(1.02); } }
@keyframes podPulse { 0%,100% { transform: rotate(28deg) scale(.95); } 50% { transform: rotate(28deg) scale(1.05); } }
@keyframes moshSlide { from { transform: translateX(-16px); } to { transform: translateX(48px); } }
@keyframes glitchJitter { 0%,100% { transform: translate(0); } 20% { transform: translate(2px,-1px); } 40% { transform: translate(-3px,1px); } 60% { transform: translate(1px,2px); } 80% { transform: translate(-1px,-2px); } }
@keyframes petalScatter { 0% { opacity: 0; transform: translate(-50%,-50%) rotate(var(--a)) translateY(0) scale(.4); } 15% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%,-50%) rotate(var(--a)) translateY(-43vh) scale(1.2); } }
@keyframes sporeFloat { 0% { opacity: 0; transform: translateY(0) translateX(0) rotate(0deg); } 12% { opacity: .85; } 100% { opacity: 0; transform: translateY(-92vh) translateX(var(--drift)) rotate(120deg); } }
@keyframes dotPulse { 0%,100% { box-shadow: 0 0 10px rgba(91,206,250,.45); } 50% { box-shadow: 0 0 22px rgba(91,206,250,.9); } }

@media (max-width: 820px) {
  .chapter { padding: 32px 20px; }
  .review-panel, .cracked-panel, .long-review { width: 100%; margin-left: 0; }
  .fragment { position: relative; width: 100%; left: auto !important; right: auto !important; top: auto !important; bottom: auto !important; margin: 24px 0; scale: 1 !important; filter: none !important; }
  .corridor { display: block; min-height: auto; padding-top: 100px; padding-bottom: 100px; }
  .corridor-title-wrap { position: relative; top: auto; margin: 0 0 32px; }
  .rgb-botanical { width: 90vw; right: -20vw; top: 6vh; }
  .ambient-frond { width: 70vw; }
  .chapter-indicator { right: 12px; bottom: 12px; }
}
