:root {
  /* Typography compliance: Cormorant Garamond, Literata, Inter** from Google Fonts */
  --frost: #EEF8F5;
  --mist: #F8FFFC;
  --sage: #BFD8C8;
  --ink: #18382D;
  --lichen: #6F8779;
  --dew: #A8DCE8;
  --paper: #EFE4CF;
  --plum: #4A3E4D;
  --glass: rgba(248, 255, 252, 0.42);
  --edge: rgba(168, 220, 232, 0.38);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 8%, rgba(168, 220, 232, 0.42), transparent 24rem),
    radial-gradient(circle at 82% 16%, rgba(239, 228, 207, 0.50), transparent 28rem),
    linear-gradient(145deg, var(--frost), var(--mist) 42%, #e8f5ee 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 4;
  background-image:
    linear-gradient(90deg, rgba(24, 56, 45, 0.035) 1px, transparent 1px),
    linear-gradient(0deg, rgba(111, 135, 121, 0.035) 1px, transparent 1px);
  background-size: 88px 88px, 88px 88px;
  mix-blend-mode: multiply;
}

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.memory-pool, .mist-sheet {
  position: absolute;
  display: block;
  filter: blur(20px);
  opacity: 0.68;
}

.memory-pool {
  border-radius: 48% 52% 62% 38% / 48% 44% 56% 52%;
  animation: morphPool 20s ease-in-out infinite alternate;
}

.pool-one {
  width: 42vw;
  height: 34vw;
  left: -12vw;
  top: 26vh;
  background: radial-gradient(circle at 28% 24%, rgba(248, 255, 252, 0.90), rgba(168, 220, 232, 0.32) 40%, rgba(191, 216, 200, 0.24));
}

.pool-two {
  width: 34vw;
  height: 48vw;
  right: -10vw;
  top: 86vh;
  background: radial-gradient(circle at 40% 32%, rgba(239, 228, 207, 0.60), rgba(191, 216, 200, 0.34), rgba(111, 135, 121, 0.16));
  animation-duration: 26s;
}

.pool-three {
  width: 48vw;
  height: 30vw;
  left: 24vw;
  top: 245vh;
  background: radial-gradient(circle at 50% 50%, rgba(168, 220, 232, 0.36), rgba(248, 255, 252, 0.28), rgba(74, 62, 77, 0.08));
  animation-duration: 30s;
}

.mist-sheet {
  inset: 6vh 8vw auto auto;
  width: 42vw;
  height: 88vh;
  border-radius: 44% 56% 42% 58%;
  background: rgba(248, 255, 252, 0.28);
  backdrop-filter: blur(16px);
  transform: rotate(8deg);
}

.mist-b {
  inset: 154vh auto auto 4vw;
  width: 30vw;
  transform: rotate(-14deg);
}

.fog-viewport {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  place-items: center;
  align-content: center;
  padding: 10vh 8vw;
  text-align: center;
  overflow: hidden;
}

.opening-stem {
  position: absolute;
  left: 48%;
  top: -10vh;
  width: 3px;
  height: 126vh;
  border-radius: 50%;
  background: linear-gradient(var(--dew), var(--lichen), var(--sage));
  filter: blur(8px);
  opacity: 0.62;
}

.condensation {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 48%, transparent 0 15%, rgba(248, 255, 252, 0.88) 33%, rgba(238, 248, 245, 0.62) 60%, rgba(248, 255, 252, 0.24)),
    repeating-radial-gradient(circle at 28% 34%, rgba(111, 135, 121, 0.08) 0 1px, transparent 1px 10px);
  backdrop-filter: blur(10px);
  animation: clearCondensation 4.8s ease-out forwards;
}

.eyebrow, .chapter-kicker, .annotation, .inhale-mark, .seed-date {
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: clamp(0.68rem, 1.15vw, 0.82rem);
  color: rgba(24, 56, 45, 0.62);
  font-weight: 500;
}

.fog-viewport h1 {
  position: relative;
  z-index: 2;
  margin: 0.2em 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 300;
  font-size: clamp(4rem, 12vw, 12rem);
  line-height: 0.82;
  letter-spacing: -0.045em;
  color: rgba(24, 56, 45, 0.91);
  text-shadow: 0 1px 0 rgba(248,255,252,0.9), 0 24px 55px rgba(111, 135, 121, 0.24);
  filter: blur(14px);
  opacity: 0;
  animation: revealTitle 4.2s 0.5s cubic-bezier(.21,.76,.22,1) forwards;
}

.opening-note {
  position: relative;
  z-index: 2;
  max-width: 34rem;
  margin: 1.5rem auto 0;
  font-family: Literata, Georgia, serif;
  font-size: clamp(1rem, 1.6vw, 1.35rem);
  line-height: 1.75;
  color: rgba(24, 56, 45, 0.72);
}

.inhale-mark { margin-top: 4rem; }

.story-vine {
  position: relative;
  z-index: 1;
  min-height: 520vh;
}

.vine-axis {
  position: absolute;
  top: -4vh;
  bottom: 0;
  left: 46%;
  width: 120px;
  transform: translateX(-50%);
  pointer-events: none;
}

.vine-line {
  width: 100%;
  height: 100%;
  overflow: visible;
}

#stemPath {
  fill: none;
  stroke: rgba(24, 56, 45, 0.46);
  stroke-width: 2.6;
  stroke-linecap: round;
  filter: drop-shadow(0 0 12px rgba(168, 220, 232, 0.72));
  stroke-dasharray: 2600;
  stroke-dashoffset: calc(2600 - (var(--scroll, 0) * 2600));
}

.chapter {
  position: relative;
  min-height: 104vh;
  display: flex;
  align-items: center;
  padding: 12vh 8vw;
}

.chapter::before {
  content: attr(data-count);
  position: absolute;
  left: calc(46% + 34px);
  top: 48%;
  width: 2.8rem;
  height: 2.8rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--lichen);
  background: rgba(248, 255, 252, 0.50);
  border: 1px solid var(--edge);
  box-shadow: 0 0 30px rgba(168, 220, 232, 0.36);
  backdrop-filter: blur(14px);
  font: 500 0.72rem/1 Inter, sans-serif;
  letter-spacing: 0.16em;
}

.leaf-pane {
  position: relative;
  isolation: isolate;
  width: min(42rem, 86vw);
  padding: clamp(2rem, 5vw, 4.8rem);
  background: linear-gradient(135deg, rgba(248, 255, 252, 0.58), rgba(238, 248, 245, 0.28));
  border: 1px solid var(--edge);
  box-shadow: 0 30px 90px rgba(111, 135, 121, 0.18), inset 0 0 40px rgba(248, 255, 252, 0.34);
  backdrop-filter: blur(22px) saturate(1.25);
  opacity: 0;
  transform: translateY(58px) rotate(var(--tilt, -2deg));
  transition: opacity 1.1s ease, transform 1.1s cubic-bezier(.19,.74,.22,1), filter 1.1s ease;
  filter: blur(8px);
}

.leaf-pane.is-visible {
  opacity: 1;
  transform: translateY(var(--drift, 0px)) rotate(var(--tilt, -2deg));
  filter: blur(0);
}

.leaf-pane::before {
  content: "";
  position: absolute;
  inset: 1rem;
  z-index: -1;
  border-radius: inherit;
  background: radial-gradient(circle at 18% 22%, rgba(168, 220, 232, 0.23), transparent 32%), radial-gradient(circle at 88% 76%, rgba(239, 228, 207, 0.38), transparent 28%);
}

.left { margin-right: auto; margin-left: 5vw; }
.right { margin-left: auto; margin-right: 4vw; }

.leaf-wide {
  border-radius: 12% 54% 14% 52% / 18% 48% 20% 46%;
  --tilt: -3deg;
}

.leaf-tall {
  width: min(35rem, 84vw);
  border-radius: 48% 12% 46% 14% / 54% 18% 52% 18%;
  --tilt: 4deg;
}

.leaf-small {
  width: min(28rem, 78vw);
  border-radius: 42% 16% 48% 12% / 18% 50% 16% 46%;
}

.cluster-two { margin-top: 30vh; --tilt: 5deg; }

.leaf-pane h2, .leaf-pane h3 {
  margin: 0.15em 0 0.45em;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 600;
  line-height: 0.98;
  color: var(--ink);
}

.leaf-pane h2 { font-size: clamp(2.9rem, 6.2vw, 6.8rem); letter-spacing: -0.045em; }
.leaf-pane h3 { font-size: clamp(2rem, 3.8vw, 4rem); letter-spacing: -0.035em; }

.fragment {
  max-width: 31rem;
  margin: 0;
  font-family: Literata, Georgia, serif;
  font-size: clamp(1.02rem, 1.45vw, 1.34rem);
  line-height: 1.78;
  color: rgba(24, 56, 45, 0.76);
}

.annotation { margin-top: 1.8rem; color: rgba(111, 135, 121, 0.78); }

.seed-date {
  position: absolute;
  top: 1.6rem;
  right: 2rem;
  color: rgba(74, 62, 77, 0.58);
}

.leaf-veins, .rings {
  position: absolute;
  inset: 8% 6% auto auto;
  width: 62%;
  height: auto;
  opacity: 0.42;
  z-index: -1;
  overflow: visible;
}

.leaf-veins path, .rings path {
  fill: none;
  stroke: rgba(24, 56, 45, 0.48);
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-dasharray: 700;
  stroke-dashoffset: calc(700 - (var(--scroll, 0) * -520));
}

.leaf-outline { stroke: rgba(111, 135, 121, 0.42); stroke-width: 1.8; }
.midrib { stroke: rgba(24, 56, 45, 0.62); }

.refract-pane { border-radius: 18% 44% 12% 50% / 20% 50% 16% 46%; }
.refract-pane::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(112deg, transparent 0 35%, rgba(168, 220, 232, 0.18) 36% 42%, transparent 43% 58%, rgba(248, 255, 252, 0.32) 59% 64%, transparent 65%);
  pointer-events: none;
}

.chapter-thread { align-items: flex-start; gap: 8vw; }

.chapter-bloom { min-height: 120vh; align-items: center; }

.canopy {
  position: relative;
  width: 100%;
  min-height: 72vh;
}

.bloom-leaf {
  position: absolute;
  width: min(36rem, 76vw);
  border-radius: 46% 14% 48% 16% / 18% 48% 16% 46%;
}

.bloom-a { left: 6vw; top: 4vh; --tilt: -7deg; }
.bloom-b { right: 6vw; top: 22vh; --tilt: 6deg; background: linear-gradient(135deg, rgba(239, 228, 207, 0.42), rgba(248, 255, 252, 0.40)); }
.bloom-c { left: 32vw; top: 42vh; width: min(24rem, 64vw); --tilt: 1deg; }

@keyframes revealTitle {
  0% { opacity: 0; filter: blur(18px); transform: translateY(18px) scale(0.98); }
  100% { opacity: 1; filter: blur(0); transform: translateY(0) scale(1); }
}

@keyframes clearCondensation {
  0% { opacity: 1; backdrop-filter: blur(18px); }
  62% { opacity: 0.52; }
  100% { opacity: 0.18; backdrop-filter: blur(2px); }
}

@keyframes morphPool {
  0% { transform: translate3d(0, 0, 0) rotate(0deg); border-radius: 48% 52% 62% 38% / 48% 44% 56% 52%; }
  100% { transform: translate3d(4vw, -5vh, 0) rotate(11deg); border-radius: 64% 36% 42% 58% / 36% 58% 42% 64%; }
}

@media (max-width: 800px) {
  .vine-axis { left: 16%; }
  .chapter::before { left: calc(16% + 20px); }
  .chapter { padding: 12vh 5vw 12vh 18vw; }
  .left, .right { margin-left: 0; margin-right: 0; }
  .chapter-thread { display: block; }
  .cluster-two { margin-top: 10vh; }
  .bloom-leaf { position: relative; left: auto; right: auto; top: auto; margin: 0 0 3vh; }
  .canopy { min-height: 0; }
}
