:root {
  --moon-navy: #071A3A;
  --pond-blue: #0B2E5F;
  --firefly: #C9FF4A;
  --clover: #89D6A3;
  --lavender: #DDB7FF;
  --peony: #FF7EB6;
  --cyan: #8DEBFF;
  --moonmilk: #FFF1C9;
  --blackberry: #140B2D;
  --progress: 0;
}

/* DESIGN typography trace: Inter* / Inter** is used for crisp microcopy, nav labels, and compact bento annotations. */

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--moonmilk);
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--blackberry);
}

a, button { font: inherit; color: inherit; }

.page-shell {
  position: relative;
  min-height: 100vh;
  isolation: isolate;
  background:
    radial-gradient(circle at 16% 12%, rgba(141, 235, 255, .32), transparent 28%),
    radial-gradient(circle at 74% 8%, rgba(255, 126, 182, .28), transparent 25%),
    radial-gradient(circle at 45% 54%, rgba(11, 46, 95, .84), transparent 42%),
    linear-gradient(145deg, #071A3A 0%, #0B2E5F 42%, #140B2D 100%);
}

.page-shell::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -5;
  background-image:
    radial-gradient(circle, rgba(255, 241, 201, .2) 0 1px, transparent 1.5px),
    linear-gradient(110deg, transparent 0 44%, rgba(201, 255, 74, .05) 45% 46%, transparent 47% 100%);
  background-size: 38px 38px, 100% 100%;
  opacity: .48;
}

.mesh {
  position: fixed;
  z-index: -4;
  filter: blur(38px);
  opacity: .64;
  border-radius: 42% 58% 64% 36% / 52% 35% 65% 48%;
  animation: breathe 13s ease-in-out infinite alternate;
}

.mesh-one {
  width: 48vw;
  height: 42vw;
  left: -12vw;
  top: 4vh;
  background: radial-gradient(circle at 30% 30%, #8DEBFF, transparent 35%), radial-gradient(circle at 68% 68%, #DDB7FF, transparent 45%);
}

.mesh-two {
  width: 52vw;
  height: 36vw;
  right: -14vw;
  top: 30vh;
  background: radial-gradient(circle at 42% 30%, #FF7EB6, transparent 38%), radial-gradient(circle at 66% 66%, #C9FF4A, transparent 32%);
  animation-duration: 17s;
}

.mesh-three {
  width: 54vw;
  height: 24vw;
  left: 24vw;
  bottom: -10vw;
  background: radial-gradient(circle at 22% 40%, #89D6A3, transparent 34%), radial-gradient(circle at 74% 58%, #0B2E5F, transparent 50%);
  animation-duration: 21s;
}

.topbar {
  position: fixed;
  top: 18px;
  left: 18px;
  right: 18px;
  z-index: 20;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
  padding: 10px;
  border: 1px solid rgba(255, 241, 201, .18);
  border-radius: 999px;
  background: rgba(7, 26, 58, .52);
  backdrop-filter: blur(18px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.16), 0 20px 60px rgba(20,11,45,.36);
}

.brand-mark {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 999px;
  font-family: "Nunito Sans", "Inter", system-ui, sans-serif;
  font-weight: 900;
  letter-spacing: .04em;
  color: var(--firefly);
  background: linear-gradient(135deg, rgba(141,235,255,.16), rgba(255,126,182,.12));
}

.brand-mark i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #C9FF4A;
  box-shadow: 0 0 18px #C9FF4A;
}

.field-tabs { display: flex; justify-content: center; gap: 8px; }
.field-tabs a, .moon-tab {
  border: 1px solid rgba(255,241,201,.18);
  border-radius: 999px;
  padding: 10px 14px;
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  background: rgba(255, 241, 201, .07);
}

.field-tabs a:hover, .moon-tab:hover { background: rgba(201,255,74,.16); color: #C9FF4A; }
.moon-tab { border: 0; cursor: pointer; background: linear-gradient(135deg, rgba(201,255,74,.22), rgba(141,235,255,.16)); }

.chapter {
  position: relative;
  min-height: 100vh;
  padding: 108px 4vw 36px;
  display: grid;
  align-items: center;
}

.chapter-label {
  position: absolute;
  top: 96px;
  left: 5vw;
  z-index: 3;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
  text-shadow: 0 0 16px rgba(141,235,255,.65);
}

.bento-meadow {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-rows: minmax(76px, auto);
  gap: 16px;
  width: min(1480px, 100%);
  margin: 0 auto;
}

.tile {
  position: relative;
  overflow: hidden;
  min-height: 150px;
  padding: clamp(18px, 2.2vw, 34px);
  border: 1px solid rgba(255, 241, 201, .18);
  background:
    radial-gradient(circle at 18% 18%, rgba(255,255,255,.18), transparent 22%),
    radial-gradient(circle at 82% 14%, rgba(141,235,255,.18), transparent 27%),
    linear-gradient(145deg, rgba(255,241,201,.13), rgba(7,26,58,.44));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.22), inset 0 -18px 44px rgba(20,11,45,.18), 0 22px 70px rgba(20,11,45,.42);
  backdrop-filter: blur(20px) saturate(1.22);
  transition: transform .55s cubic-bezier(.2,.8,.2,1), filter .55s, opacity .55s, border-radius .8s;
}

.tile::before {
  content: "";
  position: absolute;
  inset: -42%;
  background: radial-gradient(circle at var(--mx, 40%) var(--my, 35%), rgba(201,255,74,.18), transparent 18%), radial-gradient(circle at 62% 68%, rgba(255,126,182,.16), transparent 24%);
  opacity: .72;
  transition: opacity .4s;
}

.tile::after {
  content: attr(data-title);
  position: absolute;
  right: 18px;
  bottom: 16px;
  color: rgba(255,241,201,.58);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.tile > * { position: relative; z-index: 1; }
.interactive-tile:hover { transform: translateY(-8px) scale(1.018); filter: saturate(1.18) brightness(1.07); }
.bento-meadow.has-focus .interactive-tile:not(.focused) { opacity: .62; filter: saturate(.76) brightness(.82); }
.interactive-tile.focused { z-index: 4; border-color: rgba(201,255,74,.44); }

.word-tile { display: flex; flex-direction: column; justify-content: space-between; border-radius: 38% 62% 42% 58% / 56% 44% 60% 40%; animation: floatLetter 5.5s ease-in-out infinite alternate; }
.word-letter { font-family: "Nunito Sans", "Inter", sans-serif; font-size: clamp(72px, 13vw, 210px); line-height: .82; font-weight: 900; letter-spacing: -.11em; color: #FFF1C9; text-shadow: 0 0 24px rgba(201,255,74,.38), 0 12px 44px rgba(20,11,45,.48); }
.word-tile small { color: #C9FF4A; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.tile-g { grid-column: 1 / 4; grid-row: span 3; background-color: rgba(11,46,95,.42); }
.tile-gi { grid-column: 4 / 8; grid-row: span 2; border-radius: 34% 66% 68% 32% / 62% 40% 60% 38%; animation-delay: -.8s; }
.tile-ggl { grid-column: 8 / 13; grid-row: span 3; border-radius: 56% 44% 34% 66% / 36% 64% 46% 54%; animation-delay: -1.6s; }
.pond-tile { grid-column: 1 / 7; grid-row: span 4; border-radius: 50% 50% 34% 66% / 36% 62% 38% 64%; background: radial-gradient(circle at 50% 88%, rgba(141,235,255,.42), transparent 34%), linear-gradient(135deg, rgba(11,46,95,.76), rgba(221,183,255,.22)); }
.charm-tile { grid-column: 7 / 10; grid-row: span 2; border-radius: 66% 34% 48% 52% / 44% 66% 34% 56%; }
.tiny-tile { grid-column: 10 / 13; grid-row: span 2; min-height: 120px; border-radius: 44% 56% 60% 40% / 58% 42% 58% 42%; }
.seed-tile { grid-column: 7 / 13; grid-row: span 2; border-radius: 30px 80px 42px 94px; background: linear-gradient(135deg, rgba(255,241,201,.18), rgba(137,214,163,.16)); }

h1, h2 { margin: 0; font-family: "Nunito Sans", "Inter", system-ui, sans-serif; font-weight: 900; letter-spacing: -.045em; }
h1 { max-width: 900px; font-size: clamp(40px, 6vw, 96px); line-height: .9; }
h2 { font-size: clamp(32px, 4vw, 68px); line-height: .95; }
p { max-width: 650px; color: rgba(255,241,201,.8); font-size: clamp(15px, 1.35vw, 20px); line-height: 1.55; }
.field-caption { display: inline-block; margin-bottom: 16px; color: #8DEBFF; font-size: 12px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.poem { font-family: "Fraunces", Georgia, serif; color: #FFF1C9; font-size: clamp(26px, 3vw, 54px); line-height: 1.04; }
.poem.large { font-size: clamp(42px, 6vw, 104px); }

.story-grid .story-lead, .clover-letter, .lantern-path { grid-column: span 7; grid-row: span 5; }
.moth-card, .quote-card { grid-column: span 5; grid-row: span 3; border-radius: 82px 32px 100px 42px; }
.ripple-card, .note-card, .beetle-card, .jar-card { grid-column: span 5; grid-row: span 2; border-radius: 36px 96px 42px 76px; }
.story-lead { border-radius: 40% 60% 38% 62% / 44% 30% 70% 56%; background: radial-gradient(circle at 38% 72%, rgba(141,235,255,.36), transparent 30%), rgba(11,46,95,.42); }
.clover-letter { border-radius: 90px 40px 110px 48px; background: radial-gradient(circle at 18% 74%, rgba(137,214,163,.34), transparent 32%), rgba(7,26,58,.42); }
.lantern-path { grid-column: 1 / 9; border-radius: 64px 140px 80px 120px; background: radial-gradient(circle at 75% 28%, rgba(201,255,74,.24), transparent 24%), rgba(11,46,95,.46); }
.horizon-tile { grid-column: 9 / 13; grid-row: span 5; border-radius: 110px 46px 34px 140px; display: grid; align-content: end; background: linear-gradient(180deg, rgba(20,11,45,.22), rgba(7,26,58,.8)); }

.charm-button {
  margin-top: 16px;
  border: 1px solid rgba(201,255,74,.42);
  border-radius: 999px 999px 999px 34px;
  padding: 13px 20px;
  color: #071A3A;
  font-weight: 900;
  background: linear-gradient(135deg, #C9FF4A, #8DEBFF);
  cursor: pointer;
  box-shadow: 0 0 30px rgba(201,255,74,.22);
}

.glyph { font-size: 54px; color: #DDB7FF; }
.glyph-bubbles { display: flex; align-items: center; justify-content: center; gap: 18px; min-height: 100%; font-family: "Fraunces", Georgia, serif; font-size: 70px; color: #C9FF4A; }
.icon-line { display: inline-grid; place-items: center; width: 62px; height: 62px; margin-bottom: 18px; border-radius: 50%; color: #C9FF4A; border: 1px solid rgba(201,255,74,.4); box-shadow: inset 0 0 24px rgba(201,255,74,.12); font-size: 32px; }

.moth { width: 180px; height: 110px; margin: 20px auto; background: radial-gradient(ellipse at 28% 50%, rgba(221,183,255,.85), transparent 45%), radial-gradient(ellipse at 72% 50%, rgba(255,126,182,.78), transparent 45%); filter: drop-shadow(0 0 24px rgba(221,183,255,.36)); clip-path: polygon(50% 45%, 4% 0, 18% 95%, 50% 55%, 82% 95%, 96% 0); animation: flutter 3.4s ease-in-out infinite; }
.ripple-stack { position: relative; height: 150px; }
.ripple-stack span { position: absolute; inset: 50% auto auto 50%; width: 42px; height: 42px; border: 2px solid rgba(141,235,255,.55); border-radius: 50%; transform: translate(-50%, -50%); animation: ripple 2.8s ease-out infinite; }
.ripple-stack span:nth-child(2) { animation-delay: .55s; }
.ripple-stack span:nth-child(3) { animation-delay: 1.1s; }
.trail { display: flex; gap: 16px; padding: 36px 0; }
.trail span { width: 12px; height: 12px; border-radius: 50%; background: #C9FF4A; box-shadow: 0 0 18px #C9FF4A; animation: blink 1.8s ease-in-out infinite alternate; }
.trail span:nth-child(2) { animation-delay: .2s; transform: translateY(18px); }
.trail span:nth-child(3) { animation-delay: .4s; transform: translateY(-8px); }
.trail span:nth-child(4) { animation-delay: .6s; transform: translateY(24px); }
.jar { position: relative; width: 108px; height: 144px; margin: 10px auto 20px; border: 2px solid rgba(255,241,201,.42); border-radius: 28px 28px 42px 42px; background: linear-gradient(135deg, rgba(141,235,255,.12), rgba(255,241,201,.08)); }
.jar::before { content: ""; position: absolute; left: 26px; right: 26px; top: -12px; height: 18px; border-radius: 8px; background: rgba(255,241,201,.32); }
.jar i, .horizon-lights span, .firefly { position: absolute; width: 7px; height: 7px; border-radius: 50%; background: #C9FF4A; box-shadow: 0 0 18px 5px rgba(201,255,74,.55); }
.jar i:nth-child(1) { left: 28px; top: 46px; }
.jar i:nth-child(2) { left: 64px; top: 72px; }
.jar i:nth-child(3) { left: 44px; top: 104px; }
.horizon-lights { position: relative; height: 220px; }
.horizon-lights span:nth-child(1) { left: 12%; bottom: 24%; }
.horizon-lights span:nth-child(2) { left: 34%; bottom: 48%; }
.horizon-lights span:nth-child(3) { left: 50%; bottom: 30%; }
.horizon-lights span:nth-child(4) { left: 70%; bottom: 62%; }
.horizon-lights span:nth-child(5) { left: 86%; bottom: 38%; }

.firefly-field { position: fixed; inset: 0; z-index: 15; pointer-events: none; overflow: hidden; }
.firefly { left: 50%; top: 50%; opacity: .82; transform: translate3d(0,0,0); }
.giggle-glyph {
  position: fixed;
  z-index: 30;
  pointer-events: none;
  color: #C9FF4A;
  font-family: "Fraunces", Georgia, serif;
  font-size: 28px;
  text-shadow: 0 0 18px rgba(201,255,74,.8);
  animation: glyphRise 1.2s ease-out forwards;
}

@keyframes breathe { to { transform: translate3d(3vw, -2vh, 0) scale(1.08); border-radius: 62% 38% 36% 64% / 38% 58% 42% 62%; } }
@keyframes floatLetter { to { transform: translateY(-12px) rotate(1.2deg); border-radius: 64% 36% 58% 42% / 42% 68% 32% 58%; } }
@keyframes flutter { 50% { transform: rotateX(34deg) scale(.94); } }
@keyframes ripple { from { width: 30px; height: 30px; opacity: .75; } to { width: 180px; height: 180px; opacity: 0; } }
@keyframes blink { to { opacity: .28; transform: translateY(-6px) scale(.7); } }
@keyframes glyphRise { from { transform: translateY(0) scale(.8); opacity: 0; } 20% { opacity: 1; } to { transform: translateY(-90px) scale(1.3) rotate(18deg); opacity: 0; } }

@media (max-width: 900px) {
  .topbar { grid-template-columns: 1fr; border-radius: 28px; position: absolute; }
  .field-tabs { flex-wrap: wrap; }
  .chapter { padding-top: 210px; }
  .chapter-label { top: 188px; }
  .bento-meadow { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .tile-g, .tile-gi, .tile-ggl, .pond-tile, .charm-tile, .tiny-tile, .seed-tile, .story-grid .story-lead, .clover-letter, .lantern-path, .horizon-tile, .moth-card, .quote-card, .ripple-card, .note-card, .beetle-card, .jar-card { grid-column: 1 / -1; }
  .word-letter { font-size: clamp(86px, 30vw, 160px); }
}
