:root {
  --design-font-check: "IBM Plex Mono**";
  --mist-glass: #F4FFF8;
  --lagoon-cyan: #62D6D9;
  --meadow-jade: #5FAE73;
  --orchid-blush: #F2A7C8;
  --mango-fish: #FFB547;
  --deep-pond: #16343A;
  --lavender-shadow: #AFA7FF;
  --pearl: #FFFFFF;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--deep-pond);
  font-family: "Commissioner", Inter, system-ui, sans-serif;
  background: var(--mist-glass);
  overflow-x: hidden;
}

.atmosphere {
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: -3;
  background: linear-gradient(135deg, #F4FFF8 0%, #62D6D9 42%, #F2A7C8 100%);
}

.gradient-sky {
  position: absolute;
  inset: -12%;
  background:
    radial-gradient(circle at 18% 18%, rgba(255, 255, 255, .84), transparent 26%),
    radial-gradient(circle at 74% 12%, rgba(175, 167, 255, .56), transparent 24%),
    radial-gradient(circle at 70% 80%, rgba(95, 174, 115, .36), transparent 30%),
    radial-gradient(circle at 25% 82%, rgba(255, 181, 71, .24), transparent 20%);
  filter: blur(4px);
}

.greenhouse {
  position: absolute;
  width: 54vw;
  height: 86vh;
  border: 1px solid rgba(244, 255, 248, .38);
  border-bottom: 0;
  border-radius: 50% 50% 0 0;
  opacity: .42;
  transform-origin: bottom center;
}

.greenhouse::before,
.greenhouse::after {
  content: "";
  position: absolute;
  inset: 9% 18% 0;
  border: 1px solid rgba(255, 255, 255, .24);
  border-bottom: 0;
  border-radius: 50% 50% 0 0;
}

.greenhouse::after { inset: 18% 35% 0; }
.greenhouse-one { left: -12vw; bottom: 0; }
.greenhouse-two { right: -16vw; bottom: 4vh; transform: scale(.82); }

.water-ribbon {
  position: absolute;
  width: 150vw;
  height: 30vh;
  left: -24vw;
  border-radius: 50%;
  background: linear-gradient(90deg, rgba(244,255,248,.12), rgba(98,216,217,.34), rgba(175,167,255,.18));
  filter: blur(10px);
  transform: rotate(-13deg);
}
.ribbon-one { top: 30vh; }
.ribbon-two { top: 69vh; transform: rotate(11deg); opacity: .78; }

.dew-field {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,.72) 0 2px, transparent 3px);
  background-size: 9rem 7rem;
  opacity: .34;
}

main { position: relative; }

.chapter {
  min-height: 100vh;
  position: relative;
  display: grid;
  align-items: center;
  padding: 8vh 10vw;
  isolation: isolate;
}

.chapter::before {
  content: attr(data-word);
  position: absolute;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(5rem, 18vw, 17rem);
  font-style: italic;
  color: rgba(255,255,255,.22);
  letter-spacing: -.08em;
  right: 4vw;
  bottom: 6vh;
  z-index: -1;
}

.hero { place-items: center; }

.fog-pane,
.glass-plaque,
.sunrise-pond {
  position: relative;
  width: min(780px, 86vw);
  padding: clamp(2rem, 5vw, 5rem);
  border: 1px solid rgba(244,255,248,0.55);
  border-radius: 3.2rem;
  background: linear-gradient(145deg, rgba(255,255,255,.34), rgba(244,255,248,.16));
  box-shadow: 0 32px 90px rgba(98, 216, 217, .28), inset 0 1px 0 rgba(255,255,255,.55);
  backdrop-filter: blur(22px) saturate(130%);
  overflow: hidden;
}

.fog-pane h1 {
  margin: .1em 0;
  font-size: clamp(4.2rem, 13vw, 12rem);
  line-height: .78;
  letter-spacing: -.11em;
  font-weight: 800;
  color: rgba(22, 52, 58, .42);
  text-shadow: 0 1px 0 rgba(255,255,255,.72);
}

.condensation {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(110deg, rgba(255,255,255,.82), rgba(244,255,248,.42) 48%, rgba(255,255,255,.68)),
    radial-gradient(circle at 30% 30%, rgba(255,255,255,.72), transparent 22%);
  backdrop-filter: blur(14px);
  opacity: var(--fog, .86);
  transform: translateX(calc(var(--scroll, 0) * 1px));
  pointer-events: none;
  mix-blend-mode: screen;
}

.etched-label {
  margin: 0 0 1rem;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .24em;
  font-weight: 700;
  color: rgba(22, 52, 58, .58);
}

.field-note {
  margin: 0;
  max-width: 38rem;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(1.35rem, 2.5vw, 2.1rem);
  line-height: 1.15;
  color: rgba(22, 52, 58, .76);
}

h2 {
  margin: 0 0 .35em;
  font-size: clamp(3.1rem, 8vw, 7rem);
  line-height: .88;
  letter-spacing: -.08em;
  font-weight: 300;
}

.split-left { justify-items: start; }
.split-right { justify-items: end; }
.split-right .glass-plaque { margin-top: 6vh; }

.glass-plaque {
  opacity: .38;
  filter: blur(8px);
  transform: translateY(4rem) rotate(-1deg);
  transition: opacity .9s ease, filter .9s ease, transform .9s ease;
}

.glass-plaque.is-visible,
.sunrise-pond.is-visible {
  opacity: 1;
  filter: blur(0);
  transform: translateY(0) rotate(0deg);
}

.code-bubble {
  display: inline-block;
  margin-top: 2rem;
  padding: .85rem 1.1rem;
  border: 1px solid rgba(255,255,255,.62);
  border-radius: 999px;
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, monospace;
  color: rgba(22,52,58,.7);
  background: rgba(244,255,248,.22);
  box-shadow: 0 12px 40px rgba(175, 167, 255, .18);
}

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

.lambda-fish {
  position: absolute;
  width: 5.3rem;
  height: 2.5rem;
  border-radius: 58% 42% 45% 55%;
  filter: drop-shadow(0 12px 22px rgba(22,52,58,.16));
  opacity: .82;
}

.lambda-fish::before {
  content: "";
  position: absolute;
  right: -1.25rem;
  top: .25rem;
  border-left: 1.7rem solid currentColor;
  border-top: 1rem solid transparent;
  border-bottom: 1rem solid transparent;
}
.lambda-fish i {
  position: absolute;
  left: 1.4rem;
  top: .25rem;
  font: 700 1.35rem "IBM Plex Mono", monospace;
  color: rgba(255,255,255,.82);
}
.fish-mango { background: linear-gradient(135deg, #FFB547, #F2A7C8); color: #FFB547; }
.fish-cyan { background: linear-gradient(135deg, #62D6D9, #F4FFF8); color: #62D6D9; }
.fish-lavender { background: linear-gradient(135deg, #AFA7FF, #F2A7C8); color: #AFA7FF; }
.fish-a { top: 28vh; left: -12vw; animation: swim 19s linear infinite; }
.fish-b { top: 62vh; left: -18vw; animation: swim 27s 3s linear infinite; transform: scale(.68); }
.fish-c { top: 45vh; left: -22vw; animation: swim 23s 8s linear infinite; transform: scale(.52); }

@keyframes swim {
  from { translate: -8vw 0; }
  50% { translate: 58vw -6vh; }
  to { translate: 118vw 3vh; }
}

.pearl-trail {
  position: fixed;
  right: 2.2vw;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  display: grid;
  gap: .82rem;
}
.pearl {
  width: .78rem;
  height: .78rem;
  border-radius: 50%;
  background: rgba(255,255,255,.52);
  border: 1px solid rgba(244,255,248,.72);
  box-shadow: 0 0 0 .25rem rgba(98,216,217,.08);
  transition: transform .3s ease, background .3s ease;
}
.pearl.active { transform: scale(1.55); background: #FFFFFF; }
.pearl span { display: none; }

.lily-row {
  position: absolute;
  bottom: 7vh;
  display: flex;
  gap: 1.2rem;
}
.lily-pad {
  border: 1px solid rgba(244,255,248,.62);
  border-radius: 50%;
  min-width: 6.8rem;
  height: 3.4rem;
  background: rgba(95,174,115,.18);
  color: #16343A;
  font-family: "Commissioner", sans-serif;
  text-transform: uppercase;
  letter-spacing: .18em;
  backdrop-filter: blur(12px);
  transform: rotate(-4deg);
  cursor: pointer;
}
.lily-pad:nth-child(2) { transform: rotate(5deg) translateY(.6rem); background: rgba(98,216,217,.18); }
.lily-pad:nth-child(3) { transform: rotate(-1deg); background: rgba(175,167,255,.18); }

.note-orb {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  transform: translateX(-50%) translateY(140%);
  z-index: 7;
  max-width: min(30rem, 84vw);
  padding: .9rem 1.2rem;
  border-radius: 999px;
  background: rgba(255,255,255,.48);
  border: 1px solid rgba(244,255,248,.62);
  backdrop-filter: blur(18px);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.25rem;
  color: #16343A;
  transition: transform .45s ease;
}
.note-orb.show { transform: translateX(-50%) translateY(0); }

.reeds {
  position: absolute;
  inset: auto auto 12vh 8vw;
  display: flex;
  gap: 3rem;
  color: rgba(22,52,58,.34);
  font: 500 1rem "IBM Plex Mono", monospace;
}
.reeds span { writing-mode: vertical-rl; border-left: 1px solid rgba(22,52,58,.18); padding-top: 6rem; }

.hidden-word {
  position: absolute;
  right: 12vw;
  top: 26vh;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-style: italic;
  font-size: clamp(3rem, 10vw, 8rem);
  color: rgba(255,255,255,.34);
  opacity: 0;
  transform: translateY(2rem);
  transition: opacity 1s ease, transform 1s ease;
}
.hidden-word.is-visible { opacity: 1; transform: translateY(0); }

.dew-constellation {
  position: absolute;
  left: 12vw;
  top: 18vh;
  width: 22rem;
  height: 20rem;
  background: linear-gradient(35deg, transparent 49%, rgba(255,255,255,.45) 50%, transparent 51%);
}
.dew-constellation b {
  position: absolute;
  width: .7rem;
  height: .7rem;
  border-radius: 50%;
  background: #FFFFFF;
  box-shadow: 0 0 24px rgba(98,216,217,.7);
}
.dew-constellation b:nth-child(1){ left: 0; top: 40%; }
.dew-constellation b:nth-child(2){ left: 34%; top: 8%; }
.dew-constellation b:nth-child(3){ right: 10%; top: 42%; }
.dew-constellation b:nth-child(4){ left: 45%; bottom: 4%; }

.bubble-proof {
  position: absolute;
  right: 14vw;
  bottom: 16vh;
  display: grid;
  gap: 1rem;
}
.bubble-proof span {
  width: 4.8rem;
  height: 4.8rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(244,255,248,.24);
  border: 1px solid rgba(255,255,255,.58);
  font-family: "IBM Plex Mono", monospace;
  animation: rise 5s ease-in-out infinite;
}
.bubble-proof span:nth-child(2){ animation-delay: .8s; }
.bubble-proof span:nth-child(3){ animation-delay: 1.6s; }
.bubble-proof span:nth-child(4){ animation-delay: 2.4s; }
@keyframes rise { 50% { transform: translateY(-2rem); } }

.sunrise-pond {
  margin: auto;
  text-align: center;
  opacity: .45;
  filter: blur(7px);
  transform: translateY(3rem);
  transition: opacity 1s ease, filter 1s ease, transform 1s ease;
  background: linear-gradient(145deg, rgba(255,255,255,.4), rgba(255,181,71,.12), rgba(98,216,217,.18));
}
.sunrise-pond .field-note { margin: 0 auto; }
.reflection {
  margin-top: 2.2rem;
  font-size: clamp(4rem, 13vw, 12rem);
  line-height: .8;
  letter-spacing: -.1em;
  font-weight: 800;
  color: rgba(255,255,255,.62);
  transform: scaleY(-1);
  text-shadow: 0 20px 30px rgba(98,216,217,.32);
}

@media (max-width: 720px) {
  .chapter { padding: 8vh 7vw; }
  .lily-row { flex-direction: column; left: 7vw; bottom: 3vh; }
  .pearl-trail { right: 1rem; }
  .bubble-proof, .dew-constellation, .reeds { opacity: .45; transform: scale(.72); }
}
