/* ==========================================================================
   Georgetown Wallpaper Installer — motion
   Everything here is progressive enhancement:
   - content is visible by default; js/main.js adds .reveal-on to <html>
     only when IntersectionObserver exists, and only then do [data-reveal]
     elements start hidden;
   - all movement sits inside prefers-reduced-motion: no-preference;
   - print always shows everything.
   ========================================================================== */

/* Used by the supplied validation script (inline "animation: fadeIn 0.3s ease") */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-3px); }
  to   { opacity: 1; transform: none; }
}

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

@keyframes heroSettle {
  from { transform: scale(1.07); }
  to   { transform: scale(1); }
}

@keyframes cardPress {
  from { opacity: 0; box-shadow: 0 0 0 rgba(0, 0, 0, 0); }
  to   { opacity: 1; }
}

@keyframes chipRise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

@keyframes swatchFloat {
  0%, 100% { translate: 0 0; }
  50%      { translate: 0 -8px; }
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }

  /* Hero entrance */
  .js .hero__photo img { animation: heroSettle 1.8s cubic-bezier(.2, .7, .2, 1) both; }
  .js .hero__card { animation: cardPress 0.9s 0.2s ease both; }
  .js .hero__chips li { animation: chipRise 0.6s ease both; }
  .js .hero__chips li:nth-child(1) { animation-delay: 0.45s; }
  .js .hero__chips li:nth-child(2) { animation-delay: 0.55s; }
  .js .hero__chips li:nth-child(3) { animation-delay: 0.65s; }
  .js .hero__chips li:nth-child(4) { animation-delay: 0.75s; }

  /* Scroll reveal */
  .reveal-on [data-reveal] {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.75s ease, transform 0.75s cubic-bezier(.2, .7, .2, 1), box-shadow 0.35s ease;
    transition-delay: var(--reveal-delay, 0s);
  }
  .reveal-on [data-reveal].is-in {
    opacity: 1;
    transform: none;
  }
  /* Service cards keep their hover lift after revealing */
  .reveal-on .service-card.is-in:hover,
  .reveal-on .service-card.is-in:focus-within { transform: translateY(-6px); transition-delay: 0s; }

  /* Process groove fills from step 1 to step 4 */
  .reveal-on .timeline::after {
    transform: scaleX(0);
    transition: transform 1.6s 0.25s cubic-bezier(.4, .1, .2, 1);
  }
  .reveal-on .timeline.is-in::after { transform: scaleX(1); }
  .reveal-on .timeline .timeline__knob { transition: box-shadow 0.5s ease, color 0.5s ease; }
  .reveal-on .timeline.is-in .timeline__knob { color: var(--accent-text); }
  .reveal-on .timeline.is-in .timeline__step:nth-child(1) .timeline__knob { transition-delay: 0.3s; }
  .reveal-on .timeline.is-in .timeline__step:nth-child(2) .timeline__knob { transition-delay: 0.8s; }
  .reveal-on .timeline.is-in .timeline__step:nth-child(3) .timeline__knob { transition-delay: 1.3s; }
  .reveal-on .timeline.is-in .timeline__step:nth-child(4) .timeline__knob { transition-delay: 1.8s; }

  /* Gentle float on the CTA swatches */
  .cta__panel.is-in .swatch--1 { animation: swatchFloat 7s ease-in-out infinite; }
  .cta__panel.is-in .swatch--2 { animation: swatchFloat 7s 1.2s ease-in-out infinite; }
  .cta__panel.is-in .swatch--3 { animation: swatchFloat 7s 2.4s ease-in-out infinite; }

  /* Lightbox */
  .lightbox:not([hidden]) .lightbox__img { animation: fadeIn 0.35s ease both; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
    scroll-behavior: auto !important;
  }
  .service-card:hover, .service-card:focus-within,
  .btn:hover { transform: none; }
  .service-card:hover .service-card__photo img,
  .g-link:hover img { transform: none; }
}

@media print {
  [data-reveal] { opacity: 1 !important; transform: none !important; }
  .site-header, .drawer, .mobile-bar, .lightbox, .skip-link { display: none !important; }
  .hero__card { position: static; transform: none; width: auto; margin-top: 16px; }
  .timeline::after { transform: none !important; }
  body { background: #fff; }
}
