/* ==========================================================================
   GREGORY'S FINE TAILORING — Animation layer
   All motion is gated behind prefers-reduced-motion at the foot of this file.
   Only `transform` and `opacity` are animated (no layout thrash).
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. KEYFRAMES
   -------------------------------------------------------------------------- */
@keyframes word-in {
  to { opacity: 1; transform: translateY(0) rotate(0); }
}

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

@keyframes cue {
  0%, 100% { transform: scaleY(1);   opacity: 1; }
  50%      { transform: scaleY(.55); opacity: .4; }
}

@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-100%); }
}

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

@keyframes ring {
  0%, 62%, 100% { transform: rotate(0); }
  66% { transform: rotate(-13deg); }
  70% { transform: rotate(11deg); }
  74% { transform: rotate(-9deg); }
  78% { transform: rotate(7deg); }
  82% { transform: rotate(0); }
}

@keyframes pulse-ring {
  0%   { transform: scale(.9); opacity: .75; }
  70%  { transform: scale(1.5); opacity: 0; }
  100% { transform: scale(1.5); opacity: 0; }
}

@keyframes curtain-up {
  to { transform: translateY(-101%); }
}

@keyframes seam {
  to { background-position: 40px 0; }
}

/* --------------------------------------------------------------------------
   2. PAGE-LOAD CURTAIN
   -------------------------------------------------------------------------- */
.curtain {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  background: var(--ink);
  animation: curtain-up .85s var(--ease-out) .55s forwards;
}
.curtain__mark {
  width: 140px;
  opacity: 0;
  animation: word-in .6s var(--ease-out) .05s forwards;
}
.curtain__seam {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background-image: linear-gradient(90deg, var(--gold) 0 18px, transparent 18px 40px);
  background-size: 40px 2px;
  animation: seam .6s linear infinite;
  opacity: .8;
}
.curtain.is-done { display: none; }

/* --------------------------------------------------------------------------
   3. SCROLL-TRIGGERED ENTRANCES
   Applied by IntersectionObserver in animations.js
   -------------------------------------------------------------------------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(28px) scale(.98);
  transition:
    opacity   .75s var(--ease-out),
    transform .75s var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: transform, opacity;
}
[data-reveal].is-revealed {
  opacity: 1;
  transform: translateY(0) scale(1);
  will-change: auto;
}

/* Directional variants */
[data-reveal="left"]  { transform: translateX(-38px); }
[data-reveal="right"] { transform: translateX(38px); }
[data-reveal="scale"] { transform: scale(.9); }
[data-reveal="fade"]  { transform: none; }
[data-reveal="left"].is-revealed,
[data-reveal="right"].is-revealed { transform: translateX(0); }

/* --------------------------------------------------------------------------
   4. MOBILE NAV STAGGER
   -------------------------------------------------------------------------- */
.mobile-nav.is-open li:nth-child(1)  a { animation-delay: .05s; }
.mobile-nav.is-open li:nth-child(2)  a { animation-delay: .10s; }
.mobile-nav.is-open li:nth-child(3)  a { animation-delay: .15s; }
.mobile-nav.is-open li:nth-child(4)  a { animation-delay: .20s; }
.mobile-nav.is-open li:nth-child(5)  a { animation-delay: .25s; }
.mobile-nav.is-open li:nth-child(6)  a { animation-delay: .30s; }
.mobile-nav.is-open li:nth-child(7)  a { animation-delay: .35s; }
.mobile-nav.is-open li:nth-child(8)  a { animation-delay: .40s; }
.mobile-nav.is-open li:nth-child(9)  a { animation-delay: .45s; }
.mobile-nav.is-open li:nth-child(10) a { animation-delay: .50s; }
.mobile-nav.is-open li:nth-child(11) a { animation-delay: .55s; }
.mobile-nav.is-open li:nth-child(12) a { animation-delay: .60s; }
.mobile-nav.is-open li:nth-child(13) a { animation-delay: .65s; }
.mobile-nav.is-open li:nth-child(14) a { animation-delay: .70s; }

/* --------------------------------------------------------------------------
   5. CALL BUTTON PULSE HALO
   -------------------------------------------------------------------------- */
.mobile-bar__call { position: relative; overflow: hidden; }
.mobile-bar__call::before {
  content: '';
  position: absolute;
  left: 50%; top: 50%;
  width: 62px; height: 62px;
  margin: -31px 0 0 -31px;
  border-radius: 50%;
  background: rgba(255,255,255,.5);
  animation: pulse-ring 2.6s ease-out infinite;
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   6. CUSTOM CURSOR (fine pointers only)
   -------------------------------------------------------------------------- */
@media (pointer: fine) and (min-width: 1024px) {
  .cursor-ring {
    position: fixed;
    top: 0; left: 0;
    width: 28px; height: 28px;
    margin: -14px 0 0 -14px;
    border: 1px solid var(--gold);
    border-radius: 50%;
    pointer-events: none;
    z-index: 1100;
    opacity: 0;
    transition: opacity .3s ease, width .25s var(--ease-out), height .25s var(--ease-out),
                margin .25s var(--ease-out), background-color .25s ease;
    will-change: transform;
  }
  .cursor-ring.is-active { opacity: .85; }
  .cursor-ring.is-hovering {
    width: 52px; height: 52px;
    margin: -26px 0 0 -26px;
    background: rgba(240,216,32,.10);
  }
}

/* --------------------------------------------------------------------------
   7. REDUCED MOTION — disable everything
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  html { scroll-behavior: auto; }

  [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
  }
  .reveal-word { opacity: 1 !important; transform: none !important; }
  .curtain { display: none !important; }
  .marquee__track { animation: none !important; }
  .cursor-ring { display: none !important; }
  .float-deco, .popup__deco { animation: none !important; }
  .mobile-bar__call::before { display: none !important; }
  .mobile-nav a.m-link { opacity: 1 !important; transform: none !important; animation: none !important; }
  .hero__bg { transform: none !important; }
}
