/* ==========================================================================
   ANIMATIONS — scroll reveals, keyframes, micro-interactions
   ========================================================================== */

/* Base state for anything GSAP/ScrollTrigger will reveal.
   Kept subtle per the brief: fade + small rise, never large slides.
   Scoped under .js-ready (set synchronously in <head>) so that content
   stays fully visible by default if JavaScript is disabled or blocked —
   this is progressive enhancement, not a requirement to see the page. */
.js-ready [data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}

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

.js-ready [data-reveal="scale"] {
  transform: scale(0.94);
}

[data-reveal="scale"].is-revealed {
  transform: scale(1);
}

/* Clip-path curtain reveal — used on the about image and gallery photos.
   Animates clip-path only (GPU-composited, no layout reflow) rather than
   width/height, so it stays smooth even on lower-end phones. */
.js-ready [data-reveal="clip"] {
  clip-path: inset(0 0 100% 0);
  transition: clip-path 1s var(--ease);
  will-change: clip-path;
}

[data-reveal="clip"].is-revealed {
  clip-path: inset(0 0 0% 0);
}

@media (prefers-reduced-motion: reduce) {
  .js-ready [data-reveal="clip"] {
    clip-path: none;
  }
}

.js-ready [data-reveal-stagger] > * {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}

[data-reveal-stagger].is-revealed > * {
  opacity: 1;
  transform: translateY(0);
}

[data-reveal-stagger].is-revealed > *:nth-child(1) { transition-delay: 0s; }
[data-reveal-stagger].is-revealed > *:nth-child(2) { transition-delay: 0.08s; }
[data-reveal-stagger].is-revealed > *:nth-child(3) { transition-delay: 0.16s; }
[data-reveal-stagger].is-revealed > *:nth-child(4) { transition-delay: 0.24s; }
[data-reveal-stagger].is-revealed > *:nth-child(5) { transition-delay: 0.32s; }
[data-reveal-stagger].is-revealed > *:nth-child(6) { transition-delay: 0.4s; }

@media (prefers-reduced-motion: reduce) {
  [data-reveal],
  [data-reveal-stagger] > * {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* Hero entrance: hidden up-front so the GSAP timeline in animations.js
   can animate these in without a flash of fully-visible content. */
.js-ready .hero .tag,
.js-ready .hero h1,
.js-ready .hero .description,
.js-ready .hero .buttons,
.js-ready .hero-image {
  opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
  .js-ready .hero .tag,
  .js-ready .hero h1,
  .js-ready .hero .description,
  .js-ready .hero .buttons,
  .js-ready .hero-image {
    opacity: 1;
  }
}

/* Hero image: subtle parallax handled via GSAP transform, glow pulses gently */
@keyframes glowPulse {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

.hero-glow {
  animation: glowPulse 6s ease-in-out infinite;
}

/* Counters use plain text updates via JS; add a soft entrance */
.counter-row {
  opacity: 0;
  transition: opacity 0.5s ease;
}

.counter-row.is-counting {
  opacity: 1;
}

/* Signature underline-draw for marked phrases in headings */
.mark-draw {
  position: relative;
  display: inline-block;
}

.mark-draw::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0.06em;
  width: 100%;
  height: 0.09em;
  background: var(--orange);
  transform-origin: left center;
  transform: scaleX(0);
}

.mark-draw.is-revealed::after {
  transform: scaleX(1);
  transition: transform 0.9s var(--ease) 0.2s;
}

/* Loader logo subtle breathing while progress completes */
@keyframes loaderBreathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.03); }
}

.loader-mark {
  animation: loaderBreathe 1.6s ease-in-out infinite;
}

/* FAQ answer open state driven by JS setting max-height inline;
   icon rotation already handled in style.css */

/* Video play affordance pulse on gallery preview */
@keyframes ringPulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 122, 0, 0.5); }
  100% { box-shadow: 0 0 0 16px rgba(255, 122, 0, 0); }
}

.gallery-item.wide .gallery-expand {
  animation: ringPulse 2.4s ease-out infinite;
}

/* ==========================================================================
   MAGNETIC BUTTONS
   JS (animations.js) drives the pull-toward-cursor transform via GSAP
   quickTo, so the CSS transition here intentionally excludes `transform` —
   two engines animating the same property at once causes visible jitter.
   Box-shadow/color hovers still transition smoothly in CSS.
   ========================================================================== */
.btn.is-magnetic {
  transition: box-shadow 0.35s ease, background-color 0.3s ease, color 0.3s ease;
}

@media (hover: none) {
  .btn.is-magnetic {
    transition: transform 0.45s var(--ease), box-shadow 0.45s var(--ease), background-color 0.3s ease, color 0.3s ease;
  }
}

/* ==========================================================================
   SPOTLIGHT CARD HOVER
   A soft radial highlight that follows the cursor within the card, set via
   --mx/--my custom properties updated in animations.js on mousemove.
   Opacity-only transition — cheap to composite, no repaint of layout.
   ========================================================================== */
.service-card,
.price-box,
.review-card,
.about-card {
  position: relative;
  isolation: isolate;
}

.service-card::before,
.price-box::before,
.review-card::before,
.about-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.45s ease;
  background: radial-gradient(
    260px circle at var(--mx, 50%) var(--my, 50%),
    rgba(255, 122, 0, 0.14),
    transparent 70%
  );
  pointer-events: none;
}

.service-card:hover::before,
.price-box:hover::before,
.review-card:hover::before,
.about-card:hover::before {
  opacity: 1;
}

@media (hover: none) {
  .service-card::before,
  .price-box::before,
  .review-card::before,
  .about-card::before {
    display: none;
  }
}
