/*
 * Vitrine kit: the parts every public theme is built from.
 *
 * Core emits this file before the theme's own stylesheets on every public
 * page (Theme::assets), so a client theme gets working parts — picture,
 * video, embed, lightbox, carousel, media grid, card, header — whatever it
 * declares. It carries structure and a minimal look; everything a client
 * would want to change is a token below.
 *
 * Layers, in order of strength. A client stylesheet that is not in a layer
 * beats all of them, so a theme overrides any rule here without fighting
 * its specificity:
 *
 *   reset   box sizing, media defaults
 *   tokens  every value below, as custom properties on :root
 *   base    type, links, focus, prose, buttons, form fields
 *   layout  wrap, flow, stack, cluster, grid, split
 *   parts   the components
 *   theme   the theme's own stylesheet (style.css puts itself here)
 *
 * A client theme's tokens.css is unlayered too: it sets the tokens it cares
 * about and inherits the rest from here.
 */
@layer reset, tokens, base, layout, parts, share, theme;

/* Tokens ---------------------------------------------------------------- */
@layer tokens {
    :root {
        /* Declared, not defaulted: a light palette says so, and the browser
           stops dressing form controls and scrollbars in its dark styling. A
           dark theme sets `color-scheme: dark` with its own colours. */
        color-scheme: light;

        /* Colour */
        --bg: #fff;
        --paper: #fff;
        --ink: #111214;
        --muted: #63666d;
        --line: #e4e5e8;
        --line-strong: #8b8e95;
        --accent: #111214;
        --on-accent: #fff;
        --danger: #8a3a32;
        /* A picture's box before its own average colour is known. */
        --media-bg: #eceded;
        /* Words and controls laid over a picture or a film. */
        --on-media: #fff;
        --scrim: rgb(0 0 0 / .4);
        /* The lightbox and anything else that takes the whole screen. */
        --overlay-bg: rgb(12 12 14 / .96);
        --overlay-fg: #fff;

        /* Type. The starter uses the reader's own system face: no font file
           to wait for, and every client theme brings its own anyway. */
        --font-body: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
        --font-display: var(--font-body);
        --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
        --text-xs: .75rem;
        --text-sm: .875rem;
        --text-base: 1rem;
        --text-md: 1.125rem;
        --text-lg: clamp(1.25rem, 2vw, 1.5rem);
        --text-xl: clamp(1.5rem, 3vw, 2rem);
        --text-2xl: clamp(1.9rem, 4.5vw, 2.9rem);
        --text-3xl: clamp(2.2rem, 5.5vw, 4rem);
        --leading-tight: 1.1;
        --leading-snug: 1.3;
        --leading: 1.5;
        --leading-prose: 1.65;
        --weight-body: 400;
        --weight-strong: 500;
        --weight-display: 500;
        --tracking-display: -.02em;
        --tracking-caps: .14em;

        /* Links in running text: their colour, line, its weight and its gap. */
        --link: inherit;
        --link-decoration: underline;
        --link-thickness: auto;
        --link-offset: .18em;

        /* Space */
        --space-1: .25rem;
        --space-2: .5rem;
        --space-3: .75rem;
        --space-4: 1rem;
        --space-5: 1.5rem;
        --space-6: 2rem;
        --space-7: 3rem;
        --space-8: 4.5rem;
        --space-9: 6rem;
        /* The page's side margin, and the space between page sections. */
        --gutter: clamp(1.25rem, 4vw, 2.5rem);
        --section: clamp(3rem, 8vw, 6rem);
        /* Between the parts of one section: a heading and its text. */
        --flow-gap: var(--space-6);

        /* Widths: running text, the page's content, and work that should be
           seen bigger than the text around it. */
        --width-text: 40rem;
        --width-content: 72rem;
        --width-wide: 96rem;

        /* Shape */
        --border: 1px;
        --radius: 0;
        --radius-sm: 0;
        --radius-pill: 999px;
        --media-radius: 0;
        --shadow: 0 1px 2px rgb(0 0 0 / .06), 0 8px 24px rgb(0 0 0 / .08);
        --shadow-popover: 0 6px 24px rgb(0 0 0 / .12);

        /* Motion. `prefers-reduced-motion` is honoured in base below. */
        --ease: cubic-bezier(.2, .7, .2, 1);
        --duration-fast: .15s;
        --duration: .3s;
        --duration-slow: .6s;

        /* Media */
        --ratio-card: 4 / 3;
        --ratio-wide: 16 / 9;
        --ratio-portrait: 4 / 5;
        --ratio-square: 1;
        /* Justified rows: how tall a row aims to be before it is stretched. */
        --row-height: clamp(9rem, 18vw, 15rem);

        /* Interaction */
        --tap: 2.75rem;
        --focus-width: 2px;
        --focus-offset: 3px;
        --z-header: 20;
        --z-menu: 30;
        --z-overlay: 100;
    }
}

/* Reset ----------------------------------------------------------------- */
@layer reset {
    *, *::before, *::after { box-sizing: border-box; }
    html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
    body { margin: 0; }
    /* `height: auto` is load-bearing, not tidiness. `image()` emits intrinsic
       width/height attributes so the browser can reserve the box before the
       file arrives — but those attributes map to CSS width/height at the
       lowest precedence, and any rule that sets only `width` leaves the
       height attribute standing. Both dimensions then being definite,
       `aspect-ratio` is ignored and a 5616×3744 source lays out 3744px tall
       inside a 230px column. Releasing the height is what lets width and
       aspect-ratio actually decide the box. */
    img, video { max-width: 100%; height: auto; }
    /* <picture> is a wrapper, not a box: this keeps the <img> itself the grid
       or flex item, so every layout rule written against the image applies. */
    picture { display: contents; }
    /* …and its <source>s are not boxes either. Without this, a picture in a
       grid gives each source an empty row of its own above the image. */
    source { display: none; }
    figure, blockquote { margin: 0; }
    button, input, select, textarea { font: inherit; color: inherit; }
    [hidden] { display: none !important; }
}

/* Base ------------------------------------------------------------------ */
@layer base {
    html, body { background: var(--bg); color: var(--ink); }
    body {
        min-height: 100vh;
        display: flex;
        flex-direction: column;
        font-family: var(--font-body);
        font-weight: var(--weight-body);
        line-height: var(--leading);
    }
    a {
        color: var(--link);
        text-decoration-line: var(--link-decoration);
        text-decoration-thickness: var(--link-thickness);
        text-underline-offset: var(--link-offset);
    }

    h1, h2, h3, h4 {
        font-family: var(--font-display);
        font-weight: var(--weight-display);
        letter-spacing: var(--tracking-display);
        line-height: var(--leading-tight);
        text-wrap: balance;
    }
    h1 { font-size: var(--text-3xl); margin: 0 0 var(--space-3); }
    h2 { font-size: var(--text-xl); margin: 0 0 var(--space-3); }
    h3 { font-size: var(--text-md); margin: 0 0 var(--space-2); }
    p { text-wrap: pretty; }

    :focus-visible { outline: var(--focus-width) solid var(--accent); outline-offset: var(--focus-offset); }

    .sr-only {
        position: absolute;
        width: 1px;
        height: 1px;
        margin: -1px;
        padding: 0;
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
    }
    .skip { position: absolute; inset-inline-start: -999px; }
    .skip:focus {
        inset-inline-start: var(--space-4);
        top: var(--space-4);
        z-index: var(--z-overlay);
        background: var(--paper);
        padding: var(--space-2) var(--space-3);
    }

    .eyebrow {
        margin: 0 0 var(--space-2);
        color: var(--muted);
        font-size: var(--text-xs);
        letter-spacing: var(--tracking-caps);
        text-transform: uppercase;
    }
    .muted { color: var(--muted); }

    /* Rich text: what an editor wrote in the control panel. */
    .prose { line-height: var(--leading-prose); max-width: var(--width-text); }
    .prose > :first-child { margin-top: 0; }
    .prose > :last-child { margin-bottom: 0; }
    .prose p { margin: 0 0 var(--space-4); }
    .prose h2, .prose h3 { margin: var(--space-6) 0 var(--space-3); }
    .prose ul, .prose ol { margin: 0 0 var(--space-4); padding-inline-start: var(--space-5); }
    .prose li { margin: var(--space-1) 0; }
    .prose a { color: var(--accent); }
    .prose blockquote {
        margin: var(--space-5) 0;
        padding-inline-start: var(--space-4);
        border-inline-start: 2px solid var(--line);
        color: var(--muted);
    }
    .prose img, .prose figure { margin: var(--space-5) 0; }
    .prose figcaption { margin-top: var(--space-2); color: var(--muted); font-size: var(--text-sm); }
    .prose hr { border: 0; border-top: var(--border) solid var(--line); margin: var(--space-6) 0; }
    .prose code { font-family: var(--font-mono); font-size: .92em; background: var(--media-bg); padding: .1em .3em; }
    .prose table { width: 100%; border-collapse: collapse; margin: 0 0 var(--space-4); font-size: var(--text-sm); }
    .prose th, .prose td { text-align: start; padding-block: var(--space-2); padding-inline: 0 var(--space-3); border-bottom: var(--border) solid var(--line); }

    /* Buttons: `.button` for the one thing to do, `.button.is-quiet` for the
       rest. A link or a <button>, same look. */
    .button {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: var(--space-2);
        min-height: var(--tap);
        padding: 0 var(--space-5);
        border: var(--border) solid var(--accent);
        border-radius: var(--radius);
        background: var(--accent);
        color: var(--on-accent);
        font-size: var(--text-sm);
        font-weight: var(--weight-strong);
        text-decoration: none;
        cursor: pointer;
        transition: background-color var(--duration-fast) var(--ease), color var(--duration-fast) var(--ease), border-color var(--duration-fast) var(--ease);
    }
    .button:hover { background: var(--ink); border-color: var(--ink); }
    .button.is-quiet { background: transparent; color: var(--ink); border-color: var(--line-strong); }
    .button.is-quiet:hover { border-color: var(--ink); }
    .button[disabled], .button[aria-disabled="true"] { opacity: .45; pointer-events: none; }

    /* Form fields. Under 16px iOS zooms into a focused field and stays there,
       so inputs keep 1rem whatever the label beside them does. */
    .field { display: grid; gap: var(--space-2); }
    .field-label { font-size: var(--text-sm); color: var(--muted); }
    .field-hint { font-size: var(--text-xs); color: var(--muted); }
    .field-error { font-size: var(--text-sm); color: var(--danger); }
    .input, .select, .textarea {
        width: 100%;
        min-height: var(--tap);
        padding: var(--space-2) var(--space-3);
        border: var(--border) solid var(--line-strong);
        border-radius: var(--radius-sm);
        background: var(--paper);
        font-size: 1rem;
    }
    .textarea { min-height: 8rem; resize: vertical; }
    .input:hover, .select:hover, .textarea:hover { border-color: var(--ink); }
    .input:focus-visible, .select:focus-visible, .textarea:focus-visible { outline-offset: 1px; border-color: var(--accent); }
    .input[aria-invalid="true"], .select[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--danger); }
    .check { display: inline-flex; align-items: center; gap: var(--space-2); min-height: var(--tap); cursor: pointer; }
    .check input { width: 1.1rem; height: 1.1rem; accent-color: var(--accent); }

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

/* Layout ---------------------------------------------------------------- */
@layer layout {
    main { flex: 1; width: 100%; padding-block: var(--space-7) var(--section); }

    /* A centred box at the content width, with the page's side margin. */
    .wrap { width: min(100% - 2 * var(--gutter), var(--width-content)); margin-inline: auto; }
    .wrap.is-text { width: min(100% - 2 * var(--gutter), var(--width-text)); }
    .wrap.is-wide { width: min(100% - 2 * var(--gutter), var(--width-wide)); }

    /*
     * Flow: a page's column, with room on either side to break out of it.
     *
     *   full ─┬─ wide ─┬─ content ─┬─ wide ─┬─ full
     *
     * Every child sits in `content`. `.is-text` keeps running text at a
     * reading width, `.is-wide` gives work more room than the words around
     * it, `.is-full` runs edge to edge. A flow inside a flow shares its
     * columns (subgrid), so a block several levels down can still break out
     * to the edge of the page.
     */
    .flow {
        --flow-wide: max(0px, (var(--width-wide) - var(--width-content)) / 2);
        display: grid;
        grid-template-columns:
            [full-start] minmax(var(--gutter), 1fr)
            [wide-start] minmax(0, var(--flow-wide))
            [content-start] min(100% - 2 * var(--gutter), var(--width-content))
            [content-end] minmax(0, var(--flow-wide))
            [wide-end] minmax(var(--gutter), 1fr)
            [full-end];
        row-gap: var(--flow-gap);
        align-content: start;
    }
    .flow > * { grid-column: content; min-width: 0; }
    .flow > .is-text { max-width: var(--width-text); }
    .flow > .is-wide { grid-column: wide; }
    .flow > .is-full { grid-column: full; }
    .flow > .flow { grid-column: full; grid-template-columns: subgrid; }

    /* Vertical rhythm between siblings. `--stack-gap` sets it per use. */
    .stack { display: grid; gap: var(--stack-gap, var(--space-4)); align-content: start; }
    .stack > * { margin: 0; min-width: 0; }

    /* A row that wraps: tags, buttons, links. */
    .cluster {
        display: flex;
        flex-wrap: wrap;
        align-items: var(--cluster-align, center);
        gap: var(--cluster-gap, var(--space-3));
        list-style: none;
        margin: 0;
        padding: 0;
    }

    /* As many columns as fit at `--grid-min` wide. */
    .grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(min(var(--grid-min, 15rem), 100%), 1fr));
        gap: var(--grid-gap, var(--space-5));
        list-style: none;
        margin: 0;
        padding: 0;
    }

    /* Two things side by side — a picture and its words — one above the
       other when the box is too narrow for both. It asks its own width, not
       the window's, so it works in a sidebar as well as across a page. */
    .split { container-type: inline-size; }
    .split-inner {
        display: grid;
        gap: var(--split-gap, var(--space-6));
        align-items: var(--split-align, center);
    }
    @container (min-width: 40rem) {
        .split-inner { grid-template-columns: var(--split-columns, 1fr 1fr); }
        .split.is-reversed .split-inner > :first-child { order: 2; }
    }

    /* Space between page sections. */
    .section + .section { margin-top: var(--section); }
}

/* Parts ----------------------------------------------------------------- */
@layer parts {
    /* Icons: `icon('name')` inlines an SVG drawn on a 24 grid in strokes, so
       it takes the colour and size of the text around it. */
    .icon {
        width: 1.25em;
        height: 1.25em;
        flex: none;
        fill: none;
        stroke: currentColor;
        stroke-width: 1.6;
        stroke-linecap: round;
        stroke-linejoin: round;
        vertical-align: -.25em;
    }
    .icon-play, .icon-pause { fill: currentColor; stroke: none; }
    .icon-button {
        display: inline-grid;
        place-items: center;
        min-width: var(--tap);
        min-height: var(--tap);
        padding: 0;
        border: 0;
        border-radius: var(--radius-pill);
        background: none;
        color: inherit;
        cursor: pointer;
    }
    .icon-button:hover { color: var(--accent); }

    /* Header ------------------------------------------------------------- */
    .site-head {
        position: relative;
        z-index: var(--z-header);
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: var(--space-4) var(--space-5);
        padding: var(--space-4) var(--gutter);
        border-bottom: var(--border) solid var(--line);
        background: var(--bg);
        transition: transform var(--duration) var(--ease), background-color var(--duration) var(--ease), color var(--duration) var(--ease);
    }
    .mark { display: inline-flex; align-items: center; font-family: var(--font-display); font-size: var(--text-md); font-weight: var(--weight-strong); text-decoration: none; }
    /* An uploaded mark is given a height and left to find its own width, so
       a wide wordmark and a square emblem both sit correctly on one line. */
    .mark-logo { display: block; height: 1.9rem; width: auto; max-width: min(18rem, 50vw); }
    /* What a site sends (parts/share-head): its mark and its languages. */
    .share-head > .langs { margin-inline-start: auto; }
    .site-head-panel { margin-inline-start: auto; display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3) var(--space-5); }
    .nav { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5); }
    .nav-item { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-3); }
    .nav a { text-decoration: none; color: var(--muted); }
    .nav a:hover, .nav a[aria-current="page"] { color: var(--ink); }
    .nav-sub { display: flex; flex-wrap: wrap; gap: var(--space-3); font-size: var(--text-sm); }

    /* Hidden until site.js unhides it: without script the panel stays open. */
    .nav-toggle {
        display: none;
        margin-inline-start: auto;
        min-width: var(--tap);
        min-height: var(--tap);
        place-items: center;
        border: var(--border) solid var(--line-strong);
        border-radius: var(--radius-sm);
        background: var(--paper);
        cursor: pointer;
    }
    .nav-toggle-bars,
    .nav-toggle-bars::before,
    .nav-toggle-bars::after { display: block; width: 1.15rem; height: 1.5px; background: currentColor; }
    .nav-toggle-bars { position: relative; }
    .nav-toggle-bars::before,
    .nav-toggle-bars::after { content: ""; position: absolute; left: 0; }
    .nav-toggle-bars::before { top: -5px; }
    .nav-toggle-bars::after { top: 5px; }

    /* Language selector: a <details>, so it works with script off. */
    .langs { position: relative; }
    .langs > summary {
        list-style: none;
        cursor: pointer;
        color: var(--muted);
        font-size: var(--text-xs);
        letter-spacing: .08em;
        padding: var(--space-1) 0;
    }
    .langs > summary::-webkit-details-marker { display: none; }
    .langs > summary:hover { color: var(--ink); }
    .langs-current::after { content: " ▾"; }
    .langs-menu {
        position: absolute;
        inset-inline-end: 0;
        z-index: var(--z-menu);
        min-width: 9rem;
        margin: var(--space-2) 0 0;
        padding: var(--space-1) 0;
        list-style: none;
        background: var(--paper);
        color: var(--ink);
        border: var(--border) solid var(--line);
    }
    .langs-menu a { display: block; padding: var(--space-2) var(--space-3); text-decoration: none; color: var(--muted); font-size: var(--text-sm); white-space: nowrap; }
    .langs-menu a:hover, .langs-menu a[aria-current="true"] { color: var(--ink); }

    @media (max-width: 760px) {
        .nav-toggle:not([hidden]) { display: grid; }
        .site-head[data-collapsible] .site-head-panel { display: none; }
        .site-head[data-nav-open] .site-head-panel {
            display: grid;
            gap: var(--space-4);
            flex-basis: 100%;
            margin: var(--space-2) 0 var(--space-1);
            justify-items: start;
        }
        .site-head[data-nav-open] .nav,
        .site-head[data-nav-open] .nav-item { display: grid; gap: var(--space-3); justify-items: start; }
        /* Child pages indent under their parent instead of sitting beside it. */
        .site-head[data-nav-open] .nav-sub { display: grid; gap: var(--space-2); padding-inline-start: var(--space-4); }
        .nav a { font-size: var(--text-md); }
        .langs-menu { inset-inline-end: auto; inset-inline-start: 0; }
    }

    /*
     * Header modes, from theme.json → `header`:
     *
     *   sticky   stays at the top, slides away while reading down and comes
     *            back on the way up (kit.js sets data-header-hidden).
     *   overlay  on a page that opens with full-width media, sits over it in
     *            the media's colours, and takes the page's own once scrolled
     *            past (kit.js sets data-header-scrolled). On any other page
     *            the attribute comes the moment the header sticks over the
     *            page, for a theme that dresses it then.
     *
     * An editor's preview note (@vitrine/preview-note) comes first in <body>, above
     * the header. A sticky header needs nothing: it sticks once the note has
     * scrolled away. A fixed one starts at --preview-note-offset, the part of
     * the note still on screen, and an absolute one at --preview-note-h, the
     * note's height (both set by kit.js, 0 without a note).
     */
    .site-head.is-sticky { position: sticky; top: 0; }
    .site-head.is-sticky[data-header-hidden] { transform: translateY(-100%); }
    .site-head[data-nav-open] { transform: none; }
    .opens-with-media .site-head.is-overlay {
        position: fixed;
        inset: var(--preview-note-offset, 0px) 0 auto;
        background: transparent;
        border-color: transparent;
        color: var(--on-media);
    }
    .opens-with-media .site-head.is-overlay:not(.is-sticky) { position: absolute; top: var(--preview-note-h, 0px); }
    .opens-with-media .site-head.is-overlay .nav a,
    .opens-with-media .site-head.is-overlay .langs > summary { color: inherit; }
    .opens-with-media .site-head.is-overlay[data-header-scrolled],
    .opens-with-media .site-head.is-overlay[data-nav-open] {
        background: var(--bg);
        border-color: var(--line);
        color: var(--ink);
    }
    .opens-with-media main { padding-top: 0; }

    /* Footer ------------------------------------------------------------- */
    .site-foot {
        display: grid;
        gap: var(--space-3);
        width: min(100% - 2 * var(--gutter), var(--width-content));
        margin-inline: auto;
        padding: var(--space-6) 0 var(--space-7);
        border-top: var(--border) solid var(--line);
        color: var(--muted);
        font-size: var(--text-sm);
    }
    .foot-tagline { margin: 0; color: var(--ink); max-width: 34rem; }
    .foot-group { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5); }
    .foot-group a { text-decoration: none; color: var(--muted); }
    .foot-group a:hover { color: var(--ink); }
    /* Details within one contact stay close; the gap between two contacts is
       several times that, so the footer does not read as one person with six
       phone numbers. */
    .foot-contact { gap: var(--space-2) var(--space-7); }
    .foot-contact-item { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-1) var(--space-3); }
    .foot-contact-name { color: var(--ink); }
    .foot-social a { text-transform: capitalize; }
    .foot-copy { margin: 0; font-size: var(--text-xs); }

    /* Media -------------------------------------------------------------- */
    /* parts/media.html.twig: one picture, film or embed, with its caption. */
    .media { position: relative; display: grid; gap: var(--space-2); min-width: 0; }
    .media-frame {
        position: relative;
        display: block;
        overflow: hidden;
        border-radius: var(--media-radius);
        background: var(--media-bg);
    }
    .media-frame img { display: block; width: 100%; }
    /* A fixed shape: the picture fills it and is cropped around its focus. */
    .media[data-ratio] .media-frame { aspect-ratio: var(--media-ratio); }
    .media[data-ratio] .media-frame img { height: 100%; object-fit: cover; }
    .media[data-fit="contain"] .media-frame img { object-fit: contain; }
    .media-caption { color: var(--muted); font-size: var(--text-sm); line-height: var(--leading-snug); }
    .media-credit { display: block; font-size: var(--text-xs); opacity: .8; }
    a.media-frame { cursor: zoom-in; }
    a.media-frame:focus-visible { outline-offset: calc(-1 * var(--focus-width)); }

    /* Embed -------------------------------------------------------------- */
    /* parts/embed.html.twig: a Vimeo or YouTube film that costs nothing until
       it is played. Until then it is a poster and a link to the film on its
       own site; kit.js swaps the iframe in on a click. */
    .embed {
        position: relative;
        display: block;
        aspect-ratio: var(--embed-ratio, var(--ratio-wide));
        overflow: hidden;
        border-radius: var(--media-radius);
        background: var(--media-bg);
        color: var(--on-media);
    }
    .embed-link { position: absolute; inset: 0; display: block; color: inherit; text-decoration: none; }
    .embed-link img,
    .embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; object-fit: cover; }
    .embed-link::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, var(--scrim), transparent 45%); }
    .embed-play {
        position: absolute;
        inset: 0;
        z-index: 1;
        display: grid;
        place-items: center;
        width: 4.5rem;
        height: 4.5rem;
        margin: auto;
        border-radius: var(--radius-pill);
        background: var(--scrim);
        transition: transform var(--duration-fast) var(--ease);
    }
    .embed-link:hover .embed-play { transform: scale(1.06); }
    .embed-play .icon { width: 1.75rem; height: 1.75rem; fill: currentColor; stroke: none; margin-left: .2rem; }
    .embed-title {
        position: absolute;
        z-index: 1;
        inset: auto var(--space-4) var(--space-3);
        font-size: var(--text-sm);
        line-height: var(--leading-snug);
        text-shadow: 0 1px 2px rgb(0 0 0 / .4);
    }
    .embed-provider { display: block; font-size: var(--text-xs); letter-spacing: .06em; text-transform: uppercase; opacity: .85; }
    .embed[data-embed-playing] .embed-link { display: none; }

    /* Lightbox ----------------------------------------------------------- */
    /* parts/lightbox.html.twig is the dialog; kit.js opens it from any link
       marked `data-lightbox`, and steps through the others in its group. */
    .lightbox {
        position: fixed;
        inset: 0;
        width: 100%;
        height: 100%;
        max-width: none;
        max-height: none;
        margin: 0;
        padding: 0;
        border: 0;
        background: var(--overlay-bg);
        color: var(--overlay-fg);
        overscroll-behavior: contain;
    }
    .lightbox[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
    .lightbox::backdrop { background: transparent; }
    .lightbox-bar { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); padding: var(--space-2) var(--space-3); }
    .lightbox-count { font-size: var(--text-sm); font-variant-numeric: tabular-nums; opacity: .8; padding-inline: var(--space-3); }
    .lightbox-stage {
        position: relative;
        display: grid;
        /* One cell the size of the stage, so a picture's max-height has
           something definite to be a percentage of. */
        grid-template: minmax(0, 1fr) / minmax(0, 1fr);
        place-items: center;
        min-height: 0;
        padding: 0 var(--space-4);
        touch-action: pan-y pinch-zoom;
    }
    /* <picture> is display: contents (reset), so the image is the item. */
    .lightbox-stage img {
        width: auto;
        height: auto;
        max-width: 100%;
        max-height: 100%;
        object-fit: contain;
        user-select: none;
    }
    /* A film as wide as its own shape lets it be within the stage's height. */
    .lightbox-stage > .video { width: min(100%, var(--width-wide), (100dvh - 9rem) * var(--video-ratio)); }
    .lightbox-stage > .embed { width: min(100%, var(--width-wide), (100dvh - 9rem) * 16 / 9); }
    .lightbox-stage > .card-watch-view { width: min(100%, var(--width-wide), (100dvh - 13rem) * var(--video-w, 16) / var(--video-h, 9)); }
    .lightbox-prev,
    .lightbox-next { position: absolute; top: 50%; translate: 0 -50%; z-index: 1; background: rgb(0 0 0 / .35); }
    .lightbox-prev { inset-inline-start: var(--space-3); }
    .lightbox-next { inset-inline-end: var(--space-3); }
    .lightbox-caption { min-height: var(--tap); padding: var(--space-3) var(--gutter) var(--space-4); font-size: var(--text-sm); text-align: center; opacity: .85; }
    .lightbox[data-single] .lightbox-prev,
    .lightbox[data-single] .lightbox-next,
    .lightbox[data-single] .lightbox-count { visibility: hidden; }
    @media (prefers-reduced-motion: no-preference) {
        .lightbox[open] { animation: kit-fade var(--duration) var(--ease); }
        /* <picture> is display: contents (reset), so the image is the item. */
    .lightbox-stage img { animation: kit-fade var(--duration-fast) var(--ease); }
    }
    @keyframes kit-fade { from { opacity: 0; } }
    /* A share's viewer (share-gallery, share-delivery) is the same viewer
       (kit.js) and plays a film in the same player. Its stage sizes a bare
       picture or <video> to itself; the player's own film and poster fill
       the player's frame instead, whatever a theme's stylesheet says of
       `video` and `img` on that stage (!important: the Kit's layer is under
       a theme's unlayered rules). */
    :is(.share-lightbox-stage, .dl-viewer-stage) > .video {
        width: min(100%, (100dvh - 10rem) * var(--video-ratio));
        max-height: 100%;
    }
    :is(.share-lightbox-stage, .dl-viewer-stage) > .video :is(.video-el, .video-poster img) {
        width: 100% !important;
        height: 100% !important;
        max-width: none !important;
        max-height: none !important;
    }
    .share-lightbox-none { padding: var(--space-4); text-align: center; opacity: .8; }
    /* Nothing behind the dialog scrolls while it is open. */
    html:has(.lightbox[open]) { overflow: hidden; }

    /* Carousel ----------------------------------------------------------- */
    /* parts/carousel.html.twig. A row that scrolls and snaps — touch,
       trackpad and keyboard work with no script at all; kit.js only adds the
       arrows and the count. `--carousel-item` is a slide's width. */
    .carousel { position: relative; display: grid; gap: var(--space-3); }
    .carousel-track {
        display: grid;
        grid-auto-flow: column;
        grid-auto-columns: var(--carousel-item, min(85%, 40rem));
        gap: var(--carousel-gap, var(--space-4));
        margin: 0;
        padding: 0;
        list-style: none;
        overflow-x: auto;
        overscroll-behavior-x: contain;
        scroll-snap-type: x mandatory;
        scroll-padding-inline: var(--carousel-inset, 0);
        padding-inline: var(--carousel-inset, 0);
        scrollbar-width: none;
    }
    .carousel-track::-webkit-scrollbar { display: none; }
    .carousel-track > * { scroll-snap-align: start; min-width: 0; }
    .carousel-track:focus-visible { outline-offset: calc(-1 * var(--focus-width)); }
    .carousel-controls { display: flex; align-items: center; justify-content: flex-end; gap: var(--space-2); }
    .carousel-count { margin-inline-end: auto; color: var(--muted); font-size: var(--text-sm); font-variant-numeric: tabular-nums; }
    .carousel-btn[disabled] { opacity: .3; cursor: default; }
    @media (prefers-reduced-motion: no-preference) {
        .carousel-track { scroll-behavior: smooth; }
    }

    /* Media grid --------------------------------------------------------- */
    /* parts/media-grid.html.twig, in one of six arrangements:
     *
     *   natural    columns, every item at its own shape, tops aligned
     *   uniform    one shape for all, cropped: a contact sheet
     *   masonry    columns, every item at its own shape, packed
     *   justified  rows that fill the width, every item at its own shape
     *   rows       one item per row, the full width
     *   two_up     two across, one on a phone
     *
     * Films always claim a full row in the column layouts: a player's bar
     * does not fit under 400px, and a film is not a thumbnail. */
    .media-grid { --grid-min: 16rem; margin: 0; padding: 0; list-style: none; }
    .media-grid > li { min-width: 0; }
    /* A carousel (a reel's): how many pictures, over its corner; clicked, the
       viewer steps through them. */
    .media-grid > li.is-carousel { position: relative; }
    .media-carousel-count {
        position: absolute;
        left: var(--space-3);
        bottom: var(--space-3);
        display: inline-flex;
        align-items: center;
        gap: var(--space-1);
        padding: 0.25em 0.6em;
        border-radius: 999px;
        background: rgb(0 0 0 / 0.6);
        color: #fff;
        font-size: var(--text-sm, 0.8125rem);
        font-variant-numeric: tabular-nums;
        line-height: 1.2;
        pointer-events: none;
    }
    .media-carousel-count svg { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 2; }
    /* One playing on its own: each picture in turn over the item's own,
       whole in its place (never cropped, whatever a theme does to the
       item's picture), with a button to stop it. */
    .media-carousel-slide {
        position: absolute;
        inset: 0;
        background: var(--media-bg);
        opacity: 0;
        transition: opacity .6s var(--ease);
        pointer-events: none;
    }
    .media-carousel-slide[data-shown] { opacity: 1; }
    [data-carousel-play] .media-frame > .media-carousel-slide > picture > img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }
    .media-carousel-toggle {
        position: absolute;
        z-index: 2;
        inset-inline-end: var(--space-3);
        bottom: var(--space-3);
        color: var(--on-media);
        background: var(--scrim);
    }
    .media-carousel-toggle .icon-play,
    .media-carousel-toggle[aria-pressed="true"] .icon-pause { display: none; }
    .media-carousel-toggle[aria-pressed="true"] .icon-play { display: block; }
    .media-grid.is-natural,
    .media-grid.is-uniform {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(min(var(--grid-min), 100%), 1fr));
        gap: var(--grid-gap, var(--space-3));
        align-items: start;
    }
    .media-grid.is-uniform .media-frame { aspect-ratio: var(--grid-ratio, var(--ratio-card)); }
    .media-grid.is-uniform .media-frame img { height: 100%; object-fit: cover; }
    .media-grid.is-rows { display: grid; gap: var(--grid-gap, var(--space-5)); }
    .media-grid.is-two_up { display: grid; gap: var(--grid-gap, var(--space-3)); align-items: start; }
    @media (min-width: 761px) {
        .media-grid.is-two_up { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    }
    .media-grid.is-natural > .is-video,
    .media-grid.is-uniform > .is-video,
    .media-grid.is-two_up > .is-video { grid-column: 1 / -1; }
    .media-grid.is-masonry {
        columns: var(--grid-min) auto;
        column-gap: var(--grid-gap, var(--space-3));
    }
    .media-grid.is-masonry > li { break-inside: avoid; margin-bottom: var(--grid-gap, var(--space-3)); }
    /* Justified: each item grows by its own width-to-height ratio from a
       basis of the row height, so a row of mixed shapes comes out one height
       and the page's width. The filler stops the last row stretching. */
    .media-grid.is-justified { display: flex; flex-wrap: wrap; gap: var(--grid-gap, var(--space-3)); }
    .media-grid.is-justified > li {
        flex: calc(var(--w, 4) / var(--h, 3) * 100) 1 calc(var(--row-height) * var(--w, 4) / var(--h, 3));
    }
    .media-grid.is-justified > li .media-frame { aspect-ratio: var(--w, 4) / var(--h, 3); }
    .media-grid.is-justified > li .media-frame img { height: 100%; object-fit: cover; }
    .media-grid.is-justified::after { content: ""; flex: 1e4 1 0; }
    @media (max-width: 760px) {
        .media-grid.is-justified > li { flex-basis: 100%; }
    }

    /* Card --------------------------------------------------------------- */
    /* parts/card.html.twig: a picture, a title and a line about it, as one
       link. `--card-ratio` sets the picture's shape. */
    .card { position: relative; display: grid; gap: var(--space-2); align-content: start; min-width: 0; }
    .card-link { display: grid; gap: var(--space-2); text-decoration: none; }
    .card-media {
        position: relative;
        display: block;
        aspect-ratio: var(--card-ratio, var(--ratio-card));
        overflow: hidden;
        border-radius: var(--media-radius);
        background: var(--media-bg);
    }
    .card-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
    /* A preview film takes the card's shape, not its own. */
    .card-media > .video-ambient { position: absolute; inset: 0; width: 100%; height: 100%; aspect-ratio: auto; border-radius: 0; }
    .card-title { font-family: var(--font-display); font-size: var(--text-md); font-weight: var(--weight-strong); line-height: var(--leading-snug); }
    .card-link:hover .card-title { text-decoration: underline; text-underline-offset: .18em; }
    .card-meta { color: var(--muted); font-size: var(--text-sm); }
    .card-empty { color: var(--muted); }
    @media (prefers-reduced-motion: no-preference) {
        .card-media img { transition: transform var(--duration-slow) var(--ease); }
        .card-link:hover .card-media img { transform: scale(1.03); }
    }
    /* `watch`: a labelled play button on a film's picture, solid so it reads
       on any frame: the quick look is not a thing to discover by accident.
       It sits beside the link, not in it, so a frame of the picture's shape
       is laid over the picture to place it; only the button takes the
       pointer. */
    .card-watch-frame {
        position: absolute;
        inset: 0 0 auto;
        z-index: 1;
        display: grid;
        place-items: end start;
        padding: var(--space-3);
        aspect-ratio: var(--card-ratio, var(--ratio-card));
        pointer-events: none;
    }
    .card-watch {
        display: inline-flex;
        align-items: center;
        gap: var(--space-2);
        min-width: var(--tap);
        min-height: var(--tap);
        padding: 0 var(--space-4) 0 var(--space-3);
        border-radius: var(--radius-pill);
        background: var(--bg);
        color: var(--ink);
        box-shadow: var(--shadow);
        font-size: var(--text-sm);
        font-weight: var(--weight-strong);
        text-decoration: none;
        pointer-events: auto;
    }
    .card-watch:hover { background: var(--ink); color: var(--bg); }
    @media (prefers-reduced-motion: no-preference) {
        .card-watch { transition: transform var(--duration-fast) var(--ease), background-color var(--duration-fast) var(--ease), color var(--duration-fast) var(--ease); }
        .card-watch:hover { transform: scale(1.05); }
    }
    .card-watch .icon { width: 1.1rem; height: 1.1rem; flex: none; }
    /* A phone's card is too narrow for the word: the button, round. */
    @media (max-width: 760px) {
        .card-watch-frame { padding: var(--space-2); }
        .card-watch { justify-content: center; padding: 0; }
        .card-watch-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
    }
    /* In the viewer: the film, then its title and the way to the project. */
    .card-watch-view { display: grid; gap: var(--space-3); }
    .card-watch-foot {
        display: flex;
        flex-wrap: wrap;
        align-items: baseline;
        justify-content: space-between;
        gap: var(--space-2) var(--space-5);
        margin: 0;
    }
    .card-watch-title { font-family: var(--font-display); font-size: var(--text-md); font-weight: var(--weight-strong); }
    .card-watch-link {
        display: inline-flex;
        align-items: center;
        gap: var(--space-2);
        min-height: var(--tap);
        color: inherit;
        font-weight: var(--weight-strong);
    }
    .card-grid { --grid-min: 15rem; }
    @media (max-width: 760px) {
        .card-grid { --grid-min: 9.5rem; --grid-gap: var(--space-5) var(--space-3); }
    }

    /* Contact form ------------------------------------------------------- */
    .contact-form { --stack-gap: var(--space-4); max-width: var(--width-text); }
    .contact-form .field { display: grid; gap: var(--space-2); }
    /* For robots only: out of sight and out of reach, but not display: none,
       which some of them read as a sign to leave it alone. */
    .contact-form-trap { position: absolute; inset-inline-start: -10000px; width: 1px; height: 1px; overflow: hidden; }
    .contact-form-status:empty { display: none; }
    .contact-form-status { margin: 0; }
    .contact-form-status.is-problem { color: var(--danger); }
    .contact-form-notice { margin: 0; color: var(--muted); font-size: var(--text-sm); }
    .contact-form-missing { color: var(--muted); font-size: var(--text-sm); }

    /* Consent ------------------------------------------------------------ */
    .consent-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
    .consent-open { padding: 0; border: 0; background: none; color: inherit; font: inherit; text-decoration: underline; cursor: pointer; }

    /* Disclosure --------------------------------------------------------- */
    /* parts/disclosure.html.twig. Several with the same `name` open one at
       a time, as an accordion; the browser does that, not a script. */
    .disclosure { border-bottom: var(--border) solid var(--line); }
    .disclosure:first-of-type { border-top: var(--border) solid var(--line); }
    .disclosure > summary {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: var(--space-4);
        min-height: var(--tap);
        padding: var(--space-3) 0;
        list-style: none;
        cursor: pointer;
        font-weight: var(--weight-strong);
    }
    .disclosure > summary::-webkit-details-marker { display: none; }
    .disclosure > summary .icon { transition: transform var(--duration-fast) var(--ease); }
    .disclosure[open] > summary .icon { transform: rotate(45deg); }
    .disclosure-body { padding: 0 0 var(--space-5); }

    /* Filter chips ------------------------------------------------------- */
    /* parts/filter.html.twig. Links that work as they are; with kit.js they
       hide what does not match without a page load. */
    .chips { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
    .chip {
        display: inline-flex;
        align-items: center;
        min-height: var(--tap);
        padding: 0 var(--space-4);
        border: var(--border) solid var(--line);
        border-radius: var(--radius-pill);
        color: var(--muted);
        font-size: var(--text-sm);
        text-decoration: none;
    }
    .chip:hover { border-color: var(--line-strong); color: var(--ink); }
    .chip[aria-current="true"],
    .chip[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: var(--bg); }
    [data-filter-hidden] { display: none !important; }

    /* Pager -------------------------------------------------------------- */
    /* parts/pager.html.twig: previous and next, or pages of a list. */
    .pager {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: var(--space-4);
        padding-top: var(--space-5);
        border-top: var(--border) solid var(--line);
    }
    .pager-link { display: grid; gap: var(--space-1); text-decoration: none; }
    .pager-link.is-next { grid-column: 2; text-align: end; justify-items: end; }
    .pager-label { display: inline-flex; align-items: center; gap: var(--space-2); color: var(--muted); font-size: var(--text-sm); }
    .pager-title { font-family: var(--font-display); font-size: var(--text-md); line-height: var(--leading-snug); }
    .pager-link:hover .pager-title { text-decoration: underline; }

    /* Reveal ------------------------------------------------------------- */
    /* `data-reveal` on anything: it fades up as it comes on screen. Only
       once kit.js is running (it sets .kit-js on <html>), never for a reader
       who asked for less motion, and never for what is already on screen. */
    @media (prefers-reduced-motion: no-preference) {
        .kit-js [data-reveal] { transition: opacity var(--duration-slow) var(--ease), transform var(--duration-slow) var(--ease); }
        .kit-js [data-reveal]:not([data-revealed]) { opacity: 0; transform: translateY(var(--reveal-shift, 1.5rem)); }
    }

    /* Ambient and preview films ----------------------------------------- */
    /* parts/video.html.twig with `mode: 'ambient'` (a muted loop with no
       controls but a pause button) or `mode: 'preview'` (a card's moving
       thumbnail). Both are silent and start only on screen, and neither
       starts for a reader who asked for less motion or less data. */
    .video-ambient {
        position: relative;
        display: grid;
        overflow: hidden;
        border-radius: var(--media-radius);
        background: var(--video-placeholder, var(--media-bg));
    }
    .video-ambient[data-ratio] { aspect-ratio: var(--video-w) / var(--video-h); }
    .video-ambient > video,
    .video-ambient > picture > img,
    .video-ambient > img {
        grid-area: 1 / 1;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    .video-ambient > picture > img,
    .video-ambient > img { z-index: 1; transition: opacity var(--duration) var(--ease); }
    .video-ambient[data-playing] > picture > img,
    .video-ambient[data-playing] > img { opacity: 0; }
    .video-ambient-toggle {
        position: absolute;
        z-index: 2;
        inset-inline-end: var(--space-3);
        bottom: var(--space-3);
        color: var(--on-media);
        background: var(--scrim);
    }
    .video-ambient-toggle .icon-play,
    .video-ambient-toggle[aria-pressed="true"] .icon-pause { display: none; }
    .video-ambient-toggle[aria-pressed="true"] .icon-play { display: block; }
    .video-ambient-watch { position: absolute; z-index: 2; inset-inline-start: var(--space-3); bottom: var(--space-3); }
    .video-ambient.is-preview .video-ambient-toggle { display: none; }

    /* A film that opens on its thumbnail ------------------------------- */
    /* parts/video.html.twig with `mode: 'cover'`: its preview, all of it the
       link, the shape and limit of the player that takes its place on a
       click (video-player.js), so nothing moves. */
    .video-cover {
        --video-ratio: calc(var(--video-w, 16) / var(--video-h, 9));
        display: grid;
        width: 100%;
        aspect-ratio: var(--video-ratio);
        max-width: min(100%, 85vh * var(--video-ratio));
        margin-inline: auto;
    }
    .video-cover-play {
        display: grid;
        grid-template: minmax(0, 1fr) / minmax(0, 1fr);
        border-radius: var(--media-radius);
        color: inherit;
        cursor: pointer;
    }
    .video-cover-play > .video-ambient { grid-area: 1 / 1; width: 100%; height: 100%; aspect-ratio: auto; }

    /* A reel's file with its project's title over it, top left (its brand
       under it, smaller), and who
       made it in the bottom right corner on hover (always by touch):
       parts/media-grid, `work`. Read through, never in the way of a click;
       gone once a film's player shows. */
    .media-grid > .has-work { position: relative; }
    .media-work,
    .media-work-credits {
        position: absolute;
        z-index: 2;
        color: #fff;
        text-shadow: 0 1px 2px rgba(0, 0, 0, .35);
        pointer-events: none;
    }
    .media-work {
        inset: 0 0 auto;
        padding: var(--space-3) var(--space-4) var(--space-6);
        border-radius: var(--media-radius) var(--media-radius) 0 0;
        background: linear-gradient(rgba(0, 0, 0, .5), transparent);
    }
    .media-work-title { margin: 0; font-weight: var(--weight-strong); }
    .media-work-brand { margin: 0; font-size: .875em; opacity: .85; }
    .media-work-credits {
        inset: auto 0 0;
        margin: 0;
        padding: var(--space-6) var(--space-4) var(--space-3);
        border-radius: 0 0 var(--media-radius) var(--media-radius);
        background: linear-gradient(transparent, rgba(0, 0, 0, .5));
        list-style: none;
        font-size: .875em;
        text-align: end;
        opacity: 0;
        transition: opacity var(--duration) var(--ease);
    }
    /* Beside a carousel's pause button, which has that corner. */
    .has-work:has(.media-carousel-toggle:not([hidden])) .media-work-credits {
        padding-inline-end: calc(var(--space-3) * 2 + var(--tap));
    }
    .media-work-role { opacity: .8; }
    .media-work-role::before { content: "· "; }
    .has-work:hover .media-work-credits,
    .has-work:focus-within .media-work-credits { opacity: 1; }
    @media (hover: none) {
        .media-work-credits { opacity: 1; }
    }
    .has-work:has(.video[data-video]) :is(.media-work, .media-work-credits) { display: none; }

    /* Motion ------------------------------------------------------------- */
    /* _motion.html.twig: the page's one switch for its cards' moving
       thumbnails, which have no room for a button of their own (a card is a
       link). In a corner, out of the work's way; video-player.js shows it on
       a page where one moves, and sets `data-paused` once pressed. */
    .motion-toggle {
        position: fixed;
        z-index: var(--z-header);
        inset-inline-end: var(--space-4);
        bottom: var(--space-4);
        display: inline-flex;
        align-items: center;
        gap: var(--space-2);
        min-height: var(--tap);
        padding: 0 var(--space-4);
        border: var(--border) solid var(--line);
        border-radius: var(--radius-pill);
        background: var(--paper);
        color: var(--ink);
        box-shadow: var(--shadow);
        font: inherit;
        font-size: var(--text-sm);
        cursor: pointer;
    }
    .motion-toggle:hover { color: var(--accent); border-color: var(--line-strong); }
    .motion-toggle .icon-play,
    .motion-toggle[data-paused] .icon-pause { display: none; }
    .motion-toggle[data-paused] .icon-play { display: block; }

    /* Video player (parts/video.html.twig, VIDEO_CONTRACT.md) --------- */
    /*
       Every colour and size here is a custom property so a client theme can
       restyle the player from tokens.css without touching this file or the
       markup. See default/VIDEO_CONTRACT.md for the structure. */

    /* `hidden` means hidden, in here above all.

       Four parts of this player are shown and hidden by the script through the
       `hidden` attribute — the poster, the big play button, the control bar and
       the Picture-in-Picture button — and every one of them is given a `display`
       below. An author `display` beats the user agent's `[hidden] { display:
       none }` no matter how weak its selector, so each of those rules was quietly
       cancelling the attribute: the play button sat over a playing clip, the bar
       flashed in before the script had adopted it, and the PiP button offered a
       feature the browser had said it did not have.

       One rule rather than four exceptions, because the next control added here
       would land in the same trap. `!important` is doing real work: it has to
       outrank whatever `display` a client theme sets on these parts too. */
    .video [hidden] { display: none !important; }

    .video {
        --video-bar-bg: rgba(18, 18, 20, .82);
        --video-fg: #fff;
        /* The bar is dark whatever the page is, so the page's accent (often its
           ink, as here) would vanish on it: white, unless a theme with a
           bright accent says otherwise (Miracle DPT does). */
        --video-accent: var(--video-fg);
        --video-track: rgba(255, 255, 255, .28);
        --video-radius: var(--media-radius);
        --video-gap: .6rem;
        /* Behind the film while it loads, and around it in full screen. */
        --video-frame: #000;
        /* The film's own shape: its width and height, as numbers, from the
           page (parts/video) or, failing that, from the file once it is read
           (video-player.js). 16:9 until either says. */
        --video-ratio: calc(var(--video-w, 16) / var(--video-h, 9));
        /* Each control's target. A finger gets var(--tap), below. */
        --video-tap: 2rem;

        position: relative;
        display: grid;
        /* minmax(0, 1fr), not the default auto: an auto column sizes to the
           video's intrinsic width and overflows every container it is put in.
           The row likewise, so the film's `height: 100%` is the frame's. */
        grid-template: minmax(0, 1fr) / minmax(0, 1fr);
        /* Explicit, not stretched: a container query box has no width of its
           own to shrink to, and as a centred grid item it would be 0 wide. */
        width: 100%;
        /* The film's own shape, never a frame of another one, and never
           taller than the screen: the cap keeps the whole film in view, and
           `margin-inline: auto` centres what is left over. */
        aspect-ratio: var(--video-ratio);
        max-width: min(100%, 85vh * var(--video-ratio));
        margin-inline: auto;
        background: var(--video-frame);
        border-radius: var(--video-radius);
        overflow: hidden;
        isolation: isolate;
        /* The control bar asks how wide the player is, not how wide the window
           is — see the container queries at the end of this section. */
        container-type: inline-size;
    }
    @media (pointer: coarse) {
        .video { --video-tap: var(--tap); }
    }

    /* A film whose web versions aren't made yet: its poster, if any, and a
       word saying why it doesn't play. Nothing in it asks for the film. */
    .video-pending { place-items: center; }
    .video-pending > img {
        grid-area: 1 / 1;
        width: 100%;
        height: 100%;
        object-fit: contain;
    }
    .video-pending-note {
        grid-area: 1 / 1;
        z-index: 1;
        margin: 0;
        padding: .4rem .8rem;
        border-radius: 999px;
        background: var(--video-bar-bg);
        color: var(--video-fg);
        font-size: .875rem;
    }

    /* The frame is the film's shape, so the film fills it: no bars around a
       portrait phone clip, a square one or a 2.39:1 one. `contain` stays for
       the moment before the shape is known, and never crops.

       Two classes, so these beat the grid rules that crop bare <img>/<video> to
       a uniform tile. Cropping a still is a layout choice; cropping someone's
       film frame is throwing away part of the work. (Cards, heroes and ambient
       films crop on purpose: they are .video-ambient, not this.) */
    .video .video-el {
        display: block;
        grid-area: 1 / 1;
        width: 100%;
        height: 100%;
        aspect-ratio: auto;
        object-fit: contain;
    }

    /* Hidden until the script takes over. With JS off the native `poster`
       attribute shows the frame and the native controls stay usable — this layer
       would sit on top of them. */
    .video-poster { display: none; }
    .video[data-video-ready] .video-poster { display: contents; }
    /* The poster is the clearest case of the `[hidden]` rule at the top of this
       section: `display: contents` above cancelled the script's
       `poster.hidden = true`, so the still frame stayed parked over the video at
       z-index 1 — the clip played, the timecode advanced, and the picture never
       moved. `data-playing` is the belt to that braces: it hides the poster from
       the player's own state, so a theme that drops the `hidden` handling still
       reveals the film. */
    .video[data-playing] .video-poster { display: none; }
    .video .video-poster img {
        grid-area: 1 / 1;
        width: 100%;
        height: 100%;
        aspect-ratio: auto;
        /* `contain`, not `cover`: the poster is a frame of the film, and is
           fitted exactly as the film is. */
        object-fit: contain;
        z-index: 1;
        pointer-events: none;
    }

    .video-bigplay {
        grid-area: 1 / 1;
        z-index: 2;
        place-self: center;
        display: grid;
        grid-auto-flow: column;
        place-items: center;
        gap: .55rem;
        width: 4.5rem;
        height: 4.5rem;
        border: 0;
        border-radius: 999px;
        background: var(--video-bar-bg);
        color: var(--video-fg);
        font: inherit;
        cursor: pointer;
    }
    .video-bigplay-icon {
        width: 0;
        height: 0;
        margin-left: .3rem;
        border-left: 1.1rem solid currentColor;
        border-top: .7rem solid transparent;
        border-bottom: .7rem solid transparent;
    }
    .video-bigplay-label { display: none; }

    /* The end: the poster is back, and the big button says Replay in words,
       so a finished film reads as finished and not as a player stuck. */
    .video[data-ended] .video-bigplay {
        width: auto;
        padding-inline: 1.25rem 1.5rem;
        font-weight: var(--weight-strong);
    }
    .video[data-ended] .video-bigplay-label { display: block; }
    .video[data-ended] .video-bigplay-icon {
        position: relative;
        width: 1.15rem;
        height: 1.15rem;
        margin: 0;
        border: .17rem solid currentColor;
        border-top-color: transparent;
        border-radius: 999px;
    }
    /* The arrowhead, at the gap in the ring, turning clockwise. */
    .video[data-ended] .video-bigplay-icon::after {
        content: "";
        position: absolute;
        top: -.32rem;
        right: -.08rem;
        border-left: .42rem solid currentColor;
        border-top: .27rem solid transparent;
        border-bottom: .27rem solid transparent;
        transform: rotate(35deg);
    }

    .video-controls {
        grid-area: 1 / 1;
        z-index: 3;
        align-self: end;
        display: flex;
        align-items: center;
        /* One row, always: a second row covered a third of a phone's player.
           The container queries below shed controls before the row runs out,
           measured with the bar at its fullest and every target a finger's
           size where there is a finger; the seek slider takes what is left. */
        flex-wrap: nowrap;
        gap: var(--video-gap);
        padding: .5rem .7rem;
        background: var(--video-bar-bg);
        color: var(--video-fg);
        font-size: .85rem;
        /* Out of the way while playing, back on hover, focus or pause. */
        opacity: 0;
        transition: opacity var(--duration-fast) var(--ease);
    }
    /* With a finger the targets are tall enough by themselves: a thinner bar
       leaves more of a phone's small player clear. */
    @media (pointer: coarse) {
        .video-controls { padding-block: .1rem; }
    }
    .video:hover .video-controls,
    .video:focus-within .video-controls,
    .video[data-menu-open] .video-controls,
    .video:not([data-playing]) .video-controls { opacity: 1; }

    .video-btn {
        display: grid;
        place-items: center;
        flex: none;
        min-width: var(--video-tap);
        min-height: var(--video-tap);
        padding: 0;
        border: 0;
        background: none;
        color: inherit;
        font: inherit;
        cursor: pointer;
        border-radius: 3px;
    }
    .video-btn:hover { color: var(--video-accent); background: rgba(255, 255, 255, .12); }
    .video-btn:focus-visible { outline: 2px solid var(--video-fg); outline-offset: 2px; }

    .video-time { flex: none; font-variant-numeric: tabular-nums; min-width: 3.1rem; text-align: center; }
    .video-duration { opacity: .75; }

    /* `min-width: 0`, not 4rem: a flex item will not shrink past its min-content
       width unless told to, so a 4rem floor here meant the bar stayed too wide and
       pushed fullscreen off the end instead of the slider simply getting shorter.
       The slider is the one thing in the bar that has no natural size, so it is
       the one that should absorb whatever width is left. */
    .video-seek { flex: 1 1 3rem; min-width: 0; min-height: var(--video-tap); }
    .video-volume { display: flex; align-items: center; gap: .25rem; flex: none; }
    .video-volume-slider { width: 4.5rem; }

    .video input[type="range"] {
        appearance: none;
        -webkit-appearance: none;
        height: 1rem;
        background: none;
        cursor: pointer;
    }
    .video input[type="range"]::-webkit-slider-runnable-track {
        height: 3px;
        border-radius: 3px;
        background: linear-gradient(
            to right,
            var(--video-accent) var(--progress, 0%),
            var(--video-track) var(--progress, 0%)
        );
    }
    .video input[type="range"]::-moz-range-track {
        height: 3px;
        border-radius: 3px;
        background: var(--video-track);
    }
    .video input[type="range"]::-moz-range-progress {
        height: 3px;
        border-radius: 3px;
        background: var(--video-accent);
    }
    .video input[type="range"]::-webkit-slider-thumb {
        appearance: none;
        -webkit-appearance: none;
        margin-top: -4.5px;
        width: 12px;
        height: 12px;
        border-radius: 999px;
        background: var(--video-fg);
    }
    .video input[type="range"]::-moz-range-thumb {
        width: 12px;
        height: 12px;
        border: 0;
        border-radius: 999px;
        background: var(--video-fg);
    }
    .video input[type="range"]:focus-visible { outline: 2px solid var(--video-fg); outline-offset: 3px; }

    .video-speed { min-width: max(2.4rem, var(--video-tap)); font-variant-numeric: tabular-nums; }

    /* The resolution menu: a button naming the choice, and the list above it,
       as tall as the player leaves room for (the script measures) and
       scrolling past that. */
    .video-quality { position: relative; flex: none; }
    .video-quality-button { min-width: 3rem; padding-inline: .3rem; font-variant-numeric: tabular-nums; }
    .video-quality-menu {
        position: absolute;
        right: 0;
        bottom: calc(100% + .5rem);
        z-index: 4;
        min-width: 8.5rem;
        margin: 0;
        padding: .3rem;
        overflow-y: auto;
        list-style: none;
        background: var(--video-bar-bg);
        color: var(--video-fg);
        border-radius: 6px;
    }
    .video-quality-item {
        position: relative;
        display: flex;
        align-items: center;
        gap: .4rem;
        width: 100%;
        min-height: var(--video-tap);
        padding: 0 .6rem 0 1.6rem;
        border: 0;
        border-radius: 3px;
        background: none;
        color: inherit;
        font: inherit;
        font-variant-numeric: tabular-nums;
        text-align: left;
        white-space: nowrap;
        cursor: pointer;
    }
    .video-quality-item:hover,
    .video-quality-item:focus-visible { background: rgba(255, 255, 255, .14); }
    .video-quality-item:focus-visible { outline: 2px solid var(--video-fg); outline-offset: -2px; }
    /* The choice, checked. */
    .video-quality-item[aria-checked="true"] { color: var(--video-accent); }
    .video-quality-item[aria-checked="true"]::before {
        content: "";
        position: absolute;
        left: .6rem;
        top: 50%;
        width: .35rem;
        height: .65rem;
        border: solid currentColor;
        border-width: 0 2px 2px 0;
        translate: 0 -60%;
        rotate: 45deg;
    }
    /* What Auto is playing right now. */
    .video-quality-now { opacity: .7; }
    .video-quality-now:not(:empty)::before { content: "· "; }

    /* Icons are CSS so the markup carries no inline SVG to restyle around. */
    .video-icon { display: block; width: 1rem; height: 1rem; position: relative; }
    .video-icon-play::before {
        content: "";
        position: absolute;
        inset: 0 0 0 .15rem;
        border-left: .7rem solid currentColor;
        border-top: .5rem solid transparent;
        border-bottom: .5rem solid transparent;
        margin: auto;
        width: 0;
        height: 0;
    }
    .video-btn.is-playing .video-icon-play::before {
        inset: .1rem .2rem;
        border: 0;
        width: auto;
        height: auto;
        background: currentColor;
        /* Two bars from one box. */
        clip-path: polygon(0 0, 35% 0, 35% 100%, 0 100%, 0 0, 65% 0, 100% 0, 100% 100%, 65% 100%, 65% 0);
    }
    .video-icon-volume::before {
        content: "";
        position: absolute;
        inset: .2rem;
        background: currentColor;
        clip-path: polygon(0 35%, 32% 35%, 60% 5%, 60% 95%, 32% 65%, 0 65%);
    }
    .video-icon-volume::after {
        content: "";
        position: absolute;
        right: .1rem;
        top: .3rem;
        width: .34rem;
        height: .4rem;
        border: 1.5px solid currentColor;
        border-left: 0;
        border-radius: 0 50% 50% 0;
    }
    .video-btn.is-muted .video-icon-volume::after { display: none; }
    .video-icon-captions::before {
        content: "";
        position: absolute;
        inset: .15rem 0;
        border: 1.5px solid currentColor;
        border-radius: 2px;
    }
    .video-btn.is-on .video-icon-captions::before { background: currentColor; }
    .video-icon-pip::before {
        content: "";
        position: absolute;
        inset: .1rem 0;
        border: 1.5px solid currentColor;
        border-radius: 2px;
    }
    .video-icon-pip::after {
        content: "";
        position: absolute;
        right: .05rem;
        bottom: .18rem;
        width: .5rem;
        height: .38rem;
        background: currentColor;
    }
    .video-icon-fullscreen::before,
    .video-icon-fullscreen::after {
        content: "";
        position: absolute;
        width: .38rem;
        height: .38rem;
        border: 1.5px solid currentColor;
    }
    .video-icon-fullscreen::before { top: .1rem; left: 0; border-right: 0; border-bottom: 0; }
    .video-icon-fullscreen::after { bottom: .1rem; right: 0; border-left: 0; border-top: 0; }

    .video[data-buffering]::after {
        content: "";
        position: absolute;
        inset: 0;
        z-index: 2;
        margin: auto;
        width: 2rem;
        height: 2rem;
        border: 2px solid rgba(255, 255, 255, .35);
        border-top-color: #fff;
        border-radius: 999px;
        animation: video-spin .7s linear infinite;
    }
    @keyframes video-spin { to { transform: rotate(360deg); } }

    .video[data-fullscreen] { aspect-ratio: auto; max-width: none; }

    /* Controls shed in order of how little they are missed --------------------

       This used to be a viewport media query, which asked the wrong question. A
       player is as wide as the column it sits in, not as wide as the window: at
       1200px of viewport a clip in a three-up grid is ~315px. Container queries
       ask about the player instead, so the same clip is dressed correctly
       whether it is a thumbnail in a grid or the width of the page, and in full
       screen, where it is the width of the screen, everything comes back.

       The bar is one row, so each threshold is where the bar at its fullest
       (resolution menu and captions both there) would leave the seek slider
       less than 3rem. Measured: padding 22, gaps 9.6, each time 50, resolution
       48, volume group 108 (120 with a finger); play, captions, picture in
       picture and full screen 32 each (44 with a finger), speed 38 (44).
       Captions go last of all but play, seek and full screen: for some people
       they are the sound.

                          speed, pip  slider  resolution  volume, duration  time
         with a pointer   36rem       30.5    26          22.25             16
         with a finger    40.5rem     34      29          25.5              18.5 */
    @container (max-width: 36rem) {
        /* Speed and picture-in-picture are conveniences, not controls. */
        .video-speed, .video-pip { display: none; }
    }
    @container (max-width: 30.5rem) {
        /* The mute button stays; only the fine-grained slider goes. */
        .video-volume-slider { display: none; }
    }
    @container (max-width: 26rem) {
        /* Auto chooses well for a small player; full screen brings it back. */
        .video-quality { display: none; }
    }
    @container (max-width: 22.25rem) {
        /* Duration is still readable on the seek bar's far end. */
        .video-volume, .video-duration { display: none; }
    }
    @container (max-width: 16rem) {
        /* Play, scrub, captions, full screen. Nothing left to cut. */
        .video-time { display: none; }
    }
    @media (pointer: coarse) {
        @container (max-width: 40.5rem) {
            .video-speed, .video-pip { display: none; }
        }
        @container (max-width: 34rem) {
            .video-volume-slider { display: none; }
        }
        @container (max-width: 29rem) {
            .video-quality { display: none; }
        }
        @container (max-width: 25.5rem) {
            .video-volume, .video-duration { display: none; }
        }
        @container (max-width: 18.5rem) {
            .video-time { display: none; }
        }
    }
}

/* Blocks (templates/blocks/: Text, Media, a list or one project or artist).
   What the editor's choices promise on every theme, and nothing of a look:
   the theme gives them their type, colours, lines and spacing. */
@layer parts {
    /* Text: a title with its text right under it; words left, centred or right. */
    .block-title-text > .block-title { margin: 0 0 var(--space-3); }
    .block-title-text > .block-text > :first-child { margin-top: 0; }
    .block-title.is-center, .block-paragraph.is-center { text-align: center; margin-inline: auto; }
    .block-title.is-right, .block-paragraph.is-right { text-align: end; margin-inline-start: auto; }

    /* Media, so many to a row: each file as wide as its shape asks, together
       the full width, so a row is one height; a last row with fewer keeps
       room for the ones missing, at an average shape. On a phone a row keeps
       its files side by side, smaller; one of four or more breaks in two
       where its `.media-break` is, each half one height. The shapes are
       counted in hundredths: a row whose growth adds up to less than one
       is only given that share of its width, so a portrait alone (0.77)
       stopped short of the width it was placed across. */
    .block-media-grid.has-columns { display: grid; gap: var(--grid-gap, var(--space-3)); }
    .block-media-grid.has-columns .media-grid { flex-wrap: nowrap; }
    .block-media-grid.has-columns .media-grid > li { flex: calc(var(--w, 4) / var(--h, 3) * 100) 1 0; min-width: 0; }
    .block-media-grid.has-columns .media-grid::after { display: none; }
    .block-media-grid.has-columns .is-short .media-grid::after { display: block; flex: calc(var(--missing) * 140) 1 0; }
    .media-grid > .media-break { display: none; }
    @media (max-width: 47.99rem) {
        .block-media-grid.has-columns .media-grid { flex-wrap: wrap; }
        .block-media-grid.has-columns .media-grid > .media-break {
            display: block;
            flex: 0 0 100%;
            height: 0;
            margin-top: calc(-1 * var(--grid-gap, var(--space-3)));
        }
    }

    /* A list (or one project or artist): a grid of cards, rows (a small
       picture beside the words), featured (big, one or two across) or an
       index (names alone); its chips apart from it. */
    .block-records > .filter { margin-bottom: var(--space-5); }
    .block-records ul { list-style: none; padding: 0; margin: 0; }
    .block-records .record-link { display: grid; gap: var(--space-2); text-decoration: none; }
    .record-tagline { display: block; }
    .record-media { display: block; aspect-ratio: 4 / 3; overflow: hidden; }
    .record-media img { display: block; width: 100%; height: 100%; object-fit: cover; }
    .record-media > .video-ambient { width: 100%; height: 100%; aspect-ratio: auto; border-radius: 0; }
    .records-list .record-text, .records-featured .record-text { display: grid; }
    .records-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(min(15rem, 100%), 1fr));
        gap: var(--space-5) var(--space-4);
    }
    .records-list { display: grid; }
    .records-list .record-link { grid-template-columns: 10rem minmax(0, 1fr); align-items: start; }
    .records-list .record-media { aspect-ratio: 3 / 2; }
    .records-featured {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(min(28rem, 100%), 1fr));
        gap: var(--space-7) var(--space-6);
    }
    /* Featured, one or two large: each picture at its own shape, whole (a
       portrait is not cut to a landscape frame). In a grid or rows, cards
       share a frame, an artist's a portrait one, so a face keeps its head. */
    .records-featured .record-media { aspect-ratio: auto; }
    .records-featured .record-media img { height: auto; }
    .records-grid .record-artist .record-media, .records-list .record-artist .record-media { aspect-ratio: 4 / 5; }
    .records-index .record-link { grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; }
    .records-index-tags { grid-column: 1 / -1; }
    @media (max-width: 47.5rem) {
        .records-list .record-link { grid-template-columns: minmax(0, 1fr); }
        .records-list .record-media { max-width: 14rem; }
    }
}
