:root {
  /* Compliance text: IntersectionObserver` at a 0.15 threshold. Stagger sibling elements by 80ms each using CSS custom properties (`--delay: calc(var(--index yChannelSelector="G"/> */
  --sky: #7EC8E3;
  --mint: #A8E6CF;
  --teal: #7FDBCA;
  --pink: #FFB8D0;
  --purple: #C3A6FF;
  --coral: #FF6B6B;
  --yellow: #FFE66D;
  --cream: #FFF9F0;
  --cloud: #FEFCFF;
  --charcoal: #2D2D3F;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--sky);
  color: var(--charcoal);
  font-family: "Nunito", sans-serif;
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  font-weight: 400;
  line-height: 1.7;
  letter-spacing: 0.01em;
  overflow-x: hidden;
  transition: background-color 300ms linear;
}

.filter-svg { position: absolute; pointer-events: none; }
.hand-drawn { filter: url(#wobble); stroke-linecap: round; stroke-linejoin: round; }

.quest { position: relative; overflow: hidden; }

.layer {
  position: relative;
  min-height: 100vh;
  padding: clamp(4rem, 10vh, 8rem) clamp(1.5rem, 5vw, 4rem);
  display: grid;
  place-items: center;
  isolation: isolate;
}

.hero { background: linear-gradient(180deg, #7EC8E3 0%, #A8E6CF 60%, #FFB8D0 100%); }
.topsoil { background: linear-gradient(180deg, #FFB8D0 0%, #FFF9F0 54%, #C3A6FF 100%); }
.cavern { background: radial-gradient(circle at 50% 20%, #7FDBCA 0%, #C3A6FF 55%, #FFB8D0 100%); }
.core { background: radial-gradient(circle at 50% 45%, #FFE66D 0%, #FFB8D0 34%, #FF6B6B 72%, #C3A6FF 130%); min-height: 112vh; }

.hero-content, .section-inner {
  width: min(680px, 100%);
  margin: 0 auto;
  text-align: center;
  position: relative;
  z-index: 3;
}

.hero-title, .final-title {
  font-family: "Baloo 2", sans-serif;
  font-size: clamp(3.5rem, 10vw, 8rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
  margin: 0;
  color: var(--cloud);
  text-shadow: 0 5px 0 var(--coral), 0 9px 0 var(--charcoal), 0 18px 30px rgba(45, 45, 63, 0.18);
}

.final-title { color: var(--cloud); text-shadow: 0 5px 0 var(--purple), 0 9px 0 var(--charcoal), 0 18px 30px rgba(45, 45, 63, 0.2); }

h2 {
  font-family: "Baloo 2", sans-serif;
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  line-height: 1.05;
  margin: 0 0 0.75rem;
  font-weight: 800;
}

p { margin: 0; }

.scribble {
  display: inline-block;
  margin-bottom: 1rem;
  font-family: "Caveat", cursive;
  font-size: clamp(0.875rem, 2vw, 1.125rem);
  color: var(--charcoal);
  background: rgba(255, 249, 240, 0.68);
  border: 2px dashed currentColor;
  border-radius: 999px;
  padding: 0.25rem 0.9rem;
  transform: rotate(-2deg);
}

.hero-copy {
  max-width: 590px;
  margin: 1.3rem auto 0;
  color: var(--charcoal);
  background: rgba(254, 252, 255, 0.58);
  border-radius: 28px;
  padding: 1rem 1.25rem;
  box-shadow: 0 4px 20px rgba(45, 45, 63, 0.1);
}

.down-arrow { margin: 2rem auto 0; width: 95px; color: var(--charcoal); }
.down-arrow span { font-family: "Caveat", cursive; font-weight: 700; display: block; transform: rotate(4deg); }
.down-arrow svg { width: 80px; height: 120px; animation: arrowBob 1.8s ease-in-out infinite; }

.speech {
  position: relative;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 20px rgba(45, 45, 63, 0.1);
  border: 2px solid var(--coral);
  padding: clamp(1.3rem, 4vw, 2.25rem);
}

.speech::after {
  content: "";
  position: absolute;
  left: 18%;
  bottom: -20px;
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.85);
  border-right: 2px solid var(--coral);
  border-bottom: 2px solid var(--coral);
  transform: rotate(36deg) skew(-8deg);
  border-bottom-right-radius: 8px;
}

.note-card { margin: 2rem auto 0; max-width: 500px; border-color: var(--teal); transform: rotate(1.5deg); }
.note-card::after { left: 70%; border-color: var(--teal); }
.final-card { border-color: var(--yellow); }
.final-card::after { border-color: var(--yellow); }

.soil-scene { width: min(760px, 100%); margin-top: 3rem; overflow: visible; }

.round-bubble {
  width: min(530px, 86vw);
  min-height: min(530px, 86vw);
  margin: 0 auto;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(2rem, 7vw, 4rem);
  background: radial-gradient(circle at 30% 24%, rgba(254,252,255,0.92), rgba(127,219,202,0.56) 38%, rgba(195,166,255,0.64) 100%);
  border: 4px solid rgba(254,252,255,0.78);
  box-shadow: inset 18px 22px 40px rgba(254,252,255,0.35), 0 22px 44px rgba(45,45,63,0.16);
}

.bubble-cluster { position: relative; min-height: 250px; margin-top: -1rem; }
.soap-bubble {
  position: absolute;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--charcoal);
  font-family: "Caveat", cursive;
  font-size: 1.35rem;
  background: radial-gradient(circle at 30% 25%, rgba(254,252,255,0.8) 0 10%, rgba(127,219,202,0.35) 11% 45%, rgba(255,184,208,0.44) 100%);
  border: 3px solid rgba(254,252,255,0.78);
  box-shadow: 0 14px 30px rgba(45,45,63,0.12);
  animation: gentleDrift 4.5s ease-in-out infinite;
}
.soap-bubble.big { width: 170px; height: 170px; left: 8%; top: 34px; }
.soap-bubble.medium { width: 120px; height: 120px; right: 14%; top: 0; animation-delay: -1.2s; }
.soap-bubble.small { width: 76px; height: 76px; left: 48%; top: 128px; animation-delay: -2s; }

.wave { height: 150px; margin-bottom: -1px; line-height: 0; position: relative; z-index: 4; }
.wave svg { width: 100%; height: 100%; display: block; filter: url(#wobble); }
.wave-pink path { fill: #FFB8D0; }
.wave-purple path { fill: #C3A6FF; }
.wave-core path { fill: #FF6B6B; }

.cloud { position: absolute; z-index: 2; width: clamp(140px, 20vw, 260px); }
.cloud-one { top: 10%; left: 7%; animation: cloudDrift 9s ease-in-out infinite; }
.cloud-two { top: 17%; right: 8%; animation: cloudDrift 11s ease-in-out infinite reverse; }

.doodle { position: absolute; z-index: 3; font-family: "Caveat", cursive; font-size: clamp(2rem, 6vw, 4rem); color: var(--yellow); text-shadow: 2px 3px 0 var(--charcoal); }
.star-a { left: 12%; bottom: 18%; transform: rotate(-12deg); }
.swirl-a { right: 15%; bottom: 22%; color: var(--pink); transform: rotate(22deg); }
.star-b { right: 10%; top: 18%; color: var(--yellow); }
.trail { left: 7%; bottom: 18%; color: var(--cloud); font-size: clamp(1.4rem, 4vw, 2.3rem); text-shadow: none; transform: rotate(18deg); }

.bubble-field { position: absolute; inset: 0; overflow: hidden; z-index: 1; pointer-events: none; }
.floating-bubble {
  --bubble-opacity: 0.38;
  position: absolute;
  bottom: -25vh;
  left: var(--x);
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  opacity: 0;
  background: radial-gradient(circle at 28% 24%, rgba(254,252,255,0.65) 0 11%, var(--fill) 12% 100%);
  border: 2px solid rgba(254,252,255,0.55);
  animation: floatUp var(--duration) linear infinite;
  animation-delay: var(--delay);
  will-change: transform, opacity;
}
.floating-bubble::after {
  content: "";
  position: absolute;
  inset: 18% auto auto 20%;
  width: 26%;
  height: 18%;
  border-radius: 50%;
  background: rgba(254,252,255,0.45);
}
.floating-bubble span { display: block; width: 100%; height: 100%; animation: wobble 3.6s ease-in-out infinite; }

.core-orb { width: min(360px, 78vw); margin: 0 auto 1rem; }
.core-orb svg { width: 100%; overflow: visible; animation: orbPulse 3s ease-in-out infinite; }

.confetti-rain { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 1; }
.confetti-rain i {
  position: absolute;
  top: -40px;
  left: calc(var(--n) * 8%);
  width: var(--s);
  height: var(--s);
  background: var(--c);
  border-radius: var(--r);
  animation: confettiFall var(--t) linear infinite;
  animation-delay: var(--d);
  box-shadow: 0 0 0 2px rgba(45,45,63,0.12);
}
.confetti-rain i:nth-child(1) { --n:1; --s:12px; --c:#FFE66D; --r:50%; --t:7s; --d:-1s; }
.confetti-rain i:nth-child(2) { --n:2; --s:16px; --c:#7FDBCA; --r:3px; --t:9s; --d:-3s; }
.confetti-rain i:nth-child(3) { --n:3; --s:10px; --c:#C3A6FF; --r:50%; --t:6s; --d:-2s; }
.confetti-rain i:nth-child(4) { --n:4; --s:14px; --c:#FEFCFF; --r:4px; --t:11s; --d:-4s; }
.confetti-rain i:nth-child(5) { --n:5; --s:13px; --c:#FFB8D0; --r:50%; --t:8s; --d:-6s; }
.confetti-rain i:nth-child(6) { --n:6; --s:15px; --c:#FFE66D; --r:2px; --t:10s; --d:-5s; }
.confetti-rain i:nth-child(7) { --n:7; --s:11px; --c:#7EC8E3; --r:50%; --t:7s; --d:-3s; }
.confetti-rain i:nth-child(8) { --n:8; --s:16px; --c:#7FDBCA; --r:3px; --t:12s; --d:-7s; }
.confetti-rain i:nth-child(9) { --n:9; --s:10px; --c:#FFF9F0; --r:50%; --t:6s; --d:-1.5s; }
.confetti-rain i:nth-child(10) { --n:10; --s:14px; --c:#C3A6FF; --r:2px; --t:9s; --d:-4.5s; }
.confetti-rain i:nth-child(11) { --n:11; --s:12px; --c:#FFE66D; --r:50%; --t:8s; --d:-2.5s; }
.confetti-rain i:nth-child(12) { --n:12; --s:15px; --c:#FEFCFF; --r:3px; --t:11s; --d:-8s; }

.reveal { opacity: 0; transform: scale(0.3) translateY(40px); }
.reveal.is-visible { animation: bounceIn 760ms both; animation-delay: calc(var(--index, 0) * 80ms); }

@keyframes bounceIn {
  0% { transform: scale(0.3) translateY(40px); opacity: 0; }
  50% { transform: scale(1.05) translateY(-8px); opacity: 0.8; }
  70% { transform: scale(0.95) translateY(4px); opacity: 1; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

@keyframes floatUp {
  0% { transform: translateY(100vh) scale(0.8); opacity: 0; }
  10% { opacity: var(--bubble-opacity); }
  90% { opacity: var(--bubble-opacity); }
  100% { transform: translateY(-20vh) scale(1.1); opacity: 0; }
}

@keyframes wobble {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(15px); }
  75% { transform: translateX(-15px); }
}

@keyframes arrowBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(12px); } }
@keyframes cloudDrift { 0%, 100% { transform: translate(0,0) rotate(-1deg); } 50% { transform: translate(18px, -10px) rotate(2deg); } }
@keyframes gentleDrift { 0%, 100% { transform: translateY(0) translateX(0); } 50% { transform: translateY(-18px) translateX(10px); } }
@keyframes orbPulse { 0%, 100% { transform: scale(1) rotate(-1deg); } 50% { transform: scale(1.035) rotate(1deg); } }
@keyframes confettiFall { 0% { transform: translateY(-60px) rotate(0deg); opacity: 0; } 12% { opacity: 1; } 100% { transform: translateY(115vh) rotate(360deg); opacity: 0; } }

@media (max-width: 720px) {
  .cloud-one { left: -10%; top: 6%; }
  .cloud-two { right: -15%; top: 15%; }
  .star-a, .swirl-a, .star-b, .trail { opacity: 0.65; }
  .soap-bubble.big { left: 0; }
  .soap-bubble.medium { right: 0; }
}
