/* ==========================================================================
   PAGE · ATELIER (atelier.html) — every rule scoped under .page-atelier
   The live app is sacred: nothing here sits over the iframe or animates
   behind it while it is on screen. All motion is CSS (no rAF, no JS loops).
     1. Page tokens + serif fallback
     2. The page's time of day (sky behind everything, scroll-driven)
     3. Stage bar — the masthead that rises from, and sinks behind, the frame;
        the key monitor over the actions
     4. The gilt frame — mat, double hairline that draws once, picture light
     5. Beside the work — placard | shortcuts (three columns above aspect 2.1)
     6. The workflow — a roll of real captures (film strip / contact sheet)
     7. The roll's figures · Time of day — heading, plate, copy
     8. Next
     9. Phone landscape, no JS, forced colours, contrast
   ========================================================================== */

/* Instrument Serif, Atelier's own face (never the parent brand's), from fonts/ like the site's three
   (css/styles.css, section 1). atelier.html preloads the two latin files: the masthead is the first thing drawn. */
@font-face {   /* latin-ext */
    font-family: 'Instrument Serif';
    font-style: italic;
    font-weight: 400;
    font-display: swap;
    src: url('../../fonts/instrument-serif-v5-latin-ext-italic.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {   /* latin */
    font-family: 'Instrument Serif';
    font-style: italic;
    font-weight: 400;
    font-display: swap;
    src: url('../../fonts/instrument-serif-v5-latin-italic.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {   /* latin-ext */
    font-family: 'Instrument Serif';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../../fonts/instrument-serif-v5-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {   /* latin */
    font-family: 'Instrument Serif';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../../fonts/instrument-serif-v5-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Georgia, scaled and re-measured to Instrument Serif, so the masthead keeps its
   width and baseline while the web font loads (no overflow, no shift). */
@font-face {
    font-family: 'Instrument Serif Fallback';
    src: local('Georgia');
    size-adjust: 75.6%;
    ascent-override: 131%;
    descent-override: 41%;
    line-gap-override: 0%;
}


/* ---------- 1. Page tokens ------------------------------------------------- */

.page-atelier {
    --at-serif: 'Instrument Serif', 'Instrument Serif Fallback', Georgia, serif;
    --champagne: #F3DCAE;
    --gilt-leaf: linear-gradient(172deg, var(--champagne) 8%, var(--accent) 46%, var(--accent-2) 94%);
    --film: #0B0907;
    /* frame geometry: the mat runs from the stage edge out to the outer hairline */
    --gilt-out: clamp(9px, .55rem + .45vmin, 18px);
    --gilt-in: calc(var(--gilt-out) * .42);
    /* masthead: sized by the screen's height in landscape, by its width in portrait */
    --at-mast: clamp(3rem, 13svh, 18rem);
    --at-tuck: .11em;   /* how far the letters' feet sit behind the frame at rest */
}

/* whole-pixel insets keep the 1px gilt hairlines crisp */
@supports (width: round(1.5px, 1px)) {
    .page-atelier {
        --gilt-out: round(clamp(9px, .55rem + .45vmin, 18px), 1px);
        --gilt-in: round(var(--gilt-out) * .42, 1px);
    }
}

@media (max-aspect-ratio: 4/5) {
    .page-atelier {
        --at-mast: min((100vw - 2 * var(--gutter)) / 2.5, 24svh);
    }
}

.page-atelier main {
    position: relative;
    isolation: isolate;
}

/* Serif voice for this page's display type */
.page-atelier :is(.at-title, .at-placard-title, .at-side-title, .at-frame-name, .at-key-name, .at-stats .stat-value) {
    font-family: var(--at-serif);
    font-weight: 400;
    font-stretch: normal;
}

/* the wordmark's italic "ier" (an <i>: styling, not stress) and the headings' emphasis */
.page-atelier :is(.at-masthead i, .at-placard-title i, .at-title em) {
    font-style: italic;
    color: var(--accent);
}

/* gilt leaf on the italic "ier"/emphasis where the type is large enough to carry it */
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
    .page-atelier :is(.at-masthead i, .at-placard-title i, .at-title em) {
        padding-right: .08em;
        margin-right: -.08em;
        background: var(--gilt-leaf);
        -webkit-background-clip: text;
        background-clip: text;
        -webkit-text-fill-color: transparent;
    }
}


/* ---------- 2. Time of day -------------------------------------------------
   A sky layer behind the whole page: a dawn wash, a dusk wash and the light of
   a window falling across the warm ground. Morning while the studio is on screen;
   from there to the end of the page the window light travels left → right,
   lengthens and warms toward dusk. Transform/opacity only (compositor), driven
   by the root scroll timeline. Static morning without support / reduced motion. */

.page-atelier .at-sky {
    position: absolute;
    inset: 0;
    z-index: -1;
    overflow: clip;
    pointer-events: none;
    /* the light fades out over the page's last screen, so the ground meets the footer's
       edge connector without a seam */
    -webkit-mask-image: linear-gradient(#000 calc(100% - 75svh), transparent calc(100% - 4rem));
    mask-image: linear-gradient(#000 calc(100% - 75svh), transparent calc(100% - 4rem));
}

.page-atelier .at-sun {
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100svh;
}

.page-atelier .at-sun-wash {
    position: absolute;
    inset: 0;
}

.page-atelier .at-sun-wash--dawn {
    background:
        radial-gradient(90% 70% at 4% -8%, rgba(255, 230, 186, .13), rgba(255, 214, 152, .045) 42%, transparent 72%),
        radial-gradient(60% 50% at 30% 0%, rgba(255, 240, 214, .05), transparent 70%);
}

/* low evening sun from the right */
.page-atelier .at-sun-wash--dusk {
    opacity: 0;
    background:
        radial-gradient(80% 62% at 100% 74%, rgba(236, 132, 76, .19), rgba(200, 92, 74, .065) 46%, transparent 76%),
        linear-gradient(to top, transparent, rgba(110, 48, 36, .09) 22%, transparent 64%);
}

/* the window's light: three panes by two, soft-edged, thrown as a parallelogram */
.page-atelier .at-window {
    position: absolute;
    left: 4%;
    top: 16%;
    width: 50vw;
    height: 62%;
    transform-origin: 50% 100%;
    transform: skewX(-26deg);
}

.page-atelier .at-window-light {
    position: absolute;
    inset: 0;
    -webkit-mask:
        linear-gradient(90deg, transparent, #000 5%, #000 29.5%, transparent 32.5% 34.5%, #000 37.5% 62.5%, transparent 65.5% 67.5%, #000 70.5% 95%, transparent),
        linear-gradient(transparent, #000 7%, #000 45%, transparent 48.5% 51.5%, #000 55% 93%, transparent);
    -webkit-mask-composite: source-in;
    mask:
        linear-gradient(90deg, transparent, #000 5%, #000 29.5%, transparent 32.5% 34.5%, #000 37.5% 62.5%, transparent 65.5% 67.5%, #000 70.5% 95%, transparent),
        linear-gradient(transparent, #000 7%, #000 45%, transparent 48.5% 51.5%, #000 55% 93%, transparent);
    mask-composite: intersect;
}

.page-atelier .at-window-light--day {
    background: linear-gradient(180deg, rgba(255, 240, 210, .085), rgba(255, 226, 172, .05));
}

.page-atelier .at-window-light--dusk {
    opacity: 0;
    background: linear-gradient(180deg, rgba(255, 168, 104, .12), rgba(236, 118, 80, .07));
}

@supports (animation-timeline: scroll()) {
    /* the day starts once the studio has (nearly) left the screen */
    :root:not(.motion-off) .page-atelier :is(.at-window, .at-sun-wash, .at-window-light) {
        animation-timing-function: linear;
        animation-fill-mode: both;
        animation-timeline: scroll(root);
        animation-range: 90svh 100%;
    }

    :root:not(.motion-off) .page-atelier .at-window { animation-name: at-day-window; }
    :root:not(.motion-off) .page-atelier .at-sun-wash--dawn { animation-name: at-day-out; }
    :root:not(.motion-off) .page-atelier .at-sun-wash--dusk { animation-name: at-day-in; }
    :root:not(.motion-off) .page-atelier .at-window-light--day { animation-name: at-day-out; }
    :root:not(.motion-off) .page-atelier .at-window-light--dusk { animation-name: at-day-in; }
}

@keyframes at-day-window {
    0% { transform: translateX(0) skewX(-26deg) scale(1, 1); }
    45% { transform: translateX(26vw) skewX(-4deg) scale(.82, .78); }
    100% { transform: translateX(52vw) skewX(32deg) scale(1.4, 1.04); }
}

@keyframes at-day-out {
    0%, 30% { opacity: 1; }
    85%, 100% { opacity: 0; }
}

@keyframes at-day-in {
    0%, 35% { opacity: 0; }
    100% { opacity: 1; }
}


/* ---------- 3. Stage bar & masthead ----------------------------------------
   The h1 is the giant serif wordmark. Its feet sit behind the top of the frame
   (the stage stacks above it), it rises from behind the frame on arrival and
   sinks behind it as the page scrolls, so the frame visibly occludes it. */

.page-atelier .stage {
    /* the mat stands outside the stage: leave room for it below, and keep the usual
       gap between its outer hairline and the side panels */
    --stage-pad-b: calc(var(--gilt-out) + clamp(.5rem, 1.6vh, 1.25rem));
    --stage-gap: calc(clamp(1rem, 1.6vw, 2.25rem) + var(--gilt-out));
    /* the bar's height before the script measures it (and without JS): eyebrow + masthead */
    --stage-bar-h: calc(var(--at-mast) * .75 + 2.5rem);
}

/* portrait and narrow bars stack the actions over the masthead */
@media (max-aspect-ratio: 4/5), (max-width: 55.49rem) {
    .page-atelier .stage {
        --stage-bar-h: calc(var(--at-mast) * .75 + 6rem);
    }
}

.page-atelier .stage-bar {
    align-items: flex-end;
    padding-bottom: 0;
    /* when the stage is narrower than the page (its width is capped at 2.4 × its height),
       the bar lines up with the frame's outer hairline */
    padding-inline: max(0px, (100% - var(--stage-h) * 2.4) / 2 - var(--gilt-out));
}

.page-atelier .stage-id {
    gap: clamp(.15rem, .6vh, .5rem);
}

.page-atelier .stage-meta {
    margin-bottom: calc(var(--gilt-out) + clamp(.6rem, 1.4vh, 1.1rem));
}

.page-atelier .stage-skip {
    gap: .55em;
}

/* full screen needs the script; "Open in new tab" still works without it */
html:not(.js) .page-atelier [data-fullscreen] {
    display: none;
}

.page-atelier .at-masthead {
    position: relative;
    z-index: 1;
    font-family: var(--at-serif);
    font-size: var(--at-mast);
    font-weight: 400;
    font-stretch: normal;
    line-height: .86;
    letter-spacing: -.03em;
    white-space: nowrap;
    color: var(--plasma);
    text-wrap: nowrap;
    overflow-wrap: normal;
    hyphens: none;
    /* line box: baseline at .77em, box bottom .09em below it. The bar ends where the
       stage begins, so the frame's mat edge (gilt-out above it) cuts --at-tuck into the feet. */
    margin-bottom: calc(var(--gilt-out) - .09em - var(--at-tuck));
}

.page-atelier .at-masthead-set,
.page-atelier .at-masthead-word {
    display: inline-block;
}

/* the A's foot serif overhangs its side bearing: set it on the gutter, inside the frame's edge */
.page-atelier .at-masthead-word {
    padding-left: .025em;
}

/* sunrise: the wordmark rises from behind the frame while the frame draws */
:root.js:not(.motion-off) .page-atelier .at-masthead-word {
    animation: at-rise 1.6s var(--ease-out) .15s backwards;
}

:root.js:not(.motion-off) .page-atelier .at-eyebrow {
    animation: reveal-rise var(--dur-3) var(--ease-out) .95s backwards;
}

/* sunset: as the page scrolls, the wordmark slides down behind the frame */
@supports (animation-timeline: scroll()) {
    :root:not(.motion-off) .page-atelier .at-masthead-set {
        animation: at-set linear both;
        animation-timeline: scroll(root);
        animation-range: 0 calc(var(--at-mast) * 1.8);
    }
}

@keyframes at-rise {
    from { translate: 0 .74em; }
}

@keyframes at-set {
    to { translate: 0 .9em; }
}

/* narrow bars and portrait: status and actions first, the giant wordmark last (it meets the frame) */
@container (max-width: 50.99rem) {
    .page-atelier .stage-meta {
        order: -1;
        flex-basis: 100%;
        margin-bottom: 0;
    }

    .page-atelier .stage-id {
        flex-basis: 100%;
    }
}

@media (max-aspect-ratio: 4/5) {
    .page-atelier .stage-meta {
        order: -1;
        flex-basis: 100%;
        margin-bottom: 0;
    }

    .page-atelier .stage-id {
        flex-basis: 100%;
    }
}

/* the tiniest screens: icon-only actions keep the bar to one row (labels stay for screen readers) */
@media (max-width: 359.98px) {
    .page-atelier .stage-actions .btn {
        min-width: 44px;
        padding-inline: .75em;
        gap: 0;
    }

    .page-atelier .at-btn-label {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
    }
}

/* Landscape bars from 51rem: the masthead | the actions, with the key monitor (or the
   WebGPU note, in three columns) standing over them in the room the tall masthead leaves.
   The masthead gives way before it would crowd the actions on narrow square screens. */
@media not (max-aspect-ratio: 4/5) {
    @media (min-height: 520.02px) {
        @container (min-width: 51rem) {
            .page-atelier .at-masthead {
                --at-mast: clamp(3rem, min(13svh, (100cqi - 35rem - var(--space-l)) / 2.1), 18rem);
            }

            .page-atelier .stage-meta {
                display: grid;
                grid-template-columns: repeat(3, auto);
                justify-content: end;
                align-items: center;
                gap: .45rem 1.25rem;
            }

            .page-atelier .stage-meta > :is(.at-monitor, .at-gpu-note) {
                grid-column: 1 / -1;
            }

            .page-atelier .at-monitor {
                justify-self: end;
            }
        }
    }
}

/* Key monitor: caps only (aria-hidden), lit by the same live key legend as the Shortcuts
   panel. Shown to keyboard-and-pointer visitors wherever that panel isn't beside the
   studio (three columns hide it, below). */
.page-atelier .at-monitor {
    display: none;
    align-items: center;
    gap: .55rem;
}

.page-atelier .at-monitor-label {
    margin-right: .2rem;
    font-family: var(--font-mono);
    font-size: clamp(.625rem, .25rem + .45vmin, .8125rem);
    font-weight: 500;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--text-3);
}

.page-atelier .at-monitor-keys {
    display: inline-flex;
    gap: 3px;
}

.page-atelier .at-monitor kbd {
    min-width: 2em;
    height: 2em;
    padding: 0 .45em;
    font-size: clamp(.6875rem, .3rem + .5vmin, .875rem);   /* grows on 4K so the caps stay legible */
}

.page-atelier .at-monitor .key--wide {
    min-width: 3.1em;
}

@media (hover: hover), (pointer: fine) {
    @container (min-width: 51rem) {
        .page-atelier .at-monitor {
            display: inline-flex;
        }
    }
}

/* portrait: the monitor ends the actions' row */
@media (max-aspect-ratio: 4/5) {
    .page-atelier .at-monitor {
        order: 1;
        margin-left: auto;
    }
}

html:not(.js) .page-atelier :is(.at-monitor, .live-status) {
    display: none;
}

/* the bar's WebGPU note only stands in three columns (section 5) */
.page-atelier .at-gpu-note--bar {
    display: none;
}


/* ---------- 4. The gilt frame ----------------------------------------------
   A dark mat between two gilt hairlines, outside the frame. Each hairline draws
   itself once (1.4s) as two runs from the top-left corner — top then right side,
   left side then bottom — that meet at the bottom-right, the inner frame a beat
   behind the outer. Lines grow by transform only, so the draw stays smooth on the
   compositor while the studio boots on the main thread. --gilt-a is the share of
   the run along the top (≈ width / (width + height) of the stage), so both runs
   keep one speed and arrive together. When the studio takes the keyboard, the
   picture light comes on above it. */

.page-atelier .stage-screen {
    z-index: 2;
    /* inset by the mat, so the outer hairline (not the frame) meets the page's gutter */
    width: min(100% - 2 * var(--gilt-out), var(--stage-h) * 2.4);
    --gilt-a: .66;          /* landscape stages run ≈ 2:1 */
    --gilt-dur: 1.4s;
}

@media (max-aspect-ratio: 4/5) {
    .page-atelier .stage-screen { --gilt-a: .42; }
}

@media (min-aspect-ratio: 4/5) and (max-aspect-ratio: 5/4) {
    .page-atelier .stage-screen { --gilt-a: .54; }
}

.page-atelier .stage-frame {
    border-radius: 2px;
    box-shadow: 0 0 0 1px rgba(var(--accent-rgb), .22);
}

.page-atelier .at-mat {
    position: absolute;
    inset: calc(-1 * var(--gilt-out));
    z-index: -1;
    border-radius: 3px;
    background: linear-gradient(180deg, #211B14, #17130E 30%, #120F0B);
    box-shadow:
        inset 0 1px 0 rgba(255, 240, 214, .06),
        0 2.5rem 6rem -3.5rem rgba(0, 0, 0, .95),
        0 0 0 1px rgba(0, 0, 0, .5);
}

.page-atelier .at-gilt {
    --gilt-delay: .25s;
    position: absolute;
    pointer-events: none;
    color: rgba(var(--accent-rgb), .72);
    transition: color var(--dur-3) var(--ease-out);
}

.page-atelier .at-gilt--outer {
    inset: calc(-1 * var(--gilt-out));
}

.page-atelier .at-gilt--inner {
    --gilt-delay: .4s;
    inset: calc(-1 * var(--gilt-in));
    color: rgba(var(--accent-rgb), .5);
}

.page-atelier .at-gilt-run {
    position: absolute;
    inset: 0;
}

.page-atelier .at-gilt-run::before,
.page-atelier .at-gilt-run::after {
    content: "";
    position: absolute;
    background: currentColor;
}

/* run a: the top (drawn left → right), then the right side (top → bottom) */
.page-atelier .at-gilt-run--a::before { top: 0; left: 0; right: 0; height: 1px; transform-origin: 0 0; }
.page-atelier .at-gilt-run--a::after { top: 0; right: 0; bottom: 0; width: 1px; transform-origin: 0 0; }
/* run b: the left side (top → bottom), then the bottom (left → right) */
.page-atelier .at-gilt-run--b::before { top: 0; bottom: 0; left: 0; width: 1px; transform-origin: 0 0; }
.page-atelier .at-gilt-run--b::after { left: 0; right: 0; bottom: 0; height: 1px; transform-origin: 0 0; }

/* the first leg eases in and the second eases out at the same slope, so each run
   reads as one continuous stroke of the pen */
:root.js:not(.motion-off) .page-atelier .at-gilt-run::before,
:root.js:not(.motion-off) .page-atelier .at-gilt-run::after {
    animation: var(--leg-name) var(--leg-dur) var(--leg-ease) var(--leg-delay) backwards;
}

:root.js:not(.motion-off) .page-atelier .at-gilt-run::before {
    --leg-ease: cubic-bezier(.5, 0, 1, 1);
    --leg-delay: var(--gilt-delay);
}

:root.js:not(.motion-off) .page-atelier .at-gilt-run::after {
    --leg-ease: cubic-bezier(0, 0, .5, 1);
}

:root.js:not(.motion-off) .page-atelier .at-gilt-run--a::before {
    --leg-name: at-draw-x;
    --leg-dur: calc(var(--gilt-dur) * var(--gilt-a));
}

:root.js:not(.motion-off) .page-atelier .at-gilt-run--a::after {
    --leg-name: at-draw-y;
    --leg-dur: calc(var(--gilt-dur) * (1 - var(--gilt-a)));
    --leg-delay: calc(var(--gilt-delay) + var(--gilt-dur) * var(--gilt-a));
}

:root.js:not(.motion-off) .page-atelier .at-gilt-run--b::before {
    --leg-name: at-draw-y;
    --leg-dur: calc(var(--gilt-dur) * (1 - var(--gilt-a)));
}

:root.js:not(.motion-off) .page-atelier .at-gilt-run--b::after {
    --leg-name: at-draw-x;
    --leg-dur: calc(var(--gilt-dur) * var(--gilt-a));
    --leg-delay: calc(var(--gilt-delay) + var(--gilt-dur) * (1 - var(--gilt-a)));
}

@keyframes at-draw-x {
    from { transform: scaleX(0); }
}

@keyframes at-draw-y {
    from { transform: scaleY(0); }
}

/* picture light: a warm spill on the wall above the frame (outside the iframe) */
.page-atelier .at-picture-light {
    position: absolute;
    left: 50%;
    bottom: calc(100% + var(--gilt-out) - 1px);
    width: min(76%, 72rem);
    height: clamp(3.5rem, 10svh, 8rem);
    translate: -50% 0;
    pointer-events: none;
    background:
        radial-gradient(50% 100% at 50% 100%, rgba(var(--accent-rgb), .2), rgba(var(--accent-rgb), .06) 55%, transparent 78%);
    opacity: 0;
    transition: opacity var(--dur-4) var(--ease-out);
}

/* the studio has the keyboard. .is-engaged comes from js/page-atelier.js: Chromium
   doesn't match :focus-within once focus is inside the iframe's own document. */
.page-atelier .stage-screen:is(:focus-within, .is-engaged) .at-picture-light {
    opacity: 1;
}

.page-atelier .stage-screen:is(:focus-within, .is-engaged) .at-gilt {
    color: var(--accent);
}

/* lamp ignition, Atelier style: a solid 2px gilt ring at the frame's edge says plainly that
   the studio has the keyboard; the glow stays on the mat */
.page-atelier .stage-screen:is(:focus-within, .is-engaged) .stage-frame,
.page-atelier .stage-frame:has(.app-frame:fullscreen) {
    box-shadow:
        0 0 0 2px var(--accent),
        0 0 calc(var(--gilt-out) * 1.6) 0 rgba(var(--accent-rgb), .4);
}


/* ---------- 5. Beside the work: placard | shortcuts ------------------------ */

.page-atelier .at-side {
    display: grid;
    align-content: start;
    gap: var(--space-m);
}

.page-atelier .at-side:focus {
    outline: none;
}

/* The museum placard */
.page-atelier .at-placard {
    position: relative;
    display: grid;
    gap: .9rem;
    padding: clamp(1.25rem, .9rem + 1.1vmin, 2.1rem);
    border-radius: 3px;
    background: linear-gradient(168deg, rgba(38, 31, 23, .82), rgba(22, 18, 13, .9));
    box-shadow: inset 0 0 0 1px var(--line), 0 1.5rem 3rem -2rem rgba(0, 0, 0, .8);
}

/* the frame's double rule, in miniature */
.page-atelier .at-placard::before {
    content: "";
    position: absolute;
    inset: 5px;
    border-radius: 1px;
    box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), .2);
    pointer-events: none;
}

.page-atelier .at-placard-maker,
.page-atelier .at-placard-sub,
.page-atelier .at-placard-facts dt {
    font-family: var(--font-mono);
    font-size: var(--t-mono);
    font-weight: 500;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--text-3);
}

.page-atelier .at-placard-maker {
    color: var(--accent-text);
}

.page-atelier .at-placard-title {
    font-size: clamp(2.25rem, 1.6rem + 2.2vmin, 3.5rem);
    line-height: .9;
    letter-spacing: -.025em;
    color: var(--plasma);
}

.page-atelier .at-placard-kind {
    margin-top: -.35rem;
    font-family: var(--at-serif);
    font-size: clamp(1.125rem, 1rem + .4vmin, 1.375rem);
    font-style: italic;
    line-height: 1.25;
    color: var(--text-2);
}

.page-atelier .at-placard-facts {
    display: grid;
    gap: .55rem;
    padding-block: .9rem;
    border-block: 1px solid var(--line);
}

.page-atelier .at-placard-facts > div {
    display: grid;
    align-content: start;   /* a fact that wraps never drops its neighbours' lines */
    gap: .1rem;
}

.page-atelier .at-placard-facts dd {
    margin: 0;
    font-size: var(--t-small);
    line-height: 1.45;
    color: var(--text);
}

.page-atelier .at-placard-list {
    display: grid;
    gap: .1rem 1.25rem;
    counter-reset: at-feature;
}

.page-atelier .at-placard-list li {
    display: grid;
    grid-template-columns: 1.9rem minmax(0, 1fr);
    align-items: baseline;
    padding-block: .3rem;
    font-size: var(--t-small);
    line-height: 1.4;
    color: var(--text-2);
    counter-increment: at-feature;
}

.page-atelier .at-placard-list li::before {
    content: counter(at-feature, decimal-leading-zero);
    font-family: var(--font-mono);
    font-size: .6875rem;
    letter-spacing: .08em;
    font-variant-numeric: tabular-nums;
    color: var(--accent-text);
}

@container (min-width: 30rem) {
    .page-atelier .at-placard-facts {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 1rem;
    }

    .page-atelier .at-placard-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-auto-flow: row;
    }
}

/* Shortcuts: the live key legend */
.page-atelier .at-keys {
    display: grid;
    gap: .55rem;
}

.page-atelier .at-side-title {
    font-size: clamp(1.75rem, 1.3rem + 1.6vmin, 2.5rem);
    line-height: 1;
    letter-spacing: -.02em;
    margin-bottom: .6rem;
}

.page-atelier .at-legend {
    display: grid;
    gap: 0 1.5rem;
    border-top: 1px solid var(--line);
}

.page-atelier .at-key {
    display: grid;
    grid-template-columns: 5.4rem minmax(0, 1fr);
    grid-template-rows: auto auto;
    align-items: center;
    column-gap: .9rem;
    padding-block: .5rem;
    border-bottom: 1px solid var(--line);
}

/* caps sit against their names: single caps line up with the K of Ctrl K */
.page-atelier .at-key-caps {
    grid-row: 1 / span 2;
    display: flex;
    justify-content: flex-end;
    gap: .3rem;
}

.page-atelier .at-key-caps kbd {
    font-size: .8125rem;
}

.page-atelier .at-key-name {
    font-size: 1.25rem;
    line-height: 1.1;
    color: var(--plasma);
    transition: color 120ms;
}

.page-atelier .at-key-what {
    font-size: var(--t-small);
    line-height: 1.35;
    color: var(--text-3);
}

.page-atelier .at-key:has(.is-down) .at-key-name {
    color: var(--accent);
}

@container (min-width: 34rem) {
    .page-atelier .at-legend {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.page-atelier .at-keys-hint {
    margin-top: .5rem;
    font-size: var(--t-small);
    line-height: 1.55;
    color: var(--text-3);
}

/* the hint speaks to the visitor's own input: a keyboard and pointer, or a touch screen */
.page-atelier .at-keys-hint--touch {
    display: none;
}

@media (hover: none) and (pointer: coarse) {
    .page-atelier .at-keys-hint--fine {
        display: none;
    }

    .page-atelier .at-keys-hint--touch {
        display: block;
    }
}

/* without JS nothing runs here, so nothing lights */
html:not(.js) .page-atelier .at-keys-hint {
    display: none;
}

.page-atelier .at-saved {
    display: flex;
    align-items: baseline;   /* the bookmark rests on the first line, however the line wraps */
    gap: .65rem;
    font-size: var(--t-small);
    color: var(--text-2);
}

/* a little bookmark: saved in this browser */
.page-atelier .at-saved-mark {
    flex: none;
    width: .7rem;
    height: .9rem;
    background: var(--accent);
    clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 72%, 0 100%);
}

.page-atelier .at-gpu-note {
    margin: 0;
}

/* Three columns: the panels hang beside the work like a gallery wall, the placard low
   beside the frame, the shortcuts high on the other side. The side columns never drop
   below a readable width (they grow with the screen, 16–24rem), and on 32:9 each panel
   hangs at the centre of its wall instead of leaving the screen's edges bare. */
@media (min-aspect-ratio: 21/10) and (min-height: 520.02px) {
    .page-atelier .stage {
        --at-side-min: clamp(16rem, 11vw, 24rem);
        grid-template-columns: minmax(var(--at-side-min), 1fr) minmax(0, calc(var(--stage-h) * 2.4)) minmax(var(--at-side-min), 1fr);
    }

    .page-atelier .stage-screen {
        width: 100%;
    }

    /* the masthead stands over the frame's outer hairline (the columns are symmetric, so
       the stage starts half the leftover width in); the actions may run on over the shortcuts */
    .page-atelier .stage-bar {
        --at-stage-w: min(var(--stage-h) * 2.4, 100% - 2 * var(--at-side-min) - 2 * var(--stage-gap));
        padding-inline: max(0px, (100% - var(--at-stage-w)) / 2 - var(--gilt-out)) 0px;
    }

    /* the full legend is beside the studio: no monitor. Without WebGPU, the note takes its
       place over the actions (it adds no width: the actions set the column) */
    .page-atelier .at-monitor,
    .page-atelier .at-gpu-note--side {
        display: none;
    }

    .page-atelier .at-gpu-note--bar:not([hidden]) {
        display: block;
        contain: inline-size;
        max-width: none;
        padding-block: .45rem;
        font-size: .8125rem;
        line-height: 1.5;
        text-wrap: pretty;
    }

    .page-atelier .at-side {
        width: min(100%, 34rem);
        justify-self: center;
        gap: var(--space-s);
    }

    .page-atelier .stage-side--start {
        align-self: end;
    }

    .page-atelier .at-placard {
        gap: .7rem;
    }

    .page-atelier .at-key {
        grid-template-columns: 4.9rem minmax(0, 1fr);
        padding-block: .4rem;
    }
}

/* tall three-column walls (1440p ultrawides): the panels grow to the scale of the work,
   as single tall columns (no fact or feature ever wraps) */
@media (min-aspect-ratio: 21/10) and (min-height: 1200px) {
    .page-atelier .at-side {
        width: min(100%, 28rem);
    }

    .page-atelier :is(.at-placard-facts, .at-placard-list) {
        grid-template-columns: minmax(0, 1fr);
    }

    .page-atelier .at-placard-facts {
        gap: .55rem;
    }

    .page-atelier .at-placard {
        gap: .9rem;
        padding: 2.25rem 2.25rem 2rem;
    }

    .page-atelier .at-placard-title {
        font-size: 3.75rem;
    }

    .page-atelier .at-placard-kind {
        font-size: 1.5rem;
    }

    .page-atelier :is(.at-placard-facts dd, .at-placard-list li, .at-key-what, .at-keys-hint, .at-saved) {
        font-size: 1rem;
    }

    .page-atelier .at-placard-list li {
        padding-block: .45rem;
    }

    .page-atelier .at-side-title {
        font-size: 3rem;
    }

    .page-atelier .at-key {
        grid-template-columns: 6rem minmax(0, 1fr);
        padding-block: .7rem;
    }

    .page-atelier .at-key-name {
        font-size: 1.5rem;
    }

    .page-atelier .at-key-caps kbd {
        font-size: .9375rem;
    }
}

/* super-ultrawide: the actions end where the frame ends, not at the screen's edge */
@media (min-aspect-ratio: 3/1) and (min-height: 520.02px) {
    .page-atelier .stage-bar {
        padding-inline: max(0px, (100% - var(--at-stage-w)) / 2 - var(--gilt-out));
    }
}

/* three columns under ~940px tall: a compact placard and tighter key rows, so both
   panels fit the stage's height without scrolling */
@media (min-aspect-ratio: 21/10) and (min-height: 520.02px) and (max-height: 940px) {
    .page-atelier .at-placard {
        gap: .55rem;
        padding: 1rem 1.1rem 1.1rem;
    }

    .page-atelier .at-placard-title {
        font-size: 2rem;
    }

    .page-atelier .at-placard-kind {
        margin-top: -.2rem;
        font-size: 1.0625rem;
    }

    .page-atelier .at-placard-facts {
        padding-block: .6rem;
    }

    .page-atelier .at-placard-facts > div:nth-child(n+2) {
        display: none;
    }

    .page-atelier .at-placard-list li {
        padding-block: .12rem;
        font-size: .8125rem;
        line-height: 1.3;
    }

    .page-atelier .at-key {
        padding-block: .25rem;
    }

    .page-atelier .at-side-title {
        margin-bottom: .3rem;
    }

    /* without WebGPU the note deepens the bar (and shortens the stage): the hint gives way */
    .page-atelier .stage:has(.at-gpu-note--bar:not([hidden])) .at-keys-hint {
        display: none;
    }
}

/* short three-column windows (1600×600): the descriptions give way to the names */
@media (min-aspect-ratio: 21/10) and (min-height: 520.02px) and (max-height: 760px) {
    .page-atelier .at-key-what,
    .page-atelier .at-keys-hint {
        display: none;
    }

    .page-atelier .at-key-caps {
        grid-row: auto;
    }

    /* the note, smaller, keeps the bar as shallow as it can */
    .page-atelier .at-gpu-note--bar:not([hidden]) {
        padding-block: .3rem;
        font-size: .75rem;
        line-height: 1.4;
    }

    .page-atelier .stage:has(.at-gpu-note--bar:not([hidden])) :is(.at-placard-list li, .at-key) {
        padding-block: 0;
    }

    .page-atelier .stage:has(.at-gpu-note--bar:not([hidden])) .at-key {
        min-height: 2.05rem;
    }
}

/* the shortest three-column windows (≤ 640px tall): the tightest panels */
@media (min-aspect-ratio: 21/10) and (min-height: 520.02px) and (max-height: 640px) {
    .page-atelier .at-placard {
        gap: .35rem;
        padding: .85rem 1rem .9rem;
    }

    .page-atelier :is(.at-placard-list li, .at-key) {
        padding-block: 0;
    }

    .page-atelier .at-key {
        min-height: 2.05rem;
    }

    .page-atelier .at-keys {
        gap: .4rem;
    }

    .page-atelier .at-side-title {
        font-size: 1.625rem;
        margin-bottom: .15rem;
    }

    /* and without WebGPU, the panels' small headings give way too */
    .page-atelier .stage:has(.at-gpu-note--bar:not([hidden])) :is(.at-placard-maker, .at-keys > .eyebrow) {
        display: none;
    }
}


/* ---------- 6. The workflow: a roll of real captures -----------------------
   One continuous film. ≥ 44rem: frames sit side by side in strips (3 per strip,
   6 when the strip is very wide) with sprocket rows above and below, and the film
   runs off both edges of the screen; captions sit under each frame. Narrower:
   the roll turns vertical, sprockets on both sides and captions on the film.
   The sprocket tile is film base with a real hole, so the page's light shows through. */

.page-atelier .at-head {
    max-width: 62rem;
}

.page-atelier .at-title {
    font-size: min(var(--t-h1), 11cqi);
    line-height: .98;
    letter-spacing: -.025em;
    max-width: 18ch;
}

/* "Draw it. Furnish it." then the gilt "Film it." on a line of its own; each sentence
   stays whole, so the narrowest screens break between sentences, never inside one */
.page-atelier .at-title--workflow {
    max-width: none;
    text-wrap: balance;
}

.page-atelier .at-title--workflow em {
    display: block;
    width: fit-content;
}

.page-atelier .at-roll {
    --sprocket: clamp(15px, .55rem + .5vmin, 26px);
    --frame-line: clamp(4px, .3rem, 8px);
    --hole-x: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 20'%3E%3Cpath fill='%230B0907' fill-rule='evenodd' d='M0 0H24V20H0ZM7.5 6H16.5A1.5 1.5 0 0 1 18 7.5V12.5A1.5 1.5 0 0 1 16.5 14H7.5A1.5 1.5 0 0 1 6 12.5V7.5A1.5 1.5 0 0 1 7.5 6Z'/%3E%3C/svg%3E");
    --hole-y: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 24'%3E%3Cpath fill='%230B0907' fill-rule='evenodd' d='M0 0H20V24H0ZM7.5 6H12.5A1.5 1.5 0 0 1 14 7.5V16.5A1.5 1.5 0 0 1 12.5 18H7.5A1.5 1.5 0 0 1 6 16.5V7.5A1.5 1.5 0 0 1 7.5 6Z'/%3E%3C/svg%3E");
    --film-strip:
        var(--hole-x) 0 0 / auto var(--sprocket) round no-repeat,
        var(--hole-x) 0 100% / auto var(--sprocket) round no-repeat,
        linear-gradient(var(--film), var(--film)) 0 var(--sprocket) / 100% calc(100% - 2 * var(--sprocket)) no-repeat;
    overflow-x: clip;
    container: at-roll / inline-size;
}

.page-atelier .at-reel {
    display: grid;
    width: var(--wrap);
    margin-inline: auto;
    padding-block: var(--space-2xs);
}

.page-atelier .at-frame {
    position: relative;
    min-width: 0;
}

.page-atelier .at-frame figure {
    display: grid;
    height: 100%;
}

.page-atelier .at-frame-film {
    position: relative;
}

.page-atelier .at-frame-shot {
    position: relative;
    display: block;
    aspect-ratio: 16 / 9;
    overflow: clip;   /* not hidden: the print's view timeline must see the page's scroll */
    border-radius: 2px;
    background: #000;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, .6);
    transition: box-shadow 140ms ease-out;
}

.page-atelier .at-frame-shot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* a whisper of emulsion: the frame's corners fall off like a print */
.page-atelier .at-frame-shot::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    box-shadow: inset 0 0 2.5rem rgba(11, 9, 7, .45);
}

/* The prints (and the plate further down) develop as they come into view: from a dim,
   warm latent image to full colour, scrubbed by their own view timeline instead of a
   one-shot observer, because the studio's boot can hold the shared main thread for
   seconds. Every in-between state is still a visible picture, and the captions never
   hide. Frames further along a strip develop a little later (--at-col). Static where
   unsupported / under reduced motion. */
@supports (animation-timeline: view()) {
    :root.js:not(.motion-off) .page-atelier :is(.at-frame-shot img, .at-frame-shot .at-card-keys, .at-light-plate picture) {
        animation: at-develop linear both;
        animation-timeline: view();
        animation-range: entry calc(5% + var(--at-col, 0) * 12%) cover calc(42% + var(--at-col, 0) * 6%);
    }
}

@keyframes at-develop {
    from { filter: brightness(.42) sepia(.8) saturate(.75) contrast(1.1); }
    to { filter: none; }
}

/* the end-of-roll title card: the search and shortcut keys */
.page-atelier .at-frame-card {
    display: grid;
    place-items: center;
    background:
        radial-gradient(60% 55% at 50% 45%, rgba(var(--accent-rgb), .16), transparent 70%),
        radial-gradient(90% 60% at 50% 115%, rgba(140, 110, 80, .2), transparent 70%),
        #12110F;
}

.page-atelier .at-frame-card::after {
    box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), .12);
}

/* the caps scale with the card itself, so they never fill it edge to edge */
.page-atelier .at-frame-card {
    container-type: inline-size;
}

.page-atelier .at-card-keys {
    display: flex;
    align-items: center;
    gap: .35em;
    font-size: clamp(.75rem, 6.5cqi, 1.5rem);
}

.page-atelier .at-card-keys kbd {
    font-size: 1em;
}

.page-atelier .at-card-or {
    margin-inline: .3em;
    font-family: var(--at-serif);
    font-style: italic;
    font-size: 1.4em;
    color: var(--text-3);
}

/* the key Atelier just received lights its frame */
.page-atelier .at-frame:has(kbd.is-down) .at-frame-shot {
    box-shadow: 0 0 0 1px var(--accent), 0 0 2.25rem -.4rem rgba(var(--accent-rgb), .75);
}

.page-atelier .at-frame:has(kbd.is-down) .at-frame-name {
    color: var(--accent);
}

/* captions */
.page-atelier .at-frame-caption {
    display: grid;
    align-content: start;
    gap: .5rem;
    padding: 1.1rem var(--frame-line) 0;
}

.page-atelier .at-frame-head {
    display: flex;
    align-items: center;
    gap: .75rem;
    min-width: 0;
}

.page-atelier .at-frame-num {
    font-family: var(--font-mono);
    font-size: var(--t-mono);
    letter-spacing: .14em;
    font-variant-numeric: tabular-nums;
    color: var(--accent-text);
}

.page-atelier .at-frame-name {
    font-size: clamp(1.5rem, 1.15rem + 1.1vmin, 2.25rem);
    line-height: 1;
    letter-spacing: -.015em;
    color: var(--plasma);
    transition: color 140ms;
}

/* each mode's key stands right after its name */
.page-atelier .at-frame-head kbd {
    margin-left: -.15rem;
}

.page-atelier .at-frame-text {
    font-size: var(--t-small);
    line-height: 1.55;
    color: var(--text-2);
    max-width: 40ch;
}

.page-atelier .at-frame-text kbd {
    font-size: .6875rem;
    min-width: 1.9em;
    height: 1.9em;
    vertical-align: .05em;
}

/* --- vertical roll (narrow) --- */
@container at-roll (max-width: 43.99rem) {
    .page-atelier .at-frame {
        padding: calc(var(--frame-line) * 1.5) var(--sprocket);
        background:
            var(--hole-y) 0 0 / var(--sprocket) auto no-repeat round,
            var(--hole-y) 100% 0 / var(--sprocket) auto no-repeat round,
            linear-gradient(var(--film), var(--film)) var(--sprocket) 0 / calc(100% - 2 * var(--sprocket)) 100% no-repeat;
    }

    .page-atelier .at-frame:first-child {
        border-radius: 4px 4px 0 0;
    }

    .page-atelier .at-frame:last-child {
        border-radius: 0 0 4px 4px;
    }

    .page-atelier .at-frame-caption {
        padding: 1rem .35rem 1.35rem;
    }
}

/* --- strips (wide) --- */
@container at-roll (min-width: 44rem) {
    .page-atelier .at-reel {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        row-gap: clamp(2.25rem, 1.5rem + 3vmin, 4rem);
    }

    .page-atelier .at-frame figure {
        grid-template-rows: auto 1fr;
    }

    .page-atelier .at-frame-film {
        padding: var(--sprocket) var(--frame-line);
        background: var(--film-strip);
    }

    /* the film leaves the screen at both ends of every strip */
    .page-atelier .at-frame:nth-child(3n + 1) .at-frame-film::before,
    .page-atelier .at-frame:nth-child(3n) .at-frame-film::after {
        content: "";
        position: absolute;
        top: 0;
        bottom: 0;
        width: 100vw;
        background: var(--film-strip);
        pointer-events: none;
    }

    .page-atelier .at-frame:nth-child(3n + 1) .at-frame-film::before { right: 100%; }
    .page-atelier .at-frame:nth-child(3n) .at-frame-film::after { left: 100%; }

    .page-atelier .at-frame:nth-child(3n + 2) { --at-col: 1; }
    .page-atelier .at-frame:nth-child(3n) { --at-col: 2; }
}

/* one strip of six when frames would still be generous (QHD+ ultrawide, 4K) */
@container at-roll (min-width: 168rem) {
    .page-atelier .at-reel {
        width: min(100% - 2 * var(--gutter), 260rem);
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }

    .page-atelier .at-frame:nth-child(3n + 1) .at-frame-film::before,
    .page-atelier .at-frame:nth-child(3n) .at-frame-film::after {
        content: none;
    }

    .page-atelier .at-frame:first-child .at-frame-film::before,
    .page-atelier .at-frame:last-child .at-frame-film::after {
        content: "";
        position: absolute;
        top: 0;
        bottom: 0;
        width: 100vw;
        background: var(--film-strip);
        pointer-events: none;
    }

    .page-atelier .at-frame:first-child .at-frame-film::before { right: 100%; }
    .page-atelier .at-frame:last-child .at-frame-film::after { left: 100%; }

    .page-atelier .at-frame:nth-child(2) { --at-col: .4; }
    .page-atelier .at-frame:nth-child(3) { --at-col: .8; }
    .page-atelier .at-frame:nth-child(4) { --at-col: 1.2; }
    .page-atelier .at-frame:nth-child(5) { --at-col: 1.6; }
    .page-atelier .at-frame:nth-child(6) { --at-col: 2; }
}


/* ---------- 7. The roll's figures · Time of day ----------------------------- */

/* the figures close the workflow, right under the roll */
.page-atelier .at-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-l) var(--space-m);
    margin-top: clamp(2.5rem, 1.5rem + 4vmin, 5.5rem);
}

.page-atelier .at-stats .stat {
    align-content: start;
    gap: .75rem;
    padding-top: 1.1rem;
    border-top: 1px solid var(--line-strong);
}

.page-atelier .at-stats .stat-label {
    order: 2;
    max-width: 22ch;
    line-height: 1.5;
}

.page-atelier .at-stats .stat-value {
    font-size: clamp(3rem, 1.6rem + 5.5vmin, 7.5rem);
    line-height: .9;
    letter-spacing: -.03em;
}

@container (min-width: 48rem) {
    .page-atelier .at-stats {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

/* The section opens with its heading; from 60rem the plate stands to the left of the
   heading and copy, which centre on it together. */
.page-atelier .at-light-split {
    display: grid;
    column-gap: clamp(2rem, 5vw, 6rem);
}

.page-atelier .at-light-split > * {
    min-width: 0;
}

.page-atelier .at-light-head {
    margin-bottom: var(--space-xl);
}

.page-atelier .at-light-plate {
    --plate-max-h: min(72svh, 56rem);
    justify-self: center;
}

/* clip, not hide: an overflow-hidden picture would be its image's scroll container, and
   the image's view() timeline (the parallax drift) would never move with the page */
.page-atelier .at-light-plate [data-parallax] {
    overflow: clip;
}

.page-atelier .at-light-copy {
    display: grid;
    gap: var(--space-s);
    margin-top: var(--space-xl);
    container-type: inline-size;
}

.page-atelier .at-light-text {
    font-size: var(--t-lead);
    line-height: 1.5;
    color: var(--text-2);
    max-width: 34ch;
}

/* the page's own light is only mentioned where it really moves */
.page-atelier .at-light-text--sky {
    display: none;
}

@supports (animation-timeline: scroll()) {
    @media (forced-colors: none) and (not (prefers-contrast: more)) {
        :root:not(.motion-off) .page-atelier .at-light-text--sky {
            display: block;
        }
    }
}

.page-atelier .at-light-copy .btn-row {
    margin-top: var(--space-s);
}

@container (min-width: 60rem) {
    .page-atelier .at-light-split {
        grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
        grid-template-rows: 1fr auto auto 1fr;
    }

    .page-atelier .at-light-plate {
        grid-area: 1 / 1 / 5 / 2;
        justify-self: start;
        align-self: center;
    }

    .page-atelier .at-light-head {
        grid-area: 2 / 2;
        margin-bottom: var(--space-2xs);
    }

    .page-atelier .at-light-copy {
        grid-area: 3 / 2;
        margin-top: var(--space-s);
    }
}


/* ---------- 8. Next ------------------------------------------------------- */

.page-atelier .at-next {
    padding-top: 0;
}

.page-atelier .at-next .wrap {
    display: flex;
    justify-content: flex-end;
    padding-top: clamp(2rem, 1rem + 4vmin, 4rem);
    border-top: 1px solid var(--line);
}


/* ---------- 9. Modes ------------------------------------------------------ */

/* phone landscape: the 40px bar and the stage fill the screen exactly — a small
   wordmark, no mat, the frame's own edge turns gilt */
@media (orientation: landscape) and (max-height: 520px) {
    .page-atelier .stage-bar {
        align-items: center;
        padding-inline: 0;
    }

    /* one 40px row (no matter how narrow): the small wordmark, then the actions */
    .page-atelier .stage-meta {
        order: 0;
        flex-basis: auto;
        margin-bottom: 0;
    }

    .page-atelier .stage-id {
        flex-basis: auto;
    }

    .page-atelier .at-masthead {
        font-size: 1.6rem;
        line-height: 1;
        margin-bottom: 0;
    }

    .page-atelier .at-masthead-set,
    .page-atelier .at-masthead-word,
    .page-atelier .at-eyebrow {
        animation: none !important;
    }

    .page-atelier .at-mat,
    .page-atelier .at-gilt,
    .page-atelier .at-picture-light {
        display: none;
    }

    /* the stage clears the whole header, including the no-JS link row (--header-offset).
       "Back to the live studio" (#studio) lands where the snap does: the bar at the top and
       the stage filling the rest, the header scrolled away. The margin undoes the root's
       header scroll-padding and skips the header itself; the section is not a snap area, so
       the snap points (and the way back up to the header) stay as they are. */
    .page-atelier .stage {
        --stage-pad-b: 0px;
        --stage-bar-h: 40px;
        padding-top: var(--header-offset);
        scroll-margin-top: calc(-2 * var(--header-offset) - 1rem);
    }

    .page-atelier .stage-screen {
        width: 100%;
    }

    .page-atelier .stage-frame {
        box-shadow: 0 0 0 1px rgba(var(--accent-rgb), .45);
    }
}

/* Without JS the studio can't run: the poster stands in front of the idle frame with an
   honest caption; "Open in new tab" stays as the action */
html:not(.js) .page-atelier .app-frame {
    visibility: hidden;
}

html:not(.js) .page-atelier .stage-poster {
    z-index: 1;
}

.page-atelier .at-nojs {
    position: absolute;
    inset: auto 0 0;
    z-index: 2;
    display: grid;
    grid-template-columns: minmax(0, 60ch);
    gap: .4rem;
    max-width: none;
    padding: clamp(2.5rem, 12%, 8rem) clamp(1rem, 4%, 3rem) clamp(1rem, 4%, 2.5rem);
    font-size: clamp(.9375rem, .85rem + .4vmin, 1.25rem);
    line-height: 1.5;
    color: var(--text);
    text-wrap: balance;
    background: linear-gradient(to top, rgba(15, 13, 10, .92), rgba(15, 13, 10, .7) 55%, transparent);
}

.page-atelier .at-nojs-kicker {
    font-family: var(--font-mono);
    font-size: var(--t-mono);
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--accent-text);
}

@media (forced-colors: active) {
    .page-atelier .at-sky {
        display: none;
    }

    /* the masthead's glyphs rise into the eyebrow's line; keep the eyebrow's backplate on top */
    .page-atelier .at-eyebrow {
        position: relative;
        z-index: 2;
    }

    .page-atelier :is(.at-masthead i, .at-placard-title i, .at-title em) {
        background: none;
        -webkit-text-fill-color: currentColor;
        color: CanvasText;
    }

    .page-atelier .at-nojs {
        background: Canvas;
    }

    .page-atelier .at-mat {
        background: Canvas;
        box-shadow: none;
    }

    .page-atelier .at-gilt {
        color: CanvasText;
    }

    .page-atelier .at-gilt-run::before,
    .page-atelier .at-gilt-run::after {
        forced-color-adjust: none;
    }

    /* the film stock (sprocket tiles) is decoration: drop it, keep the prints */
    .page-atelier .at-frame-film,
    .page-atelier .at-frame {
        background: none !important;
    }

    .page-atelier .at-frame-film::before,
    .page-atelier .at-frame-film::after,
    .page-atelier .at-picture-light,
    .page-atelier .at-saved-mark {
        display: none;
    }

    .page-atelier .at-placard,
    .page-atelier .at-frame-shot {
        border: 1px solid CanvasText;
    }
}

@media (prefers-contrast: more) {
    .page-atelier .at-placard {
        background: var(--laminate);
    }

    .page-atelier .at-sky {
        display: none;
    }
}
