/* =====================================================================
   THE SCENE: a supplier page turns into the table (js/scene.js).
   It lives in the hero (js/hero.js pins it and drives it with the scroll).
   Static first (no JS, still mode):
   the page and the finished table next to each other, the steps as a list.
   .scene.is-live is the running scene: one frame shared by the page and
   the table.
   ===================================================================== */

/* ---------- Static layout ---------- */
.mframe { position: relative; display: grid; gap: 12px; }
.msite { position: relative; height: 250px; overflow: hidden; border: 1px solid var(--night-line); border-radius: var(--r); background: var(--shop-bg); color: var(--shop-ink); }
.msheet { overflow: hidden; border: 1px solid var(--night-line); border-radius: var(--r); }
.msheet .sheet__body { flex: none; }
/* Narrower price, stock and SKU columns: the name keeps its room when the table gets only part of
   the frame (at 1300 px the name column used to collapse to one letter) */
@media (min-width: 700px) { .msheet { --c-i: 26px; --c-p: 76px; --c-s: 86px; --c-k: 72px; } }
/* Side by side only where the table still gets a real width; stacked below that */
@media (min-width: 1200px) {
  .mframe { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); }
  .msite { height: auto; min-height: 420px; }
  .msite .site__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.msteps { display: grid; gap: 10px; }
.mstep { display: flex; align-items: flex-start; gap: 12px; color: var(--night-muted); font-size: 15.5px; line-height: 1.4; }
.mstep span { display: flex; align-items: center; justify-content: center; width: 24px; height: 24px; flex: none; border: 1px solid var(--night-line); border-radius: 6px; font: 500 12px/1 var(--mono); }

.mflights { position: absolute; inset: 0; z-index: 6; pointer-events: none; }
.mflights .chip-f { opacity: 0; }
.mbeam { position: absolute; left: 0; right: 0; top: 0; z-index: 4; height: 2px; pointer-events: none; opacity: 0; }
.mbeam::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: var(--lime); box-shadow: 0 0 12px 2px rgb(var(--lime-rgb) / 0.75); }
.mbeam::after { content: ""; position: absolute; left: 0; right: 0; bottom: 2px; height: 40px; background: linear-gradient(to top, rgb(var(--lime-rgb) / 0.22), rgb(var(--lime-rgb) / 0)); }
/* Waiting for the first scroll (variant C): the beam rests at the top of the page, breathing */
.mbeam.is-idle { animation: m-breathe 2.8s ease-in-out infinite; }
@keyframes m-breathe { 0%, 100% { opacity: 0.25; } 50% { opacity: 0.9; } }

/* ---------- Running ---------- */
.scene.is-live .mframe { display: block; height: var(--mh, 440px); overflow: hidden; border: 1px solid var(--night-line); border-radius: var(--r); background: var(--night-2); }
.scene.is-live .msite { position: absolute; left: 0; right: 0; top: 0; height: calc(var(--split, 45%) - 4px); border: 0; border-radius: 0; }
.scene.is-live .msheet { position: absolute; left: 0; right: 0; bottom: 0; height: calc(100% - var(--split, 45%) - 4px); border: 0; border-radius: 0; }
@media (min-width: 1200px) {
  .scene.is-live .msite { right: auto; bottom: 0; width: calc(40% - 4px); height: auto; }
  .scene.is-live .msheet { left: auto; top: 0; width: calc(60% - 4px); height: auto; }
}
.scene.is-live .msheet .c.is-pending { color: transparent; }
.scene.is-live .msheet .c.is-pending::before { opacity: 0; }
.scene.is-live .mstep { transition: color 0.3s ease; }
.scene.is-live .mstep span { transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease; }
.scene.is-live .mstep.is-now { color: var(--night-ink); }
.scene.is-live .mstep.is-now span, .scene.is-live .mstep.is-done span { background: var(--lime); border-color: var(--lime); color: var(--on-lime); }
.scene.is-live .msite { transition: opacity 0.4s ease; }
.scene.is-live.is-built .msite { opacity: 0.45; }
.scene.is-live .msheet { transition: box-shadow 0.4s ease; }
.scene.is-live.is-built .msheet { box-shadow: inset 0 0 0 2px var(--sel); }

/* ---------- The caption above the frame ---------- */
.hscene__cap { display: grid; gap: 10px; margin-bottom: 12px; }
.hscene__title { display: flex; align-items: center; gap: 10px; color: var(--night-ink); font: 500 14.5px/1.35 var(--sans); }
.hscene__title i { width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--lime); }
.hscene__count { margin-left: auto; color: var(--night-muted); font: 500 12px/1 var(--mono); font-variant-numeric: tabular-nums; }
.hscene__bar { display: none; }
.hscene .mstep { font-size: 14.5px; }
/* Live: a counter and a thin line follow the scroll, one step at a time under them. The old step
   leaves quickly and the new one comes a beat later, so two texts never overlap. */
.hscene.is-live .hscene__bar { display: block; position: relative; height: 2px; border-radius: 1px; background: var(--night-line); overflow: hidden; }
.hscene.is-live .hscene__bar span { position: absolute; inset: 0; background: var(--lime); transform: scaleX(0); transform-origin: 0 50%; }
.hscene.is-live .msteps { display: grid; }
.hscene.is-live .mstep { grid-area: 1 / 1; align-items: center; min-height: 24px; opacity: 0; transition: opacity 0.14s ease, color 0.3s ease; }
.hscene.is-live .mstep.is-now { opacity: 1; transition: opacity 0.3s ease 0.14s, color 0.3s ease; }
/* Waiting for the first scroll: the dot breathes with the beam */
.hscene.is-waiting .hscene__title i { box-shadow: 0 0 10px rgb(var(--lime-rgb) / 0.7); animation: m-breathe 2.8s ease-in-out infinite; }
@media (min-width: 1000px) {
  .hscene__title { font-size: 15.5px; }
  .hscene .mstep { font-size: 15.5px; }
}
