/* ==========================================================================
   Taana Carpets — Motion
   Scroll reveals only run when JS has added `.js` to <html>, so content is
   always visible without JavaScript. All motion is disabled for users who
   prefer reduced motion.
   ========================================================================== */

/* Scroll reveal ----------------------------------------------------------- */
.js .reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 1s var(--ease), transform 1.1s var(--ease-out);
  transition-delay: var(--delay, 0s);
}

.js .reveal--fade {
  transform: none;
}

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

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

.js .reveal--zoom {
  transform: scale(0.96);
}

.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* Image curtain: a sand panel slides away to uncover the photograph */
.js .reveal-media {
  position: relative;
  overflow: hidden;
}

.js .reveal-media::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background: var(--sand);
  transform-origin: right;
  transition: transform 1.2s var(--ease-out);
  transition-delay: var(--delay, 0s);
  pointer-events: none;
}

.js .reveal-media img {
  transform: scale(1.12);
  transition: transform 1.8s var(--ease-out);
  transition-delay: var(--delay, 0s);
}

.js .reveal-media.is-visible::after {
  transform: scaleX(0);
}

.js .reveal-media.is-visible img {
  transform: none;
}

/* Hover zoom must win after the reveal has finished */
.js .reveal-media.is-visible.zoom:hover img {
  transform: scale(1.06);
  transition-delay: 0s;
}

/* Hero entrance ---------------------------------------------------------- */
.hero__media img {
  animation: kenBurns 18s var(--ease) forwards;
}

.hero__copy > * {
  opacity: 0;
  animation: fadeUp 1.1s var(--ease-out) forwards;
}

.hero__copy > *:nth-child(1) {
  animation-delay: 0.2s;
}

.hero__copy > *:nth-child(2) {
  animation-delay: 0.35s;
}

.hero__copy > *:nth-child(3) {
  animation-delay: 0.5s;
}

.hero__copy > *:nth-child(4) {
  animation-delay: 0.65s;
}

.hero__meta {
  opacity: 0;
  animation: fadeIn 1.2s var(--ease) 0.9s forwards;
}

.page-hero__media img {
  animation: kenBurnsSoft 14s var(--ease) forwards;
}

.page-hero__content > div > * {
  opacity: 0;
  animation: fadeUp 1s var(--ease-out) forwards;
}

.page-hero__content > div > *:nth-child(2) {
  animation-delay: 0.12s;
}

.page-hero__content > div > *:nth-child(3) {
  animation-delay: 0.24s;
}

.page-hero__content > div > *:nth-child(4) {
  animation-delay: 0.36s;
}

/* Keyframes -------------------------------------------------------------- */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes softZoom {
  from {
    transform: scale(1.08);
    opacity: 0.4;
  }
  to {
    transform: none;
    opacity: 1;
  }
}

@keyframes kenBurns {
  from {
    transform: scale(1.12);
  }
  to {
    transform: scale(1);
  }
}

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

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

@keyframes scrollCue {
  0% {
    transform: scaleY(0);
    transform-origin: top;
  }
  45% {
    transform: scaleY(1);
    transform-origin: top;
  }
  55% {
    transform: scaleY(1);
    transform-origin: bottom;
  }
  100% {
    transform: scaleY(0);
    transform-origin: bottom;
  }
}

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

@keyframes dialogIn {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Reduced motion --------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0s !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
  }

  .js .reveal,
  .js .reveal-media img,
  .hero__copy > *,
  .hero__meta,
  .page-hero__content > div > * {
    opacity: 1;
    transform: none;
  }

  .js .reveal-media::after {
    display: none;
  }

  .marquee__track {
    animation: none;
  }
}
