/* Typography compliance note: Roboto Mono** from Google Fonts for code annotations. */
:root {
  --sea-aqua: #66D6D1;
  --pearl-foam: #F7F1E5;
  --lagoon-teal: #087F8C;
  --lip-coral: #FF6F91;
  --chrome-lavender: #C9B8FF;
  --sand-gold: #F4C95D;
  --ink-navy: #123047;
  --glass: rgba(247, 241, 229, 0.68);
  --shadow: rgba(18, 48, 71, 0.18);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink-navy);
  font-family: "Nunito Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 14% 8%, rgba(255, 111, 145, 0.24), transparent 25rem),
    radial-gradient(circle at 82% 16%, rgba(201, 184, 255, 0.42), transparent 26rem),
    radial-gradient(circle at 20% 88%, rgba(244, 201, 93, 0.28), transparent 22rem),
    linear-gradient(145deg, #66D6D1 0%, #F7F1E5 48%, #C9B8FF 100%);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -4;
  background-image:
    linear-gradient(rgba(18, 48, 71, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(18, 48, 71, 0.045) 1px, transparent 1px);
  background-size: 58px 58px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,0.55), rgba(0,0,0,0.12));
}

.water-bg { position: fixed; inset: 0; pointer-events: none; z-index: -3; overflow: hidden; }
.caustic {
  position: absolute;
  width: 44vw;
  height: 22vw;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(247, 241, 229, 0.45), rgba(102, 214, 209, 0.08) 56%, transparent 72%);
  filter: blur(18px);
  animation: floatCaustic 14s ease-in-out infinite alternate;
}
.caustic-one { top: 7%; left: -10%; }
.caustic-two { top: 42%; right: -14%; animation-delay: -5s; }
.caustic-three { bottom: 2%; left: 18%; animation-delay: -9s; }
.chrome-confetti { position: absolute; font-size: clamp(1.5rem, 4vw, 4.5rem); color: var(--sand-gold); text-shadow: 0 0 8px #F7F1E5, 0 0 24px #C9B8FF; animation: sparkle 2.8s ease-in-out infinite; }
.c1 { left: 8%; top: 18%; } .c2 { right: 12%; top: 30%; animation-delay: .7s; } .c3 { left: 17%; bottom: 14%; color: var(--lip-coral); animation-delay: 1.3s; } .c4 { right: 24%; bottom: 20%; animation-delay: 1.9s; }

.charm-rail {
  position: fixed;
  right: 22px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 14px 9px;
  border: 1px solid rgba(247, 241, 229, 0.72);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(247, 241, 229, 0.58), rgba(201, 184, 255, 0.35));
  box-shadow: 0 14px 38px var(--shadow), inset 0 1px 0 rgba(255,255,255,0.8);
  backdrop-filter: blur(14px);
}
.rail-bead {
  position: relative;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 25%, #F7F1E5, #C9B8FF 42%, #087F8C 100%);
  box-shadow: 0 0 0 3px rgba(247, 241, 229, 0.38), 0 0 14px rgba(102, 214, 209, 0.35);
  transition: transform .25s ease, box-shadow .25s ease;
}
.rail-bead span { position: absolute; right: 30px; top: -4px; opacity: 0; transform: translateX(8px); padding: 3px 9px; border-radius: 999px; background: var(--pearl-foam); color: var(--ink-navy); font-size: .72rem; font-weight: 800; white-space: nowrap; transition: .25s ease; }
.rail-bead:hover, .rail-bead.active { transform: scale(1.35); box-shadow: 0 0 0 5px rgba(244, 201, 93, 0.35), 0 0 22px #F4C95D; }
.rail-bead:hover span, .rail-bead.active span { opacity: 1; transform: translateX(0); }

.story-map { width: 100%; }
.scene {
  position: relative;
  min-height: 100vh;
  padding: clamp(48px, 8vw, 96px);
  isolation: isolate;
  display: grid;
  place-items: center;
}

.layer {
  position: relative;
  z-index: 8;
  border: 1px solid rgba(247, 241, 229, 0.82);
  background: linear-gradient(135deg, rgba(247, 241, 229, 0.76), rgba(102, 214, 209, 0.26) 48%, rgba(201, 184, 255, 0.34));
  box-shadow: 0 26px 80px var(--shadow), inset 0 1px 0 rgba(255,255,255,0.86), inset 0 -2px 12px rgba(8,127,140,0.10);
  backdrop-filter: blur(18px);
}

.acetate { border-radius: 42px; }
.hero-sheet {
  width: min(760px, 82vw);
  padding: clamp(34px, 6vw, 70px);
  text-align: center;
  transform: rotate(-2.2deg);
}
.hero-sheet::after, .finale-sheet::after, .experiment-card::after {
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: inherit;
  border: 2px solid rgba(255,255,255,0.32);
  pointer-events: none;
}

h1, h2, h3 { font-family: "Quicksand", "Arial Rounded MT Bold", system-ui, sans-serif; margin: 0; color: var(--ink-navy); }
h1 {
  font-size: clamp(4rem, 12vw, 9.8rem);
  line-height: .86;
  letter-spacing: -0.08em;
  text-shadow: 0 2px 0 #F7F1E5, 0 7px 0 rgba(201, 184, 255, 0.5), 0 18px 30px rgba(8,127,140,0.18);
}
h2 { font-size: clamp(2.35rem, 6vw, 5.6rem); line-height: .92; letter-spacing: -0.055em; }
h3 { font-size: clamp(1.35rem, 3vw, 2.25rem); line-height: 1; }
p { font-size: clamp(1rem, 1.7vw, 1.22rem); line-height: 1.62; margin: 0; }
.lead { max-width: 560px; margin: 22px auto 26px; font-size: clamp(1.15rem, 2.2vw, 1.6rem); font-weight: 700; }
.sticker-word {
  display: inline-block;
  margin: 0 0 12px;
  font-family: "Rubik Bubbles", "Quicksand", cursive;
  color: var(--lip-coral);
  font-size: clamp(1rem, 2.5vw, 2rem);
  text-shadow: 0 2px 0 #F7F1E5, 0 0 16px rgba(255,111,145,0.45);
  transform: rotate(-8deg);
}
.coral-bubble { color: var(--sand-gold); }

.pearl-code, pre {
  font-family: "Roboto Mono", "Mono**", ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--ink-navy);
  background: linear-gradient(100deg, rgba(247, 241, 229, 0.88), rgba(201,184,255,0.48));
  border: 1px solid rgba(18,48,71,0.13);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.75), 0 12px 26px rgba(18,48,71,.12);
}
.pearl-code { display: inline-block; padding: 12px 16px; border-radius: 18px; font-size: .92rem; }
.pearl-code span { color: var(--lip-coral); font-weight: 600; }
pre { margin: 0; padding: 24px; border-radius: 24px; overflow: hidden; font-size: clamp(.8rem, 1.35vw, 1rem); line-height: 1.6; }

.wave-map { position: absolute; inset: auto; z-index: 2; width: min(1180px, 100vw); height: auto; overflow: visible; pointer-events: none; }
.hero-waves { bottom: 4%; left: 50%; transform: translateX(-50%); }
.scene-waves { inset: 15% auto auto 50%; transform: translateX(-50%); }
.experiment-waves { bottom: 5%; left: 50%; transform: translateX(-50%); }
.merge-waves { top: 12%; left: 50%; transform: translateX(-50%); }
.draw-path { fill: none; stroke-width: 10; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: var(--path-length, 1); stroke-dashoffset: var(--path-length, 1); filter: drop-shadow(0 8px 0 rgba(247,241,229,.36)) drop-shadow(0 12px 16px rgba(18,48,71,.12)); transition: stroke-dashoffset 1s cubic-bezier(.2,.8,.2,1); }
.draw-path.aqua { stroke: var(--sea-aqua); }
.draw-path.coral { stroke: var(--lip-coral); }
.draw-path.lavender { stroke: var(--chrome-lavender); }
.draw-path.gold { stroke: var(--sand-gold); }
.draw-path.teal-merge { stroke: var(--lagoon-teal); }
.scene-active .draw-path { stroke-dashoffset: 0; }
.hand-label { font-family: "Roboto Mono", "Mono**", ui-monospace, monospace; font-size: 25px; font-weight: 600; paint-order: stroke; stroke: rgba(247,241,229,.8); stroke-width: 5px; transform: rotate(-3deg); }
.teal { fill: var(--lagoon-teal); } .coral-text { fill: var(--lip-coral); }
.decision-node { fill: var(--sand-gold); stroke: var(--pearl-foam); stroke-width: 6; filter: drop-shadow(0 0 18px #F4C95D); transform-origin: center; animation: nodePulse 1.8s ease-in-out infinite; }

.shell-callout {
  position: absolute;
  z-index: 12;
  left: clamp(24px, 7vw, 90px);
  bottom: clamp(40px, 9vw, 110px);
  width: min(310px, 78vw);
  padding: 22px 24px;
  border-radius: 32px 32px 56px 32px;
  background: linear-gradient(145deg, rgba(247,241,229,.86), rgba(102,214,209,.42));
  box-shadow: 0 24px 60px var(--shadow), inset 0 2px 0 rgba(255,255,255,.75);
  border: 1px solid rgba(247,241,229,.82);
  transform: rotate(4deg);
}
.shell-icon { float: right; font-size: 4rem; color: var(--chrome-lavender); line-height: .7; text-shadow: 0 2px 0 #F7F1E5; }
.shell-callout strong { display: block; margin-bottom: 8px; color: var(--lagoon-teal); font-family: "Roboto Mono", "Mono**", monospace; }

.tradeoff { align-items: start; grid-template-columns: 1fr 1fr; gap: 22px; }
.sticky {
  justify-self: start;
  align-self: center;
  width: min(510px, 88vw);
  padding: clamp(28px, 4vw, 46px);
  border-radius: 18px 48px 28px 44px;
  transform: rotate(-4deg);
  background: linear-gradient(135deg, rgba(247,241,229,.88), rgba(244,201,93,.32));
}
.code-slip {
  justify-self: end;
  align-self: end;
  width: min(500px, 88vw);
  padding: 18px;
  border-radius: 34px;
  transform: rotate(3deg);
  background: linear-gradient(135deg, rgba(18,48,71,.08), rgba(201,184,255,.42));
}
.tab-label { display: inline-block; padding: 6px 12px; margin-bottom: 10px; border-radius: 999px; background: var(--sea-aqua); font-family: "Roboto Mono", "Mono**", monospace; font-size: .72rem; font-weight: 600; }
.rhinestone { position: absolute; right: 28px; top: 24px; width: 22px; height: 22px; border-radius: 50%; background: radial-gradient(circle at 30% 25%, #fff, #F4C95D 40%, #FF6F91 80%); box-shadow: 0 0 24px #F4C95D; }
.gem-list { list-style: none; margin: 22px 0 0; padding: 0; font-weight: 800; }
.gem-list li { margin: 12px 0; }
.gem-list li::before { content: "✦"; color: var(--sand-gold); margin-right: 10px; text-shadow: 0 0 10px #F4C95D; }
.magnifier {
  position: absolute;
  right: 10vw;
  top: 18vh;
  z-index: 11;
  width: 230px;
  height: 230px;
  display: grid;
  place-items: center;
  padding: 34px;
  text-align: center;
  border-radius: 50%;
  background: rgba(247,241,229,.46);
  border: 8px solid rgba(201,184,255,.7);
  box-shadow: 0 28px 70px var(--shadow), inset 0 2px 20px rgba(255,255,255,.68);
  backdrop-filter: blur(10px);
}
.magnifier span { position: absolute; top: -20px; right: 20px; font-family: "Rubik Bubbles"; color: var(--lip-coral); font-size: 3rem; }
.magnifier p { font-size: .95rem; font-weight: 800; }

.experiment-card { width: min(690px, 88vw); padding: clamp(30px, 5vw, 58px); justify-self: start; align-self: start; transform: rotate(2deg); }
.postcards { position: relative; z-index: 9; display: flex; gap: clamp(18px, 4vw, 50px); align-self: end; justify-self: end; flex-wrap: wrap; justify-content: flex-end; }
.postcard {
  width: min(330px, 86vw);
  min-height: 220px;
  padding: 26px;
  border-radius: 32px;
  background: linear-gradient(150deg, rgba(247,241,229,.9), rgba(102,214,209,.26));
  border: 1px solid rgba(247,241,229,.82);
  box-shadow: 0 26px 70px var(--shadow), inset 0 1px 0 rgba(255,255,255,.86);
  transform: rotate(-3deg);
}
.postcard:nth-child(2) { transform: rotate(4deg); background: linear-gradient(150deg, rgba(247,241,229,.9), rgba(255,111,145,.2)); }
.stamp { display: grid; place-items: center; width: 52px; height: 52px; margin-bottom: 18px; border-radius: 15px; background: var(--chrome-lavender); color: var(--ink-navy); font-family: "Rubik Bubbles"; font-size: 1.8rem; box-shadow: inset 0 2px 0 rgba(255,255,255,.8), 0 8px 20px rgba(18,48,71,.12); }

.resolution { min-height: 115vh; }
.finale-sheet { width: min(730px, 88vw); padding: clamp(34px, 6vw, 70px); border-radius: 54px; text-align: center; background: linear-gradient(145deg, rgba(247,241,229,.9), rgba(102,214,209,.28), rgba(244,201,93,.22)); }
.chrome-shell { position: absolute; left: -28px; top: -38px; font-size: 7rem; color: var(--chrome-lavender); text-shadow: 0 2px 0 #F7F1E5, 0 12px 30px rgba(18,48,71,.18); transform: rotate(-18deg); }
.gloss-button { display: inline-block; margin-top: 28px; padding: 15px 24px; border-radius: 999px; color: var(--ink-navy); text-decoration: none; font-weight: 900; background: linear-gradient(135deg, #F7F1E5, #F4C95D 50%, #FF6F91); box-shadow: 0 16px 34px rgba(18,48,71,.18), inset 0 2px 0 rgba(255,255,255,.85); transition: transform .25s ease, filter .25s ease; }
.gloss-button:hover { transform: translateY(-4px) rotate(-2deg); filter: saturate(1.18); }
.resolution-notes { position: absolute; z-index: 9; right: 8vw; bottom: 10vh; display: grid; gap: 12px; width: min(340px, 84vw); }
.resolution-notes div { padding: 15px 18px; border-radius: 22px; background: rgba(247,241,229,.72); box-shadow: 0 14px 34px rgba(18,48,71,.12); backdrop-filter: blur(12px); }
.resolution-notes strong { display: block; color: var(--lagoon-teal); font-family: "Roboto Mono", "Mono**", monospace; font-size: .8rem; }
.resolution-notes span { font-weight: 800; }

.reveal-sheet { opacity: 0; transform: translateY(70px) rotate(var(--start-rotate, 0deg)); transition: opacity .8s ease, transform .9s cubic-bezier(.2,.8,.2,1); }
.reveal-sheet.in-view { opacity: 1; transform: translateY(0) rotate(var(--end-rotate, 0deg)); }
.hero-sheet { --start-rotate: -6deg; --end-rotate: -2.2deg; }
.sticky { --start-rotate: -9deg; --end-rotate: -4deg; }
.code-slip { --start-rotate: 8deg; --end-rotate: 3deg; }
.experiment-card { --start-rotate: 7deg; --end-rotate: 2deg; }
.postcard:first-child { --start-rotate: -8deg; --end-rotate: -3deg; }
.postcard:nth-child(2) { --start-rotate: 9deg; --end-rotate: 4deg; }

.hover-note { cursor: pointer; transition: transform .22s ease; }
.hover-note::after {
  content: attr(data-note);
  position: absolute;
  left: 20px;
  bottom: calc(100% + 10px);
  max-width: 240px;
  padding: 9px 12px;
  border-radius: 15px;
  background: var(--ink-navy);
  color: var(--pearl-foam);
  font-size: .82rem;
  font-weight: 800;
  opacity: 0;
  transform: translateY(8px) rotate(-2deg);
  pointer-events: none;
  transition: .22s ease;
}
.hover-note:hover { transform: translateY(-5px) rotate(var(--end-rotate, 2deg)); }
.hover-note:hover::after { opacity: 1; transform: translateY(0) rotate(-2deg); }
.charm { animation: charmDrift 5s ease-in-out infinite alternate; }

.cursor-pearls { position: fixed; inset: 0; z-index: 100; pointer-events: none; }
.pearl-dot { position: absolute; width: 9px; height: 9px; border-radius: 50%; background: radial-gradient(circle at 30% 25%, #fff, #F4C95D 45%, #FF6F91); box-shadow: 0 0 13px rgba(244,201,93,.8); transform: translate(-50%, -50%); opacity: .85; animation: pearlFade .8s ease forwards; }

@keyframes floatCaustic { from { transform: translate3d(-2%, -3%, 0) rotate(-4deg); } to { transform: translate3d(4%, 3%, 0) rotate(5deg); } }
@keyframes sparkle { 0%, 100% { opacity: .45; transform: scale(.9) rotate(-8deg); } 50% { opacity: 1; transform: scale(1.15) rotate(8deg); } }
@keyframes nodePulse { 0%, 100% { r: 12px; opacity: .78; } 50% { r: 18px; opacity: 1; } }
@keyframes charmDrift { from { translate: 0 -4px; } to { translate: 0 9px; } }
@keyframes pearlFade { to { opacity: 0; transform: translate(-50%, -50%) scale(0); } }

@media (max-width: 820px) {
  .scene { padding: 72px 22px; align-content: center; }
  .tradeoff { grid-template-columns: 1fr; }
  .charm-rail { right: 10px; transform: translateY(-50%) scale(.86); }
  .shell-callout, .magnifier, .resolution-notes { position: relative; left: auto; right: auto; top: auto; bottom: auto; margin-top: 28px; }
  .wave-map { opacity: .72; width: 130vw; }
  .postcards { justify-content: center; }
  h1 { font-size: clamp(3.2rem, 17vw, 5.2rem); }
}
