/* =====================================================================
   Animations and transitions
   Everything here is skipped when the visitor asks for reduced motion.
   ===================================================================== */
@media (prefers-reduced-motion: no-preference) {
  /* ---------- Page load: the top section settles into place ---------- */
  .hero-copy > * {
    animation: motionRise 0.6s var(--ease) backwards;
  }
  .hero-copy > :nth-child(2) {
    animation-delay: 0.1s;
  }
  .hero-copy > :nth-child(3) {
    animation-delay: 0.18s;
  }
  .hero-media {
    animation: motionReveal 0.8s var(--ease) 0.1s backwards;
  }

  /* ---------- Information pop-up ---------- */
  #info-modal {
    transition: opacity 0.22s ease, display 0.22s allow-discrete;
  }
  #info-modal > div {
    transition: transform 0.3s var(--ease);
  }
  #info-modal.hidden {
    opacity: 0;
    pointer-events: none;
  }
  #info-modal.hidden > div {
    transform: translateY(16px) scale(0.96);
  }

  /* ---------- Phone menu ---------- */
  #mobile-menu {
    transition: opacity 0.2s ease, transform 0.25s var(--ease), display 0.25s allow-discrete;
  }
  #mobile-menu.hidden {
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
  }

  /* Starting point for things that appear from nothing */
  @starting-style {
    #info-modal.flex,
    #mobile-menu:not(.hidden) {
      opacity: 0;
    }
    #info-modal.flex > div {
      transform: translateY(16px) scale(0.96);
    }
    #mobile-menu:not(.hidden) {
      transform: translateY(-10px);
    }
  }

  /* ---------- Giant footer letters rise one by one ---------- */
  .footer-watermark text {
    transition: transform 0.7s var(--ease), opacity 0.5s ease;
  }
  .footer-watermark text:nth-of-type(2) { transition-delay: 0.06s; }
  .footer-watermark text:nth-of-type(3) { transition-delay: 0.12s; }
  .footer-watermark text:nth-of-type(4) { transition-delay: 0.18s; }
  .footer-watermark text:nth-of-type(5) { transition-delay: 0.24s; }
  .footer-watermark text:nth-of-type(6) { transition-delay: 0.3s; }
  .footer-watermark text:nth-of-type(7) { transition-delay: 0.36s; }
  .footer-watermark text:nth-of-type(8) { transition-delay: 0.42s; }
  .footer-watermark.is-waiting text {
    opacity: 0;
    transform: translateY(150px);
  }

  /* ---------- Repair photo viewer ---------- */
  .fix-viewer-photo.is-changing {
    animation: motionFade 0.35s ease;
  }
  ::view-transition-group(repair-photo) {
    animation-duration: 0.4s;
    animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
  }
  ::view-transition-old(repair-photo),
  ::view-transition-new(repair-photo) {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  /* ---------- WhatsApp label slides out ---------- */
  .whatsapp-float > span {
    transform: translateX(8px);
    transition: opacity 0.3s ease, transform 0.35s var(--ease);
  }
  .whatsapp-float:hover > span,
  .whatsapp-float:focus-visible > span,
  .whatsapp-float.is-nudging > span {
    transform: translateX(0);
  }
}

.whatsapp-float.is-nudging > span {
  opacity: 1;
}

/* Theme ripple: the new colours are revealed in a growing circle */
html.theme-ripple::view-transition-old(root),
html.theme-ripple::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}

/* Phones and tablets: the menu bar moves out of the way while scrolling down */
@media (max-width: 1023px) {
  #site-header.is-tucked {
    transform: translateY(-110%);
  }
}

@keyframes motionRise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
}
@keyframes motionReveal {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
}
@keyframes motionFade {
  from {
    opacity: 0;
  }
}
