/* ==========================================================================
   FeelFree Agency — animations.css
   Loader, keyframes, reveal states, reduced-motion handling
   ========================================================================== */

/* =========================================================
   LOADER
   ========================================================= */
.loader {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  background: var(--color-bg);
}

.loader.is-done {
  display: none;
}

.loader__mark {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 660;
  letter-spacing: -0.02em;
  color: var(--color-text);
  overflow: hidden;
}

.loader__mark span {
  display: inline-block;
  transform: translateY(110%);
}

.loader__mark .logo-dot {
  color: var(--color-accent);
}

.loader__line {
  width: min(240px, 50vw);
  height: 1px;
  background: var(--color-border);
  position: relative;
  overflow: hidden;
}

.loader__line::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--color-accent);
  transform: scaleX(0);
  transform-origin: left;
}

/* When JS is disabled, never trap the user behind the loader */
html:not(.js) .loader {
  display: none;
}

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

@keyframes scroll-pulse {
  0% { transform: translateY(-100%); }
  55% { transform: translateY(100%); }
  100% { transform: translateY(100%); }
}

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

@keyframes drift {
  0%, 100% { transform: translate(0, 0); }
  33% { transform: translate(18px, -22px); }
  66% { transform: translate(-14px, 12px); }
}

@keyframes gradient-shift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

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

@keyframes pulse-dot {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 1; }
}

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

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

@keyframes core-breathe {
  0%, 100% { transform: scale(1); opacity: 0.85; }
  50% { transform: scale(1.04); opacity: 1; }
}

.flow-line {
  animation: dash-flow 14s linear infinite;
}

.flow-line--rev {
  animation: dash-flow-rev 18s linear infinite;
}

.core-breathe {
  transform-origin: center;
  transform-box: fill-box;
  animation: core-breathe 6s var(--ease-in-out) infinite;
}

/* Ambient background drift for glows */
.glow--drift {
  animation: drift 18s var(--ease-in-out) infinite;
}

/* Animated gradient text (used sparingly — hero accent) */
.text-gradient--animated {
  animation: gradient-shift 9s ease infinite;
}

/* Orbital tech ring */
.orbit-spin {
  transform-origin: center;
  animation: spin-slow 90s linear infinite;
}

.orbit-spin--reverse {
  animation-direction: reverse;
  animation-duration: 130s;
}

/* =========================================================
   REVEAL STATES
   GSAP animates [data-reveal] elements. Content stays fully
   visible without JS; the .js class opts elements in.
   ========================================================= */
html.js:not(.reduced-motion) [data-reveal],
html.js:not(.reduced-motion) [data-hero-reveal] {
  opacity: 0;
}

/* =========================================================
   REDUCED MOTION
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.15s !important;
    scroll-behavior: auto !important;
  }

  .marquee__track {
    animation: none;
    flex-wrap: wrap;
    width: auto;
  }

  .scroll-hint__line::after {
    animation: none;
    transform: none;
  }

  .loader {
    display: none;
  }
}

html.reduced-motion [data-reveal],
html.reduced-motion [data-hero-reveal] {
  opacity: 1 !important;
  transform: none !important;
  filter: none !important;
}
