:root {
  --goo: #6ee83c;
  --goo-deep: #3fae1e;
  --goo-glow: rgba(110, 232, 60, .45);
  --bg: #070b06;
  --surface: rgba(110,232,60,.05);
  --border: rgba(110,232,60,.16);
  --text: #e9f5e4;
  --muted: #8da788;
  --font-pixel: 'Press Start 2P', monospace;
  --font-body: 'Inter', system-ui, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  min-height: 100vh;
  cursor: crosshair;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--goo); color: #04120a; }

/* ================= ambient background ================= */
.ambient {
  position: fixed; inset: 0; z-index: -3; pointer-events: none;
  background:
    radial-gradient(900px 700px at 75% -10%, rgba(110,232,60,.10), transparent 60%),
    radial-gradient(700px 600px at 10% 90%, rgba(60,232,160,.07), transparent 60%),
    var(--bg);
}
.ablob {
  position: fixed; z-index: -2; pointer-events: none;
  border-radius: 50%; filter: blur(70px); opacity: .35;
  background: radial-gradient(circle, var(--goo), transparent 70%);
  animation: drift var(--ad, 22s) ease-in-out infinite alternate;
}
.ablob.b1 { width: 420px; height: 380px; left: -120px; top: 25%; --ad: 26s; }
.ablob.b2 { width: 340px; height: 320px; right: -100px; top: 55%; --ad: 19s; opacity: .22;
            background: radial-gradient(circle, #3ce8a0, transparent 70%); }
.ablob.b3 { width: 280px; height: 260px; left: 40%; top: 80%; --ad: 30s; opacity: .18; }
@keyframes drift {
  from { transform: translate(0,0) scale(1); }
  to   { transform: translate(60px,-50px) scale(1.18); }
}

.bubble {
  position: fixed; bottom: -40px; z-index: -1; pointer-events: none;
  border-radius: 50%;
  border: 2px solid rgba(110,232,60,.30);
  background: radial-gradient(circle at 32% 30%, rgba(255,255,255,.18), rgba(110,232,60,.06));
  animation: rise var(--bd) linear var(--bdel) infinite;
  opacity: 0;
}
@keyframes rise {
  0%   { transform: translateY(0) translateX(0); opacity: 0; }
  8%   { opacity: .8; }
  85%  { opacity: .6; }
  100% { transform: translateY(-112vh) translateX(var(--bx, 24px)); opacity: 0; }
}

/* ================= dripping ceiling (goo-filtered) ================= */
.ceiling {
  position: fixed; top: 0; left: 0; right: 0; height: 280px;
  z-index: 50; pointer-events: none;
  filter: url(#goo);
}
.ceiling .bar {
  position: absolute; top: 0; left: -20px; right: -20px; height: 30px;
  background: var(--goo);
}
.ceiling .drip {
  position: absolute; top: 8px;
  background: var(--goo);
  border-radius: 0 0 50% 50%;
  transform-origin: top center;
  animation: dripStretch var(--d, 5s) ease-in-out infinite;
}
@keyframes dripStretch {
  0%, 100% { transform: scaleY(.15); }
  45%      { transform: scaleY(1); }
  60%      { transform: scaleY(.92); }
}
/* soft glow under the ceiling (outside the filter, so it stays smooth) */
.ceiling-glow {
  position: fixed; top: 0; left: 0; right: 0; height: 120px;
  z-index: 49; pointer-events: none;
  background: linear-gradient(180deg, rgba(110,232,60,.18), transparent);
}

/* falling droplets + floor splats (spawned by JS) */
.droplet {
  position: fixed; left: 0; top: 0; z-index: 60; pointer-events: none;
  background: var(--goo);
  border-radius: 46% 46% 58% 58%;
  box-shadow: 0 0 12px var(--goo-glow);
}
.fsplat {
  position: fixed; z-index: 60; pointer-events: none;
  background: var(--goo); border-radius: 50%;
  animation: splatOut .8s ease-out forwards;
}
@keyframes splatOut {
  0%   { opacity: .9; scale: .4 1; }
  40%  { opacity: .8; scale: 1.25 .55; }
  100% { opacity: 0;  scale: 1.5 .4; }
}

/* ================= slime cursor trail ================= */
.trail {
  position: fixed; z-index: 70; pointer-events: none;
  width: var(--s); height: var(--s);
  margin: calc(var(--s) / -2) 0 0 calc(var(--s) / -2);
  background: var(--goo); border-radius: 50%;
  animation: trailFade .9s ease-out forwards;
}
.trail::after {
  content: ''; position: absolute; left: 32%; top: 55%;
  width: 36%; height: 0; background: inherit;
  border-radius: 0 0 50% 50%;
  animation: trailTail .9s ease-in forwards;
}
@keyframes trailFade {
  0%   { opacity: .85; transform: scale(.35); }
  30%  { opacity: .75; transform: scale(1); }
  100% { opacity: 0;   transform: scale(.85) translateY(8px); }
}
@keyframes trailTail { to { height: 30px; } }

/* ================= layout ================= */
.back-link {
  position: fixed; top: 16px; left: 16px; z-index: 100;
  font-size: 13px; font-weight: 600; text-decoration: none;
  color: #04120a; background: var(--goo);
  padding: 8px 16px; border-radius: 100px;
  box-shadow: 0 4px 20px var(--goo-glow);
  transition: transform .2s;
}
.back-link:hover { transform: scale(1.06) rotate(-2deg); }

main { position: relative; z-index: 1; }

.hero {
  min-height: 100svh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center;
  padding: 140px 24px 80px;
}

/* wobbling jelly title — letters get spans + random timing from JS */
h1.goo-title {
  font-family: var(--font-pixel);
  font-size: clamp(26px, 7vw, 68px);
  line-height: 1.4; letter-spacing: 4px;
  color: var(--goo);
  text-shadow: 0 0 40px var(--goo-glow), 3px 4px 0 #1c4a0e;
}
h1.goo-title span {
  display: inline-block;
  transform-origin: bottom center;
  animation: squish var(--sd, 2.4s) ease-in-out var(--sdel, 0s) infinite;
}
@keyframes squish {
  0%, 100% { transform: scale(1, 1); }
  25%      { transform: scale(1.12, .82) translateY(3px); }
  50%      { transform: scale(.92, 1.12) translateY(-4px); }
  75%      { transform: scale(1.05, .95); }
}

.hero p.sub {
  max-width: 520px; margin: 30px auto 10px; color: var(--muted);
  font-size: clamp(15px, 2vw, 18px); line-height: 1.7;
}
.hero p.sub b { color: var(--goo); }

/* ================= ENTER THE GOO button ================= */
.goo-zone { position: relative; display: inline-block; margin-top: 56px; }
.goo-zone .gooey {
  position: absolute; inset: -100px; pointer-events: none;
  filter: url(#goo);
}
.gooey .blob-core {
  position: absolute; inset: 100px;
  background: var(--goo); border-radius: 60px;
  transition: transform .3s cubic-bezier(.5, 2, .4, 1);
}
.goo-zone:hover .blob-core { transform: scale(1.05, 1.12); }
.gooey .orb {
  position: absolute; left: 50%; top: 50%;
  width: var(--os, 22px); height: var(--os, 22px);
  margin: calc(var(--os, 22px) / -2);
  border-radius: 50%; background: var(--goo);
  animation: orbit var(--od, 7s) linear infinite var(--odir, normal);
}
/* orbiting goo-blob parameters (CSP: no inline style attributes)
   .blob-core is child 1, orbs are children 2-5 */
.gooey .orb:nth-child(2) { --or: 112px; --od: 6.5s; --os: 24px; }
.gooey .orb:nth-child(3) { --or: 128px; --od: 9s;   --os: 18px; --odir: reverse; }
.gooey .orb:nth-child(4) { --or: 96px;  --od: 5s;   --os: 14px; animation-delay: -2s; }
.gooey .orb:nth-child(5) { --or: 140px; --od: 11s;  --os: 20px; animation-delay: -5s; }
@keyframes orbit {
  from { transform: rotate(0turn)  translateX(var(--or, 110px)); }
  to   { transform: rotate(1turn)  translateX(var(--or, 110px)); }
}
button.goo-btn {
  position: relative; z-index: 1;
  background: transparent; border: none; cursor: pointer;
  font-family: var(--font-pixel); font-size: clamp(11px, 2vw, 15px);
  color: #04120a; padding: 26px 44px; letter-spacing: 1px;
  transition: transform .15s;
}
button.goo-btn:active { transform: scale(.94); }

/* slime explosion particles */
.gpart {
  position: fixed; left: 0; top: 0; z-index: 80; pointer-events: none;
  background: var(--goo); border-radius: 50%;
  box-shadow: 0 0 10px var(--goo-glow);
}

/* ================= feature cards ================= */
section.features { max-width: 1080px; margin: 0 auto; padding: 40px 24px 180px; }
.features .head { text-align: center; margin-bottom: 64px; }
.features .head h2 {
  font-family: var(--font-pixel); font-size: clamp(16px, 3vw, 26px);
  color: var(--text); line-height: 1.6;
}
.features .head h2 em { font-style: normal; color: var(--goo); }
.features .head p { color: var(--muted); margin-top: 14px; font-size: 15px; }

.gcards { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 26px 22px; }
.gcard {
  position: relative;
  background: linear-gradient(180deg, rgba(110,232,60,.08), var(--surface));
  border: 1px solid var(--border);
  border-bottom: 4px solid var(--goo-deep);
  border-radius: 22px; padding: 30px 26px 34px;
  transition: transform .3s cubic-bezier(.4, 1.6, .4, 1), box-shadow .3s, border-color .3s;
}
.gcard:hover {
  transform: translateY(-6px) rotate(-.5deg);
  border-color: rgba(110,232,60,.4);
  border-bottom-color: var(--goo);
  box-shadow: 0 24px 48px -16px rgba(0,0,0,.7), 0 0 44px -8px var(--goo-glow);
}
.gcard .icon { display: block; width: 40px; height: 40px; margin-bottom: 16px; image-rendering: pixelated; filter: drop-shadow(0 0 14px var(--goo-glow)); }
.gcard h3 { font-size: 18px; font-weight: 800; margin-bottom: 10px; }
.gcard p { color: var(--muted); font-size: 14.5px; line-height: 1.65; }

/* drips that grow under a hovered card (goo-filtered, JS-populated) */
.cgoo {
  position: absolute; left: 14px; right: 14px; top: 100%; height: 90px;
  margin-top: -8px; pointer-events: none;
  filter: url(#goo);
}
.cgoo .lip { position: absolute; top: 0; left: 0; right: 0; height: 10px; background: var(--goo); border-radius: 0 0 10px 10px; opacity: 0; transition: opacity .25s; }
.gcard:hover .cgoo .lip { opacity: 1; }
.cgoo i {
  position: absolute; top: 4px;
  background: var(--goo); border-radius: 0 0 50% 50%;
  transform: scaleY(0); transform-origin: top center;
  transition: transform .6s cubic-bezier(.5, 1.8, .4, 1) var(--td, 0s);
}
.gcard:hover .cgoo i { transform: scaleY(1); }

footer {
  text-align: center; padding: 40px 24px 110px;
  color: var(--muted); font-size: 13px; position: relative; z-index: 1;
}
footer .puddle {
  width: min(380px, 70vw); height: 16px; margin: 0 auto 26px;
  background: var(--goo); border-radius: 50%;
  opacity: .5; filter: blur(2px);
  animation: puddleBreathe 4s ease-in-out infinite;
}
@keyframes puddleBreathe { 50% { transform: scale(1.08, .8); } }

/* the gooey filter's host svg must not take up space */
svg.goo-defs { position: absolute; width: 0; height: 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .bubble, .ablob { display: none; }
}
