/* ===========================================================
   sega.monster — dino + section animations (vanilla)
   Drop this into your existing stylesheet (or link as-is).
   =========================================================== */

:root {
  --monster:        oklch(0.82 0.21 142);
  --monster-glow:   oklch(0.88 0.18 145);
  --coral:          oklch(0.72 0.22 25);
  --sun:            oklch(0.86 0.17 85);
  --ink:            oklch(0.18 0.04 250);
}

/* -------- Dino container -------- */
.dino-monster {
  position: fixed;
  left: -1rem;
  top: 6rem;
  width: 260px;
  height: 260px;
  pointer-events: none;
  z-index: 40;
  /* Driven by JS via CSS vars */
  --p: 0;                              /* scroll progress 0..1   */
  --tx: calc(var(--p) * 62vw);
  --ty: calc(var(--p) * 8vh);
  --rot: calc(-4deg + var(--p) * 10deg);
  --scl: calc(1 + var(--p) * 0.15);
  transform: translate3d(var(--tx), var(--ty), 0)
             rotate(var(--rot)) scale(var(--scl));
  transition: transform 0.15s linear;
}

@media (max-width: 768px) {
  .dino-monster { display: none; }
}

/* habitat glow behind dino */
.dino-monster .habitat {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  filter: blur(28px);
  background: radial-gradient(circle at 50% 50%,
              oklch(0.88 0.18 145 / 0.6),
              oklch(0.72 0.22 25 / 0.25) 60%,
              transparent 75%);
  opacity: var(--p);
  transform: scale(calc(0.4 + var(--p) * 0.6));
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: -1;
}

/* outline -> colour reveal */
.dino-monster svg .fillable {
  fill-opacity: var(--p);
  stroke-width: calc(2.2px - var(--p) * 0.8px);
  transition: fill-opacity 0.3s ease, stroke-width 0.3s ease;
}
.dino-monster svg .stroke-only {
  stroke-width: calc(2.2px - var(--p) * 0.8px);
}

/* -------- Section reveal -------- */
.reveal {
  opacity: 0;
  transform: translateY(60px);
  transition: opacity 0.7s cubic-bezier(.22,1,.36,1),
              transform 0.7s cubic-bezier(.22,1,.36,1);
  will-change: opacity, transform;
}
.reveal.in {
  opacity: 1;
  transform: none;
}

/* staggered children */
.reveal .stagger > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.reveal.in .stagger > *            { opacity: 1; transform: none; }
.reveal.in .stagger > *:nth-child(2){ transition-delay: 0.08s; }
.reveal.in .stagger > *:nth-child(3){ transition-delay: 0.16s; }
.reveal.in .stagger > *:nth-child(4){ transition-delay: 0.24s; }
.reveal.in .stagger > *:nth-child(5){ transition-delay: 0.32s; }
.reveal.in .stagger > *:nth-child(6){ transition-delay: 0.40s; }

@media (prefers-reduced-motion: reduce) {
  .dino-monster, .reveal, .reveal .stagger > * {
    transition: none !important;
    transform: none !important;
    opacity: 1 !important;
  }
}
