/* YMX motion stylesheet — pairs with ymx-motion.js */

/* ---- Reveal: default fade-up ---- */
[data-reveal] {
  opacity: 0;
  transform: translate3d(0, 24px, 0);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}
[data-reveal][data-revealed] {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

/* Variants */
[data-reveal="left"]                 { transform: translate3d(-32px, 0, 0); }
[data-reveal="left"][data-revealed]  { transform: translate3d(0, 0, 0); }
[data-reveal="right"]                { transform: translate3d(32px, 0, 0); }
[data-reveal="right"][data-revealed] { transform: translate3d(0, 0, 0); }
[data-reveal="scale"]                { transform: scale(0.96); opacity: 0; }
[data-reveal="scale"][data-revealed] { transform: scale(1); opacity: 1; }

/* Stagger children */
[data-reveal-stagger] > * {
  opacity: 0;
  transform: translate3d(0, 18px, 0);
  transition: opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
[data-reveal-stagger][data-revealed] > * {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}
[data-reveal-stagger][data-revealed] > *:nth-child(1) { transition-delay: 0.05s; }
[data-reveal-stagger][data-revealed] > *:nth-child(2) { transition-delay: 0.12s; }
[data-reveal-stagger][data-revealed] > *:nth-child(3) { transition-delay: 0.19s; }
[data-reveal-stagger][data-revealed] > *:nth-child(4) { transition-delay: 0.26s; }
[data-reveal-stagger][data-revealed] > *:nth-child(5) { transition-delay: 0.33s; }
[data-reveal-stagger][data-revealed] > *:nth-child(6) { transition-delay: 0.40s; }
[data-reveal-stagger][data-revealed] > *:nth-child(7) { transition-delay: 0.47s; }

/* Image mask reveal — clip-path slides down */
[data-reveal="mask"] {
  clip-path: inset(0 0 100% 0);
  opacity: 1;
  transform: none;
  transition: clip-path 1s cubic-bezier(0.77, 0, 0.175, 1);
}
[data-reveal="mask"][data-revealed] {
  clip-path: inset(0 0 0 0);
}

/* ---- Marquee for logo wall ---- */
.ymx-marquee {
  overflow: hidden;
  position: relative;
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.ymx-marquee-track {
  display: flex;
  width: max-content;
  animation: ymx-marquee 60s linear infinite;
}
.ymx-marquee:hover .ymx-marquee-track { animation-play-state: paused; }
@keyframes ymx-marquee {
  0%   { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(-50%, 0, 0); }
}

/* ---- CTA hover micro ---- */
.ymx-cta-arrow {
  display: inline-block;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
a:hover .ymx-cta-arrow,
button:hover .ymx-cta-arrow {
  transform: translateX(6px);
}

/* Underline grow */
.ymx-underline {
  position: relative;
}
.ymx-underline::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -3px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.ymx-underline:hover::after { transform: scaleX(1); }

/* ---- Hover effects ---- */

/* Card lift — applies to any [data-hover="card"] */
[data-hover="card"] {
  transition:
    transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.25s ease;
  will-change: transform;
}
[data-hover="card"]:hover {
  transform: translate3d(0, -4px, 0);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.10), 0 4px 12px rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.45);
}

/* Subtle highlight for module sections — accent strip slides in from left */
[data-hover="module"] {
  position: relative;
  transition: background-color 0.4s ease;
}
[data-hover="module"]::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: currentColor;
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
  opacity: 0.6;
}
[data-hover="module"]:hover::before {
  transform: scaleY(1);
}

/* Image zoom inside hover container */
[data-hover="card"] img,
[data-hover="zoom"] img {
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1), filter 0.4s ease;
}
[data-hover="card"]:hover img,
[data-hover="zoom"]:hover img {
  transform: scale(1.04);
}

/* Button press feel */
[data-hover="button"] {
  position: relative;
  overflow: hidden;
  transition: transform 0.18s ease, background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
[data-hover="button"]:hover { transform: translate3d(0, -1px, 0); }
[data-hover="button"]:active { transform: translate3d(0, 0, 0); transition-duration: 0.05s; }

/* Link with arrow that slides on hover (use with text + .ymx-cta-arrow span) */
[data-hover="link"] {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
[data-hover="link"]::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -3px;
  height: 1px;
  background: currentColor;
  transform: scaleX(1);
  transform-origin: right;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
[data-hover="link"]:hover::after {
  transform: scaleX(0);
}
[data-hover="link"]:hover::before {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -3px;
  height: 1px;
  background: currentColor;
  transform: scaleX(1);
  transform-origin: left;
  animation: ymx-link-grow 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.18s forwards;
  transform: scaleX(0);
}
@keyframes ymx-link-grow {
  to { transform: scaleX(1); }
}

/* ---- Reduce motion ---- */
@media (prefers-reduced-motion: reduce) {
  [data-reveal], [data-reveal-stagger] > * {
    opacity: 1 !important;
    transform: none !important;
    clip-path: none !important;
    transition: none !important;
  }
  .ymx-marquee-track { animation: none !important; }
  [data-hover="card"]:hover,
  [data-hover="button"]:hover { transform: none !important; }
}

/* ============================================ */
/* CINEMATIC HERO INTRO                          */
/* ============================================ */

/* Subtle dim overlay that fades out — gives the "lights coming up" feel */
.ymx-hero {
  isolation: isolate;
}
.ymx-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(15, 15, 15, 0.06);
  pointer-events: none;
  animation: ymx-hero-dim 1.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  z-index: 2;
}
@keyframes ymx-hero-dim {
  0%   { opacity: 1; }
  100% { opacity: 0; }
}

/* Grain texture — fixed-position SVG noise overlay, subtle */
.ymx-grain {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  z-index: 3;
  background-image: url("data:image/svg+xml;utf8,<svg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.45 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-size: 200px 200px;
  mix-blend-mode: multiply;
  animation: ymx-grain-fade 1.6s 0.8s ease-out forwards;
}
@keyframes ymx-grain-fade {
  0%   { opacity: 0; }
  100% { opacity: 0.10; }
}

/* Eyebrow → fade in (0.3s) */
.ymx-hero-eyebrow {
  opacity: 0;
  transform: translate3d(0, 8px, 0);
  animation: ymx-hero-eyebrow 0.7s 0.3s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
@keyframes ymx-hero-eyebrow {
  to { opacity: 1; transform: none; }
}

/* Word-by-word headline — each word wraps in a clipping container, then translates up */
.ymx-hero-word-wrap {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
}
.ymx-hero-word {
  display: inline-block;
  transform: translate3d(0, 110%, 0);
  opacity: 0;
  animation: ymx-hero-word 0.85s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  /* animation-delay set inline per word */
}
@keyframes ymx-hero-word {
  0%   { transform: translate3d(0, 110%, 0); opacity: 0; }
  60%  { opacity: 1; }
  100% { transform: translate3d(0, 0, 0); opacity: 1; }
}

/* Body text → fade in slightly later */
.ymx-hero-body {
  opacity: 0;
  transform: translate3d(0, 12px, 0);
  animation: ymx-hero-fadeup 0.8s 1.1s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.ymx-hero-cta {
  opacity: 0;
  transform: translate3d(-8px, 0, 0);
  animation: ymx-hero-cta 0.7s 1.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
@keyframes ymx-hero-cta {
  to { opacity: 1; transform: none; }
}
.ymx-hero-trust {
  opacity: 0;
  animation: ymx-hero-trust 0.8s 1.7s ease-out forwards;
}
@keyframes ymx-hero-trust {
  to { opacity: 1; }
}
@keyframes ymx-hero-fadeup {
  to { opacity: 1; transform: none; }
}

/* Image → mask reveal (top→bottom wipe) */
.ymx-hero-image {
  clip-path: inset(0 0 100% 0);
  opacity: 1;
  animation: ymx-hero-mask 1.2s 0.9s cubic-bezier(0.77, 0, 0.175, 1) forwards;
}
@keyframes ymx-hero-mask {
  to { clip-path: inset(0 0 0 0); }
}

/* Scroll indicator — appears last, then pulses */
.ymx-hero-scroll {
  position: absolute;
  bottom: 32px;
  left: 64px;
  display: flex;
  align-items: center;
  gap: 16px;
  opacity: 0;
  animation: ymx-hero-trust 0.8s 2.0s ease-out forwards;
  z-index: 4;
}
.ymx-hero-scroll-line {
  display: block;
  width: 56px;
  height: 1px;
  background: rgba(15, 15, 15, 0.35);
  position: relative;
  overflow: hidden;
}
.ymx-hero-scroll-line::after {
  content: '';
  position: absolute;
  top: 0;
  left: -40%;
  width: 40%;
  height: 100%;
  background: rgba(15, 15, 15, 0.85);
  animation: ymx-hero-scroll-pulse 2.4s 2.4s ease-in-out infinite;
}
@keyframes ymx-hero-scroll-pulse {
  0%   { left: -40%; }
  60%  { left: 100%; }
  100% { left: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .ymx-hero::after,
  .ymx-grain,
  .ymx-hero-eyebrow,
  .ymx-hero-word,
  .ymx-hero-body,
  .ymx-hero-cta,
  .ymx-hero-trust,
  .ymx-hero-image,
  .ymx-hero-scroll,
  .ymx-hero-scroll-line::after {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
    clip-path: none !important;
  }
  .ymx-hero::after { display: none; }
}
