/*
 * LUEN | Homepage editorial motion — additive layer
 * Scope: homepage only. Existing hero typography, thumbnail marquee,
 * mobile gestures and CTA handlers remain untouched.
 */
/* Section headings are intentionally never clipped or hidden.
   The existing .sr parent controls their subtle entry animation. */

/* The main site already animates .sr containers. Stagger only their
   children, without changing the parent transform or the card hover. */
@media (min-width:768px) and (prefers-reduced-motion: no-preference) {
  html.luen-motion-enhanced .luen-service-choice-grid.sr > .luen-service-choice,
  html.luen-motion-enhanced .case-support-grid-v7.sr > .case-support-card-v7,
  html.luen-motion-enhanced .luen-flow-list-v2.sr > li {
    opacity:0;
    translate:0 17px;
    transition:opacity .65s cubic-bezier(.22,1,.36,1),
               translate .72s cubic-bezier(.22,1,.36,1),
               transform .28s ease,border-color .28s ease,box-shadow .28s ease;
  }
  html.luen-motion-enhanced .luen-service-choice-grid.sr.in > .luen-service-choice,
  html.luen-motion-enhanced .case-support-grid-v7.sr.in > .case-support-card-v7,
  html.luen-motion-enhanced .luen-flow-list-v2.sr.in > li {
    opacity:1;
    translate:0 0;
  }
  html.luen-motion-enhanced .luen-service-choice-grid.sr > :nth-child(2),
  html.luen-motion-enhanced .case-support-grid-v7.sr > :nth-child(2),
  html.luen-motion-enhanced .luen-flow-list-v2.sr > :nth-child(2) {
    transition-delay:.09s;
  }
  html.luen-motion-enhanced .luen-service-choice-grid.sr > :nth-child(3),
  html.luen-motion-enhanced .case-support-grid-v7.sr > :nth-child(3),
  html.luen-motion-enhanced .luen-flow-list-v2.sr > :nth-child(3) {
    transition-delay:.18s;
  }
  html.luen-motion-enhanced .luen-flow-list-v2.sr > :nth-child(4) {
    transition-delay:.27s;
  }
}

/* Gentle movement on one editorial hero case image, never on the
   continuously moving long-form / reels thumbnail rails. */
@media (min-width:901px) and (hover:hover) and (pointer:fine) and (prefers-reduced-motion:no-preference) {
  html.luen-motion-enhanced #case-herahera .case-content-media-v7 img.luen-motion-parallax {
    transform:translate3d(0,var(--luen-motion-y,0px),0) scale(1.06);
    will-change:transform;
  }
  html.luen-motion-enhanced #cases .case-support-card-v7 figure {
    overflow:hidden;
  }
  html.luen-motion-enhanced #cases .case-support-card-v7 figure img {
    transition:transform .7s cubic-bezier(.22,1,.36,1)!important;
  }
  html.luen-motion-enhanced #cases .case-support-card-v7:hover figure img,
  html.luen-motion-enhanced #cases .case-support-card-v7:focus-within figure img {
    transform:scale(1.045);
  }
}

/* Small screens show titles immediately; no scroll-driven transforms.
   Without the per-card observer (.luen-motion-mobile) cards stay visible. */
@media (max-width:767px) {
  html.luen-motion-enhanced:not(.luen-motion-mobile) .luen-service-choice-grid.sr > .luen-service-choice,
  html.luen-motion-enhanced:not(.luen-motion-mobile) .case-support-grid-v7.sr > .case-support-card-v7,
  html.luen-motion-enhanced:not(.luen-motion-mobile) .luen-flow-list-v2.sr > li {
    opacity:1!important;
    translate:none!important;
    transition-delay:0s!important;
  }
}
@media (prefers-reduced-motion:reduce) {
  html.luen-motion-enhanced .luen-service-choice-grid.sr > .luen-service-choice,
  html.luen-motion-enhanced .case-support-grid-v7.sr > .case-support-card-v7,
  html.luen-motion-enhanced .luen-flow-list-v2.sr > li {
    opacity:1!important;
    translate:none!important;
    transition-delay:0s!important;
  }
}

/* Mobile card-by-card reveal. The grid wrapper stays visible so a tall
   stack never waits on one block-level reveal; each card rises on its own
   and case images settle inside their rounded, clipped frames. */
@media (max-width:767px) and (prefers-reduced-motion:no-preference) {
  html.luen-motion-mobile body .luen-service-choice-grid.sr,
  html.luen-motion-mobile body .case-support-grid-v7.sr,
  html.luen-motion-mobile body .luen-flow-list-v2.sr {
    opacity:1!important;
    transform:none!important;
  }
  html.luen-motion-mobile .luen-service-choice-grid.sr > .luen-service-choice,
  html.luen-motion-mobile .case-support-grid-v7.sr > .case-support-card-v7,
  html.luen-motion-mobile .luen-flow-list-v2.sr > li {
    opacity:0;
    translate:0 22px;
    transition:opacity .6s cubic-bezier(.22,1,.36,1),
               translate .75s cubic-bezier(.22,1,.36,1),
               transform .28s ease,border-color .28s ease,box-shadow .28s ease;
  }
  html.luen-motion-mobile .luen-service-choice-grid.sr > .luen-motion-card-in,
  html.luen-motion-mobile .case-support-grid-v7.sr > .luen-motion-card-in,
  html.luen-motion-mobile .luen-flow-list-v2.sr > .luen-motion-card-in {
    opacity:1;
    translate:0 0;
  }
  html.luen-motion-mobile #cases .case-support-card-v7 figure img {
    scale:1.06;
    transition:scale 1.1s cubic-bezier(.22,1,.36,1);
  }
  html.luen-motion-mobile #cases .case-support-card-v7.luen-motion-card-in figure img {
    scale:1;
  }
  html.luen-motion-mobile .case-support-grid-v7.sr > :nth-child(2),
  html.luen-motion-mobile .case-support-grid-v7.sr > :nth-child(2) figure img {
    transition-delay:.09s;
  }
  html.luen-motion-mobile .case-support-grid-v7.sr > :nth-child(3),
  html.luen-motion-mobile .case-support-grid-v7.sr > :nth-child(3) figure img {
    transition-delay:.18s;
  }
}

/* Editorial reveal — THE LUEN APPROACH and PARTNER CREATORS.
   Hidden state exists only under html.luen-editorial-motion, which
   luen-motion.js adds after the observer is running (and never under
   reduced motion), so content stays visible if JS is blocked. */
@media (prefers-reduced-motion:no-preference) {
  html.luen-editorial-motion #why-luen .luen-partnership-head,
  html.luen-editorial-motion #partner-creators .luen-partnership-head,
  html.luen-editorial-motion #why-luen .luen-approach-link,
  html.luen-editorial-motion #why-luen .luen-why-row > *,
  html.luen-editorial-motion #partner-creators .luen-creator-feature-copy > * {
    opacity:0;
    translate:0 18px;
    transition:opacity .7s cubic-bezier(.22,1,.36,1),translate .8s cubic-bezier(.22,1,.36,1);
  }
  html.luen-editorial-motion #why-luen .luen-partnership-head.luen-editorial-in,
  html.luen-editorial-motion #partner-creators .luen-partnership-head.luen-editorial-in,
  html.luen-editorial-motion #why-luen .luen-approach-link.luen-editorial-in,
  html.luen-editorial-motion #why-luen .luen-why-row.luen-editorial-in > *,
  html.luen-editorial-motion #partner-creators .luen-creator-feature.luen-editorial-in .luen-creator-feature-copy > * {
    opacity:1;
    translate:0 0;
  }
  html.luen-editorial-motion #why-luen .luen-why-row.luen-editorial-in > div { transition-delay:.1s; }

  /* Hairline rule draws from the left instead of the static border. */
  html.luen-editorial-motion #why-luen .luen-why-row {
    position:relative;
    border-top-color:transparent;
  }
  html.luen-editorial-motion #why-luen .luen-why-row::before {
    content:"";
    position:absolute;
    top:-1px;left:0;right:0;
    height:1px;
    background:var(--luen-line);
    transform:scaleX(0);
    transform-origin:left center;
    transition:transform 1s cubic-bezier(.22,1,.36,1);
    pointer-events:none;
  }
  html.luen-editorial-motion #why-luen .luen-why-row.luen-editorial-in::before { transform:scaleX(1); }

  /* Portrait opens upward; the card's own overflow:hidden + radius keeps
     the rounded corners, so the clip itself needs no radius. */
  html.luen-editorial-motion #partner-creators .luen-creator-feature-media {
    clip-path:inset(100% 0 0 0);
    transition:clip-path 1.1s cubic-bezier(.22,1,.36,1);
  }
  html.luen-editorial-motion #partner-creators .luen-creator-feature.luen-editorial-in .luen-creator-feature-media {
    clip-path:inset(0 0 0 0);
  }
  html.luen-editorial-motion #partner-creators .luen-creator-feature-media img {
    scale:1.08;
    transition:scale 1.4s cubic-bezier(.22,1,.36,1),transform .7s cubic-bezier(.2,.7,.2,1);
  }
  html.luen-editorial-motion #partner-creators .luen-creator-feature.luen-editorial-in .luen-creator-feature-media img { scale:1; }
  html.luen-editorial-motion #partner-creators .luen-creator-feature.luen-editorial-in .luen-creator-feature-copy > :nth-child(2) { transition-delay:.12s; }
  html.luen-editorial-motion #partner-creators .luen-creator-feature.luen-editorial-in .luen-creator-feature-copy > :nth-child(3) { transition-delay:.2s; }
  html.luen-editorial-motion #partner-creators .luen-creator-feature.luen-editorial-in .luen-creator-feature-copy > :nth-child(4) { transition-delay:.28s; }
  html.luen-editorial-motion #partner-creators .luen-creator-feature.luen-editorial-in .luen-creator-feature-copy > :nth-child(5) { transition-delay:.36s; }
}
