/* ============================================================
   PrintYouth — motion
   Paired with public/js/motion.js. Nothing here is decorative for
   its own sake: reveals establish reading order, parallax creates
   depth, the marquee shows catalogue breadth at a glance.
   ============================================================ */

/* ---------- Reveal ---------- */
[data-reveal] {
  opacity: 0;
  transform: translate3d(0, 26px, 0);
  transition:
    opacity .9s cubic-bezier(0.16, 1, 0.3, 1),
    transform .9s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}
[data-reveal].is-in { opacity: 1; transform: none; }

[data-reveal-group] { opacity: 1; transform: none; }
[data-reveal-group] > * {
  opacity: 0;
  transform: translate3d(0, 30px, 0);
  transition:
    opacity .8s cubic-bezier(0.16, 1, 0.3, 1),
    transform .8s cubic-bezier(0.16, 1, 0.3, 1);
}
[data-reveal-group] > *.is-in { opacity: 1; transform: none; }

/* Blur-in for hero-scale type — reads as the words "focusing" */
[data-reveal="focus"] { filter: blur(10px); transform: translate3d(0, 20px, 0) scale(0.985); }
[data-reveal="focus"].is-in { filter: blur(0); transform: none; }

/* ---------- Scroll progress rail ---------- */
.progress-rail {
  position: fixed;
  inset: 0 0 auto 0;
  height: 2px;
  background: var(--crimson);
  transform: scaleX(0);
  transform-origin: 0 50%;
  z-index: 200;
  pointer-events: none;
}

/* ---------- Header lift ---------- */
.site-header {
  transition: background-color .35s var(--ease), box-shadow .35s var(--ease),
              backdrop-filter .35s var(--ease);
}
.site-header.is-stuck {
  background: rgba(8, 8, 10, 0.72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  box-shadow: 0 1px 0 rgba(255,255,255,0.08);
}

/* ---------- Pointer glow ---------- */
[data-glow] { position: relative; isolation: isolate; }
[data-glow]::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(
    440px circle at var(--gx, 50%) var(--gy, 30%),
    rgba(255, 1, 64, 0.16),
    transparent 62%
  );
  opacity: 0;
  transition: opacity .5s var(--ease);
  pointer-events: none;
}
[data-glow]:hover::after { opacity: 1; }

/* ---------- Marquee ---------- */
.marquee {
  position: relative;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
}
.marquee__track {
  display: flex;
  gap: 16px;
  width: max-content;
  animation: marquee var(--marquee-duration, 60s) linear infinite;
}
.marquee:hover .marquee__track { animation-play-state: paused; }
.marquee__item {
  flex: 0 0 auto;
  width: clamp(150px, 17vw, 230px);
  aspect-ratio: 1;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--void-2);
  border: 1px solid rgba(255,255,255,0.07);
}
.marquee__item img { width: 100%; height: 100%; object-fit: cover; }

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

/* ---------- Animated icons ---------- */
.ico-anim { transition: transform .4s var(--ease); }
.btn:hover .ico-anim--right { transform: translateX(4px); }
.btn:hover .ico-anim--down { transform: translateY(3px); }

@keyframes pulse-ring {
  0%   { transform: scale(1);   opacity: 0.55; }
  70%  { transform: scale(2.1); opacity: 0; }
  100% { transform: scale(2.1); opacity: 0; }
}
.pulse-dot { position: relative; display: inline-flex; }
.pulse-dot::before {
  content: "";
  position: absolute; inset: 0;
  border-radius: 50%;
  background: currentColor;
  animation: pulse-ring 2.4s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-3px); }
}
.icon-bob { animation: bob 2.8s ease-in-out infinite; }

/* Icon tiles that lift and tint as their section enters */
.feat__icon {
  width: 52px; height: 52px;
  display: grid; place-items: center;
  border-radius: 15px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--crimson);
  transition: transform .45s var(--ease), background-color .45s var(--ease), border-color .45s var(--ease);
}
.feat:hover .feat__icon {
  transform: translateY(-4px) scale(1.06);
  background: rgba(255, 1, 64, 0.14);
  border-color: rgba(255, 1, 64, 0.45);
}

/* ---------- Card motion ---------- */
.card {
  transition:
    transform .45s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow .45s cubic-bezier(0.16, 1, 0.3, 1),
    border-color .3s var(--ease);
}
.card:hover { transform: translateY(-7px); }
.card__media img { transition: transform .8s cubic-bezier(0.16, 1, 0.3, 1); }
.card:hover .card__media img { transform: scale(1.07); }

/* Sheen sweep across the artwork on hover */
.card__media::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(105deg, transparent 38%, rgba(255,255,255,0.22) 50%, transparent 62%);
  transform: translateX(-110%);
  transition: transform .85s var(--ease);
  pointer-events: none;
}
.card:hover .card__media::after { transform: translateX(110%); }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  [data-reveal],
  [data-reveal-group] > * { opacity: 1 !important; transform: none !important; filter: none !important; }
  .marquee__track { animation: none !important; }
  .pulse-dot::before, .icon-bob { animation: none !important; }
  .card__media::after { display: none; }
  .progress-rail { display: none; }
}
