/* ==========================================================================
   TANDEM — Animation utilities, ambient bg, marquee, reveals
   ========================================================================== */

/* —————————————————————————————————————————————————————————
   Living Background — purple-black with vibrant orchid + mint
   ————————————————————————————————————————————————————————— */
.aurora {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
  contain: layout paint;
  background:
    radial-gradient(1200px 800px at 12% 16%, rgba(180, 123, 230, 0.32), transparent 60%),
    radial-gradient(1000px 900px at 88% 78%, rgba(94, 255, 161, 0.22), transparent 60%),
    radial-gradient(800px 600px at 55% 50%, rgba(180, 123, 230, 0.12), transparent 70%),
    var(--bg);
}

.aurora__blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.95;
  will-change: transform;
  transform: translate3d(0, 0, 0);
  mix-blend-mode: screen;
}

.aurora__blob--a {
  width: 55vw; height: 55vw;
  top: -10vw; left: -10vw;
  background: radial-gradient(circle, rgba(180, 123, 230, 0.85) 0%, rgba(180, 123, 230, 0.2) 40%, transparent 70%);
  animation: drift-a 22s ease-in-out infinite;
}
.aurora__blob--b {
  width: 50vw; height: 50vw;
  top: 28vh; right: -12vw;
  background: radial-gradient(circle, rgba(94, 255, 161, 0.55) 0%, rgba(94, 255, 161, 0.12) 40%, transparent 70%);
  animation: drift-b 26s ease-in-out infinite;
}
.aurora__blob--c {
  display: block;
  width: 45vw; height: 45vw;
  bottom: -12vw; left: 20vw;
  background: radial-gradient(circle, rgba(180, 123, 230, 0.55) 0%, rgba(94, 255, 161, 0.12) 40%, transparent 70%);
  animation: drift-c 30s ease-in-out infinite;
}
.aurora__blob--d {
  display: block;
  width: 38vw; height: 38vw;
  top: 50vh; right: 30vw;
  background: radial-gradient(circle, rgba(94, 255, 161, 0.4) 0%, transparent 70%);
  animation: drift-d 18s ease-in-out infinite;
}

@keyframes drift-a {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50%      { transform: translate3d(8vw, 10vh, 0) scale(1.15); }
}
@keyframes drift-b {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50%      { transform: translate3d(-10vw, 12vh, 0) scale(1.2); }
}
@keyframes drift-c {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50%      { transform: translate3d(12vw, -8vh, 0) scale(0.9); }
}
@keyframes drift-d {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50%      { transform: translate3d(-8vw, 6vh, 0) scale(1.1); }
}

.grain { display: none; }

/* —————————————————————————————————————————————————————————
   Scan grid — STATIC (animation removed for perf — was repainting full viewport each frame)
   ————————————————————————————————————————————————————————— */
.grid-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.3;
  background-image:
    linear-gradient(to right, rgba(94, 255, 161, 0.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(94, 255, 161, 0.06) 1px, transparent 1px);
  background-size: 80px 80px;
  -webkit-mask-image: radial-gradient(ellipse 100% 80% at 50% 50%, #000 30%, transparent 80%);
          mask-image: radial-gradient(ellipse 100% 80% at 50% 50%, #000 30%, transparent 80%);
}

/* —————————————————————————————————————————————————————————
   Floating particles — DISABLED for performance (was 24 elements
   each animating opacity+transform; aggregated into significant cost)
   ————————————————————————————————————————————————————————— */
.particles { display: none; }
.particles span {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 8px rgba(94, 255, 161, 0.85);
  opacity: 0;
}

/* Position + delay + size variations via nth-child */
.particles span:nth-child(1)  { top: 12%;  left: 8%;   animation-delay: 0s;    animation-duration: 12s; }
.particles span:nth-child(2)  { top: 22%;  left: 78%;  animation-delay: -2s;   animation-duration: 16s; background: var(--orchid); box-shadow: 0 0 10px rgba(180, 123, 230, 0.85); width: 4px; height: 4px; }
.particles span:nth-child(3)  { top: 35%;  left: 45%;  animation-delay: -5s;   animation-duration: 18s; }
.particles span:nth-child(4)  { top: 8%;   left: 38%;  animation-delay: -1s;   animation-duration: 14s; width: 2px; height: 2px; }
.particles span:nth-child(5)  { top: 58%;  left: 12%;  animation-delay: -3s;   animation-duration: 20s; background: var(--orchid); box-shadow: 0 0 10px rgba(180, 123, 230, 0.85); }
.particles span:nth-child(6)  { top: 72%;  left: 88%;  animation-delay: -7s;   animation-duration: 13s; }
.particles span:nth-child(7)  { top: 88%;  left: 32%;  animation-delay: -4s;   animation-duration: 17s; width: 4px; height: 4px; }
.particles span:nth-child(8)  { top: 18%;  left: 92%;  animation-delay: -9s;   animation-duration: 15s; background: var(--orchid); box-shadow: 0 0 10px rgba(180, 123, 230, 0.85); }
.particles span:nth-child(9)  { top: 45%;  left: 88%;  animation-delay: -6s;   animation-duration: 19s; }
.particles span:nth-child(10) { top: 80%;  left: 58%;  animation-delay: -8s;   animation-duration: 14s; width: 2px; height: 2px; }
.particles span:nth-child(11) { top: 28%;  left: 22%;  animation-delay: -11s;  animation-duration: 16s; background: var(--orchid); box-shadow: 0 0 10px rgba(180, 123, 230, 0.85); }
.particles span:nth-child(12) { top: 62%;  left: 68%;  animation-delay: -10s;  animation-duration: 18s; width: 4px; height: 4px; }
.particles span:nth-child(13) { top: 5%;   left: 62%;  animation-delay: -12s;  animation-duration: 13s; }
.particles span:nth-child(14) { top: 92%;  left: 12%;  animation-delay: -2.5s; animation-duration: 21s; background: var(--orchid); box-shadow: 0 0 10px rgba(180, 123, 230, 0.85); }
.particles span:nth-child(15) { top: 42%;  left: 5%;   animation-delay: -6.5s; animation-duration: 14s; }
.particles span:nth-child(16) { top: 65%;  left: 38%;  animation-delay: -3.5s; animation-duration: 17s; width: 2px; height: 2px; }
.particles span:nth-child(17) { top: 15%;  left: 55%;  animation-delay: -7.5s; animation-duration: 15s; background: var(--orchid); box-shadow: 0 0 10px rgba(180, 123, 230, 0.85); }
.particles span:nth-child(18) { top: 50%;  left: 28%;  animation-delay: -1.5s; animation-duration: 19s; }
.particles span:nth-child(19) { top: 78%;  left: 75%;  animation-delay: -8.5s; animation-duration: 13s; width: 4px; height: 4px; }
.particles span:nth-child(20) { top: 38%;  left: 75%;  animation-delay: -4.5s; animation-duration: 16s; }
.particles span:nth-child(21) { top: 25%;  left: 30%;  animation-delay: -11.5s; animation-duration: 14s; background: var(--orchid); box-shadow: 0 0 10px rgba(180, 123, 230, 0.85); }
.particles span:nth-child(22) { top: 85%;  left: 48%;  animation-delay: -5.5s; animation-duration: 17s; }
.particles span:nth-child(23) { top: 55%;  left: 95%;  animation-delay: -9.5s; animation-duration: 15s; }
.particles span:nth-child(24) { top: 70%;  left: 18%;  animation-delay: -10.5s; animation-duration: 18s; width: 2px; height: 2px; }

@keyframes particle-float {
  0%, 100% {
    transform: translate3d(0, 0, 0);
    opacity: 0;
  }
  10%, 90% {
    opacity: 0.85;
  }
  50% {
    transform: translate3d(8px, -16px, 0);
    opacity: 1;
  }
}

/* —————————————————————————————————————————————————————————
   Plum surface moving gradient — applied to dark cards/forms
   ————————————————————————————————————————————————————————— */
.plum-gradient {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

.plum-gradient::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(70% 80% at 20% 20%, rgba(94, 255, 161, 0.16), transparent 60%),
    radial-gradient(60% 70% at 90% 90%, rgba(180, 123, 230, 0.22), transparent 65%),
    radial-gradient(50% 60% at 60% 30%, rgba(94, 255, 161, 0.08), transparent 70%);
  background-size: 200% 200%;
  animation: plum-shift 18s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes plum-shift {
  0%   { background-position: 0% 0%, 100% 100%, 50% 50%; }
  100% { background-position: 100% 100%, 0% 0%, 30% 70%; }
}

/* —————————————————————————————————————————————————————————
   Word/line splitting wrappers
   ————————————————————————————————————————————————————————— */
.line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.06em;
}

.line > * {
  display: inline-block;
  will-change: transform, opacity;
}

.word {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
  padding-bottom: 0.06em;
}

.word-inner { display: inline-block; will-change: transform, opacity; }

/* —————————————————————————————————————————————————————————
   Reveal fallbacks
   ————————————————————————————————————————————————————————— */
[data-anim].anim-init {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 800ms var(--ease-out), transform 800ms var(--ease-out);
  will-change: opacity, transform;
}
[data-anim].anim-init.is-revealed { opacity: 1; transform: translateY(0); }

[data-anim="reveal-stagger"].anim-init [data-anim-child] {
  opacity: 0;
  transform: translateY(36px);
  transition: opacity 800ms var(--ease-out), transform 800ms var(--ease-out);
}
[data-anim="reveal-stagger"].is-revealed [data-anim-child] { opacity: 1; transform: translateY(0); }

[data-anim="reveal-stagger"].is-revealed [data-anim-child]:nth-child(1) { transition-delay: 0ms; }
[data-anim="reveal-stagger"].is-revealed [data-anim-child]:nth-child(2) { transition-delay: 80ms; }
[data-anim="reveal-stagger"].is-revealed [data-anim-child]:nth-child(3) { transition-delay: 160ms; }
[data-anim="reveal-stagger"].is-revealed [data-anim-child]:nth-child(4) { transition-delay: 240ms; }
[data-anim="reveal-stagger"].is-revealed [data-anim-child]:nth-child(5) { transition-delay: 320ms; }
[data-anim="reveal-stagger"].is-revealed [data-anim-child]:nth-child(6) { transition-delay: 400ms; }

.intro-loading main { opacity: 0; transform: translateY(20px); }
body.intro-done main { opacity: 1; transform: translateY(0); transition: opacity 900ms var(--ease-out), transform 900ms var(--ease-out); }

/* —————————————————————————————————————————————————————————
   Marquee — slow horizontal flow
   ————————————————————————————————————————————————————————— */
.marquee {
  overflow: hidden;
  position: relative;
  padding-block: var(--sp-5);
  border-block: 1px solid var(--linen-line);
  -webkit-mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent);
          mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent);
}

.marquee__track {
  display: inline-flex;
  gap: 4rem;
  animation: marquee 90s linear infinite;
  white-space: nowrap;
  font-family: var(--display);
  font-size: clamp(1.5rem, 3vw, 2.5rem);
  font-weight: 400;
  color: var(--linen);
}

.marquee__track span { display: inline-flex; align-items: center; gap: 4rem; }

.marquee__track .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--mint);
  display: inline-block;
  box-shadow: 0 0 12px rgba(94, 255, 161, 0.6);
}

@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* —————————————————————————————————————————————————————————
   Scroll progress bar
   ————————————————————————————————————————————————————————— */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 0%;
  background: linear-gradient(to right, var(--mint), var(--orchid));
  z-index: 60;
  transition: width 80ms linear;
  pointer-events: none;
  box-shadow: 0 0 12px rgba(94, 255, 161, 0.7);
}

/* —————————————————————————————————————————————————————————
   Magnetic helper
   ————————————————————————————————————————————————————————— */
.magnetic {
  display: inline-flex;
  transition: transform 380ms var(--ease-out);
  will-change: transform;
}
