/* vNext prototype (legacy, to be reduced page by page). Not a source of truth for core. */
/* ===== Engine page ===== */
.phero .photo { aspect-ratio: 4 / 3; overflow: hidden; }
.phero .photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.subnav { display: flex; gap: 0; margin-top: 22px; width: max-content; border: 1px solid var(--line); }
.subnav a { padding: 8px 16px; color: var(--muted); text-decoration: none; }
.subnav a[aria-current="page"] { background: var(--fg); color: var(--bg); }
.subnav a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.act code, .tile-bar code, .cap code { font: 12px var(--font-mono); text-transform: none; letter-spacing: 0; }
.cap { margin-top: 18px; color: var(--muted); }

.eng-stage { display: grid; align-content: center; justify-items: start; gap: 18px; padding: 96px var(--gutter) 40px; max-width: 1280px; margin-inline: auto; position: sticky; inset-block-start: 0; overflow: hidden; }
.eng-k { color: var(--accent); filter: brightness(.9); }
.eng-h { font-size: clamp(2.4rem, 7vw, 6.4rem); font-weight: 800; max-width: 12em; }
.eng-p { font-size: clamp(1.1rem, 2vw, 1.5rem); max-width: 30em; color: var(--muted); }
.eng-fig { position: absolute; inset: auto var(--gutter) 6% auto; width: min(38%, 440px); aspect-ratio: 4 / 3; margin: 0; overflow: hidden; }
.eng-fig img { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (max-width: 700px) { .eng-fig { position: relative; inset: auto; width: 100%; } }
.code { margin: 28px 0 0; padding: 18px; overflow-x: auto; background: var(--fg); color: var(--bg); font: 13px/1.6 var(--font-mono); }



.mk { display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; outline-offset: 4px; }
.mk-s { flex: 0 0 min(100%, 34rem); scroll-snap-align: center; display: grid; align-content: space-between; min-height: 200px; padding: 20px; background: var(--surface); border: 1px solid var(--line); }
.mk-s b { font: 800 clamp(2rem, 5vw, 3.6rem)/1 var(--font-display); letter-spacing: -.03em; }

.gr-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.gr { display: grid; gap: 10px; padding: 18px; }
.gr p { display: flex; flex-wrap: wrap; gap: 6px; }
.gr code { padding: 2px 6px; border: 1px solid var(--line); }
@media (max-width: 700px) { .gr-grid { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Page transitions info ---------- */
.vt-wrap { overflow-x: auto; border: 1px solid var(--line); background: var(--surface); }
.vt-t { width: 100%; border-collapse: collapse; min-width: 640px; font-size: .95rem; }
.vt-t th, .vt-t td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.vt-t thead th { font: 700 12px var(--font-mono); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.vt-t tbody tr:last-child th, .vt-t tbody tr:last-child td { border-bottom: 0; }
.vt-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; margin-top: 18px; align-items: start; }
.vt-n { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; font-size: 1rem; line-height: 1.4; }
.vt-n b { font: 700 12px var(--font-mono); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); display: block; margin-bottom: 2px; }
@media (max-width: 820px) { .vt-two { grid-template-columns: minmax(0, 1fr); } }
.vt-h3 { font: 800 clamp(2rem, 5vw, 3.4rem)/1 var(--font-display); letter-spacing: -.03em; }
.vt-t2 { min-width: 520px; }

/* ---------- Scenes: clock rail, acts, clocks ---------- */
.eng-fig { inset: auto var(--gutter) 16% auto; }
.eng-clock { position: absolute; inset: auto var(--gutter) 28px; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; font: 11px var(--font-mono); text-transform: uppercase; letter-spacing: .05em; max-width: 1280px; }
.eng-clock i { font-style: normal; display: grid; gap: 4px; border-top: 2px solid var(--line); padding-top: 6px; color: var(--muted); animation: eng-beat linear both; animation-timeline: --vl-scene; animation-range: calc((var(--n) - 1) / 8 * 100%) calc(var(--n) / 8 * 100%); }
.eng-clock em { font-style: normal; min-height: 1em; }
@keyframes eng-beat { from { color: var(--muted); border-color: var(--line); } to { color: var(--fg); border-color: var(--accent); } }
@media (max-width: 700px) { .eng-clock em { display: none; } .eng-stage { padding-bottom: 72px; } }
@media (prefers-reduced-motion: reduce) { .eng-clock i { animation: none; } }

.eng-sbs { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 22rem); gap: clamp(18px, 3vw, 36px); align-items: start; margin-top: 8px; }
.eng-sbs .code { margin: 0; font-size: 12.5px; line-height: 1.65; }
@media (max-width: 980px) { .eng-sbs { grid-template-columns: minmax(0, 1fr); } }


.clk .tile-bar { flex-direction: column; align-items: flex-start; }
.eng-auto { padding: 28px 20px 32px; }
.eng-auto .eng-auto-stage { position: relative; min-block-size: 0; display: flex; flex-wrap: wrap; gap: 10px; padding: 0; }
.clk-c { padding: 14px 18px; background: var(--surface); border: 1px solid var(--line); font: 700 1rem var(--font-display); }
.clk-c.on { background: var(--fg); color: var(--bg); border-color: var(--fg); }


.gr-dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 clamp(18px, 3vw, 36px); margin: 0 0 18px; border-top: 1px solid var(--line); }
.gr-dl > div { display: grid; grid-template-columns: minmax(0, 9rem) minmax(0, 1fr); gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.gr-dl dt { font-size: 12px; color: var(--accent); filter: brightness(.85); text-transform: none; letter-spacing: 0; }
.gr-dl dd { margin: 0; color: var(--muted); }
@media (max-width: 800px) { .gr-dl { grid-template-columns: minmax(0, 1fr); } .gr-dl > div { grid-template-columns: minmax(0, 7rem) minmax(0, 1fr); } }
.gr-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 900px) { .gr-grid { grid-template-columns: minmax(0, 1fr); } }

/* Scroll markers: native previous/next buttons next to the generated dots, no visible scrollbar */
.mk { anchor-name: --mk; scrollbar-width: none; }
.mk::-webkit-scrollbar { display: none; }
@supports selector(::scroll-button(*)) {
  .mk::scroll-button(*) { position: fixed; position-anchor: --mk; inset: auto; inset-block-start: calc(anchor(bottom) + 8px); inset-inline-end: anchor(right); width: 44px; height: 44px; border: 1px solid var(--line); background: var(--surface); color: var(--fg); font: 18px var(--font-mono); cursor: pointer; display: grid; place-items: center; }
  .mk::scroll-button(inline-start) { content: "←" / "Previous slide"; inset-inline-end: calc(anchor(right) + 52px); }
  .mk::scroll-button(inline-end) { content: "→" / "Next slide"; }
  .mk::scroll-button(*):disabled { opacity: .35; cursor: default; }
  .mk::scroll-button(*):focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
}

/* ---------- Scene: wireframe film set with a scroll-driven camera ---------- */
.eng-stage { --wf: color-mix(in oklab, var(--bg) 78%, transparent); --hi: color-mix(in oklab, var(--accent) 55%, var(--bg)); display: block; padding: 0; max-width: none; width: 100%; height: 100svh; background: var(--fg); color: var(--bg); overflow: hidden; }
.eng-vp { -webkit-mask-image: radial-gradient(ellipse 72% 70% at 50% 52%, #000 40%, transparent 100%); mask-image: radial-gradient(ellipse 72% 70% at 50% 52%, #000 40%, transparent 100%); }
.ew-c > i { position: absolute; display: block; border: 1px solid var(--wf); box-sizing: border-box; }
.ew-c.ew-hi > i { border-color: var(--hi); }
.ew-p.ew-pole { border-left: 1px solid var(--wf); }
.ew-p.ew-line { border-top: 1px solid var(--wf); }
.ew-p.ew-grid { --vl-world-line: color-mix(in oklab, var(--bg) 54.6%, transparent); }   /* the old plane was 78% at .7 opacity */
.ew-p.ew-grid.ew-sparse { --vl-world-line: color-mix(in oklab, var(--bg) 23.4%, transparent); }
.ew-p.ew-mark { background: linear-gradient(var(--hi), var(--hi)) center / 100% 2px no-repeat, linear-gradient(var(--hi), var(--hi)) center / 2px 100% no-repeat; }
.ew-p.ew-slate { border: 1px solid var(--wf); }
.ew-p.ew-slate b { position: absolute; inset: 0 0 auto 0; height: 34px; border-bottom: 1px solid var(--wf); background: repeating-linear-gradient(-45deg, var(--wf) 0 6px, transparent 6px 18px); opacity: .8; }
.ew-p.ew-slate span { position: absolute; inset: 52px 16px 16px; background: repeating-linear-gradient(var(--wf) 0 1px, transparent 1px 26px); opacity: .5; }
.ew-p.ew-reel { border: 1px solid var(--hi); border-radius: 50%; }
.ew-p.ew-flat { border: 1px solid var(--wf); }
.ew-p.ew-flat b { position: absolute; inset: 0; background: linear-gradient(to bottom right, transparent calc(50% - .5px), var(--wf) 50%, transparent calc(50% + .5px)); opacity: .6; }
.ew-p.ew-screen { border: 2px solid var(--hi); background: color-mix(in oklab, var(--hi) 12%, transparent); }
.ew-p.ew-screen img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0; animation: eng-reveal linear both; animation-timeline: --vl-scene; animation-duration: 1ms; animation-range: 74% 85%; }
@keyframes eng-reveal { from { opacity: 0; filter: grayscale(1) contrast(1.3); } to { opacity: 1; filter: none; } }

.eng-hud { position: absolute; top: 88px; right: var(--gutter); display: grid; justify-items: end; gap: 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; opacity: .85; }
.eng-hud b { font: 700 clamp(1.6rem, 3vw, 2.4rem)/1 var(--font-mono); letter-spacing: 0; counter-reset: m calc(var(--vl-world-progress, 0) * 120); text-transform: none; }
.eng-hud b::after { content: counter(m) " m"; }

.eng-line { position: absolute; inset-inline-start: var(--gutter); bottom: calc(84px + (4 - var(--i)) * 66px); margin: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: baseline; column-gap: 12px; row-gap: 3px; font-size: 15px; text-transform: uppercase; letter-spacing: .06em; max-width: min(32rem, 70vw); }
.eng-line { text-shadow: 0 0 14px var(--fg), 0 0 4px var(--fg); }
.eng-line b { color: var(--hi); font-weight: 700; }
.eng-line em { grid-column: 2; line-height: 1.35; font-style: normal; text-transform: none; letter-spacing: 0; opacity: .7; font-size: 13px; }
.eng-clock i { color: color-mix(in oklab, var(--bg) 55%, transparent); border-color: color-mix(in oklab, var(--bg) 22%, transparent); }
@keyframes eng-beat { from { color: color-mix(in oklab, var(--bg) 55%, transparent); border-color: color-mix(in oklab, var(--bg) 22%, transparent); } to { color: var(--bg); border-color: var(--hi); } }
@media (max-width: 700px) { .eng-line em { display: none; } .eng-line { bottom: calc(76px + (4 - var(--i)) * 34px); } }
@media (prefers-reduced-motion: reduce) { .ew-p.ew-screen img, .eng-hud b { animation: none; } .ew-p.ew-screen img { opacity: 1; } .eng-hud { display: none; } .eng-scene[vl-pin] { min-block-size: auto; } }

/* ---------- Orbit: the camera turns 360 degrees from the centre of a ring ---------- */
.ew-p.ew-disc { background: repeating-radial-gradient(circle at var(--at), var(--wf) 0 1px, transparent 1px 100px), repeating-conic-gradient(from 0deg at var(--at), color-mix(in oklab, var(--wf) 45%, transparent) 0 .2deg, transparent .2deg 15deg); opacity: .5; }
.ew-p.ew-q1 { --at: 100% 100%; border-radius: 100% 0 0 0; } .ew-p.ew-q2 { --at: 0 100%; border-radius: 0 100% 0 0; } .ew-p.ew-q3 { --at: 100% 0; border-radius: 0 0 0 100%; } .ew-p.ew-q4 { --at: 0 0; border-radius: 0 0 100% 0; }
.ew-p.ew-ring { border: 1px solid var(--wf); border-radius: 50%; opacity: .6; }
.ew-p.ew-grid.ew-wall2 { --vl-world-line: color-mix(in oklab, var(--bg) 27.3%, transparent); }
.ew-p.ew-label { font: 600 15px/30px var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: color-mix(in oklab, var(--hi) 60%, var(--bg)); text-align: center; text-shadow: 0 0 8px var(--fg); }
.eng-orbit .eng-hud b::after { content: counter(m) "\00b0"; }
.eng-orbit .eng-hud b { counter-reset: m calc(var(--vl-world-progress, 0) * 360); }

/* Scroll markers: eased movement. Arrows and dots glide, and each slide eases in and out as it crosses the row. */
.mk { scroll-behavior: smooth; overscroll-behavior-x: contain; }
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .mk-s { animation: mk-focus both; animation-timing-function: cubic-bezier(.22, 1, .36, 1); animation-timeline: view(inline); animation-range: cover 0% cover 100%; }
    .mk-s b { display: block; animation: mk-drift both linear; animation-timeline: view(inline); animation-range: cover 0% cover 100%; }
  }
}
@keyframes mk-focus { 0% { opacity: .35; scale: .9; } 50% { opacity: 1; scale: 1; } 100% { opacity: .35; scale: .9; } }
@keyframes mk-drift { 0% { translate: 28px 0; } 50% { translate: 0 0; } 100% { translate: -28px 0; } }
@media (prefers-reduced-motion: reduce) { .mk { scroll-behavior: auto; } }
.mk:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

/* Phones: no mask (the vignette is drawn instead). Culling and detail come from vl-world. */
@media (max-width: 820px) {
  .eng-vp { -webkit-mask-image: none; mask-image: none; }
  .eng-scene { --vl-lights-vignette: 100; }   /* the lights draw the phone vignette */
}






/* ---------- Rooms: the lines become matter near the camera (vl-solid + SVG textures) ---------- */
.eng-stage { --ink: var(--bg); --paper: var(--fg); --mix: color-mix(in oklab, var(--ink) var(--p), var(--paper)); }
.ew-s { --p: 20%; backface-visibility: visible; }
.ew-s-floor { background: url(../../img/tex/tile.svg) 0 0 / 140px 140px, color-mix(in oklab, var(--ink) 31%, var(--paper)); }
.ew-s-ceil { background: url(../../img/tex/ceiling.svg) 0 0 / 140px 140px, color-mix(in oklab, var(--ink) 11%, var(--paper)); }
.ew-s-wall { --wt: 14%; background: url(../../img/tex/wall-base.svg) 0 100% / 8px 26px repeat-x, url(../../img/tex/plaster.svg) 0 0 / 240px 240px, color-mix(in oklab, var(--ink) var(--wt), var(--paper)); }
.ew-s-wall.ew-t1 { --wt: 18%; } .ew-s-wall.ew-t2 { --wt: 11%; }
.ew-s-wall--r { --wt: 19%; background: url(../../img/tex/wall-base.svg) 0 100% / 8px 26px repeat-x, url(../../img/tex/plaster.svg) 80px 60px / 240px 240px, color-mix(in oklab, var(--ink) var(--wt), var(--paper)); }
.ew-s-door { background: url(../../img/tex/door.svg) 0 0 / 100% 100%, color-mix(in oklab, var(--ink) 50%, var(--paper)); border: 7px solid color-mix(in oklab, var(--ink) 66%, var(--paper)); box-sizing: border-box; }
.ew-s-door i { position: absolute; right: 14px; top: 52%; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px color-mix(in oklab, var(--ink) 70%, var(--paper)); }
.ew-s-window { background: url(../../img/tex/glass.svg) 0 0 / 100% 100%, linear-gradient(var(--accent), color-mix(in oklab, var(--accent) 30%, var(--paper))); border: 8px solid color-mix(in oklab, var(--ink) 62%, var(--paper)); box-sizing: border-box; }
.ew-s-window i { position: absolute; left: 50%; top: 0; bottom: 0; width: 6px; margin-left: -3px; background: color-mix(in oklab, var(--ink) 62%, var(--paper)); }
.ew-s-window b { position: absolute; left: 0; right: 0; top: 50%; height: 6px; margin-top: -3px; background: color-mix(in oklab, var(--ink) 62%, var(--paper)); }

/* ---------- Quality control: Auto / Full / Lite (no JS; a person's choice beats any hint) ---------- */

/* Orbit room: wall + radial parquet + props filled. Walls and floor are built up by the scene clock. */
.ew-s-wedge { background: url(../../img/tex/tile.svg) 0 0 / 140px 140px, color-mix(in oklab, var(--ink) 33%, var(--paper)); clip-path: polygon(0 0, 100% 0, 64% 100%, 36% 100%); }
.ew-c > i { background: color-mix(in oklab, var(--ink) 34%, var(--paper)); }
.ew-c > i:nth-child(even) { background: color-mix(in oklab, var(--ink) 46%, var(--paper)); }
.ew-c.ew-hi > i { background: color-mix(in oklab, var(--accent) 38%, var(--paper)); }
.ew-c.ew-hi > i:nth-child(even) { background: color-mix(in oklab, var(--accent) 50%, color-mix(in oklab, var(--ink) 30%, var(--paper))); }
.ew-p.ew-flat { background: url(../../img/tex/plaster.svg) 0 0 / 240px 240px, color-mix(in oklab, var(--ink) 16%, var(--paper)); }
.ew-p.ew-slate { background: color-mix(in oklab, var(--ink) 62%, var(--paper)); }
.ew-p.ew-pole { background: color-mix(in oklab, var(--ink) 55%, var(--paper)); border-left: 0; }

/* ---------- Scenes: elements on the clock (pinned) ---------- */
.ac-stage { --lab: 9rem; }
.ac-h { position: absolute; inset: 14vh auto auto var(--gutter); max-width: min(46rem, 52vw); margin: 0; font: 800 clamp(2.4rem, 6vw, 5.4rem)/.96 var(--font-display); letter-spacing: -.03em; text-wrap: balance; }
.ac-p { position: absolute; inset: 43vh auto auto var(--gutter); max-width: 27rem; margin: 0; font-size: clamp(1rem, 1.5vw, 1.25rem); opacity: .8; }
.ac-btn { position: absolute; inset: 59vh auto auto var(--gutter); padding: 14px 22px; background: var(--bg); color: var(--fg); text-decoration: none; font: 700 1rem var(--font-display); clip-path: polygon(0 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%); }
.ac-btn:focus-visible { outline: 2px solid var(--hi); outline-offset: 3px; }
.ac-img { position: absolute; inset: 11vh var(--gutter) auto auto; width: min(34vw, 30rem); height: 28vh; object-fit: cover; display: block; }
.ac-code { position: absolute; inset: 43vh var(--gutter) auto auto; width: min(34vw, 30rem); margin: 0; padding: 14px 16px; background: var(--bg); color: var(--fg); font: 12px/1.6 var(--font-mono); overflow: hidden; }
.ac-rail { position: absolute; inset: auto var(--gutter) 28px var(--gutter); display: grid; gap: 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.ac-row { display: grid; grid-template-columns: var(--lab) repeat(8, minmax(0, 1fr)); column-gap: 0; row-gap: 0; align-items: center; }
.ac-row span, .ac-row b { color: color-mix(in oklab, var(--bg) 60%, transparent); font-weight: 400; }
.ac-ruler b { border-left: 1px solid color-mix(in oklab, var(--bg) 22%, transparent); padding-left: 6px; }
.ac-row i { grid-column: 2 / -1; margin-left: calc((var(--ac-a) - 1) / 8 * 100%); width: calc(var(--ac-n) / 8 * 100% - 4px); position: relative; height: 16px; overflow: hidden; background: color-mix(in oklab, var(--bg) 18%, transparent); clip-path: polygon(0 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%); }
.ac-row i::after { content: ""; position: absolute; inset: 0; background: var(--hi); scale: 0 1; transform-origin: left; animation: ac-fill linear both; animation-timeline: --vl-scene; animation-range: calc((var(--ac-a) - 1) / 8 * 100%) calc((var(--ac-a) - 1 + var(--ac-n)) / 8 * 100%); }
.ac-track { position: absolute; inset: 0 0 0 calc(var(--lab) + 4px); pointer-events: none; }
.ac-track::after { content: ""; position: absolute; inset: 0 auto 0 0; width: 2px; background: var(--hi); animation: ac-head linear both; animation-timeline: --vl-scene; }
@keyframes ac-fill { to { scale: 1 1; } }
@keyframes ac-head { to { inset-inline-start: 100%; } }
@media (prefers-reduced-motion: reduce) { .ac-row i::after { scale: 1 1; animation: none; } .ac-track::after { animation: none; } }
@media (max-width: 820px) {
  .ac-stage { --lab: 4.6rem; }
  .ac-h { inset: 9vh var(--gutter) auto var(--gutter); max-width: none; font-size: clamp(2rem, 9vw, 3rem); }
  .ac-p { inset: 21vh var(--gutter) auto var(--gutter); max-width: none; font-size: .95rem; }
  .ac-img { inset: 31vh var(--gutter) auto var(--gutter); width: auto; height: 13vh; }
  .ac-btn { inset: 46vh auto auto var(--gutter); padding: 11px 18px; }
  .ac-code { inset: 54vh var(--gutter) auto var(--gutter); width: auto; font-size: 9px; line-height: 1.45; padding: 8px 10px; }
  .ac-rail { bottom: 18px; gap: 4px; font-size: 9px; }
  .ac-row i { height: 12px; }
}

/* Time clock demo: eight beats, one cell each */
.eng-auto .clk-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.clk-c { display: grid; gap: 8px; align-content: end; min-height: 88px; padding: 12px 14px; font-size: .95rem; }
.clk-c b { font: 700 11px var(--font-mono); letter-spacing: .06em; color: var(--accent); filter: brightness(.85); }
.clk-c.on b { color: inherit; opacity: .7; filter: none; }
@media (max-width: 700px) { .eng-auto .clk-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Phones in Lite, corridor only: fewer lines on the floor and walls, and the floor is lines without the big solid slab. Walls stay solid; Full is untouched. */
@media (max-width: 820px) {
  @container not style(--vl-world-lite: 0) {
    [vl-world]:not([vl-world="full"]) .ew-grid > i:not(:nth-child(3n + 1)) { display: none; }
    [vl-world]:not([vl-world="full"]) .ew-wall > i:not(:nth-child(6n + 1)) { display: none; }
    [vl-world]:not([vl-world="full"]) .ew-s-floor { display: none; }
  }
}


/* Phones, corridor, not Full: the drawn lines exist only a short way ahead and barely behind the camera. Fewer layers alive at once (the line layers were what crashed an iPhone). */
@media (max-width: 820px) {
  .eng-scene[vl-world-path="dolly"] { --vl-world-far: 2000; --vl-world-near: 350; }
}

/* Desktop corridor: the solid floor and walls keep the same wide window as the lines, so nothing visibly fades as you move. The short window is for phones and for Lite. */
@media (min-width: 821px) {
  .eng-scene[vl-world-path="dolly"] { --vl-solid-far: 5700; --vl-solid-near: 1600; --vl-solid-fade: 1.5; }
}

/* Phones: the corridor is a cinema window. A fixed-ratio box sits in dark bars; two bars close over it and open with the scene clock (thin slit to the full frame). Less area to draw, same world inside. */
@property --eng-o { syntax: "<percentage>"; inherits: false; initial-value: 0%; }
@keyframes eng-open { from { --eng-o: 47%; } to { --eng-o: 0%; } }
@media (max-width: 820px) {
  .eng-scene[vl-world-path] { --eng-ar: 16 / 9; --eng-bar: color-mix(in oklab, var(--fg) 74%, black); }
  .eng-scene[vl-world-path="orbit"] { --eng-ar: 4 / 3; }
  .eng-scene[vl-world-path] .eng-stage { background: var(--eng-bar); }
  .eng-scene[vl-world-path] .eng-vp { inset: 50% 0 auto 0; translate: 0 -50%; block-size: auto; aspect-ratio: var(--eng-ar); background: var(--fg); }
  .eng-scene[vl-world-path] .eng-vp::before { content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none; background: linear-gradient(var(--eng-bar), var(--eng-bar)) top / 100% var(--eng-o) no-repeat, linear-gradient(var(--eng-bar), var(--eng-bar)) bottom / 100% var(--eng-o) no-repeat; animation: eng-open linear both; animation-timeline: --vl-scene; animation-range: 14% 28%; }
}
@media (max-width: 820px) and (prefers-reduced-motion: reduce) {
  .eng-scene[vl-world-path] .eng-vp::before { display: none; }
}

/* ---------- One film camera, shooting the set ----------
   Boxes like the props, placed by the same free-object numbers, driven by the scene clock.
   Orbit: a camera on a tripod in the centre turns once (its reels spin) while the set sweeps behind it.
   Dolly: a camera on a dolly rolls ahead of the lens, shooting down the corridor (wheels and reels follow the scroll). */
.eng-who, .eng-turn, .eng-up { position: absolute; left: 0; top: 0; width: 0; height: 0; transform-style: preserve-3d; }
.eng-actor--orbit .eng-up { top: -244px; }
.am { position: absolute; transform-style: preserve-3d; }
.am > i { position: absolute; display: block; border: 1px solid var(--hi); box-sizing: border-box; background: color-mix(in oklab, var(--ink) 52%, var(--paper)); }
.am > i:nth-child(even) { background: color-mix(in oklab, var(--ink) 64%, var(--paper)); }
.am.hi > i { background: color-mix(in oklab, var(--accent) 46%, var(--paper)); }
.am.hi > i:nth-child(even) { background: color-mix(in oklab, var(--accent) 58%, color-mix(in oklab, var(--ink) 30%, var(--paper))); }
.am.plate > i { border-color: var(--wf); }
.am.leg { transform-origin: 50% 0; }
.am.leg > i, .am.eye > i, .am.mb > i { border-color: var(--wf); }
.am.reel > i:nth-child(-n + 2) { border-radius: 50%; }
.eng-away { transform: rotateY(180deg); }
@keyframes eng-turn { to { transform: rotateY(-360deg); } }
@keyframes eng-spinx { to { rotate: x -1440deg; } }
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .eng-turn, .eng-actor .am.mag, .eng-actor .am.wheel { animation-duration: 1ms; animation-timing-function: linear; animation-fill-mode: both; animation-timeline: --vl-scene; }
    .eng-turn { animation-name: eng-turn; animation-range: 14.3% 85.7%; }
    .eng-actor--orbit .am.mag { animation-name: eng-spinx; animation-range: 14.3% 85.7%; }
    .eng-actor--dolly .am.mag, .eng-actor--dolly .am.wheel { animation-name: eng-spinx; animation-range: 9% 91%; }
  }
}
.eng-actor { --vl-y: 290; --vl-z: -100; }
/* Phones: the camera sits at the bottom centre of the cinema window, a little larger. */
@media (max-width: 820px) {
  .eng-actor--orbit { --vl-y: 258; --vl-z: -100; scale: .55; }
  .eng-actor--dolly { --vl-y: 175; --vl-z: -120; scale: .6; }
}

/* The camera arrives after the set has started to build and leaves before the last frame, so the picture ends alone. */
@keyframes eng-cam-in { 0% { opacity: 0; } 22%, 76% { opacity: 1; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .eng-actor { animation: eng-cam-in linear both; animation-duration: 1ms; animation-timeline: --vl-scene; }
    .eng-actor--orbit { animation-range: 34% 80%; }
    .eng-actor--dolly { animation-range: 26% 78%; }
  }
}

/* Orbit: when the pin ends the picture stops centred; a flat copy of it then grows over everything, captions included, until the stage leaves the viewport. */
.eng-zoom { position: absolute; z-index: 6; left: 50%; top: 50%; width: 698px; height: 410px; margin: -205px 0 0 -349px; border: 2px solid var(--hi); box-sizing: border-box; overflow: hidden; pointer-events: none; opacity: 0; }
.eng-zoom img { display: block; width: 100%; height: 100%; object-fit: cover; }
@keyframes eng-zoom { from { opacity: 1; scale: 1; } to { opacity: 1; scale: 6; } }
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .eng-zoom { animation: eng-zoom linear forwards; animation-duration: 1ms; animation-timeline: --vl-scene; animation-range: 85.7% 100%; }
  }
}
@media (max-width: 820px) {
  .eng-zoom { left: 0; width: 100%; height: auto; aspect-ratio: 4 / 3; margin: 0; translate: 0 -50%; border: 0; }
}
