/* Styles for js/enhance.js (GSAP / Lenis / Motion layer). */

/* page-transition curtain: hidden below the screen until a page change pulls it up.
   html.pt-in (set in <head> when we arrived through it) keeps it covering until enhance.js wipes it away. */
.pt-curtain {
  position: fixed; inset: 0; z-index: 2147483000; pointer-events: none;
  display: grid; place-items: center;
  background: var(--c-accent, #6b58f6);
  clip-path: inset(100% 0 0 0);
}
.pt-in .pt-curtain { clip-path: inset(0 0 0 0); }
.pt-curtain svg { width: clamp(44px, 5vw, 72px); height: auto; }
.pt-curtain svg path { fill: var(--c-bg, #fff); }

/* hero: eases back and softens as it scrolls away (--hs: 0 → 1, set by ScrollTrigger) */
.hero { --hs: 0; }
.hero-logo { scale: calc(1 - var(--hs) * .07); filter: blur(calc(var(--hs) * 7px)); }
.hero-line { filter: blur(calc(var(--hs) * 5px)); }

/* the cursor pill is moved by GSAP (left/top), so no layout transition on those */
.cursor-pill { will-change: left, top, transform; }

/* magnetic targets get their own layer while they move */
.btn, .work-more, .work-ctrl button, .cs-back, .cs-next .go { will-change: transform; }

/* case study: GSAP drives the gallery scale, Motion the meta row */
.fx-case .cs-gallery img, .fx-case .cs-gallery video { transition: none; will-change: transform; }
.fx-case .cs-meta > div { opacity: 0; }

@media (prefers-reduced-motion: reduce) {
  .pt-curtain { display: none; }
  .hero-logo, .hero-line { scale: none; filter: none; }
  .fx-case .cs-meta > div { opacity: 1; }
}

/* ---------- mascot buddy (js/buddy.js): the small mascot that follows the cursor ---------- */
.buddy-root { position: fixed; left: 0; top: 0; width: 0; height: 0; z-index: 55; pointer-events: none;
  /* --buddy-inv: 0 = its usual purple, 1 = white with purple eyes (set when it's over its own colour) */
  --buddy-inv: 0;
  --buddy-fill: color-mix(in srgb, var(--bg) calc(var(--buddy-inv) * 100%), var(--purple));
  --buddy-eye: color-mix(in srgb, var(--purple) calc(var(--buddy-inv) * 100%), var(--bg)); }
.buddy, .buddy-bubble { position: fixed; left: 0; top: 0; will-change: transform; }
.buddy { transform-origin: 50% 50%; transform: scale(.001); }
.buddy-char { filter: drop-shadow(0 6px 10px rgb(40 25 120 / .22)); }
.buddy-char svg { width: 100%; height: 100%; overflow: visible; display: block; }
.buddy-char .orbs { display: none; }               /* its bubbles are the ones in .buddy-bubble instead */
.buddy-char stop:nth-child(-n+2) { stop-color: var(--buddy-fill); }
.buddy-char stop:nth-child(3) { stop-color: color-mix(in srgb, var(--buddy-fill) 93%, #000); }
.buddy-char stop:nth-child(4) { stop-color: color-mix(in srgb, var(--buddy-fill) 84%, #000); }
.buddy-char .eye { fill: var(--buddy-eye); }
.buddy-bubble { border-radius: 50%; background: var(--buddy-fill); transform: scale(0); filter: drop-shadow(0 3px 5px rgb(40 25 120 / .18)); }

/* speech bubble: sits above-right of the buddy by default; .is-left / .is-below flip it (and its tail) */
.buddy-say {
  position: fixed; left: 0; top: 0; max-width: 260px; padding: 12px 16px; border-radius: 18px 18px 18px 6px;
  background: var(--ink); color: var(--bg); font-size: 15px; line-height: 1.35; font-weight: 500; letter-spacing: -.005em;
  box-shadow: 0 10px 30px rgb(30 20 80 / .18); opacity: 0; visibility: hidden; transform-origin: 0% 100%;
}
.buddy-say.on { visibility: visible; }
.buddy-say.is-left { border-radius: 18px 18px 6px 18px; transform-origin: 100% 100%; }
.buddy-say.is-below { border-radius: 6px 18px 18px 18px; transform-origin: 0% 0%; }
.buddy-say.is-below.is-left { border-radius: 18px 6px 18px 18px; transform-origin: 100% 0%; }
