/* ==========================================================================
   HOME FX LAYER (V6): the 3D and scroll animation of the sections BELOW the hero. Loaded last (after the section files). Behaviour is public/assets/js/pages/home/fx.js (+ arrivals.js for the
   pinned horizontal scroll). Calm and luxurious: cream / sand / cocoa, serif, slow ease.
   RULES: content is visible without JS and under reduced motion (everything here that hides something is gated by `.js:not(.reduced-motion)` with a CSS fail-safe); transform / opacity only
   (the story banner also animates one border-radius); no layout shift (pins add spacer height below the fold only); decorative layers are aria-hidden.
   ========================================================================== */

/* ---- 0. global: thin cocoa scroll-progress line at the very top of the page ---- */
.fx-progress { position: fixed; inset: 0 0 auto 0; z-index: calc(var(--z-header, 100) + 20); block-size: 3px; pointer-events: none; }
.fx-progress i { display: block; inline-size: 100%; block-size: 100%; background: var(--cocoa); transform-origin: 0 50%; transform: scaleX(0); will-change: transform; }
html.reduced-motion .fx-progress { display: none; }
@media (prefers-reduced-motion: reduce) { .fx-progress { display: none; } }

/* ---- 1. section curtain: every section after the first lies over the one before it with a rounded top and a soft shadow ---- */
.home > .hs { --fx-r: var(--r-block); }
.home > .hs:not(:last-child):not(.hs--last) { padding-block-end: calc(var(--fx-r) + clamp(1.5rem, 3vw, 3rem)); }          /* the strip the next section's curtain lies over: nothing of this section is covered */
.home > .hs ~ .hs {
  position: relative; background: var(--cream); margin-block-start: calc(var(--fx-r) * -1);
  border-start-start-radius: var(--fx-r); border-start-end-radius: var(--fx-r); box-shadow: 0 -20px 44px -30px rgba(var(--cocoa-rgb), .34);
}
.home > .hs ~ .hs:nth-of-type(2) { z-index: 2; } .home > .hs ~ .hs:nth-of-type(3) { z-index: 3; } .home > .hs ~ .hs:nth-of-type(4) { z-index: 4; } .home > .hs ~ .hs:nth-of-type(5) { z-index: 5; }
.home > .hs ~ .hs:nth-of-type(6) { z-index: 6; } .home > .hs ~ .hs:nth-of-type(7) { z-index: 7; } .home > .hs ~ .hs:nth-of-type(8) { z-index: 8; }
@media (max-width: 47.99em) { .home > .hs { --fx-r: var(--r-block-sm); } }

/* ---- 2. the serif marquee band between the categories and the featured collection (kit marquee: scroll-velocity skew; a static wrapped row under reduced motion) ---- */
.fx-band { margin-block-start: clamp(2.5rem, 5vw, 5rem); padding-block: clamp(.6rem, 1.4vw, 1.2rem); overflow: hidden; color: var(--cocoa); border-block: 1px solid var(--line); }
.fx-band .marquee__skew { transform-origin: 50% 50%; }
.fx-band .marquee__group { gap: 0; }
.fx-band li { display: inline-flex; align-items: center; gap: clamp(1.4rem, 3.2vw, 3.2rem); padding-inline-end: clamp(1.4rem, 3.2vw, 3.2rem); font: italic 400 clamp(2.4rem, 1rem + 5.2vw, 6rem)/1.1 var(--font-serif); letter-spacing: var(--tracking-display); white-space: nowrap; }
.fx-band li::after { content: ""; flex: none; inline-size: clamp(.5rem, .8vw, .8rem); block-size: clamp(.5rem, .8vw, .8rem); border-radius: 50%; background: var(--olive); }
html.reduced-motion .fx-band .marquee__track { flex-wrap: wrap; justify-content: center; }
@media (prefers-reduced-motion: reduce) { .fx-band .marquee__track { flex-wrap: wrap; justify-content: center; } }

/* ---- 3. SHOP BY CATEGORY: sticky stacking cards (desktop). Each next card slides up over the previous one while that one recedes (scale .94, rotateX -4deg, dims: fx.js).
          Tablets and phones keep the stacked cards of categories.css with a staggered rise. ---- */
.cat__sheet, .cat__item { min-inline-size: 0; }
.cat__dim { position: absolute; inset: 0; z-index: 4; border-radius: inherit; background: rgba(var(--cocoa-rgb), .42); opacity: 0; pointer-events: none; }
@media (min-width: 64em) {
  .cat__grid { display: block; position: relative; }
  .cat__item { --i: 0; position: sticky; inset-block-start: calc(1.25rem + var(--i) * .85rem); z-index: calc(var(--i) + 1); margin-block-end: clamp(1rem, 2vw, 1.75rem); perspective: 1500px; perspective-origin: 50% 0; }
  .cat__item:nth-child(2) { --i: 1; } .cat__item:nth-child(3) { --i: 2; } .cat__item:nth-child(4) { --i: 3; }
  .cat__item:last-child { margin-block-end: 0; }
  .cat__sheet { display: block; transform-origin: 50% 0; will-change: auto; }
  .cat__card {
    display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); aspect-ratio: auto; block-size: min(60svh, 31rem); background: var(--sand); box-shadow: var(--shadow-2);
    translate: none; transform-style: preserve-3d;
  }
  .cat__item:nth-child(2) .cat__card { background: var(--mist); }
  .cat__item:nth-child(3) .cat__card { background: var(--olive-soft); }
  .cat__card:hover, .cat__card:focus-visible { translate: none; box-shadow: var(--shadow-3); }
  .cat__card::after, .cat__card--below::after { display: none; }
  .cat__media { position: relative; inset: auto; grid-column: 2; grid-row: 1; border-radius: 0; }
  .cat__media::before { content: ""; position: absolute; z-index: 2; inset: 0 auto 0 0; inline-size: 22%; pointer-events: none; background: linear-gradient(90deg, rgba(var(--cream-rgb), .55), rgba(var(--cream-rgb), 0)); }
  .cat__item:nth-child(2) .cat__media::before { background: linear-gradient(90deg, rgba(226, 213, 195, .9), rgba(226, 213, 195, 0)); }
  .cat__item:nth-child(3) .cat__media::before { background: linear-gradient(90deg, rgba(228, 230, 210, .9), rgba(228, 230, 210, 0)); }
  .cat__item:nth-child(1) .cat__media::before { background: linear-gradient(90deg, rgba(234, 223, 209, .9), rgba(234, 223, 209, 0)); }
  .cat__body, .cat__card--below .cat__body { position: relative; inset: auto; grid-column: 1; grid-row: 1; inline-size: auto; flex-direction: column; flex-wrap: nowrap; justify-content: center; align-items: flex-start; gap: .9rem; padding: clamp(2rem, 4.2vw, 4.5rem); }
  .cat__name, .cat__card--below .cat__name { flex: none; font-size: clamp(2.8rem, 1.2rem + 4.6vw, 5.2rem); }
  .cat__sub { font-size: .78rem; }
  .cat__go { inline-size: 3.4rem; block-size: 3.4rem; margin-block-start: 1rem; }
  .cat__go .icon { inline-size: 1.3rem; block-size: 1.3rem; }
}
@media (max-width: 63.99em) {
  .js:not(.reduced-motion) .cat__item:not(.is-in) { opacity: 0; transform: translate3d(0, 4.5vh, 0); animation: hz-fadein .01s linear 3.2s forwards; }
}

/* ---- 4. FEATURED COLLECTION: the cards fan in (rotateY 28deg -> 0, translateZ, staggered: fx.js); the feature card breathes (Ken Burns) and shows a 'View' cursor pill ---- */
.feat__grid { perspective: 1600px; perspective-origin: 50% 40%; }
.feat__feature .feat__media { animation: fx-kb 26s var(--ease-in-out) infinite alternate; transform-origin: 60% 40%; }
@keyframes fx-kb { from { transform: scale(1); } to { transform: scale(1.09); } }
.js:not(.reduced-motion) .feat [data-feat-item]:not(.is-in) { transform: perspective(1500px) translate3d(3rem, 0, -14rem) rotateY(28deg); transform-origin: 0 50%; }
html.reduced-motion .feat__feature .feat__media { animation: none; }
@media (prefers-reduced-motion: reduce) { .feat__feature .feat__media { animation: none; } }

/* ---- 5. STORY BANNER: a pinned expanding scene (desktop). The banner starts as a smaller rounded card and grows to nearly the full width while you scroll (fx.js scrubs it), the headline
          reveals line by line, the photograph moves with depth and the pill appears last. Without JS / reduced motion / phones it is the plain banner of story.css. ---- */
@media (min-width: 64em) and (min-height: 36rem) {
  .story { padding-block: 0; }
  .story__stage { display: grid; align-items: center; min-block-size: 100svh; }
  .story .hs__inner { max-inline-size: none; padding-inline: clamp(.5rem, 1.4vw, 1.25rem); }
  .story__card { min-block-size: min(78svh, 46rem); transform-origin: 50% 50%; }
  .story__title { font-size: clamp(3rem, 1.4rem + 4.6vw, 6.4rem); max-inline-size: 15ch; }
}

/* ---- 6. NEW ARRIVALS: pinned horizontal scroll with coverflow depth (desktop; arrivals.js). Phones / reduced motion keep the native snap rail; where scroll-driven CSS exists the cards get
          the same depth from their position in the rail. ---- */
.arr__headside { display: flex; align-items: center; gap: clamp(1rem, 3vw, 2.5rem); }
.arr__counter { margin: 0; font: 400 clamp(1.4rem, 1rem + 1.4vw, 2.2rem)/1 var(--font-serif); letter-spacing: var(--tracking-display); color: var(--cocoa); font-variant-numeric: tabular-nums; }
.arr__counter[hidden] { display: none; }
.arr__counter span { display: inline-block; min-inline-size: 1.6ch; }
.arr--pin .arr__stage { display: grid; grid-template-columns: minmax(0, 1fr); align-content: center; min-block-size: calc(100svh - 1px); }
.arr--pin .arr__view { min-inline-size: 0; max-inline-size: 100%; }
.arr--pin .arr__view { overflow: clip; perspective: 1500px; perspective-origin: 50% 50%; padding-block: 1.5rem; }
.arr--pin .arr__rail { position: relative; overflow: visible; scroll-snap-type: none; transform-style: preserve-3d; will-change: transform; touch-action: auto; padding-block: 1.25rem 1.5rem; padding-inline: var(--arr-side, 30vw); }
/* The rail only carries the 3D scene. Its own (transparent) plane sits in the same 3D context as the tilted cards and wins hit-testing over the parts of a card
   that lean behind it, so Quick add, Quick view, the heart and the title link could not be clicked. Only the cards may take the pointer. */
.arr--pin .arr__rail { pointer-events: none; }
.arr--pin .arr__item { pointer-events: auto; }
.arr--pin .arr__item { transform-origin: 50% 60%; filter: blur(calc(max(var(--a, 0) - .62, 0) * 2.9px)); will-change: transform; }
.arr--pin .arr__item .pc { transition: none; }
.arr--pin .arr__item.is-centre .pc__media { box-shadow: 0 0 0 1px rgba(205, 187, 166, .5), var(--shadow-3); }
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .arr:not(.arr--pin) .arr__rail { perspective: 1200px; }
    .arr:not(.arr--pin) .arr__item { animation: fx-depth linear both; animation-timeline: view(inline); animation-range: entry 0% exit 100%; }
    @keyframes fx-depth { 0% { transform: rotateY(14deg) scale(.92); opacity: .7; } 50% { transform: rotateY(0) scale(1); opacity: 1; } 100% { transform: rotateY(-14deg) scale(.92); opacity: .7; } }
  }
}

/* ---- 7. VIRTUAL SHOWROOM CTA: layered 3D parallax. Back layer = the hall photograph, floating frosted garment cards at different depths (slow orbit / bob, pointer parallax), copy on top ---- */
.sr__card { perspective: 1400px; }
.sr__floats { position: absolute; inset: 0; z-index: 2; pointer-events: none; display: none; transform-style: preserve-3d; }
@media (min-width: 48em) { .sr__floats { display: block; } }
.sr__float { position: absolute; inline-size: var(--w, 9rem); transform: translateZ(var(--z, 0px)); }
.sr__float-in { display: block; animation: fx-orbit var(--t, 11s) ease-in-out var(--d, 0s) infinite alternate; }
.sr__fcard { display: grid; gap: .35rem; padding: .4rem .4rem .55rem; border-radius: var(--radius-lg); background: linear-gradient(180deg, rgba(255, 252, 247, .9), rgba(255, 250, 244, .7)); border: 1px solid var(--glass-border); box-shadow: var(--glass-shadow-lg); text-align: center; }
.sr__fcard img { display: block; inline-size: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--radius-md); background: var(--sand); }
.sr__fcard span { font: 600 .66rem/1.2 var(--font-sans); color: var(--ink); letter-spacing: .01em; padding-inline: .2rem; }
.sr__float:nth-child(1) { --w: clamp(7.5rem, 11vw, 11rem); --z: 60px; --t: 10s; inset-block-start: 9%; inset-inline-end: 27%; rotate: -4deg; }
.sr__float:nth-child(2) { --w: clamp(6.5rem, 9vw, 9rem); --z: -50px; --t: 13s; --d: -3s; inset-block-start: 22%; inset-inline-end: 7%; rotate: 5deg; }
.sr__float:nth-child(3) { --w: clamp(6rem, 8.4vw, 8.4rem); --z: 110px; --t: 12s; --d: -6s; inset-block-end: 12%; inset-inline-end: 21%; rotate: 3deg; }
.sr__float:nth-child(4) { --w: clamp(5.4rem, 7.2vw, 7.4rem); --z: -90px; --t: 15s; --d: -2s; inset-block-end: 20%; inset-inline-end: 4%; rotate: -6deg; }
@keyframes fx-orbit { 0% { transform: translate3d(0, 0, 0) rotate(-1.2deg); } 33% { transform: translate3d(.5rem, -.55rem, 0) rotate(.8deg); } 66% { transform: translate3d(-.35rem, -.9rem, 0) rotate(-.4deg); } 100% { transform: translate3d(-.5rem, -.3rem, 0) rotate(1.2deg); } }
html.reduced-motion .sr__float-in { animation: none; }
@media (prefers-reduced-motion: reduce) { .sr__float-in { animation: none; } }

/* ---- 8. JOURNAL: cards slide in with a slight rotation (journal items are gated in journal.css); the category becomes a pill that lifts with the card ---- */
.jr__cat { display: inline-block; padding: .22rem .65rem; border-radius: 999px; background: var(--sand); color: var(--ink); transition: translate var(--dur-3) var(--ease-soft), background-color var(--dur-3); }
.jr__card:hover .jr__cat, .jr__card:focus-visible .jr__cat { translate: 0 -3px; background: var(--taupe); }
.jr__card { transform-style: preserve-3d; }
.js:not(.reduced-motion) .jr__item:not(.is-in) { transform: translate3d(0, 5vh, 0) rotate(var(--jr-rot, -3deg)); }

/* ---- 9. NEWSLETTER: the field grows with a soft cocoa ring on focus, two detail photographs drift in 3D, the success mark pops ---- */
.nl { overflow: clip; }                      /* the drifting crops never leave the section (they would lie over the journal or the footer) */
.nl__card { position: relative; isolation: isolate; perspective: 1200px; }
.nl .inline-form__row { transition: transform var(--dur-3) var(--ease-spring), box-shadow var(--dur-3) var(--ease-soft); transform-origin: 50% 50%; }
.nl .inline-form__row:focus-within { transform: scale(1.035); box-shadow: 0 0 0 4px rgba(var(--cocoa-rgb), .16), 0 18px 36px -18px rgba(var(--cocoa-rgb), .4); outline-color: transparent; }
.nl .form-status[data-state="success"]::before {
  content: "\2713"; display: inline-grid; place-items: center; inline-size: 1.55em; block-size: 1.55em; margin-inline-end: .55em; border-radius: 50%; background: var(--olive); color: var(--on-accent);
  font-size: .8em; font-weight: 700; animation: fx-pop .7s var(--ease-spring) both;
}
@keyframes fx-pop { 0% { transform: scale(0) rotate(-40deg); opacity: 0; } 60% { transform: scale(1.25) rotate(8deg); opacity: 1; } 100% { transform: scale(1) rotate(0); opacity: 1; } }
.nl .form-status[data-state="success"] { animation: fx-fade .6s var(--ease-soft) both; }
@keyframes fx-fade { from { opacity: 0; transform: translateY(.4rem); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .nl .inline-form__row { transition: none; } .nl .inline-form__row:focus-within { transform: none; } .nl .form-status[data-state="success"]::before, .nl .form-status[data-state="success"] { animation: none; } }
html.reduced-motion .nl .inline-form__row:focus-within { transform: none; }
