/* ==========================================================================
   EPC — Expérience immersive (home page mode, ?mode=immersive)
   Uses the V3 tokens from v3.css (night / paper / amber, Bricolage + Instrument Serif).
   Scroll-driven values come from public/js/experience.js as CSS variables:
     --fp film progress · --op transition progress · --push camera push
     --intro intro fade · --wipe wood wipe · --out showroom title · --lp caption drift
     --x gallery offset · --d / --ad slide distance from centre
   ========================================================================== */

.xp { --xp-sw: min(1180px, 86vw); position: relative; color: var(--white); }
.xp[hidden] { display: none; }

/* Classic-only sections step aside while the immersive layer is on (they stay in the HTML for SEO). */
body.mode-xp #hero,
body.mode-xp .marquee,
body.mode-xp #services,
body.mode-xp #soustraitance { display: none; }

/* ==========================================================================
   FILM
   ========================================================================== */
.xp-film { position: relative; height: 300vh; }
.xp-stage { position: sticky; top: 0; height: 100vh; height: 100lvh; overflow: hidden; background: var(--night); }

/* Film under the WHOLE site: the stage is fixed behind every section; the page content
   scrolls over it as floating panels separated by clear windows onto the film. */
body.xp-fixed { background: var(--night); }
body.xp-fixed .xp-stage { position: fixed; inset: 0; z-index: 0; }
body.xp-fixed main > section:not(#experience),
body.xp-fixed .foot { position: relative; z-index: 1; }
body.xp-fixed .xp-show { position: relative; z-index: 1; margin-bottom: var(--xp-gap, 70vh); }
body.xp-fixed main > section:not(#experience) {
    margin: 0 clamp(8px, 1.6vw, 22px) var(--xp-gap, 70vh);
    border-radius: clamp(20px, 2.4vw, 32px); overflow: hidden;
    box-shadow: 0 40px 120px -40px rgba(0, 0, 0, .85);
}
/* No full-width panels: sections are transparent, the film is visible all around, and only the
   text blocks sit in frosted-glass boxes sized to their content.
   Tune with --xp-box-light / --xp-box-dark (background opacity) and --xp-box-blur. */
body.xp-fixed { --xp-box-light: .56; --xp-box-dark: .38; --xp-box-blur: 12px; }
body.xp-fixed main > section:not(#experience),
body.xp-fixed .foot,
body.xp-fixed .xp-show { background: transparent; box-shadow: none; border-radius: 0; overflow: visible; }

/* light boxes (dark text) */
body.xp-fixed :is(
    #atelier .eyebrow, #atelier .statement, #atelier .about-copy,
    #pourquoi .sec-head > *, #pourquoi .card:not(.card--dark),
    #faq .faq-side, #faq .faq > div:last-child
) {
    background: rgba(246, 241, 234, var(--xp-box-light)); color: var(--ink);
}
/* dark boxes (light text) */
body.xp-fixed :is(
    #methode .sec-head > *, #methode .step, #methode .process-cta, #pourquoi .card--dark,
    #contact .contact > div:first-child, #contact .form,
    .foot .foot-cta, .foot .foot-grid, .foot .foot-base,
    .xp-show-head, .xp-info, .xp-show-foot
) {
    background: rgba(13, 11, 9, var(--xp-box-dark)); color: var(--white);
}
/* shared box shape */
body.xp-fixed :is(
    #atelier .statement, #atelier .about-copy,
    #pourquoi .sec-head > *, #faq .faq-side, #faq .faq > div:last-child,
    #methode .sec-head > *, #methode .step, #methode .process-cta,
    #contact .contact > div:first-child, #contact .form,
    .foot .foot-cta, .foot .foot-grid, .foot .foot-base,
    .xp-show-head, .xp-info, .xp-show-foot
) {
    padding: clamp(18px, 2.4vw, 30px); border-radius: 22px; border: 0;
    box-shadow: inset 0 0 0 1px rgba(255, 245, 230, .14);
    -webkit-backdrop-filter: blur(var(--xp-box-blur)) saturate(1.15);
    backdrop-filter: blur(var(--xp-box-blur)) saturate(1.15);
}
body.xp-fixed #pourquoi .card {
    -webkit-backdrop-filter: blur(var(--xp-box-blur)) saturate(1.15);
    backdrop-filter: blur(var(--xp-box-blur)) saturate(1.15);
}
/* boxes hug the text instead of spanning the row */
body.xp-fixed :is(#atelier .statement, #pourquoi .sec-head > *, #methode .sec-head > *, #faq .faq-side) {
    width: fit-content; max-width: 100%; justify-self: start; align-self: start;
}
body.xp-fixed #atelier .eyebrow {
    display: inline-flex; padding: 8px 14px; border-radius: 999px;
    -webkit-backdrop-filter: blur(var(--xp-box-blur)); backdrop-filter: blur(var(--xp-box-blur));
}
body.xp-fixed #atelier .values div { background: rgba(246, 241, 234, .55); }
body.xp-fixed :is(#atelier, #pourquoi, #faq) .eyebrow { color: var(--ink); }
body.xp-fixed .foot .foot-cta { width: fit-content; max-width: calc(100% - 32px); margin: 0 auto 24px; }
body.xp-fixed .foot .foot-grid { margin-bottom: 16px; }
body.xp-fixed .xp-show-head { width: min(var(--wrap), 100%); }
body.xp-fixed .foot { border-radius: clamp(20px, 2.4vw, 32px) clamp(20px, 2.4vw, 32px) 0 0; }

.xp-screen {
    position: absolute; inset: 0; overflow: hidden; background: var(--night-2);
    transform: scale(calc((1 + .06 * var(--push, 1)) * (1 - .16 * var(--op, 0))));
    border-radius: calc(var(--op, 0) * 30px);
    will-change: transform;
}
.xp-poster, .xp-video, .xp-canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* --xp-film-filter: overall look of the background film (tune here) */
.xp { --xp-film-filter: brightness(1.06) contrast(1.04) saturate(1.08); }
.xp-poster { transition: opacity 1s var(--ease); filter: var(--xp-film-filter); }
.xp-video, .xp-canvas { opacity: 0; transition: opacity 1.2s var(--ease); filter: var(--xp-film-filter); }
.xp-ready .xp-video, .xp-ready .xp-canvas { opacity: 1; }
.xp-ready:not(.xp-noplay) .xp-poster { opacity: 0; }

/* vignette + caption legibility + film grain + transition dimming */
.xp-shade { position: absolute; inset: 0; pointer-events: none;
    background:
        linear-gradient(0deg, rgba(13, 11, 9, .38) 0%, rgba(13, 11, 9, .05) 26%, transparent 45%),
        radial-gradient(130% 100% at 50% 45%, transparent 70%, rgba(13, 11, 9, .22) 100%);
}
.xp-shade::before {
    content: ''; position: absolute; inset: -50%; opacity: .07; mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    animation: xp-grain 1.2s steps(4) infinite;
}
.xp-shade::after { content: ''; position: absolute; inset: 0; background: var(--night); opacity: calc(var(--op, 0) * .45); }
@keyframes xp-grain { 0% { transform: translate(0, 0); } 25% { transform: translate(-3%, 2%); } 50% { transform: translate(2%, -3%); } 75% { transform: translate(-2%, -1%); } }

/* warm light sweep during the pull-back */
.xp-light {
    position: absolute; inset: 0; pointer-events: none; mix-blend-mode: screen;
    background: linear-gradient(105deg, transparent 35%, rgba(242, 196, 142, .38) 50%, transparent 65%);
    transform: translateX(calc(-80% + var(--op, 0) * 160%));
    opacity: calc(min(var(--op, 0) * 6, 1) * (1 - var(--op, 0)));
}

/* cinema letterbox, opens as the film starts */
.xp-bars i { position: absolute; z-index: 3; left: 0; right: 0; height: calc(var(--intro, 1) * 10vh); background: #000; pointer-events: none; }
.xp-bars i:first-child { top: 0; }
.xp-bars i:last-child { bottom: 0; }

/* wood-texture wipe: a plank of real grain crosses the frame */
.xp-wipe { position: absolute; z-index: 4; inset: -12% 0; pointer-events: none; overflow: hidden; }
.xp-wipe i {
    position: absolute; top: 0; bottom: 0; left: 0; width: 46vw;
    background:
        linear-gradient(90deg, rgba(13, 11, 9, .85), rgba(154, 90, 30, .15) 22%, rgba(255, 220, 170, .18) 50%, rgba(154, 90, 30, .15) 78%, rgba(13, 11, 9, .85)),
        var(--tex) center / auto 100% repeat-x;
    box-shadow: 0 0 120px 40px rgba(13, 11, 9, .55);
    transform: translateX(calc(112vw - var(--wipe, 0) * 175vw)) skewX(-11deg);
    will-change: transform;
}

/* intro title */
.xp-intro {
    position: absolute; z-index: 5; left: 0; right: 0; bottom: calc(10vh + 72px);
    width: var(--wrap); margin-inline: auto;
    opacity: var(--intro, 1); transform: translateY(calc((1 - var(--intro, 1)) * -40px));
    pointer-events: none;
}
.xp-intro .eyebrow { color: var(--amber-2); }
.xp-intro-title { margin-top: 16px; font-size: clamp(2.8rem, 8vw, 7.4rem); max-width: 12ch; }
.xp-intro-title .serif { color: var(--amber-2); }
.xp-intro p { margin-top: 18px; max-width: 30rem; color: rgba(255, 245, 230, .72); }

/* synchronised captions (HTML over the film) */
.xp-caps { position: absolute; z-index: 5; left: 0; right: 0; bottom: clamp(120px, 20vh, 220px); width: var(--wrap); margin-inline: auto; pointer-events: none; }
.xp-cap { position: absolute; left: 0; bottom: 0; max-width: 15ch; transform: translateY(calc(var(--lp, 0) * -46px)); }
.xp-cap-k {
    display: inline-flex; align-items: center; gap: .6rem; margin-bottom: 14px;
    font-size: .74rem; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--amber-2);
    opacity: 0; transform: translateX(-12px); transition: opacity .5s var(--ease), transform .7s var(--ease);
}
.xp-cap-k::before { content: ''; width: 28px; height: 1px; background: currentColor; transform: scaleX(0); transform-origin: left; transition: transform .8s var(--ease) .1s; }
.xp-cap-t { display: block; font-size: clamp(2.3rem, 6.4vw, 6rem); text-shadow: 0 10px 50px rgba(0, 0, 0, .45); }
.xp-w { display: inline-block; overflow: hidden; vertical-align: bottom; padding-bottom: .1em; margin-bottom: -.1em; }
.xp-w > span { display: inline-block; transform: translateY(112%) rotate(4deg); transition: transform .55s var(--ease-io); }
.xp-cap.on .xp-cap-k { opacity: 1; transform: none; }
.xp-cap.on .xp-cap-k::before { transform: scaleX(1); }
.xp-cap.on .xp-w > span { transform: none; transition: transform 1s var(--ease) calc(.08s + var(--k) * 60ms); }

/* transition → showroom title */
.xp-outro {
    position: absolute; z-index: 6; inset: 0; display: grid; place-content: center; text-align: center; padding: 0 20px;
    opacity: var(--out, 0); transform: translateY(calc((1 - var(--out, 0)) * 34px)) scale(calc(.96 + var(--out, 0) * .04));
    pointer-events: none;
}
.xp-outro .eyebrow { justify-content: center; color: var(--amber-2); }
.xp-outro-title { margin-top: 18px; font-size: clamp(2.6rem, 7vw, 6.4rem); }
.xp-outro-title .serif { color: var(--amber); }
.xp-outro-text { margin: 20px auto 0; max-width: 32rem; color: rgba(255, 245, 230, .72); }

/* chapter rail */
.xp-rail {
    position: absolute; z-index: 7; left: 50%; bottom: 22px; transform: translateX(-50%);
    width: min(720px, calc(100% - 32px));
}
.xp-rail-bar { display: block; height: 2px; border-radius: 2px; background: rgba(255, 245, 230, .16); overflow: hidden; }
.xp-rail-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--amber-deep), var(--amber-2)); transform-origin: left; transform: scaleX(var(--fp, 0)); }
.xp-rail ol { display: flex; justify-content: space-between; margin-top: 8px; }
.xp-rail button { display: inline-flex; align-items: baseline; gap: .4rem; padding: 6px 4px; font-size: .72rem; letter-spacing: .06em; color: rgba(255, 245, 230, .5); transition: color .4s; }
.xp-rail button b { font-weight: 600; color: rgba(255, 245, 230, .35); transition: color .4s; }
.xp-rail button:hover, .xp-rail button.on { color: var(--white); }
.xp-rail button.on b, .xp-rail button.done b { color: var(--amber); }
.xp-rail button span { display: none; }
@media (min-width: 640px) { .xp-rail button span { display: inline; } }

.xp-skip {
    position: absolute; z-index: 8; right: 16px; top: 92px;
    display: inline-flex; align-items: center; gap: .5rem; min-height: 40px; padding: 0 1rem; border-radius: 999px;
    font-size: .8rem; font-weight: 600; color: var(--white);
    background: rgba(18, 15, 12, .45); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
    box-shadow: inset 0 0 0 1px rgba(255, 245, 230, .2);
    transition: background .3s, color .3s; opacity: calc(1 - var(--st, 0) * 4);
}
.xp-past .xp-skip { visibility: hidden; pointer-events: none; }
.xp-skip:hover { background: var(--amber); color: var(--night); }
@media (min-width: 1024px) { .xp-skip { right: max(24px, calc((100% - 1240px) / 2)); top: 100px; } }

.xp-cue {
    position: absolute; z-index: 5; right: 22px; bottom: 90px; display: none; align-items: center; gap: 12px;
    font-size: .7rem; letter-spacing: .2em; text-transform: uppercase; color: rgba(255, 245, 230, .55); writing-mode: vertical-rl;
    opacity: var(--intro, 1);
}
.xp-cue::after { content: ''; width: 1px; height: 56px; background: linear-gradient(var(--amber), transparent); animation: cue 2s var(--ease) infinite; transform-origin: top; }
@media (min-width: 768px) { .xp-cue { display: inline-flex; } }

@media (max-width: 767px) { .xp-rail { bottom: 70px; } .xp-note { bottom: 124px !important; } }
.xp-note { position: absolute; z-index: 7; left: 50%; bottom: 84px; transform: translateX(-50%); width: min(560px, calc(100% - 32px)); text-align: center; font-size: .8rem; color: rgba(255, 245, 230, .6); }
.xp-debug { position: fixed; z-index: 95; left: 16px; top: 92px; max-width: calc(100% - 32px); white-space: pre-wrap; padding: 8px 12px; border-radius: 8px; background: rgba(0, 0, 0, .7); color: #9fe; font: 12px/1.4 ui-monospace, Consolas, monospace; }

/* ==========================================================================
   SHOWROOM
   ========================================================================== */
.xp-show {
    position: relative;
    background:
        radial-gradient(70% 55% at 50% 58%, rgba(227, 161, 91, .13), transparent 70%),
        linear-gradient(180deg, var(--night) 0%, #120E0B 60%, var(--night) 100%);
}
.xp-show-pin { padding: clamp(80px, 12vw, 120px) 0 40px; }
.xp-show-head { width: var(--wrap); margin-inline: auto; display: grid; gap: 22px; }
.xp-show-head .eyebrow { color: var(--amber-2); }
.xp-show-title { margin-top: 12px; font-size: clamp(2.2rem, 5vw, 4.2rem); }
.xp-show-title .serif { color: var(--amber); }

.xp-tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
.xp-tabs::-webkit-scrollbar { display: none; }
.xp-tab {
    flex: 0 0 auto; display: inline-flex; align-items: baseline; gap: .45rem; min-height: 38px; padding: .45rem .9rem; border-radius: 999px;
    font-size: .8rem; color: rgba(255, 245, 230, .62); box-shadow: inset 0 0 0 1px rgba(255, 245, 230, .14);
    transition: background .4s var(--ease), color .4s var(--ease), box-shadow .4s;
}
.xp-tab b { font-size: .68rem; color: var(--amber); font-weight: 600; }
.xp-tab:hover { color: var(--white); box-shadow: inset 0 0 0 1px rgba(255, 245, 230, .35); }
.xp-tab[aria-current="true"] { background: var(--amber); color: var(--night); box-shadow: none; }
.xp-tab[aria-current="true"] b { color: var(--night); }

.xp-track { width: var(--wrap); margin: 40px auto 0; display: grid; gap: 72px; }

.xp-slide { display: grid; gap: 28px; align-items: center; }
@media (min-width: 768px) { .xp-slide { grid-template-columns: 1.12fr 1fr; gap: clamp(28px, 4vw, 64px); } }

/* ---------- product media: depth, warm light, focus ---------- */
.xp-media { position: relative; perspective: 1200px; }
.xp-media-in {
    position: relative; aspect-ratio: 4 / 3; border-radius: 22px; overflow: hidden; background: var(--night-2);
    transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transform-style: preserve-3d;
    transition: transform .7s var(--ease), box-shadow .8s var(--ease);
    box-shadow: 0 30px 80px -40px rgba(0, 0, 0, .9), inset 0 0 0 1px rgba(255, 245, 230, .08);
}
.xp-media.is-hover .xp-media-in { transition: transform .15s linear, box-shadow .8s var(--ease); }
.xp-slide.is-active .xp-media-in { box-shadow: 0 50px 120px -50px rgba(227, 161, 91, .45), 0 30px 80px -40px rgba(0, 0, 0, .9), inset 0 0 0 1px rgba(242, 196, 142, .22); }
.xp-media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
    filter: brightness(.5) saturate(.7);
    transition: filter 1s var(--ease), transform 1.6s var(--ease), clip-path 1.3s var(--ease);
}
.xp-slide.is-active .xp-media video { filter: none; }
.xp-media-in::after { /* warm key light sweeping once when the product comes into focus */
    content: ''; position: absolute; inset: 0; pointer-events: none; mix-blend-mode: screen; opacity: 0;
    background: linear-gradient(110deg, transparent 30%, rgba(242, 196, 142, .32) 48%, transparent 66%);
    transform: translateX(-100%);
}
.xp-slide.is-active .xp-media-in::after { animation: xp-sweep 1.8s var(--ease) .35s; }
@keyframes xp-sweep { 0% { opacity: 1; transform: translateX(-100%); } 100% { opacity: 1; transform: translateX(100%); } }
.xp-spot { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .5s;
    background: radial-gradient(circle at var(--mx, 50%) var(--my, 40%), rgba(255, 214, 168, .3), transparent 42%); mix-blend-mode: soft-light; }
.xp-media.is-hover .xp-spot { opacity: 1; }
.xp-num {
    position: absolute; z-index: 2; left: -6px; bottom: -.32em; pointer-events: none;
    font-family: var(--display); font-weight: 800; font-size: clamp(4rem, 9vw, 8rem); line-height: 1; letter-spacing: -.05em;
    color: transparent; -webkit-text-stroke: 1px rgba(242, 196, 142, .55);
}

/* ---------- material reveals, one per product family ---------- */
.xp-shut { position: absolute; inset: 0; z-index: 1; display: flex; pointer-events: none; }
.xp-shut i { display: none; flex: 1; background: var(--night-2); transition: transform 1.1s var(--ease-io) calc(.1s + var(--k) * 80ms); }

/* palettes — camera pull-back */
.xp-fx--pull video { transform: scale(1.32); }
.xp-fx--pull.is-seen video { transform: none; }

/* cales / recyclées — compressed-wood jaws open */
.xp-fx--compress .xp-shut { flex-direction: column; }
.xp-fx--compress .xp-shut i:nth-child(-n+2) { display: block;
    background: linear-gradient(rgba(13, 11, 9, .5), rgba(13, 11, 9, .5)), var(--tex) center / 40px auto repeat; }
.xp-fx--compress .xp-shut i:nth-child(1) { transform-origin: top; }
.xp-fx--compress .xp-shut i:nth-child(2) { transform-origin: bottom; transition-delay: .1s; }
.xp-fx--compress video { transform: scaleY(1.18); }
.xp-fx--compress.is-seen .xp-shut i { transform: scaleY(0); }
.xp-fx--compress.is-seen video { transform: none; }

/* tourillons — the image arrives piece by piece */
.xp-fx--pieces .xp-shut i { display: block; transform-origin: top; }
.xp-fx--pieces .xp-shut i:nth-child(even) { transform-origin: bottom; }
.xp-fx--pieces.is-seen .xp-shut i { transform: scaleY(0); }

/* manches — horizontal reveal that follows their length */
.xp-fx--sweep .xp-shut i:first-child { display: block; transform-origin: right; transition-duration: 1.4s;
    background: linear-gradient(90deg, var(--night-2) 92%, rgba(242, 196, 142, .55)); }
.xp-fx--sweep video { transform: scaleX(1.12) translateX(-4%); }
.xp-fx--sweep.is-seen .xp-shut i { transform: scaleX(0); }
.xp-fx--sweep.is-seen video { transform: none; }

/* box & caisses — the structure closes in, then opens to the full assembly */
.xp-fx--assemble video { clip-path: inset(24% 28% round 14px); transform: scale(.92); }
.xp-fx--assemble.is-seen video { clip-path: inset(0 round 0); transform: none; }
.xp-fx--assemble .xp-shut { inset: 24% 28%; border: 1px solid rgba(242, 196, 142, .6); border-radius: 14px; transition: inset 1.3s var(--ease), opacity .6s 1s; }
.xp-fx--assemble.is-seen .xp-shut { inset: 0; opacity: 0; }

/* sous-traitance — from raw material to a machined part */
.xp-fx--machined video { filter: blur(12px) grayscale(.8) sepia(.5) brightness(.6); transform: scale(1.06); }
.xp-fx--machined.is-seen video { filter: brightness(.5) saturate(.7); transform: none; transition-duration: 1.6s; }
.xp-fx--machined.is-active video { filter: none; }
.xp-fx--machined .xp-shut i:first-child {
    display: block; position: absolute; left: 0; right: 0; top: 0; height: 2px; flex: none; opacity: 0;
    background: var(--amber-2); box-shadow: 0 0 18px 4px rgba(242, 196, 142, .7);
}
.xp-fx--machined.is-active .xp-shut i:first-child { animation: xp-scan 1.6s var(--ease-io) .2s; }
@keyframes xp-scan { 0% { opacity: 1; top: 0; } 90% { opacity: 1; } 100% { opacity: 0; top: 100%; } }

/* ---------- product info ---------- */
.xp-cat { display: inline-flex; align-items: center; gap: .6rem; font-size: .74rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--amber-2); }
.xp-eco { padding: .15rem .55rem; border-radius: 999px; font-size: .66rem; letter-spacing: .08em; background: rgba(141, 180, 135, .2); color: var(--eco); }
.xp-title { margin-top: 14px; font-size: clamp(2.1rem, 4.2vw, 3.9rem); overflow: hidden; padding-bottom: .08em; }
.xp-title > span { display: inline-block; }
.xp-text { margin-top: 16px; max-width: 32rem; color: rgba(255, 245, 230, .72); }
.xp-feats { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: .9rem; color: rgba(255, 245, 230, .82); }
.xp-feats li { display: flex; align-items: center; gap: .45rem; }
.xp-feats .ico { color: var(--amber); width: 1em; height: 1em; }
.xp-flow { margin-top: 20px; display: grid; gap: 10px; counter-reset: f; }
.xp-flow li { display: grid; grid-template-columns: 28px 1fr; column-gap: 12px; counter-increment: f; font-size: .9rem; color: rgba(255, 245, 230, .7); }
.xp-flow li::before { content: '0' counter(f); grid-row: span 2; font-size: .72rem; font-weight: 700; color: var(--amber); padding-top: 3px; }
.xp-flow b { color: var(--white); font-weight: 600; }
.xp-dims { margin-top: 22px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.xp-dims-label { display: inline-flex; align-items: center; gap: .4rem; margin-right: 4px; font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: rgba(255, 245, 230, .5); }
.xp-dims-label .ico { color: var(--amber); }
.xp-dim {
    min-height: 38px; padding: .4rem .85rem; border-radius: 999px; font-size: .84rem; font-weight: 500; font-variant-numeric: tabular-nums;
    color: var(--white); background: rgba(255, 245, 230, .06); box-shadow: inset 0 0 0 1px rgba(255, 245, 230, .16);
    transition: background .3s, color .3s, transform .4s var(--ease);
}
.xp-dim:hover { background: var(--amber); color: var(--night); transform: translateY(-2px); }
.xp-acts { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 10px; }
.xp-acts .btn--ghost { gap: .55rem; }

/* staged reveal of the copy when a product is reached */
.xp-title > span { transform: translateY(108%); transition: transform 1.1s var(--ease); }
.xp-cat, .xp-text, .xp-feats li, .xp-flow li, .xp-dim, .xp-dims-label, .xp-acts {
    opacity: 0; transform: translateY(16px);
    transition: opacity .8s var(--ease), transform .9s var(--ease), background .3s, color .3s;
}
.xp-slide.is-seen .xp-title > span { transform: none; }
.xp-slide.is-seen :is(.xp-cat, .xp-text, .xp-feats li, .xp-flow li, .xp-dim, .xp-dims-label, .xp-acts) { opacity: 1; transform: none; }
.xp-slide.is-seen .xp-cat { transition-delay: .05s; }
.xp-slide.is-seen .xp-text { transition-delay: .25s; }
.xp-slide.is-seen :is(.xp-feats li, .xp-flow li) { transition-delay: calc(.35s + var(--k) * 70ms); }
.xp-slide.is-seen .xp-dims-label { transition-delay: .45s; }
.xp-slide.is-seen .xp-dim { transition-delay: calc(.5s + var(--k) * 70ms), calc(.5s + var(--k) * 70ms), 0s, 0s; }
.xp-slide.is-seen .xp-dim:hover { transform: translateY(-2px); }
.xp-slide.is-seen .xp-acts { transition-delay: .65s; }

.xp-show-foot { width: var(--wrap); margin: 56px auto 0; display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; font-size: .82rem; color: rgba(255, 245, 230, .55); }
.xp-count b { font-family: var(--display); font-size: 1.4rem; color: var(--white); }
.xp-show-bar { display: none; }
.xp-hint { display: none; }
.xp-out { margin-left: auto; display: inline-flex; align-items: center; gap: .5rem; color: var(--amber-2); font-weight: 600; }
.xp-out:hover { color: var(--white); }
.xp-count { display: none; }

/* ---------- desktop: horizontal cinematic gallery (sticky, scroll-driven) ---------- */
@media (min-width: 1024px) {
    .xp-show-head { grid-template-columns: auto 1fr; align-items: end; gap: 40px; }
    .xp-tabs { justify-content: flex-end; flex-wrap: wrap; -webkit-mask-image: none; mask-image: none; }
}
.xp-h .xp-show-pin {
    position: sticky; top: 0; height: 100vh; overflow: hidden;
    display: grid; grid-template-rows: auto minmax(0, 1fr) auto; padding: 96px 0 26px;
    /* one viewport-wide column: without it the column grows to the whole track width (~9000px)
       and the header, footer and cards are laid out off-centre */
    grid-template-columns: minmax(0, 1fr);
}
.xp-h .xp-track {
    width: auto; min-width: 0; margin: 0; display: flex; gap: 7vw; align-items: center;
    padding-inline: calc((100% - var(--xp-sw)) / 2);   /* % of the pin, not 100vw (which counts the scrollbar) */
    transform: translate3d(var(--x, 0px), 0, 0); will-change: transform;
}
.xp-h .xp-slide {
    flex: 0 0 var(--xp-sw); max-height: 100%;
    transform: perspective(1600px) translateZ(calc(var(--ad, 1) * -140px)) rotateY(calc(var(--d, 1) * -7deg));
    opacity: calc(1 - var(--ad, 1) * .55);
}
/* head, cards and footer share one centred column, so the active card lines up with them */
.xp-h .xp-show-head, body.xp-fixed .xp-h .xp-show-head, .xp-h .xp-show-foot { width: var(--xp-sw); margin-inline: auto; }
/* --xp-avail = height of the gallery row (measured in experience.js): the card always fits, vertically centred */
.xp-h .xp-slide { max-height: var(--xp-avail, 100%); }
.xp-h .xp-media-in { aspect-ratio: auto; height: min(58vh, 46vw, var(--xp-avail, 58vh) - 8px); }
.xp-h .xp-show-foot { margin-top: 0; }
/* keep the footer clear of the fixed mode switch (bottom-left) */
body.xp-fixed .xp-h .xp-show-pin { padding-bottom: 72px; row-gap: 16px; }
body.xp-fixed .xp-h #xpShow.xp-show .xp-show-head { padding: 16px 24px; }  /* #xpShow: beats the shared glass-box rule (its :is() holds IDs) */
body.xp-fixed .xp-h #xpShow.xp-show .xp-show-foot { padding: 10px 22px; }
.xp-h .xp-num { font-size: clamp(3rem, 6vw, 5.6rem); }
/* sous-traitance (the longest card): a bit more room for the copy, steps laid out side by side */
.xp-h .xp-slide:has(.xp-flow) { grid-template-columns: 1fr 1.12fr; }
.xp-h .xp-flow { grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 14px; }
.xp-h .xp-flow li { grid-template-columns: 1fr; align-content: start; row-gap: 4px; font-size: .82rem; line-height: 1.4; }
.xp-h .xp-flow li::before { grid-row: auto; padding-top: 0; }
.xp-h .xp-flow b { font-size: .9rem; }
/* fit: experience.js adds .is-tight when a card is taller than the gallery row, and zooms it down as a last resort */
.xp-h .xp-slide.is-tight .xp-title { font-size: clamp(1.7rem, 2.6vw, 2.4rem); }
.xp-h .xp-slide.is-tight .xp-text { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 10px; }
.xp-h .xp-slide.is-tight :is(.xp-feats, .xp-flow, .xp-dims) { margin-top: 12px; }
.xp-h .xp-slide.is-tight .xp-feats { font-size: .82rem; gap: 6px 14px; }
.xp-h .xp-slide.is-tight .xp-acts { margin-top: 14px; }
/* the film chapter rail would sit on the showroom footer: it steps aside while the gallery is on screen */
body.xp-fixed .xp-rail { transition: opacity .45s var(--ease), transform .55s var(--ease); }
body.xp-fixed .xp-rail.is-away { opacity: 0; transform: translate(-50%, 16px); pointer-events: none; }
.xp-h .xp-count { display: inline; }
.xp-h .xp-show-bar { display: block; flex: 1; max-width: 360px; height: 2px; background: rgba(255, 245, 230, .14); border-radius: 2px; overflow: hidden; }
.xp-h .xp-show-bar i { display: block; height: 100%; background: var(--amber); transform-origin: left; transform: scaleX(var(--sp, 0)); }
.xp-h .xp-hint { display: inline; }
/* laptop screens: tighter copy so the whole card (media + text + buttons) fits between header and footer */
@media (max-height: 860px) {
    .xp-h .xp-show-pin { padding-top: 88px; }
    .xp-h .xp-show-title { font-size: clamp(2rem, 3.4vw, 2.8rem); }
    .xp-h .xp-title { font-size: clamp(1.9rem, 3.2vw, 3rem); margin-top: 10px; }
    .xp-h .xp-text { margin-top: 12px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
    .xp-h :is(.xp-feats, .xp-flow, .xp-dims) { margin-top: 14px; }
    .xp-h .xp-acts { margin-top: 18px; }
    .xp-h .xp-dim { min-height: 32px; padding: .3rem .72rem; font-size: .8rem; }
    .xp-h .xp-tab { min-height: 34px; padding: .35rem .8rem; }
    body.xp-fixed .xp-h #xpShow.xp-show .xp-info { padding: 22px 24px; }
}
@media (max-height: 760px) {
    .xp-h .xp-text { -webkit-line-clamp: 2; }
    .xp-h .xp-show-title { font-size: 2.2rem; }
    .xp-h .xp-flow span { display: none; }
}

/* ==========================================================================
   MODE SWITCH (fixed, bottom-left) + entry points
   ========================================================================== */
.mode-sw {
    position: fixed; z-index: 49; left: 12px; bottom: 12px;
    display: flex; padding: 4px; border-radius: 999px;
    background: rgba(18, 15, 12, .78); -webkit-backdrop-filter: blur(14px) saturate(1.3); backdrop-filter: blur(14px) saturate(1.3);
    box-shadow: inset 0 0 0 1px rgba(255, 245, 230, .14), 0 18px 40px -20px rgba(0, 0, 0, .8);
    transition: opacity .4s, transform .5s var(--ease);
}
.mode-sw button {
    display: inline-flex; align-items: center; gap: .4rem; min-height: 36px; padding: 0 .85rem; border-radius: 999px;
    font-size: .76rem; font-weight: 600; color: rgba(255, 245, 230, .7); transition: background .35s var(--ease), color .35s var(--ease);
}
.mode-sw button:hover { color: var(--white); }
.mode-sw button[aria-pressed="true"] { background: var(--amber); color: var(--night); }
.mode-sw .ico { width: 1em; height: 1em; }
.menu-open .mode-sw { opacity: 0; pointer-events: none; }
@media (min-width: 768px) { .mode-sw { left: 20px; bottom: 20px; } .mode-sw button { padding: 0 1rem; font-size: .8rem; } }

.hero-xp { gap: .55rem; }
.menu-xp { display: flex; align-items: center; gap: .6rem; margin-top: .4rem; color: var(--amber-2); font-weight: 600; text-align: left; }

/* ==========================================================================
   LITE — reduced motion / data saver: no scrubbing, plain readable layout
   ========================================================================== */
.xp-lite .xp-film { height: auto !important; }
.xp-lite .xp-stage { position: relative; height: auto; overflow: visible; padding: 110px 0 40px; }
.xp-lite .xp-screen { position: relative; width: var(--wrap); margin: 28px auto 0; aspect-ratio: 16 / 9; max-height: 78vh; border-radius: 20px; transform: none; }
.xp-lite .xp-shade, .xp-lite .xp-light, .xp-lite .xp-bars, .xp-lite .xp-wipe, .xp-lite .xp-outro,
.xp-lite .xp-rail, .xp-lite .xp-skip, .xp-lite .xp-cue, .xp-lite .xp-intro p { display: none; }
.xp-lite .xp-intro { position: static; opacity: 1; transform: none; }
.xp-lite .xp-caps { position: static; margin-top: 36px; display: grid; gap: 22px; }
.xp-lite .xp-cap { position: static; max-width: none; transform: none; }
.xp-lite .xp-cap-t { font-size: clamp(1.5rem, 3.4vw, 2.4rem); }
.xp-lite .xp-note { position: static; transform: none; margin: 16px auto 0; display: block; }
.xp-lite .xp-show-pin { position: static; height: auto; }

@media (prefers-reduced-motion: reduce) {
    .xp *, .xp *::before, .xp *::after { transition-duration: .01ms !important; animation: none !important; }
    .xp-w > span, .xp-title > span { transform: none; }
    /* captions still follow the film, without movement: a plain cross-fade */
    .xp-cap { opacity: 0; }
    .xp-cap.on, .xp-lite .xp-cap { opacity: 1; }
}

/* rail: always on top while the film runs under the page, in a small glass pill */
body.xp-fixed .xp-rail {
    position: fixed; z-index: 45; padding: 8px 14px 4px; border-radius: 16px;
    background: rgba(13, 11, 9, .55); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    box-shadow: inset 0 0 0 1px rgba(255, 245, 230, .1);
}
@media (min-width: 768px) { body.xp-fixed .xp-rail { width: min(620px, calc(100% - 320px)); } }
/* the showroom lets the film glow through */
body.xp-fixed .xp-show {
    background:
        radial-gradient(70% 55% at 50% 58%, rgba(227, 161, 91, .12), transparent 70%),
        linear-gradient(180deg, rgba(13, 11, 9, .25) 0, rgba(13, 11, 9, .45) 22vh, rgba(13, 11, 9, .45) calc(100% - 22vh), rgba(13, 11, 9, .25) 100%);
}
