/* ==========================================================================
   NELDRA MOTION — support styles for assets/js/motion.js
   html.motion       = the motion layer is expected (set in <head>)
   html.motion-live  = GSAP has taken over
   Without JS or with reduced motion nothing here hides content.
   ========================================================================== */

/* ScrollTrigger measures the page by jumping to the top and back. With the
   browser's smooth scrolling on, that jump glides, and after a reload part-way
   down every scene is measured in the wrong place. In-page links still glide:
   motion.js scrolls them itself. */
html.motion { scroll-behavior: auto; }

/* Accessible split text: real text for screen readers (.sr-only, neldra.css),
   masked words on screen */
.split { display: inline; }
.w {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
  /* room for descenders (g, p, y) inside the mask without shifting the line */
  padding-bottom: .14em;
  margin-bottom: -.14em;
}
.w__i { display: inline-block; will-change: transform; }

/* Hero seam: a hairline drawn down the split during the intro. It sits on the
   Contract panel's left edge, not at 50%: a pointer over the hero widens one
   panel while the line is still drawing, and a line fixed in the middle was
   left standing there on its own. */
.hero { position: relative; }
.hero__seam {
  position: absolute;
  top: 0; bottom: 0; left: 0;
  width: 1px;
  z-index: 4;
  background: #fff;
  mix-blend-mode: difference;
  transform-origin: 50% 0;
  opacity: 0;
  pointer-events: none;
}
/* stacked hero on tablets/phones: there is no vertical split to draw */
@media (max-width: 860px) { .hero__seam { display: none; } }

/* File pickers have a wide built-in minimum; keep them inside the form */
input[type="file"] { max-width: 100%; min-width: 0; }

/* Leaving a page: a white veil (driven by motion.js) */
.page-veil {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: var(--c-bg);
  opacity: 0;
  pointer-events: none;
}

@media (prefers-reduced-motion: no-preference) {
  /* Arriving: the page settles in from white */
  .motion body { animation: neldra-page-in .55s ease both; }

  /* Start states, held from the first paint so nothing flashes. If the
     scripts never arrive, the release animation shows everything at 2.4 s. */
  .motion .hero .panel__label > .meta,
  .motion .hero .panel__title,
  .motion .hero .panel__enter,
  .motion .hero .panel__media img,
  .motion .pdp__figure--detail,
  .motion .woocommerce ul.products li.product {
    opacity: 0;
    animation: neldra-release .6s ease 2.4s forwards;
  }
  .motion .project__media,
  .motion .pfig,
  .motion .pdp__figure--main {
    clip-path: inset(100% 0 0 0);
    animation: neldra-unclip .8s ease 2.4s forwards;
  }

  /* GSAP in control: no CSS timers, no CSS transitions on revealed elements */
  .motion-live .hero .panel__label > .meta,
  .motion-live .hero .panel__title,
  .motion-live .hero .panel__enter,
  .motion-live .hero .panel__media img,
  .motion-live .woocommerce ul.products li.product,
  .motion-live .project__media,
  .motion-live .pfig,
  .motion-live .pdp__figure--main,
  .motion-live .pdp__figure--detail { animation: none; }
  /* GSAP sets the start offset inline. The resting state must have no offset:
     neldra.css parks hidden reveals 32px low until .is-visible, and that rule
     came back (a 32px drop) when a finished tween cleared its transform. */
  .motion-live [data-reveal] { transition: none; transform: none; }

  /* Scrubbed scenes animate clip-path; keep them on their own layer */
  .motion-live .collections-split,
  .motion-live .block-dark.bleed { will-change: clip-path; }
}

@keyframes neldra-page-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes neldra-release { to { opacity: 1; } }
@keyframes neldra-unclip { to { clip-path: inset(0 0 0 0); } }
