/* ==========================================================================
   DESIGN MEDIAN STUDIO — Keyframes and scroll-reveal states
   ========================================================================== */

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

@keyframes pulse-ring {
  0% {
    transform: scale(0.9);
    opacity: 0.8;
  }
  100% {
    transform: scale(1.45);
    opacity: 0;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-14px);
  }
}

@keyframes float-slow {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-20px) rotate(2deg);
  }
}

@keyframes glow-breathe {
  0%,
  100% {
    opacity: 0.5;
    transform: scale(1);
  }
  50% {
    opacity: 0.9;
    transform: scale(1.08);
  }
}

@keyframes orbit {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes dash-flow {
  to {
    stroke-dashoffset: -200;
  }
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes wipe-in {
  from {
    transform: scaleY(0);
    transform-origin: bottom;
  }
  to {
    transform: scaleY(1);
    transform-origin: bottom;
  }
}

@keyframes wipe-out {
  from {
    transform: scaleY(1);
    transform-origin: top;
  }
  to {
    transform: scaleY(0);
    transform-origin: top;
  }
}

/* ---------- Scroll reveal ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(34px);
  transition: opacity var(--t-slow) var(--ease-out),
    transform var(--t-slow) var(--ease-out);
  will-change: opacity, transform;
}

[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

[data-reveal="left"] {
  transform: translateX(-40px);
}
[data-reveal="right"] {
  transform: translateX(40px);
}
[data-reveal="scale"] {
  transform: scale(0.94);
}
[data-reveal="left"].is-visible,
[data-reveal="right"].is-visible,
[data-reveal="scale"].is-visible {
  transform: none;
}

/* Stagger via inline --d custom property */
[data-reveal][style*="--d"] {
  transition-delay: var(--d, 0ms);
}

/* ---------- Animated typography ---------- */
.words {
  display: block;
}
.word {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
}
.word + .word {
  margin-left: 0.24em;
}
.word > span {
  display: inline-block;
  transform: translateY(105%);
  animation: word-rise 900ms var(--ease-out) forwards;
  animation-delay: calc(var(--wi, 0) * 70ms + 150ms);
}
@keyframes word-rise {
  to {
    transform: translateY(0);
  }
}

/* Gradient accent text */
.text-gradient {
  background: linear-gradient(100deg, var(--text) 25%, var(--brand-orange) 55%, var(--text) 85%);
  background-size: 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: gradient-shift 8s linear infinite;
}
@keyframes gradient-shift {
  to {
    background-position: 250% 0;
  }
}

/* ---------- Hero atmosphere ---------- */
.hero__grid {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 90px 90px;
  mask-image: radial-gradient(ellipse at 50% 40%, #000 0%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 40%, #000 0%, transparent 78%);
}

.hero__glow {
  position: absolute;
  z-index: 0;
  pointer-events: none;
  border-radius: 50%;
  filter: blur(80px);
  animation: glow-breathe 7s ease-in-out infinite;
}
.hero__glow--one {
  width: 42vw;
  height: 42vw;
  left: -10vw;
  top: -12vw;
  background: radial-gradient(circle, rgba(var(--orange-rgb), 0.14), transparent 68%);
}
.hero__glow--two {
  width: 34vw;
  height: 34vw;
  right: -8vw;
  bottom: -10vw;
  background: radial-gradient(circle, rgba(var(--orange-rgb), 0.09), transparent 68%);
  animation-delay: -3.5s;
}

.hero__orbit {
  position: absolute;
  z-index: 0;
  pointer-events: none;
  border: 1px solid var(--line);
  border-radius: 50%;
}
.hero__orbit--one {
  width: min(56vw, 760px);
  aspect-ratio: 1;
  right: -14%;
  top: 4%;
  opacity: 0.6;
}
.hero__orbit--two {
  width: min(38vw, 520px);
  aspect-ratio: 1;
  right: -4%;
  top: 18%;
  border-style: dashed;
  animation: orbit 60s linear infinite;
  opacity: 0.4;
}
.hero__orbit-dot {
  position: absolute;
  top: -4px;
  left: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand-orange);
  box-shadow: 0 0 14px var(--brand-orange);
}

#particle-canvas {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  width: 100%;
  height: 100%;
}

/* ---------- Parallax layers ---------- */
[data-parallax] {
  will-change: transform;
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
  }

  .word > span {
    transform: none !important;
  }

  .marquee__track {
    animation: none !important;
  }

  #particle-canvas {
    display: none;
  }
}
