/* ============================================================
   ANIMATIONS — keyframes + scroll-reveal utility classes.
   All animations use transform/opacity only for 60fps.
   ============================================================ */

/* ---- Keyframes ---- */
@keyframes aurora-drift {
  0% {
    transform: translate3d(-4%, -2%, 0) rotate(0deg) scale(1.05);
  }
  100% {
    transform: translate3d(4%, 3%, 0) rotate(8deg) scale(1.15);
  }
}
@keyframes float-a {
  0% {
    transform: translate3d(0, 0, 0);
  }
  100% {
    transform: translate3d(60px, 40px, 0);
  }
}
@keyframes float-b {
  0% {
    transform: translate3d(0, 0, 0);
  }
  100% {
    transform: translate3d(-50px, -30px, 0);
  }
}
@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.55);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(46, 204, 113, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(46, 204, 113, 0);
  }
}
@keyframes ripple {
  to {
    transform: scale(3.2);
    opacity: 0;
  }
}
@keyframes marquee {
  to {
    transform: translateX(-50%);
  }
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes bob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}
@keyframes scroll-hint {
  0% {
    transform: translate3d(0, 0, 0);
    opacity: 0;
  }
  40% {
    opacity: 1;
  }
  100% {
    transform: translate3d(0, 16px, 0);
    opacity: 0;
  }
}

/* ============================================================
   SCROLL REVEAL — set initial state, JS adds .is-visible.
   ============================================================ */
[data-reveal] {
  opacity: 0;
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
  transition-delay: var(--reveal-delay, 0s);
  will-change: transform, opacity;
}
[data-reveal="up"] {
  transform: translateY(40px);
}
[data-reveal="down"] {
  transform: translateY(-40px);
}
[data-reveal="left"] {
  transform: translateX(40px);
}
[data-reveal="right"] {
  transform: translateX(-40px);
}
[data-reveal="scale"] {
  transform: scale(0.9);
}
[data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* Text reveal — words clip up */
.text-reveal {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
}
.text-reveal > span {
  display: inline-block;
  transform: translateY(110%);
  transition: transform 0.9s var(--ease-out);
  transition-delay: var(--reveal-delay, 0s);
}
.text-reveal.is-visible > span {
  transform: translateY(0);
}

/* Scroll hint mouse */
.scroll-hint {
  width: 24px;
  height: 38px;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--r-pill);
  display: grid;
  justify-items: center;
  padding-top: 7px;
}
.scroll-hint::before {
  content: "";
  width: 3px;
  height: 7px;
  border-radius: 2px;
  background: var(--accent);
  will-change: transform, opacity;
  animation: scroll-hint 1.8s var(--ease-in-out) infinite;
}

/* ============================================================
   PREMIUM LOADER — preloader + page-transition overlay.
   Replaces the old plain black-screen transition.
   ============================================================ */
.loader {
  position: fixed;
  inset: 0;
  z-index: var(--z-transition);
  display: grid;
  place-items: center;
  background: var(--bg);
  background-image: radial-gradient(60% 60% at 50% 38%, rgba(59, 130, 246, 0.18), transparent 70%),
    radial-gradient(40% 40% at 50% 70%, rgba(0, 229, 255, 0.1), transparent 70%);
  opacity: 1;
  visibility: visible;
  transition: opacity 0.45s var(--ease), visibility 0s linear 0s;
}
.loader.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.55s var(--ease), visibility 0s linear 0.55s;
}
.loader__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-5);
}
.loader__mark {
  position: relative;
  width: 92px;
  height: 92px;
  display: grid;
  place-items: center;
}
.loader__monogram {
  position: relative;
  z-index: 1;
  width: 72px;
  height: 48px;
  display: block;
  animation: loader-pulse 1.8s var(--ease-in-out) infinite;
}
.loader__monogram svg {
  width: 100%;
  height: 100%;
  shape-rendering: geometricPrecision;
}
.loader__ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  padding: 2px;
  background: conic-gradient(
    from 0deg,
    transparent 0deg,
    var(--primary) 120deg,
    var(--accent) 220deg,
    transparent 340deg
  );
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 2px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 2px));
  animation: loader-spin 1s linear infinite;
}
.loader__name {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.loader__bar {
  position: relative;
  width: 180px;
  height: 2px;
  border-radius: var(--r-pill);
  background: var(--border);
  overflow: hidden;
}
.loader__bar::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 40%;
  border-radius: inherit;
  background: var(--grad-primary);
  box-shadow: 0 0 14px -2px rgba(59, 130, 246, 0.8);
  animation: loader-slide 1.1s var(--ease-in-out) infinite;
}
@keyframes loader-spin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes loader-pulse {
  0%,
  100% {
    transform: scale(0.96);
    opacity: 0.85;
  }
  50% {
    transform: scale(1.04);
    opacity: 1;
  }
}
@keyframes loader-slide {
  0% {
    transform: translateX(-110%);
  }
  100% {
    transform: translateX(360%);
  }
}
@media (prefers-reduced-motion: reduce) {
  .loader__ring,
  .loader__monogram,
  .loader__bar::after {
    animation: none !important;
  }
  .loader__bar::after {
    width: 100%;
    transform: none;
  }
}

/* ============================================================
   REDUCED MOTION — disable heavy motion, keep usability.
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  [data-reveal],
  .text-reveal > span {
    opacity: 1 !important;
    transform: none !important;
  }
  .bg-aurora,
  .bg-shape {
    animation: none !important;
  }
}
