:root {
  /* Design typography marker: Slab** */
  --paper-mist: #F8F2E7;
  --rain-blue: #26395F;
  --pollen-gold: #FFD66E;
  --meadow-teal: #4FE3C1;
  --aurora-violet: #7B61FF;
  --moss-shadow: #2F5A45;
  --lantern-cream: #FFF1C7;
  --dusk-rose: #F08BB4;
  --heading: "Zilla Slab", Georgia, serif;
  --body: "Roboto Slab", Georgia, serif;
  --label: "Arvo", Georgia, serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--rain-blue);
  background:
    radial-gradient(circle at 13% 18%, rgba(255, 214, 110, 0.32), transparent 22rem),
    radial-gradient(circle at 90% 8%, rgba(240, 139, 180, 0.34), transparent 28rem),
    linear-gradient(125deg, #26395F 0%, #7B61FF 28%, #4FE3C1 58%, #F08BB4 82%, #FFF1C7 100%);
  font-family: var(--body);
}

body::before,
.paper-grain {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

body::before {
  background: rgba(248, 242, 231, 0.45);
  mix-blend-mode: screen;
}

.paper-grain {
  opacity: 0.36;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(47, 90, 69, 0.13) 0 1px, transparent 1.5px),
    radial-gradient(circle at 80% 60%, rgba(38, 57, 95, 0.12) 0 1px, transparent 1.5px),
    linear-gradient(45deg, rgba(255, 241, 199, 0.25), transparent 42%);
  background-size: 21px 24px, 31px 27px, 100% 100%;
}

.aurora-veil {
  position: fixed;
  inset: -18vh -12vw;
  z-index: 0;
  pointer-events: none;
  filter: blur(38px) saturate(116%);
  opacity: 0.72;
  background:
    radial-gradient(ellipse at 20% 28%, rgba(79, 227, 193, 0.62), transparent 34%),
    radial-gradient(ellipse at 72% 16%, rgba(123, 97, 255, 0.6), transparent 32%),
    radial-gradient(ellipse at 55% 76%, rgba(240, 139, 180, 0.52), transparent 36%),
    linear-gradient(125deg, #26395F 0%, #7B61FF 28%, #4FE3C1 58%, #F08BB4 82%, #FFF1C7 100%);
  animation: auroraDrift 19s ease-in-out infinite alternate;
}

.meadow-walk { position: relative; z-index: 3; }

.chapter {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 12vh 7vw;
  isolation: isolate;
}

.opening {
  overflow: hidden;
  clip-path: polygon(0 0, 100% 0, 100% 84%, 0 100%);
  background:
    radial-gradient(ellipse at 15% 78%, rgba(255, 214, 110, 0.42), transparent 26rem),
    linear-gradient(125deg, rgba(38, 57, 95, 0.84) 0%, rgba(123, 97, 255, 0.55) 34%, rgba(79, 227, 193, 0.47) 64%, rgba(255, 241, 199, 0.88) 100%);
}

.wash {
  position: absolute;
  inset: -20%;
  z-index: -1;
  opacity: 0.72;
  filter: blur(26px);
  transform: rotate(-10deg);
}

.wash-one {
  background: linear-gradient(125deg, transparent 6%, rgba(123, 97, 255, 0.64), rgba(79, 227, 193, 0.42), transparent 72%);
  animation: seepOne 5s ease-out both;
}

.wash-two {
  background: radial-gradient(ellipse at 60% 40%, rgba(240, 139, 180, 0.55), transparent 34%), radial-gradient(ellipse at 30% 80%, rgba(255, 214, 110, 0.42), transparent 28%);
  animation: seepTwo 6.5s ease-out both;
}

.hero-mark {
  width: min(82vw, 1050px);
  transform: rotate(-4deg) translateY(5vh);
  transform-origin: left center;
  text-shadow: 0 1rem 4rem rgba(38, 57, 95, 0.18);
}

h1,
h2 {
  margin: 0;
  font-family: var(--heading);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: 0.035em;
}

h1 {
  max-width: 100%;
  color: rgba(255, 241, 199, 0.95);
  font-size: clamp(5rem, 19vw, 16rem);
  background: linear-gradient(120deg, #FFF1C7 5%, #FFD66E 28%, #F08BB4 48%, #4FE3C1 68%, #F8F2E7 92%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0.5rem 2rem rgba(38, 57, 95, 0.22));
  animation: pigmentLetters 3.8s cubic-bezier(.2,.78,.16,1) both;
}

h2 {
  color: var(--rain-blue);
  font-size: clamp(2.65rem, 6vw, 7rem);
}

p {
  font-size: clamp(1rem, 1.45vw, 1.35rem);
  line-height: 1.78;
}

.tagline {
  margin: 1rem 0 0 1vw;
  max-width: 33rem;
  color: var(--lantern-cream);
  font-size: clamp(1.15rem, 2vw, 2.2rem);
}

.eyebrow,
.caption,
.coordinate,
.field-note,
.diagonal-thread a::after,
.ritual-button,
.letter-face span {
  font-family: var(--label);
  letter-spacing: 0.16em;
  text-transform: lowercase;
}

.eyebrow {
  color: var(--lantern-cream);
  font-size: 0.83rem;
}

.field-note {
  position: absolute;
  right: 10vw;
  bottom: 22vh;
  color: var(--moss-shadow);
  background: rgba(255, 241, 199, 0.54);
  padding: 0.8rem 1.1rem;
  transform: rotate(7deg);
  border: 1px solid rgba(47, 90, 69, 0.2);
  box-shadow: 0 1.2rem 4rem rgba(38, 57, 95, 0.16);
}

.flare {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  mix-blend-mode: screen;
}

.sun-flare {
  width: 34vmin;
  height: 11vmin;
  right: 13vw;
  top: 22vh;
  background: radial-gradient(ellipse, rgba(255, 241, 199, 0.9), rgba(255, 214, 110, 0.38) 38%, transparent 72%);
  filter: blur(5px);
  transform: rotate(-18deg);
  animation: flarePulse 5s ease-in-out infinite;
}

.ribbon {
  margin-top: -16vh;
  background: rgba(248, 242, 231, 0.56);
}

.ribbon::before,
.ribbon::after {
  content: "";
  position: absolute;
  inset: -2px;
  z-index: -2;
  pointer-events: none;
}

.ribbon::before {
  opacity: 0.92;
  filter: blur(0.2px);
}

.ribbon::after {
  inset: 12% -5%;
  opacity: 0.22;
  background-image: linear-gradient(110deg, transparent 49%, rgba(38, 57, 95, 0.7) 49.4%, transparent 49.8%);
  background-size: 78px 78px;
}

.ribbon-gate {
  clip-path: polygon(0 13%, 100% 0, 100% 82%, 0 100%);
}
.ribbon-gate::before {
  background: linear-gradient(113deg, rgba(255, 241, 199, 0.86), rgba(79, 227, 193, 0.43) 46%, rgba(248, 242, 231, 0.9));
}

.ribbon-pond {
  clip-path: polygon(0 0, 100% 16%, 100% 100%, 0 80%);
}
.ribbon-pond::before {
  background: linear-gradient(125deg, rgba(38, 57, 95, 0.78), rgba(123, 97, 255, 0.45) 32%, rgba(79, 227, 193, 0.54) 76%, rgba(255, 241, 199, 0.82));
}
.ribbon-pond .vellum { color: var(--lantern-cream); }
.ribbon-pond h2 { color: var(--lantern-cream); }

.ribbon-letter {
  clip-path: polygon(0 17%, 100% 5%, 100% 83%, 0 94%);
}
.ribbon-letter::before {
  background: linear-gradient(103deg, rgba(240, 139, 180, 0.62), rgba(255, 241, 199, 0.86) 46%, rgba(123, 97, 255, 0.24));
}

.ribbon-lantern {
  clip-path: polygon(0 4%, 100% 18%, 100% 88%, 0 76%);
}
.ribbon-lantern::before {
  background: linear-gradient(125deg, rgba(47, 90, 69, 0.84), rgba(38, 57, 95, 0.68) 48%, rgba(255, 214, 110, 0.55));
}
.ribbon-lantern .vellum,
.ribbon-lantern h2 { color: var(--lantern-cream); }

.ribbon-orchard {
  clip-path: polygon(0 13%, 100% 0, 100% 100%, 0 82%);
}
.ribbon-orchard::before {
  background: linear-gradient(118deg, rgba(255, 241, 199, 0.92), rgba(79, 227, 193, 0.36), rgba(240, 139, 180, 0.42), rgba(248, 242, 231, 0.86));
}

.chapter-inner {
  width: min(1120px, 88vw);
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: clamp(2rem, 7vw, 7rem);
  transform: rotate(-2.6deg);
}

.chapter-inner.reverse { transform: rotate(3deg); }

.vellum {
  position: relative;
  padding: clamp(1.5rem, 4vw, 4rem);
  background: rgba(248, 242, 231, 0.46);
  border: 1px solid rgba(255, 241, 199, 0.46);
  box-shadow: 0 1.6rem 5rem rgba(38, 57, 95, 0.14), inset 0 0 5rem rgba(255, 241, 199, 0.17);
  backdrop-filter: blur(8px);
}

.vellum::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px dashed rgba(47, 90, 69, 0.24);
  transform: rotate(1.2deg);
  pointer-events: none;
}

.panel-left { border-radius: 54% 46% 51% 49% / 9% 13% 11% 10%; }
.panel-right { border-radius: 46% 54% 50% 50% / 12% 8% 13% 9%; }
.wide-note { grid-column: 1 / span 2; width: min(820px, 100%); }

.caption {
  margin: 0 0 0.8rem;
  font-size: 0.78rem;
  color: var(--moss-shadow);
}

.ribbon-pond .caption,
.ribbon-lantern .caption { color: var(--pollen-gold); }

.object-sketch svg {
  width: min(420px, 80vw);
  overflow: visible;
  filter: drop-shadow(0 1.4rem 2.2rem rgba(38, 57, 95, 0.2));
}

.object-sketch path,
.object-sketch circle {
  fill: none;
  stroke: var(--moss-shadow);
  stroke-width: 9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.object-sketch circle {
  fill: rgba(255, 214, 110, 0.42);
  stroke: var(--pollen-gold);
}

.gate-sketch { position: relative; }
.gate-sketch::after {
  content: "";
  position: absolute;
  width: 16rem;
  height: 5.5rem;
  right: 0;
  top: 30%;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(255, 214, 110, 0.9), rgba(79, 227, 193, 0.22) 44%, transparent 72%);
  filter: blur(7px);
  mix-blend-mode: screen;
  transform: rotate(-15deg);
}

.ritual-button {
  justify-self: start;
  width: 10.5rem;
  height: 10.5rem;
  border: 1px solid rgba(47, 90, 69, 0.45);
  border-radius: 50%;
  color: var(--rain-blue);
  background: radial-gradient(circle, rgba(255, 241, 199, 0.8), rgba(255, 214, 110, 0.48), rgba(79, 227, 193, 0.2));
  box-shadow: 0 0 0 1.2rem rgba(255, 241, 199, 0.16), 0 1.2rem 3rem rgba(38, 57, 95, 0.18);
  cursor: pointer;
  transition: transform 600ms ease, box-shadow 600ms ease;
}

.ritual-button.is-open,
.ritual-button:hover {
  transform: rotate(-9deg) scale(1.06);
  box-shadow: 0 0 0 2.4rem rgba(79, 227, 193, 0.16), 0 0 4rem rgba(255, 214, 110, 0.7);
}

.pond-orb {
  position: relative;
  width: min(46vw, 30rem);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 36%, rgba(255, 241, 199, 0.78), rgba(79, 227, 193, 0.42) 22%, rgba(123, 97, 255, 0.3) 52%, rgba(38, 57, 95, 0.42) 76%);
  box-shadow: inset 0 0 4rem rgba(255, 241, 199, 0.26), 0 1.8rem 5rem rgba(38, 57, 95, 0.28);
  transform: rotate(-14deg) scaleY(0.72);
}

.pond-orb span {
  position: absolute;
  inset: 16%;
  border: 1px solid rgba(255, 241, 199, 0.55);
  border-radius: 50%;
  animation: ripple 4s ease-in-out infinite;
}
.pond-orb span:nth-child(2) { inset: 27%; animation-delay: -1s; }
.pond-orb span:nth-child(3) { inset: 38%; animation-delay: -2s; }
.pond-orb span:nth-child(4) { inset: 5%; animation-delay: -3s; }

.coordinate {
  position: absolute;
  left: 9vw;
  bottom: 18vh;
  color: rgba(255, 241, 199, 0.78);
  font-size: 0.7rem;
  transform: rotate(-8deg);
}

.folded-letter {
  width: min(70vw, 25rem);
  aspect-ratio: 1.35;
  position: relative;
  perspective: 900px;
  cursor: pointer;
}

.letter-face {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 2.5rem;
  backface-visibility: hidden;
  background:
    linear-gradient(155deg, rgba(255, 241, 199, 0.86), rgba(248, 242, 231, 0.9)),
    radial-gradient(circle at 38% 58%, rgba(240, 139, 180, 0.34), transparent 34%);
  border: 1px solid rgba(47, 90, 69, 0.22);
  box-shadow: 0 1.8rem 5rem rgba(38, 57, 95, 0.18);
  clip-path: polygon(0 0, 100% 7%, 94% 100%, 5% 91%);
  transition: transform 900ms cubic-bezier(.2,.76,.18,1);
}

.letter-face.front::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(28deg, transparent 49%, rgba(47, 90, 69, 0.22) 50%, transparent 51%);
}

.letter-face.back {
  transform: rotateY(180deg);
  color: var(--moss-shadow);
  font-style: italic;
}

.folded-letter.is-turned .front { transform: rotateY(180deg); }
.folded-letter.is-turned .back { transform: rotateY(360deg); }

.lantern {
  position: relative;
  width: 15rem;
  height: 24rem;
  margin: auto;
  filter: drop-shadow(0 0 3rem rgba(255, 214, 110, 0.56));
}

.lantern::before {
  content: "";
  position: absolute;
  inset: 28% -70% 16%;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(255, 241, 199, 0.72), rgba(255, 214, 110, 0.28), transparent 68%);
  filter: blur(9px);
  animation: flarePulse 4s ease-in-out infinite;
}

.lantern-loop,
.lantern-base,
.lantern-glass {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}
.lantern-loop {
  top: 0;
  width: 7rem;
  height: 5rem;
  border: 0.55rem solid rgba(255, 241, 199, 0.72);
  border-bottom: none;
  border-radius: 50% 50% 0 0;
}
.lantern-glass {
  top: 4.2rem;
  width: 11rem;
  height: 15rem;
  border-radius: 45% 45% 38% 38%;
  border: 0.55rem solid rgba(255, 241, 199, 0.64);
  background: radial-gradient(circle at 50% 55%, #FFF1C7, #FFD66E 22%, rgba(240, 139, 180, 0.24) 48%, rgba(38, 57, 95, 0.08) 72%);
}
.lantern-base {
  bottom: 0;
  width: 13rem;
  height: 3.2rem;
  border-radius: 50%;
  background: rgba(255, 241, 199, 0.62);
}

.petal-map {
  grid-column: 1 / span 2;
  position: absolute;
  inset: auto 3vw 16vh auto;
  width: 23rem;
  height: 15rem;
  border-top: 1px dashed rgba(47, 90, 69, 0.45);
  transform: rotate(-12deg);
}

.petal-map i {
  position: absolute;
  width: 2.4rem;
  height: 1.2rem;
  border-radius: 100% 0 100% 0;
  background: rgba(240, 139, 180, 0.58);
  box-shadow: 0 0 1.6rem rgba(255, 214, 110, 0.28);
}
.petal-map i:nth-child(1) { left: 1rem; top: 1rem; }
.petal-map i:nth-child(2) { left: 5rem; top: 5rem; background: rgba(255, 214, 110, 0.64); }
.petal-map i:nth-child(3) { left: 10rem; top: 2rem; background: rgba(79, 227, 193, 0.5); }
.petal-map i:nth-child(4) { left: 14rem; top: 8rem; }
.petal-map i:nth-child(5) { left: 19rem; top: 4rem; background: rgba(123, 97, 255, 0.38); }
.petal-map i:nth-child(6) { left: 21rem; top: 11rem; background: rgba(255, 241, 199, 0.78); }

.closing {
  min-height: 86vh;
  margin-top: -10vh;
  text-align: center;
  color: var(--lantern-cream);
  clip-path: polygon(0 0, 100% 16%, 100% 100%, 0 100%);
  background: linear-gradient(125deg, #26395F 0%, #7B61FF 28%, #4FE3C1 58%, #F08BB4 82%, #FFF1C7 100%);
}

.closing h2 {
  color: var(--lantern-cream);
  font-size: clamp(4rem, 13vw, 12rem);
}

.closing-wash {
  position: absolute;
  inset: 8% 5%;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(255, 241, 199, 0.34), transparent 67%);
  filter: blur(28px);
}

.diagonal-thread {
  position: fixed;
  top: 8vh;
  left: 5vw;
  width: 32rem;
  height: 1px;
  z-index: 10;
  transform: rotate(-17deg);
  background: linear-gradient(90deg, transparent, rgba(255, 241, 199, 0.86), transparent);
}

.diagonal-thread a {
  position: absolute;
  top: -0.5rem;
  width: 1rem;
  height: 1rem;
  border-radius: 50% 0 50% 50%;
  background: var(--lantern-cream);
  border: 1px solid rgba(47, 90, 69, 0.28);
  transform: rotate(48deg);
  box-shadow: 0 0 1.2rem rgba(255, 214, 110, 0.5);
}
.diagonal-thread a:nth-child(1) { left: 4%; }
.diagonal-thread a:nth-child(2) { left: 25%; }
.diagonal-thread a:nth-child(3) { left: 48%; }
.diagonal-thread a:nth-child(4) { left: 70%; }
.diagonal-thread a:nth-child(5) { left: 91%; }
.diagonal-thread a::after {
  content: attr(data-label);
  position: absolute;
  left: 1.2rem;
  top: -0.2rem;
  color: var(--lantern-cream);
  font-size: 0.61rem;
  opacity: 0;
  transform: rotate(17deg) translateY(0.3rem);
  transition: opacity 260ms ease, transform 260ms ease;
}
.diagonal-thread a:hover::after { opacity: 1; transform: rotate(17deg) translateY(0); }

.cursor-stain {
  position: fixed;
  left: 0;
  top: 0;
  width: 9rem;
  height: 9rem;
  z-index: 12;
  pointer-events: none;
  border-radius: 50% 42% 56% 44%;
  background: radial-gradient(circle, rgba(255, 241, 199, 0.42), rgba(255, 214, 110, 0.22), rgba(79, 227, 193, 0.14), transparent 72%);
  filter: blur(7px);
  mix-blend-mode: screen;
  opacity: 0;
  transform: translate3d(-50%, -50%, 0);
}

.pollen-field {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 11;
}

.mote {
  position: absolute;
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  opacity: 0.78;
  background: var(--mote-color);
  box-shadow: 0 0 1rem var(--mote-color);
  transform: translate3d(var(--x), var(--y), 0);
}

.mote.flare-mote {
  width: calc(var(--size) * 6);
  height: calc(var(--size) * 2.2);
  border-radius: 50%;
  filter: blur(2px);
  transform: translate3d(var(--x), var(--y), 0) rotate(var(--angle));
}

@keyframes auroraDrift {
  0% { transform: translate3d(-2vw, -2vh, 0) rotate(-3deg) scale(1); }
  100% { transform: translate3d(3vw, 4vh, 0) rotate(4deg) scale(1.08); }
}

@keyframes seepOne {
  from { opacity: 0; transform: translateX(-24%) rotate(-10deg) scale(0.92); }
  to { opacity: 0.72; transform: translateX(0) rotate(-10deg) scale(1); }
}

@keyframes seepTwo {
  from { opacity: 0; transform: translateY(-18%) rotate(5deg) scale(0.84); }
  to { opacity: 0.74; transform: translateY(0) rotate(5deg) scale(1.04); }
}

@keyframes pigmentLetters {
  0% { opacity: 0; letter-spacing: 0.22em; filter: blur(18px) drop-shadow(0 0 0 rgba(38,57,95,0)); }
  58% { opacity: 0.92; filter: blur(2px) drop-shadow(0 0.5rem 2rem rgba(38,57,95,0.18)); }
  100% { opacity: 1; letter-spacing: 0.035em; filter: blur(0) drop-shadow(0 0.5rem 2rem rgba(38,57,95,0.22)); }
}

@keyframes flarePulse {
  0%, 100% { opacity: 0.56; transform: rotate(-18deg) scale(0.96); }
  50% { opacity: 0.95; transform: rotate(-14deg) scale(1.08); }
}

@keyframes ripple {
  0%, 100% { transform: scale(0.9); opacity: 0.22; }
  50% { transform: scale(1.18); opacity: 0.76; }
}

@media (max-width: 760px) {
  .chapter { padding: 14vh 6vw; }
  .chapter-inner,
  .chapter-inner.reverse {
    grid-template-columns: 1fr;
    transform: rotate(0deg);
  }
  .wide-note,
  .petal-map { grid-column: auto; }
  .diagonal-thread { width: 18rem; left: 8vw; }
  .pond-orb { width: 75vw; }
  .ritual-button { width: 8.5rem; height: 8.5rem; }
  .field-note { right: 5vw; bottom: 12vh; }
}
