/* ============================================
   KDM DERMA THERAPY · ANIMATIONS
   Keyframes, scroll reveals, micro-interactions
   ============================================ */

/* ═══════════════════════════════════════════
   SCROLL REVEAL FOUNDATIONS
   ═══════════════════════════════════════════ */

.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity var(--duration-luxe) var(--ease-out-quart),
              transform var(--duration-luxe) var(--ease-out-quart);
  will-change: opacity, transform;
}

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

.reveal--left {
  transform: translateX(-32px);
}

.reveal--left.is-visible {
  transform: translateX(0);
}

.reveal--right {
  transform: translateX(32px);
}

.reveal--right.is-visible {
  transform: translateX(0);
}

.reveal--fade {
  transform: none;
}

.reveal--scale {
  transform: scale(0.95);
}

.reveal--scale.is-visible {
  transform: scale(1);
}

/* Staggered children */
.reveal-stagger > * {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity var(--duration-luxe) var(--ease-out-quart),
              transform var(--duration-luxe) var(--ease-out-quart);
}

.reveal-stagger.is-visible > *:nth-child(1)  { transition-delay:   0ms; opacity: 1; transform: translateY(0); }
.reveal-stagger.is-visible > *:nth-child(2)  { transition-delay:  80ms; opacity: 1; transform: translateY(0); }
.reveal-stagger.is-visible > *:nth-child(3)  { transition-delay: 160ms; opacity: 1; transform: translateY(0); }
.reveal-stagger.is-visible > *:nth-child(4)  { transition-delay: 240ms; opacity: 1; transform: translateY(0); }
.reveal-stagger.is-visible > *:nth-child(5)  { transition-delay: 320ms; opacity: 1; transform: translateY(0); }
.reveal-stagger.is-visible > *:nth-child(6)  { transition-delay: 400ms; opacity: 1; transform: translateY(0); }
.reveal-stagger.is-visible > *:nth-child(7)  { transition-delay: 480ms; opacity: 1; transform: translateY(0); }
.reveal-stagger.is-visible > *:nth-child(8)  { transition-delay: 560ms; opacity: 1; transform: translateY(0); }
.reveal-stagger.is-visible > *:nth-child(9)  { transition-delay: 640ms; opacity: 1; transform: translateY(0); }
.reveal-stagger.is-visible > *:nth-child(10) { transition-delay: 720ms; opacity: 1; transform: translateY(0); }


/* ═══════════════════════════════════════════
   HERO ENTRANCE (page load)
   ═══════════════════════════════════════════ */

.hero__eyebrow,
.hero__title,
.hero__lede,
.hero__ctas,
.hero__credentials,
.hero__visual {
  opacity: 0;
  transform: translateY(40px);
  animation: hero-rise 1200ms var(--ease-out-quart) forwards;
}

.hero__eyebrow     { animation-delay: 100ms; }
.hero__title       { animation-delay: 250ms; }
.hero__lede        { animation-delay: 450ms; }
.hero__ctas        { animation-delay: 600ms; }
.hero__credentials { animation-delay: 750ms; }
.hero__visual      { animation-delay: 400ms; }

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

/* Slower fade for portrait */
.hero__visual {
  animation: hero-rise 1400ms var(--ease-out-quart) forwards;
  animation-delay: 400ms;
}


/* ═══════════════════════════════════════════
   TEXT WORD-BY-WORD REVEAL
   ═══════════════════════════════════════════ */

.split-words {
  display: inline-block;
}

.split-words .word {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
}

.split-words .word-inner {
  display: inline-block;
  transform: translateY(110%);
  transition: transform 0.9s var(--ease-out-quart);
}

.split-words.is-visible .word-inner {
  transform: translateY(0);
}

.split-words.is-visible .word:nth-child(1)  .word-inner { transition-delay: 0ms; }
.split-words.is-visible .word:nth-child(2)  .word-inner { transition-delay: 50ms; }
.split-words.is-visible .word:nth-child(3)  .word-inner { transition-delay: 100ms; }
.split-words.is-visible .word:nth-child(4)  .word-inner { transition-delay: 150ms; }
.split-words.is-visible .word:nth-child(5)  .word-inner { transition-delay: 200ms; }
.split-words.is-visible .word:nth-child(6)  .word-inner { transition-delay: 250ms; }
.split-words.is-visible .word:nth-child(7)  .word-inner { transition-delay: 300ms; }
.split-words.is-visible .word:nth-child(8)  .word-inner { transition-delay: 350ms; }
.split-words.is-visible .word:nth-child(9)  .word-inner { transition-delay: 400ms; }
.split-words.is-visible .word:nth-child(10) .word-inner { transition-delay: 450ms; }


/* ═══════════════════════════════════════════
   PARALLAX
   ═══════════════════════════════════════════ */

.parallax {
  will-change: transform;
  transition: transform 0.1s linear;
}


/* ═══════════════════════════════════════════
   HOVER MICRO-INTERACTIONS
   ═══════════════════════════════════════════ */

.lift-on-hover {
  transition: transform var(--duration-normal) var(--ease-out-quart),
              box-shadow var(--duration-normal) var(--ease-out-quart);
}

.lift-on-hover:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

.glow-on-hover {
  position: relative;
  transition: all var(--duration-normal) var(--ease-out-quart);
}

.glow-on-hover::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: inherit;
  background: radial-gradient(circle, rgba(201, 163, 56, 0.4), transparent 70%);
  opacity: 0;
  z-index: -1;
  transition: opacity var(--duration-normal) var(--ease-out-quart);
}

.glow-on-hover:hover::after {
  opacity: 1;
}

.scale-on-hover {
  overflow: hidden;
}

.scale-on-hover img,
.scale-on-hover .scale-target {
  transition: transform var(--duration-luxe) var(--ease-out-quart);
}

.scale-on-hover:hover img,
.scale-on-hover:hover .scale-target {
  transform: scale(1.06);
}


/* ═══════════════════════════════════════════
   FLOATING / DRIFT ANIMATIONS
   ═══════════════════════════════════════════ */

@keyframes float-soft {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(-8px) rotate(0.5deg); }
}

.float {
  animation: float-soft 6s ease-in-out infinite;
}

.float--slow {
  animation-duration: 9s;
}

.float--delayed {
  animation-delay: 2s;
}


/* ═══════════════════════════════════════════
   SHIMMER (loading + accent)
   ═══════════════════════════════════════════ */

@keyframes shimmer {
  from { background-position: -200% 0; }
  to   { background-position: 200% 0; }
}

.shimmer {
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(201, 163, 56, 0.2) 50%,
    transparent 100%
  );
  background-size: 200% 100%;
  animation: shimmer 3s infinite;
}


/* ═══════════════════════════════════════════
   ROTATE EFFECTS
   ═══════════════════════════════════════════ */

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

.spin-slow {
  animation: spin-slow 30s linear infinite;
}

@keyframes rotate-y {
  0%   { transform: perspective(1000px) rotateY(0deg); }
  100% { transform: perspective(1000px) rotateY(360deg); }
}


/* ═══════════════════════════════════════════
   ORBITING BADGE (decorative)
   ═══════════════════════════════════════════ */

.orbit-badge {
  position: absolute;
  width: 160px;
  height: 160px;
  animation: spin-slow 30s linear infinite;
}

.orbit-badge svg {
  width: 100%;
  height: 100%;
}


/* ═══════════════════════════════════════════
   PULSE / BEACON
   ═══════════════════════════════════════════ */

@keyframes pulse-ring {
  0%   { box-shadow: 0 0 0 0 rgba(201, 163, 56, 0.7); }
  70%  { box-shadow: 0 0 0 24px rgba(201, 163, 56, 0); }
  100% { box-shadow: 0 0 0 0 rgba(201, 163, 56, 0); }
}

.beacon {
  animation: pulse-ring 2.5s infinite;
  border-radius: 50%;
}


/* ═══════════════════════════════════════════
   GRADIENT FLOW (animated gradients)
   ═══════════════════════════════════════════ */

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

.gradient-flow {
  background-size: 200% 200%;
  animation: gradient-flow 12s ease infinite;
}


/* ═══════════════════════════════════════════
   COUNTER ANIMATION (CSS only via @property)
   ═══════════════════════════════════════════ */

@property --count {
  syntax: '<integer>';
  inherits: false;
  initial-value: 0;
}

.count-up {
  counter-reset: num var(--count);
  animation: count 2.5s var(--ease-out-quart) forwards;
}

.count-up.is-visible::after {
  content: counter(num);
}

@keyframes count {
  to { --count: var(--count-end, 100); }
}


/* ═══════════════════════════════════════════
   MARQUEE PAUSE ON HOVER
   ═══════════════════════════════════════════ */

.marquee__track {
  animation-play-state: running;
}

.marquee:hover .marquee__track {
  animation-play-state: paused;
}


/* ═══════════════════════════════════════════
   ENTRANCE VARIANTS
   ═══════════════════════════════════════════ */

@keyframes slide-up {
  from { opacity: 0; transform: translateY(60px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes slide-down {
  from { opacity: 0; transform: translateY(-60px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes slide-in-left {
  from { opacity: 0; transform: translateX(-60px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes slide-in-right {
  from { opacity: 0; transform: translateX(60px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes scale-in {
  from { opacity: 0; transform: scale(0.92); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes blur-in {
  from { opacity: 0; filter: blur(12px); }
  to   { opacity: 1; filter: blur(0); }
}


/* ═══════════════════════════════════════════
   CURSOR (custom) — DISABLED. Native cursor only.
   ═══════════════════════════════════════════ */

.custom-cursor { display: none !important; }
body.has-custom-cursor { cursor: auto !important; }
body.has-custom-cursor a, body.has-custom-cursor button { cursor: pointer !important; }

@media (hover: hover) and (pointer: fine) {
  .custom-cursor--legacy-disabled {
    display: none;
  }
}


/* ═══════════════════════════════════════════
   PAGE TRANSITIONS
   ═══════════════════════════════════════════ */

.page-transition {
  position: fixed;
  inset: 0;
  background: var(--color-ink);
  z-index: var(--z-modal);
  transform: translateY(100%);
  transition: transform var(--duration-slow) var(--ease-out-expo);
  pointer-events: none;
}

.page-transition.is-active {
  transform: translateY(0);
}


/* ═══════════════════════════════════════════
   SKELETON LOADERS
   ═══════════════════════════════════════════ */

.skeleton {
  background: linear-gradient(
    90deg,
    var(--clay-100) 0%,
    var(--clay-200) 50%,
    var(--clay-100) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 2s infinite linear;
  border-radius: var(--radius-md);
}
