/*
Theme Name: Avada Child
Description: Child theme for Avada
Author: aecync
Template: Avada
Version: 1.1.0
*/

/* =============================================================
   AECYNC — interactive demo
   1 tokens · 2 shell · 3 scene system · 4 type · 5 components
   6 navigation · 7 doc scene · 8 intro · 9 responsive

   Perf pass — visual output unchanged. [OPT] = why. [OPT-TEST] = the
   two blocks with behavioural risk; delete either on its own.
   ============================================================= */

/* ---------- 1. TOKENS ---------- */

:root {
  /* page padding — fixed and identical on every scene */
  --pad-x: 70px;
  --pad-top: 180px;
  --pad-bottom: 40px;
  --rail: 90px;   /* right gutter reserved for the progress rail */
  --rail-m: 74px; /* bottom gutter for the rail on mobile */

  /* rhythm — every gap and margin comes from this scale */
  --gap-2xs: 6px;
  --gap-xs: 10px;
  --gap-s: 16px;
  --gap-m: 24px;
  --gap-l: 40px;
  --gap-xl: 64px;

  --r-s: 10px;
  --r-m: 14px;
  --r-l: 18px;
  --r-pill: 999px;

  --c-bg: #0a0a0a;
  --c-text: #fff;
  --c-muted: rgba(255, 255, 255, .72);
  --c-soft: rgba(255, 255, 255, .45);
  --c-faint: rgba(255, 255, 255, .28);
  --c-gold: #d6ad78;
  --c-line: rgba(255, 255, 255, .11);
  --c-line-strong: rgba(255, 255, 255, .2);
  --c-fill: rgba(255, 255, 255, .08);
  --c-gold-fill: rgba(214, 173, 120, .1);
  --c-gold-line: rgba(214, 173, 120, .45);

  --surface-bg: linear-gradient(145deg, rgba(255, 255, 255, .055), rgba(255, 255, 255, .018));
  --shadow-card: 0 18px 40px rgba(0, 0, 0, .28);
  --shadow-lift: 0 22px 50px rgba(0, 0, 0, .34);

  --font-display: "Cal Sans", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;

  --fs-eyebrow: 9px;
  --fs-micro: 10px;
  --fs-small: 11px;
  --fs-body: 13px;
  --fs-h3: 15px;
  --fs-h2: clamp(36px, 1.6vw, 54px);
  --fs-h1: clamp(42px, 5.2vw, 86px);

  --lh-body: 1.5;
  --track-body: .06em;
  --track-wide: .08em;
  --track-eyebrow: .2em;
  --copy: 72ch;

  --dur-scene: .7s;
  --ease: cubic-bezier(.22, .61, .36, 1);
  --t: .3s var(--ease); /* shared transition timing */
}

/* ---------- 2. SHELL ---------- */

html,
body {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--c-bg);
}

#experience-overlay,
#experience-overlay *,
#experience-overlay *::before,
#experience-overlay *::after { box-sizing: border-box; }

#experience-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  color: var(--c-text);
  font-family: var(--font-body);
  pointer-events: none;
  touch-action: none;
}

#experience-overlay img { display: block; max-width: 100%; }

#experience-overlay :focus-visible { outline: 1px solid var(--c-gold); outline-offset: 3px; }

/* Every scrollable region in a scene shares one scrollbar look. */
[data-inner-scroll],
[data-h-scroll] {
  scrollbar-width: thin;
  scrollbar-color: var(--c-line-strong) transparent;
}

[data-inner-scroll]::-webkit-scrollbar,
[data-h-scroll]::-webkit-scrollbar { width: 6px; height: 6px; }

[data-inner-scroll]::-webkit-scrollbar-thumb,
[data-h-scroll]::-webkit-scrollbar-thumb { border-radius: var(--r-pill); background: var(--c-line-strong); }

[data-inner-scroll]::-webkit-scrollbar-track,
[data-h-scroll]::-webkit-scrollbar-track { background: transparent; }

[data-inner-scroll] { overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; }

[data-h-scroll] {
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  touch-action: pan-x;
  scroll-behavior: smooth;
}

/* ---------- 3. SCENE SYSTEM ----------
   One grid drives every scene; content is placed with .slot--*
   modifiers, never per-scene positioning. Rows are minmax(0,1fr)
   and slots are min-height:0, so a scene cannot exceed the viewport. */

.scene-panel {
  position: absolute;
  inset: 0;
  padding: var(--pad-top) calc(var(--pad-x) + var(--rail)) var(--pad-bottom) calc(var(--pad-x) + var(--rail)/2);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: var(--gap-l);
  opacity: 0;
  visibility: hidden;
  transform: translate3d(0, 100%, 0);
  contain: layout paint style;
  transition:
    transform var(--dur-scene) var(--ease),
    opacity var(--dur-scene) var(--ease),
    visibility 0s linear var(--dur-scene);
}

/* [OPT-TEST] Skips layout/raster for the 12 off-screen scenes.
   If transitions ever snap instead of slide, delete this block. */
.scene-panel:not(.active):not(.exit-up):not(.exit-down):not(.enter-from-top):not(.enter-from-bottom) {
  content-visibility: hidden;
}

.scene-panel.active {
  opacity: 1;
  visibility: visible;
  transform: translate3d(0, 0, 0);
  will-change: transform, opacity;
  transition:
    transform var(--dur-scene) var(--ease),
    opacity var(--dur-scene) var(--ease),
    visibility 0s linear 0s;
}

.scene-panel.exit-up,
.scene-panel.enter-from-top { transform: translate3d(0, -100%, 0); }

.scene-panel.exit-down,
.scene-panel.enter-from-bottom { transform: translate3d(0, 100%, 0); }

.scene-panel.exit-up,
.scene-panel.exit-down {
  opacity: 0;
  visibility: hidden;
  will-change: transform, opacity; /* [OPT] outgoing panel was repainting, not compositing */
}

.slot {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--gap-m);
  pointer-events: auto;
}

.slot--tl { grid-area: 1 / 1; width: fit-content !important; }
.slot--bl { grid-area: 2 / 1; justify-content: flex-end; }
.slot--br { grid-area: 2 / 2; justify-content: flex-end; align-items: flex-end; }
.slot--left { grid-area: 1 / 1 / 3 / 2; justify-content: space-between; width: fit-content; }
.slot--full { grid-area: 1 / 1 / 3 / 3; }
.slot--end { justify-content: flex-end; gap: var(--gap-xl); }

.slot > * { flex: 0 0 auto; }
.slot > .is-flexible { flex: 0 1 auto; min-height: 0; }

/* ---------- 4. TYPE ---------- */

.eyebrow {
  display: block;
  font: 400 var(--fs-eyebrow)/1 var(--font-body);
  letter-spacing: var(--track-eyebrow);
  text-transform: uppercase;
}

.eyebrow--gold { font-size: var(--fs-micro); font-weight: 600; letter-spacing: .16em; color: var(--c-gold); }

.title { margin: 0; font: 500 var(--fs-h1)/1 var(--font-display); width: fit-content; }

.title--s { margin: 0; font: 500 var(--fs-h2)/1 var(--font-display); }

.heading { margin: 0; font: 500 var(--fs-h2)/1.2 var(--font-body); color: rgba(255, 255, 255, .96); }

.body {
  margin: 0;
  max-width: var(--copy);
  font: 400 var(--fs-body)/var(--lh-body) var(--font-body);
  letter-spacing: var(--track-body);
  color: var(--c-muted);
}

.body strong { color: var(--c-text); font-weight: 500; }

.micro {
  margin: 0;
  width: 100%;
  font: 400 var(--fs-micro)/1.55 var(--font-body);
  color: var(--c-soft);
}

.stack { display: flex; flex-direction: column; gap: var(--stack, var(--gap-s)); }
.stack--s { --stack: var(--gap-xs); }
.stack--m { --stack: var(--gap-m); }

/* ---------- 5. COMPONENTS ---------- */

/* 5.1 underline link */
.link {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding-bottom: 6px;
  font: 400 var(--fs-small)/1 var(--font-body);
  letter-spacing: var(--track-wide);
  color: var(--c-text);
  text-decoration: none;
}

.link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 28px;
  height: 1px;
  background: rgba(255, 255, 255, .65);
  transition: width var(--t);
}

.link:hover::after { width: 100%; }

/* 5.2 controls — one base for the three pressable shapes */
.btn,
.chip,
.choice {
  appearance: none;
  border: 1px solid var(--c-line);
  border-radius: var(--r-pill);
  font-family: var(--font-body);
  color: var(--c-text);
  text-decoration: none;
  cursor: pointer;
  transition: color var(--t), background var(--t), border-color var(--t), transform var(--t);
}

.btn {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  gap: var(--gap-xs);
  width: fit-content;
  padding: 10px 18px;
  border-color: var(--c-gold-line);
  background: rgba(255, 255, 255, .03);
  font-size: var(--fs-small);
  line-height: 1;
  letter-spacing: var(--track-wide);
}

.btn:hover { background: var(--c-gold-fill); }

/* sheen sweep */
.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, .18) 50%, transparent 70%);
  transform: translate3d(-140%, 0, 0);
  transition: transform .8s var(--ease);
}

.btn:hover::before { transform: translate3d(140%, 0, 0); }

.btn__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: 1px solid var(--c-gold-line);
  border-radius: 50%;
  font-size: var(--fs-small);
  font-weight: 700;
  transition: transform var(--t);
}

.btn:hover .btn__icon { transform: rotate(12deg) scale(1.08); }

.actions { display: flex; align-items: center; gap: var(--gap-l); margin-top: var(--gap-xs); }

/* 5.3 chips */
.chips {
  display: flex;
  align-items: center;
  gap: var(--gap-2xs);
  padding: 0 0 12px;
  margin: 0 0 var(--gap-2xs);
  border: 0;
  border-bottom: 1px solid var(--c-line);
}

.chips--plain { padding: 0; margin: 0; border-bottom: 0; flex-wrap: wrap; }

.chip {
  flex: 0 0 auto;
  padding: 9px 16px;
  background: rgba(255, 255, 255, .015);
  font: 500 var(--fs-eyebrow)/1 var(--font-body);
  letter-spacing: .1em;
  text-transform: uppercase;
  white-space: nowrap;
  color: rgba(255, 255, 255, .68);
}

.chip:hover { color: var(--c-text); border-color: var(--c-gold-line); background: var(--c-gold-fill); }
.chip.is-active { color: #18130e; border-color: var(--c-gold); background: var(--c-gold); }

/* 5.4 surface — the one glass panel, used by every card */
.surface {
  padding: var(--gap-s);
  border: 1px solid var(--c-line);
  border-radius: var(--r-l);
  background: var(--surface-bg);
  box-shadow: var(--shadow-card), inset 0 1px 0 rgba(255, 255, 255, .035);
}

.surface--roomy { padding: var(--gap-m); }

/* 5.5 hero image tiles */
.card-row { display: flex; gap: var(--gap-xs); }

.tile {
  position: relative;
  overflow: hidden;
  width: 180px;
  aspect-ratio: 1.12 / 1;
  border-radius: var(--r-m);
  background: var(--c-fill);
  color: var(--c-text);
  text-decoration: none;
  transition: transform var(--t), box-shadow var(--t);
}

.tile img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .6s var(--ease);
}

.tile::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(0, 0, 0, .1), rgba(0, 0, 0, .55));
}

.tile__content {
  position: absolute;
  left: 20px;
  top: 20px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: var(--gap-s);
}

.tile__content > span { max-width: 110px; font-size: var(--fs-h3); line-height: 1.05; }

.tile:hover { transform: translate3d(0, -8px, 0); box-shadow: var(--shadow-lift); }
.tile:hover img { transform: scale(1.06); }

/* 5.6 video card + lightbox */
.video-card { width: 340px; cursor: pointer; pointer-events: auto; }

.video-thumb {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--r-m);
  background: var(--c-fill);
  transition: transform var(--t), box-shadow var(--t);
}

.video-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: .35;
  transition: opacity var(--t);
}

.video-play {
  position: absolute;
  left: 50%;
  top: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .22);
  transform: translate(-50%, -50%);
  transition: transform var(--t), background var(--t);
}

.video-play::before {
  content: "";
  margin-left: 3px;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-left: 12px solid #fff;
}

.video-card:hover .video-thumb { transform: scale(1.03); box-shadow: var(--shadow-lift); }
.video-card:hover .video-thumb img { opacity: .65; }
.video-card:hover .video-play { transform: translate(-50%, -50%) scale(1.08); background: rgba(255, 255, 255, .32); }

.video-lightbox {
  position: fixed;
  inset: 0;
  z-index: 99998;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, .82);
  pointer-events: auto;
}

.video-lightbox.is-open { display: flex; }
.video-lightbox video { width: min(82vw, 1100px); max-height: 82vh; border-radius: var(--r-l); background: #000; }

.video-close {
  position: absolute;
  right: 32px;
  top: 24px;
  border: 0;
  background: transparent;
  color: var(--c-text);
  font-size: 42px;
  line-height: 1;
  cursor: pointer;
}

/* 5.7 configurator shell —
   header and footer stay put, the scrolling region absorbs the rest.
   Same rule for both configurators, so they behave identically. */
.configurator { display: flex; flex-direction: column; gap: var(--gap-s); min-height: 0; }

.configurator > * { flex: 0 0 auto; }
.configurator > [data-inner-scroll] { flex: 1 1 auto; min-height: 0; }

.configurator__body { display: flex; flex-direction: column; gap: var(--gap-s); padding-right: 4px; }

.configurator__note {
  display: flex;
  align-items: center;
  gap: var(--gap-2xs);
  padding-top: var(--gap-xs);
  border-top: 1px solid var(--c-line);
  font: 400 var(--fs-micro)/1 var(--font-body);
  letter-spacing: .025em;
  color: rgba(214, 173, 120, .78);
}

/* 5.8 capsules */
.capsule-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-content: start;
  gap: var(--gap-2xs);
  padding-right: 4px;
  contain: layout style; /* [OPT] keeps filter reflow inside the grid */
}

.capsule {
  appearance: none;
  position: relative;
  overflow: hidden;
  min-width: 0;
  min-height: 148px;
  aspect-ratio: .9;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  padding: var(--gap-xs);
  border: 1px solid transparent;
  border-radius: var(--r-s);
  background: rgba(255, 255, 255, .035);
  color: var(--c-text);
  text-align: left;
  cursor: pointer;
  contain: layout style; /* [OPT] hover invalidation stops here */
  transition: transform var(--t), background var(--t), border-color var(--t), box-shadow var(--t);
}

.capsule:hover {
  border-color: rgba(214, 173, 120, .28);
  background: rgba(255, 255, 255, .075);
  box-shadow: var(--shadow-card);
}

.capsule.is-selected { border-color: var(--c-gold); background: var(--c-gold-fill); }
.capsule.is-hidden { display: none; }

.capsule__image {
  position: absolute;
  z-index: 0;
  inset: 8px 8px 30px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  pointer-events: none;
}

/* Static shadow only — animating `filter` across 20 images is what
   was dropping frames, so hover moves the layer instead. */
.capsule__image img {
  width: 84%;
  max-width: 110px;
  height: auto;
  object-fit: contain;
  object-position: center top;
  filter: drop-shadow(0 10px 8px rgba(0, 0, 0, .38));
  transform: translate3d(0, 0, 0);
  transition: transform var(--t);
}

.capsule:hover .capsule__image img { transform: translate3d(0, -4px, 0) scale(1.06); }

.capsule__name,
.capsule__meta,
.capsule__intensity { position: relative; z-index: 1; }

.capsule__name,
.capsule__meta {
  display: block;
  width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.capsule__name { margin-bottom: 3px; font: 500 var(--fs-small)/1.15 var(--font-body); color: rgba(255, 255, 255, .94); }
.capsule__meta { font: 400 var(--fs-eyebrow)/1 var(--font-body); color: rgba(255, 255, 255, .42); }

.capsule__intensity {
  --pct: calc((var(--intensity) / 12) * 100%);
  display: block;
  width: 52px;
  height: 4px;
  margin-top: 7px;
  border-radius: var(--r-pill);
  background: linear-gradient(to right, rgba(214, 173, 120, .92) var(--pct), rgba(255, 255, 255, .13) var(--pct));
}

/* 5.9 hero capsule picker */
.picker { display: flex; gap: var(--gap-s); }

.pick {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--gap-xs);
  width: 140px;
  padding: var(--gap-s);
  border: 0;
  background: none;
  color: var(--c-text);
  cursor: pointer;
}

.pick::before {
  content: "";
  position: absolute;
  top: 6px;
  left: 50%;
  width: 104px;
  height: 104px;
  border: 1px solid rgba(214, 173, 120, .65);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(214, 173, 120, .22) 0%, rgba(214, 173, 120, .08) 45%, transparent 72%);
  opacity: .75;
  transform: translate3d(-50%, 0, 0) scale(.85);
  transition: opacity var(--t), transform var(--t);
  pointer-events: none;
}

.pick:hover::before,
.pick.is-active::before { opacity: 1; transform: translate3d(-50%, 0, 0) scale(1); }

.pick img {
  position: relative;
  z-index: 2;
  width: 100px;
  height: 100px;
  object-fit: contain;
  transition: transform var(--t);
}

.pick:hover img,
.pick.is-active img { transform: translate3d(0, -3px, 0) scale(1.04); }

.pick__info { position: relative; z-index: 2; text-align: center; }
.pick__title { display: block; margin-bottom: 4px; font: 600 var(--fs-h3)/1 var(--font-body); }
.pick__desc { font: 400 var(--fs-micro)/1.4 var(--font-body); color: rgba(255, 255, 255, .65); }

/* 5.10 product configurator */
.product__header,
.product__label { display: flex; align-items: center; justify-content: space-between; gap: var(--gap-s); }

.product__price { display: flex; align-items: center; gap: var(--gap-xs); margin-top: var(--gap-xs); }
.product__price strong { font-size: 28px; line-height: 1; }

.product__price del,
.product__label small { font-size: var(--fs-small); color: var(--c-soft); }

.badge {
  padding: 6px 9px;
  border-radius: var(--r-pill);
  background: var(--c-gold-fill);
  font: 400 var(--fs-eyebrow)/1 var(--font-body);
  letter-spacing: var(--track-wide);
  text-transform: uppercase;
  color: var(--c-gold);
}

.product__section { padding-top: var(--gap-s); border-top: 1px solid var(--c-line); }

.product__label {
  margin-bottom: var(--gap-xs);
  font: 400 var(--fs-micro)/1 var(--font-body);
  letter-spacing: var(--track-body);
  color: rgba(255, 255, 255, .82);
}

.choice-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap-2xs); }

.choice {
  display: flex;
  flex-direction: column;
  gap: var(--gap-2xs);
  padding: var(--gap-xs);
  border-radius: var(--r-s);
  background: rgba(255, 255, 255, .025);
  font: 400 var(--fs-eyebrow)/1.1 var(--font-body);
  text-align: left;
  color: rgba(255, 255, 255, .62);
}

.choice:hover,
.choice.is-active { border-color: var(--c-gold); background: rgba(214, 173, 120, .09); color: var(--c-text); }

.choice img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  border-radius: 8px;
  background: rgba(255, 255, 255, .045);
  transition: transform var(--t);
}

.choice:hover img,
.choice.is-active img { transform: scale(1.04); }

/* 5.11 coffee info card */
.info-card { width: 100%; display: flex; flex-direction: column; gap: var(--gap-xs); }

.info-card__meta {
  display: flex;
  gap: var(--gap-s);
  font-size: var(--fs-micro);
  letter-spacing: var(--track-wide);
  text-transform: uppercase;
  color: var(--c-gold);
}

/* ---------- 6. NAVIGATION ---------- */

.rail {
  position: absolute;
  right: var(--pad-x);
  top: 50%;
  z-index: 30;
  height: 320px;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translate3d(0, -50%, 0);
  transition: opacity .4s var(--ease), visibility .4s var(--ease);
}

.rail.is-visible { opacity: 1; visibility: visible; }

.rail__track {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--gap-m);
  transition: transform .6s var(--ease);
}

/* [OPT] was permanent; now only while the rail is on screen */
.rail.is-visible .rail__track { will-change: transform; }

.rail__step {
  position: relative;
  display: grid;
  grid-template-columns: 12px 42px;
  column-gap: 28px;
  align-items: center;
  min-height: 14px;
  font: 600 var(--fs-body)/1 var(--font-body);
  letter-spacing: .04em;
  color: rgba(255, 255, 255, .26);
  opacity: .32;
  transition: opacity var(--t), color var(--t);
}

.rail__step::after {
  content: "";
  position: absolute;
  left: 5.5px;
  top: 17px;
  width: 1px;
  height: 14px;
  background: rgba(255, 255, 255, .12);
  transform: translateX(-50%);
}

.rail__step:last-child::after { display: none; }

.rail__dot {
  position: relative;
  z-index: 2;
  justify-self: center;
  width: 8px;
  height: 8px;
  border: 1px solid var(--c-faint);
  border-radius: 50%;
  background: var(--c-faint);
  transition: width var(--t), height var(--t), background var(--t), border-color var(--t), box-shadow var(--t);
}

.rail__step span {
  opacity: .65;
  transform-origin: left center;
  transition: opacity var(--t), transform var(--t);
}

.rail__step.is-near { opacity: .55; }
.rail__step.is-far { opacity: .2; }
.rail__step.is-active { opacity: 1; color: rgba(255, 255, 255, .96); }
.rail__step.is-active span { opacity: 1; transform: scale(1.3); }

.rail__step.is-active .rail__dot {
  width: 10px;
  height: 10px;
  background: #fff;
  border-color: #fff;
  box-shadow: 0 0 14px rgba(255, 255, 255, .55);
}

.rail__track.is-changing .rail__step { opacity: .18; }

.rail__track.is-changing .rail__step.is-active,
.rail__track.is-changing .rail__step.is-active span,
.rail__track.is-changing .rail__step.is-active .rail__dot { opacity: 1; }

.scroll-hint {
  position: absolute;
  left: 50%;
  bottom: var(--pad-bottom);
  z-index: 35;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--gap-xs);
  font-size: var(--fs-body);
  color: rgba(255, 255, 255, .82);
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate3d(-50%, 0, 0);
  transition: opacity .45s var(--ease), visibility .45s var(--ease);
}

.scroll-hint.is-visible { opacity: 1; visibility: visible; }

/* [OPT] two infinite animations were ticking even while hidden */
.scroll-hint:not(.is-visible) .scroll-hint__mouse span,
.scroll-hint:not(.is-visible) .scroll-hint__arrow { animation-play-state: paused; }

.scroll-hint__mouse {
  position: relative;
  width: 22px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, .85);
  border-radius: var(--r-pill);
}

.scroll-hint__mouse span {
  position: absolute;
  left: 50%;
  top: 7px;
  width: 2px;
  height: 7px;
  border-radius: var(--r-pill);
  background: #fff;
  transform: translateX(-50%);
  animation: mouse-wheel 1.45s ease-in-out infinite;
}

.scroll-hint__arrow {
  width: 11px;
  height: 11px;
  border-right: 2px solid rgba(255, 255, 255, .85);
  border-bottom: 2px solid rgba(255, 255, 255, .85);
  transform: rotate(45deg);
  animation: arrow-bounce 1.45s ease-in-out infinite;
}

@keyframes mouse-wheel {
  0% { opacity: 0; transform: translateX(-50%) translateY(0); }
  35% { opacity: 1; }
  100% { opacity: 0; transform: translateX(-50%) translateY(12px); }
}

@keyframes arrow-bounce {
  0%, 100% { opacity: .35; transform: rotate(45deg) translate(0, 0); }
  50% { opacity: 1; transform: rotate(45deg) translate(4px, 4px); }
}

/* ---------- 7. SCENE 12 — document scroller ----------
   The only scene taller than the viewport. The panel never scrolls;
   .doc__scroll does, and the wheel/touch handler defers to it. */

.scene--doc { --pad-top: 110px; }

.doc { position: relative; overflow: hidden; min-height: 0; }

.doc__scroll {
  flex: 1 1 auto;
  min-height: 0;
  padding-right: var(--gap-s);
  padding-bottom: var(--gap-l);
  contain: layout style; /* [OPT] tallest subtree — keep its work local */
}

.doc-layout {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, .7fr);
  gap: clamp(32px, 5vw, 90px);
}

.doc-main { min-width: 0; display: flex; flex-direction: column; gap: clamp(42px, 6vw, 80px); }
.doc-header { max-width: 820px; }
.doc-section { max-width: 900px; }

.doc-header .body,
.doc-section .body { max-width: 76ch; }

.doc-side { min-width: 0; display: flex; flex-direction: column; gap: var(--gap-s); }

.tag-row { display: flex; flex-wrap: wrap; gap: var(--gap-2xs); }

.tag-row span,
.tag-row button {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 8px 13px;
  border: 1px solid var(--c-line);
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, .035);
  font: 400 var(--fs-small)/1 var(--font-body);
  color: rgba(255, 255, 255, .68);
}

.tag-row button {
  appearance: none;
  cursor: pointer;
  transition: color var(--t), background var(--t), border-color var(--t), transform var(--t);
}

.tag-row button:hover {
  color: var(--c-text);
  border-color: var(--c-gold-line);
  background: var(--c-gold-fill);
  transform: translateY(-1px);
}

.tag-row button.is-active {
  color: #18130e;
  border-color: var(--c-gold);
  background: var(--c-gold);
}

.contact {
  display: grid;
  grid-template-columns: minmax(0, .8fr) minmax(320px, 1fr);
  gap: clamp(28px, 5vw, 70px);
  padding-top: clamp(30px, 4vw, 55px);
  border-top: 1px solid var(--c-line);
}

.contact > * { min-width: 0; }

.form-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  padding: var(--gap-m);
  border: 1px dashed var(--c-line-strong);
  border-radius: var(--r-m);
  background: rgba(255, 255, 255, .025);
  font-size: var(--fs-body);
  text-align: center;
  color: var(--c-soft);
}

.doc-links { display: flex; flex-wrap: wrap; gap: var(--gap-2xs) var(--gap-s); padding: var(--gap-2xs) 4px; }

.doc-links a {
  position: relative;
  font: 400 var(--fs-micro)/1.3 var(--font-body);
  color: rgba(255, 255, 255, .58);
  text-decoration: none;
  transition: color var(--t);
}

.doc-links a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: -3px;
  height: 1px;
  background: var(--c-gold);
  transition: right var(--t);
}

.doc-links a:hover { color: var(--c-text); }
.doc-links a:hover::after { right: 0; }

.doc-footer {
  width: 100%;
  max-width: 1440px;
  margin: var(--gap-l) auto 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap-s);
  padding: 22px 0;
  border-top: 1px solid var(--c-line);
  font: 400 var(--fs-micro)/1.4 var(--font-body);
  color: rgba(255, 255, 255, .38);
}

.doc-footer strong { color: var(--c-muted); font-weight: 500; }

/* ---------- 8. INTRO ----------
   Opacity + translate only. The original also animated filter: blur(),
   which forces a full repaint every frame. */

body.site-intro-playing [data-anim] { opacity: 0; transform: translate3d(0, 26px, 0); }

body.site-intro-playing .scene-panel.active [data-anim] {
  animation: rise-in .9s var(--ease) both;
  animation-delay: calc(.15s + (var(--i, 0) * .18s));
}

body.site-intro-playing .scroll-hint.is-visible { animation: rise-in-hint .9s var(--ease) 1.15s both; }

@keyframes rise-in {
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}

@keyframes rise-in-hint {
  from { opacity: 0; transform: translate3d(-50%, 26px, 0); }
  to { opacity: 1; transform: translate3d(-50%, 0, 0); }
}

/*
.unity-loader { transition: opacity .7s var(--ease), visibility .7s var(--ease); }
.unity-loader.is-leaving { opacity: 0; visibility: hidden; }
*/

.unity-loader {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  background: var(--loader-bg);

  opacity: 1;
  visibility: visible;
  will-change: opacity;

  transition:
    opacity .7s cubic-bezier(.22, .61, .36, 1),
    visibility .7s cubic-bezier(.22, .61, .36, 1);
}

.unity-loader.is-leaving {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* ---------- 9. RESPONSIVE ---------- */

/* short desktop screens: tighten the frame, keep the layout */
@media (min-width: 769px) and (max-height: 860px) {
  :root {
    --pad-top: 112px;
    --pad-bottom: 62px;
    --fs-h1: clamp(38px, 4.4vw, 64px);
    --gap-xl: 40px;
  }
}

@media (max-width: 768px) {
  :root {
    --pad-x: 24px;
    --pad-top: 80px;
    --pad-bottom: 54px;
    --rail: 0px;
    --fs-h1: clamp(30px, 9vw, 40px);
    --fs-body: 12px;
    --gap-xl: 36px;
  }

  /* one column, top-to-bottom flow */
  .scene-panel {
    padding: var(--pad-top) var(--pad-x) calc(var(--pad-bottom) + var(--rail-m));
    display: flex;
    flex-direction: column;
    gap: var(--gap-m);
  }

  .slot--bl,
  .slot--br,
  .slot--end { margin-top: auto; }

  .slot--br { align-items: flex-end; }

  .scene--doc { --pad-top: 72px; }

  .video-card,
  .video-lightbox { display: none !important; }

  .card-row { flex-direction: column; align-items: flex-end; }
  .tile { width: 104px; aspect-ratio: 1; }
  .tile__content { left: 10px; top: 10px; gap: var(--gap-xs); }

  /* filters and capsules become horizontal rails */
  .chips { flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; }
  .chip { padding: 8px 13px; font-size: 8px; }

  /* the rail scrolls sideways, so it must not absorb height */
  .configurator > .capsule-grid { flex: 0 0 auto; }

  .capsule-grid {
    grid-template-columns: none;
    grid-template-rows: 1fr;
    grid-auto-flow: column;
    grid-auto-columns: clamp(105px, 31vw, 135px);
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0 0 var(--gap-xs);
    scroll-snap-type: x proximity;
  }

  .capsule { width: 100%; min-height: 0; aspect-ratio: 1.2; scroll-snap-align: start; }

  /* [OPT-TEST] This mask buffers the whole scroller offscreen and
     re-rasterises it every scroll frame — the most expensive thing on
     mobile. Kept because deleting it removes the soft edges. If the
     capsule rail still stutters, comment it out. */
  .chips,
  .capsule-grid {
    -webkit-mask-image: linear-gradient(to right, transparent 0, #000 12px, #000 calc(100% - 24px), transparent 100%);
    mask-image: linear-gradient(to right, transparent 0, #000 12px, #000 calc(100% - 24px), transparent 100%);
  }

  .picker { flex-wrap: wrap; gap: var(--gap-xs); }
  .pick { width: 96px; padding: var(--gap-xs); }
  .pick::before { width: 72px; height: 72px; }
  .pick img { width: 68px; height: 68px; }

  .choice-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .doc-layout,
  .contact { grid-template-columns: 1fr; }

  .doc-footer { flex-direction: column; align-items: flex-start; gap: var(--gap-2xs); }

  /* rail moves to the bottom edge */
  .rail {
    left: 50%;
    right: auto;
    top: auto;
    bottom: 24px;
    height: 54px;
    transform: translate3d(-50%, 0, 0);
  }

  .rail__track { flex-direction: row; align-items: center; }

  .rail__step {
    grid-template-columns: none;
    grid-template-rows: 12px 22px;
    row-gap: 8px;
    justify-items: center;
    min-width: 34px;
    min-height: auto;
  }

  .rail__step::after { display: none; }
  .rail__step span { transform-origin: center center; }

  .rail__dot::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 100%;
    width: 24px;
    height: 1px;
    margin-left: 8px;
    background: rgba(255, 255, 255, .12);
    transform: translateY(-50%);
  }

  .rail__step:last-child .rail__dot::after { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}




/* ----- RESPONSIVE -----*/


/* ---------- 9.1 TABLET / SMALL LAPTOP ---------- */

@media (min-width: 769px) and (max-width: 1180px) {
  :root {
    --pad-x: 40px;
    --rail: 72px;
    --fs-h1: clamp(34px, 4.6vw, 58px);
    --gap-l: 28px;
  }

  .capsule-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .capsule { min-height: 132px; }
  .tile { width: 148px; }
  .video-card { width: 288px; }
  .pick { width: 118px; }
  .pick img { width: 84px; height: 84px; }
  .pick::before { width: 88px; height: 88px; }
}


/* ---------- 9.2 SHORT DESKTOP SCREENS ---------- */

@media (min-width: 769px) and (max-height: 860px) {
  :root {
    --pad-top: 112px;
    --pad-bottom: 70px;
    --fs-h1: clamp(38px, 4.4vw, 64px);
    --gap-xl: 40px;
  }
}


/* ---------- 9.3 MOBILE — TOKENS ---------- */

@media (max-width: 768px) {
  :root {
      


    --pad-x: 20px;
    --pad-top: 76px;
    --pad-bottom: 16px;
    --rail: 0px;
    --rail-m: 96px;  /* rail + scroll hint live in this bottom gutter */

    /* minimum height reserved for the 3D scene at the top */
    --stage: 36vh;
    /* how tall an inner card scroller may get before it scrolls */
    --sheet-cap: 34vh;

    --gap-2xs: 6px;
    --gap-xs: 9px;
    --gap-s: 12px;
    --gap-m: 16px;
    --gap-l: 22px;
    --gap-xl: 26px;

    --fs-h1: clamp(28px, 8.4vw, 38px);
    --fs-h2: clamp(19px, 5.4vw, 24px);
    --fs-h3: 13px;
    --fs-body: 12px;
    --copy: 42ch;

    --r-l: 14px;
  }

  @supports (height: 100svh) {
    :root {
      --stage: 36svh;
      --sheet-cap: 34svh;
    }
  }
}


/* ---------- 9.4 MOBILE — SCENE MODEL ---------- */

@media (max-width: 768px) {

  /* Readability scrim so copy survives over a bright 3D frame.
     Fixed, painted once, never animated with the panels. */
  #experience-overlay::before {
    content: "";
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: 76vh;
    z-index: 0;
    /*background: linear-gradient(
      to top,
      rgba(10, 10, 10, .94) 0%,
      rgba(10, 10, 10, .88) 34%,
      rgba(10, 10, 10, .55) 66%,
      rgba(10, 10, 10, 0) 100%
    );*/
    pointer-events: none;
  }

  .scene-panel {
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: var(--gap-m);

    /* top padding is the 3D stage; bottom clears rail + hint */
    padding: max(var(--pad-top), 36vh) var(--pad-x) calc(var(--pad-bottom) + var(--rail-m));

    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    scrollbar-width: none;
  }

  @supports (height: 100svh) {
    .scene-panel {
      padding-top: max(var(--pad-top), var(--stage));
    }
  }

  .scene-panel::-webkit-scrollbar { width: 0; height: 0; }

  /* Bottom-align without justify-content, so the first block is never
     clipped when the sheet overflows and starts scrolling. */
  .scene-panel > * { flex: 0 0 auto; }
  .scene-panel > *:first-child { margin-top: auto; }

  .slot,
  .slot--tl,
  .slot--left {
    width: 100% !important;
    align-items: stretch;
    justify-content: flex-start;
    gap: var(--gap-s);
  }

  /* the old mobile alignment hacks are handled by the sheet now */
  .slot--bl,
  .slot--br,
  .slot--end { margin-top: 0; }
  .slot--end { gap: var(--gap-m); }

  /* nothing shrinks on mobile — the sheet scrolls instead */
  .slot > .is-flexible { flex: 0 0 auto; min-height: 0; }

  .surface { padding: 13px 14px; border-radius: var(--r-l); }
  .surface--roomy { padding: 15px; }

  .title { width: 100%; }
  .heading { font-size: clamp(17px, 4.8vw, 21px); }
  .actions { flex-wrap: wrap; gap: var(--gap-s) var(--gap-m); margin-top: 2px; }

  /* touch targets */
  .btn { min-height: 44px; padding: 11px 16px; }
  .link { min-height: 30px; padding-bottom: 5px; }
  .btn__icon { width: 20px; height: 20px; }
}


/* ---------- 9.5 MOBILE — CONTENT DIET ----------
   The 3D scene, the card headings and the tag rows already carry the
   message on a phone. Long supporting paragraphs and cursor-only hints
   are the first thing to go; nothing structural is removed. */

@media (max-width: 768px) {

  /* step narration duplicated by the on-screen machine */
  .scene-panel[data-scene="2"] .slot--tl .body,
  .scene-panel[data-scene="3"] .slot--tl .body,
  .scene-panel[data-scene="4"] .slot--tl .body,
  .scene-panel[data-scene="8"] .slot--tl .body,
  .scene-panel[data-scene="9"] .slot--tl .body,
  .scene-panel[data-scene="6"] .slot--left > .stack .body,
  .scene-panel[data-scene="7"] .slot--left > .stack .body,
  .scene-panel[data-scene="11"] .slot--left > .stack .body { display: none; }

  /* stat rows that repeat what the grid below already shows */
  .scene-panel[data-scene="6"] .slot--left > .stack .tag-row,
  .scene-panel[data-scene="7"] .slot--left > .stack .tag-row { display: none; }

  /* "hover the handle", "select a capsule above" — pointer language */
  .scene-panel:not(.scene--doc) .micro { display: none; }

  /* everything that survives gets clamped rather than truncated */
  .scene-panel:not(.scene--doc) .body {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    overflow: hidden;
  }

  .scene-panel[data-scene="0"] .slot--left .body { -webkit-line-clamp: 4; line-clamp: 4; }

  /* card chrome shrinks, gold eyebrow stays as the anchor */
  .product__header { align-items: flex-start; gap: var(--gap-xs); }
  .badge { padding: 5px 8px; }

  .tag-row { gap: 5px; }
  .tag-row span,
  .tag-row button {
    min-height: 30px;
    padding: 6px 10px;
    font-size: var(--fs-micro);
  }
}


/* ---------- 9.5b MOBILE — DROP THE STATIC CARDS ----------
   These surfaces only restate the heading above them. Hide the whole
   slot, not just the card, or the sheet keeps the flex gap where the
   card used to be. */

@media (max-width: 768px) {
  .scene-panel[data-scene="5"] .slot--bl,
    .scene-panel[data-scene="6"] .slot--bl,
      .scene-panel[data-scene="7"] .slot--bl,
  .scene-panel[data-scene="9"] .slot--bl { display: none; }

  /* here the card shares a slot with the copy, so it goes on its own */
  .scene-panel[data-scene="1"] .slot--left > .surface,
  .scene-panel[data-scene="11"] .slot--left > .surface { display: none; }
}

/* ---------- 9.6 MOBILE — COMPONENTS ---------- */

@media (max-width: 768px) {

  /* 9.6.1 hero -------------------------------------------------- */

  .video-card,
  .video-lightbox { display: none !important; }

  .card-row {
    flex-direction: row;
    width: 100%;
    gap: var(--gap-xs);
  }

  .tile {
    flex: 1 1 0;
    width: auto;
    aspect-ratio: 1.55 / 1;
    border-radius: var(--r-s);
  }

  .tile__content { left: 12px; top: 12px; gap: var(--gap-2xs); }
  .tile__content > span { max-width: none; font-size: 13px; }
  .tile__content .link { font-size: 10px; padding-bottom: 4px; }
  .tile__content .link::after { width: 18px; }


  /* 9.6.2 capsule picker (scene 1) — three across, no wrap ------- */

  .picker {
    display: flex;
    flex-wrap: nowrap;
    gap: var(--gap-2xs);
    width: 100%;
  }

  .pick {
    flex: 1 1 0;
    width: auto;
    min-width: 0;
    padding: 8px 2px;
  }

  .pick::before { top: 4px; width: 72px; height: 72px; }
  .pick img { width: 64px; height: 64px; }
  .pick__title { margin-bottom: 2px; font-size: 12px; }
  .pick__desc { font-size: 9px; line-height: 1.3; }


  /* 9.6.3 filters + capsule rail (scenes 6, 7) ------------------- */

  .chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 10px;
    touch-action: pan-x;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    /* soft edge on the filter rail only — cheap, it is one row */
    -webkit-mask-image: linear-gradient(to right, transparent 0, #000 10px, #000 calc(100% - 22px), transparent 100%);
    mask-image: linear-gradient(to right, transparent 0, #000 10px, #000 calc(100% - 22px), transparent 100%);
  }

  .chips::-webkit-scrollbar { width: 0; height: 0; }
  .chip { min-height: 34px; padding: 9px 13px; font-size: 8px; }

  .configurator { gap: var(--gap-xs); }
  .configurator > .capsule-grid { flex: 0 0 auto; }

  .capsule-grid {
    grid-template-columns: none;
    grid-template-rows: 1fr;
    grid-auto-flow: column;
    grid-auto-columns: clamp(112px, 33vw, 138px);
    overflow-x: auto;
    overflow-y: hidden;
    padding: 2px 0 var(--gap-xs);
    scroll-snap-type: x proximity;
    scroll-padding-left: 2px;
    scrollbar-width: none;
    /* NOTE: no mask here. Masking the horizontal scroller was the most
       expensive paint on mobile; the fade is not worth the frames. */
  }

  .capsule-grid::-webkit-scrollbar { width: 0; height: 0; }

  .capsule {
    width: 100%;
    min-height: 0;
    aspect-ratio: 1.18;
    padding: var(--gap-xs);
    scroll-snap-align: start;
  }

  .capsule__image { inset: 6px 6px 28px; }
  .capsule__image img { width: 78%; max-width: 88px; }
  .capsule__intensity { width: 44px; margin-top: 5px; }

  .configurator__note { padding-top: 8px; font-size: 9px; }


  /* 9.6.4 machine configurator (scene 10) ------------------------ */

  .product__price strong { font-size: 22px; }

  .configurator__body {
    max-height: min(34vh, 320px);
    padding-right: 2px;
    gap: var(--gap-xs);
  }

  @supports (height: 100svh) {
    .configurator__body { max-height: min(var(--sheet-cap), 320px); }
  }

  .product__section { padding-top: var(--gap-xs); }
  .product__label { margin-bottom: 6px; }

  /* tint swatches become a snap rail instead of a cramped 2x2 */
  .choice-grid {
    display: flex;
    flex-wrap: nowrap;
    gap: var(--gap-2xs);
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 6px;
    touch-action: pan-x;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }

  .choice-grid::-webkit-scrollbar { width: 0; height: 0; }
  .choice { flex: 0 0 clamp(84px, 25vw, 104px); scroll-snap-align: start; }


  /* 9.6.5 feature callouts (scene 9) ---------------------------- */

  .scene-panel[data-scene="9"] .slot--tl .tag-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 4px;
    touch-action: pan-x;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
  }

  .scene-panel[data-scene="9"] .slot--tl .tag-row::-webkit-scrollbar { width: 0; height: 0; }

  .scene-panel[data-scene="9"] .slot--tl .tag-row button {
    flex: 0 0 auto;
    min-height: 38px;
    white-space: nowrap;
  }


  /* 9.6.6 result / info cards ----------------------------------- */

  .info-card { gap: var(--gap-2xs); }
  .info-card__meta { gap: var(--gap-xs); font-size: 9px; }

  /* the coffee grid is the interaction — put it under the thumb and
     lift the card that responds to it above */
  .scene-panel[data-scene="6"] .slot--left,
  .scene-panel[data-scene="7"] .slot--left { margin-top: 0; }

  .scene-panel[data-scene="6"] .slot--br,
  .scene-panel[data-scene="7"] .slot--br {
    order: -1;
    margin-top: auto;
    align-items: stretch;
  }
}

/* ---------- 9.6b MOBILE — SHEET GUTTER + GRID SCENES ---------- */

@media (max-width: 768px) {

  /* 1. The gutter as a flex item. Scroll containers don't reliably
     include padding-bottom in their scrollable area, which is what was
     cropping the capsule rail. The gap is subtracted so the spacing
     matches --pad-bottom exactly. */
  .scene-panel:not(.scene--doc) { padding-bottom: 0; }

  .scene-panel:not(.scene--doc)::after {
    content: "";
    display: block;
    flex: 0 0 auto;
    width: 100%;
    height: calc(var(--pad-bottom) + var(--rail-m) - var(--gap-m));
    pointer-events: none;
  }

  /* 2. Info cards keep their live parts only. */
  .scene-panel[data-scene="6"] .info-card,
  .scene-panel[data-scene="7"] .info-card {
    gap: 6px;
    padding: 11px 13px;
  }

  .scene-panel[data-scene="6"] .info-card .body,
  .scene-panel[data-scene="6"] .info-card .tag-row,
  .scene-panel[data-scene="7"] .info-card .body,
  .scene-panel[data-scene="7"] .info-card .tag-row,
  .scene-panel[data-scene="7"] .info-card .heading { display: none; }

  .scene-panel[data-scene="6"] .info-card .title--s { font-size: 17px; }
  .scene-panel[data-scene="7"] .info-card .actions { margin-top: 4px; }

  /* 3. Smaller capsules — more of them visible, less vertical cost. */
  .scene-panel[data-scene="6"] .capsule-grid,
  .scene-panel[data-scene="7"] .capsule-grid {
    grid-auto-columns: clamp(100px, 29vw, 124px);
  }

  .scene-panel[data-scene="6"] .capsule,
  .scene-panel[data-scene="7"] .capsule { aspect-ratio: 1.28; }
}

/* ---------- 9.6c MOBILE — GRID SCENES FIT INSTEAD OF SCROLL ----------
   Browsing scenes: the collection is the subject, the machine is
   context. A smaller stage keeps the sheet inside the panel, so the
   normal bottom padding applies like everywhere else. */

@media (max-width: 768px) {
  .scene-panel[data-scene="6"],
  .scene-panel[data-scene="7"],
  .scene-panel[data-scene="10"] { --stage: 22vh; gap: var(--gap-s); }

  @supports (height: 100svh) {
    .scene-panel[data-scene="6"],
    .scene-panel[data-scene="7"],
    .scene-panel[data-scene="10"] { --stage: 22svh; }
  }

  

/* ---------- 9.7 MOBILE — DOCUMENT SCENE (12) ---------- */

@media (max-width: 768px) {

  .scene--doc {
    --pad-top: 72px;
    padding-top: var(--pad-top);
    padding-bottom: calc(var(--pad-bottom) + var(--rail-m));
    overflow: hidden;          /* .doc__scroll owns the scrolling here */
    touch-action: none;
  }

  .scene--doc > .slot--full {
    flex: 1 1 auto;
    min-height: 0;
    margin-top: 0 !important;
  }

  .doc { flex: 1 1 auto; width: 100%; min-height: 0; }

  .doc__scroll {
    padding-right: 0;
    padding-bottom: var(--gap-m);
  }

  .doc-layout,
  .contact { grid-template-columns: 1fr; }

  .doc-layout { gap: 32px; }
  .doc-main { gap: 34px; }
  .doc-header .body,
  .doc-section .body { max-width: none; }

  .contact { gap: 22px; padding-top: 26px; }

  .form-slot {
    min-height: 0;
    padding: var(--gap-s);
    text-align: left;
  }

  .doc-side { gap: var(--gap-xs); }
  .doc-links { gap: 8px 16px; }

  .doc-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--gap-2xs);
    margin-top: var(--gap-m);
    padding: 18px 0 0;
  }
}


/* ---------- 9.8 MOBILE — NAVIGATION ---------- */

@media (max-width: 768px) {

  .rail {
    left: 50%;
    right: auto;
    top: auto;
    bottom: 22px;
    z-index: 40;
    height: 54px;
    transform: translate3d(-50%, 0, 0);
  }

  .rail__track { flex-direction: row; align-items: center; gap: var(--gap-m); }

  .rail__step {
    grid-template-columns: none;
    grid-template-rows: 12px 22px;
    row-gap: 8px;
    justify-items: center;
    min-width: 34px;
    min-height: auto;
    font-size: 12px;
  }

  .rail__step::after { display: none; }
  .rail__step span { transform-origin: center center; }

  .rail__dot::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 100%;
    width: 24px;
    height: 1px;
    margin-left: 8px;
    background: rgba(255, 255, 255, .12);
    transform: translateY(-50%);
  }

  .rail__step:last-child .rail__dot::after { display: none; }

  /* hint sits in the gutter above the rail, never on top of content */
  .scroll-hint {
    bottom: calc(var(--rail-m) - 14px);
    z-index: 39;
    gap: 6px;
    font-size: 10px;
    letter-spacing: .04em;
    color: rgba(255, 255, 255, .62);
  }

  .scroll-hint__mouse { display: none; }
  .scroll-hint__arrow { width: 8px; height: 8px; border-width: 1.5px; }
}


/* ---------- 9.9 TOUCH DEVICES ----------
   Hover states stick on tap and read as broken. Swap them for a press
   state on anything without a fine pointer, phone or not. */

@media (hover: none) {
  .tile:hover { transform: none; box-shadow: none; }
  .tile:hover img { transform: none; }
  .capsule:hover {
    border-color: transparent;
    background: rgba(255, 255, 255, .035);
    box-shadow: none;
  }
  .capsule:hover .capsule__image img { transform: translate3d(0, 0, 0); }
  .chip:hover { color: rgba(255, 255, 255, .68); border-color: var(--c-line); background: rgba(255, 255, 255, .015); }
  .chip.is-active:hover { color: #18130e; border-color: var(--c-gold); background: var(--c-gold); }
  .choice:hover { border-color: var(--c-line); background: rgba(255, 255, 255, .025); color: rgba(255, 255, 255, .62); }
  .choice.is-active:hover { border-color: var(--c-gold); background: rgba(214, 173, 120, .09); color: var(--c-text); }
  .choice:hover img { transform: none; }
  .choice.is-active img { transform: scale(1.04); }
  .pick:hover::before { opacity: .75; transform: translate3d(-50%, 0, 0) scale(.85); }
  .pick.is-active::before { opacity: 1; transform: translate3d(-50%, 0, 0) scale(1); }
  .pick:hover img { transform: none; }
  .pick.is-active img { transform: translate3d(0, -3px, 0) scale(1.04); }
  .link:hover::after { width: 28px; }
  .btn:hover { background: rgba(255, 255, 255, .03); }
  .btn:hover::before { transform: translate3d(-140%, 0, 0); }
  .btn:hover .btn__icon { transform: none; }
  .tag-row button:hover {
    color: rgba(255, 255, 255, .68);
    border-color: var(--c-line);
    background: rgba(255, 255, 255, .035);
    transform: none;
  }
  .tag-row button.is-active:hover { color: #18130e; border-color: var(--c-gold); background: var(--c-gold); }

  .btn, .chip, .choice, .capsule, .pick, .tile, .tag-row button, .link {
    -webkit-tap-highlight-color: transparent;
  }

  .btn:active, .chip:active, .choice:active,
  .capsule:active, .pick:active, .tag-row button:active { transform: scale(.97); }
}


/* ---------- 9.10 SMALL PHONES ---------- */

@media (max-width: 380px) {
  :root { --pad-x: 16px; --fs-h1: clamp(26px, 8.6vw, 32px); }

  .pick__desc { display: none; }
  .pick img { width: 56px; height: 56px; }
  .pick::before { width: 64px; height: 64px; }
  .tile__content > span { font-size: 12px; }
  .rail__track { gap: var(--gap-s); }
}


/* ---------- 9.11 LANDSCAPE PHONES ----------
   No vertical room for a stage, so the 3D moves to the right half and
   the sheet becomes a left column. */

@media (max-width: 900px) and (orientation: landscape) and (max-height: 520px) {
  :root {
    --pad-top: 56px;
    --pad-bottom: 12px;
    --rail-m: 12px;
    --fs-h1: clamp(22px, 5.2vw, 30px);
  }

  .scene-panel {
    padding: var(--pad-top) 46vw var(--pad-bottom) var(--pad-x);
  }

  .scene-panel:not(.scene--doc) .body,
  .scene-panel:not(.scene--doc) .video-card { display: none; }

  .scene--doc { padding-right: var(--pad-x); }
  .picker { max-width: 340px; }
  .capsule-grid { grid-auto-columns: 104px; }
  .configurator__body { max-height: 40vh; }

  .rail { bottom: 8px; height: 42px; }
  .scroll-hint { display: none; }
}


/* ---------- 9.12 REDUCED MOTION ---------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}