/* =====================================================================
   The stage — the premium layer over style.css.

   style.css is the site: its layout, its every breakpoint, the hard-won
   fixes for phones held sideways. This file is the finish laid over it, and
   it keeps to one rule so that none of that is put at risk:

       it changes how surfaces LOOK — colour, light, depth, type, motion —
       and leaves how they are LAID OUT alone.

   No display, no grid, no width, no position on an existing component.
   Where this file does lay something out, it is something this file brought
   (the hero, the stage behind the page, the footer's spacer).

   The direction, against the flat "hard style" underneath:

     depth      glass surfaces over a lit 3D scene, hairline edges, soft
                layered shadows in place of solid offset blocks
     type       Unbounded for display — titles, big figures, ranks — and
                Archivo in tracked capitals for the small labels, and for the text
     light      the wordmark's gold as light rather than paint: glows, a
                sheen across a thumbnail, light travelling round the
                podium's edges
     motion     one easing for everything (--ease-out: quick to start, a
                long soft landing), blocks that rise into place, figures
                that count up

   Loaded after style.css and matching its selectors, so every rule here
   wins by order rather than by force. Removing the <link> to this file (and
   the stage markup in the layout) puts the hard style back exactly.
   ===================================================================== */

:root {
    --font-display: "Unbounded", "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
    /* The small all-caps labels: the text face, bold and tracked out. (They were a
       monospace once, which read as code rather than as part of the page.) */
    --font-label: var(--font);
    /* The list's hero: the face the level names are set in on the cards —
       Archivo, heavy, at its normal width — so the hero's headline and the
       names under it read as one voice. */
    --font-hero: var(--font);

    --ease-out: cubic-bezier(.16, 1, .3, 1);
    --ease-spring: cubic-bezier(.34, 1.56, .64, 1);

    /* Rounder than the blocks underneath: these are lit objects now, not
       stamped shapes. */
    --radius:     1.125rem;
    --radius-sm:  0.75rem;
    --radius-xs:  0.5rem;
    --btn-radius: 0.75rem;

    /* Light theme. Warm paper under white glass, lit the way the dark
       theme is: a sun of gold in the top corner, a peach light from the
       left, a white bloom over the hero, and the page falling from bright
       at the top to a warmer tone below — so it has the same depth the
       dark one gets for free from its night. */
    --bg:             #f3efe7;
    --ground-1:       rgba(255, 190, 30, 0.30);
    --ground-2:       rgba(255, 145, 60, 0.13);
    --ground-3:       rgba(255, 255, 255, 0.75);
    --ground-fall:    linear-gradient(180deg, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 42%, rgba(150, 105, 30, 0.07) 100%);
    --grid-line:      rgba(60, 45, 15, 0.05);
    --grid-mask:      radial-gradient(ellipse 75% 62% at 50% 22%, #000 10%, transparent 72%);
    --vignette:       rgba(150, 110, 45, 0.2);
    --grain:          0.05;

    --glass:          rgba(255, 255, 255, 0.72);
    --glass-strong:   rgba(255, 255, 255, 0.9);
    --glass-card:     rgba(255, 255, 255, 0.9);
    --glass-blur:     saturate(170%) blur(18px);
    /* What sits on the glass — a row inside a panel, a chip, a button on a
       card: a veil of light over the pane rather than a grey of its own, so
       it carries the colour coming through the pane as the pane does. */
    --glass-pane:     rgba(255, 255, 255, 0.78);
    --glass-inset:    rgba(255, 255, 255, 0.55);
    --glass-chip:     rgba(255, 255, 255, 0.55);
    --hairline:       rgba(60, 45, 15, 0.09);
    --hairline-strong: rgba(60, 45, 15, 0.16);
    --sheen:          inset 0 1px 0 rgba(255, 255, 255, 0.95);
    --pill-on:        rgba(27, 26, 23, 0.06);

    /* Warm shadows, not grey: on paper this colour, a grey shadow reads as
       dirt and a brown one reads as depth. */
    --shadow-sm:  0 1px 2px rgba(70, 50, 10, 0.06), 0 14px 32px -16px rgba(70, 50, 10, 0.32);
    --shadow:     0 2px 6px rgba(70, 50, 10, 0.08), 0 28px 52px -22px rgba(70, 50, 10, 0.42);
    --shadow-lg:  0 4px 14px rgba(70, 50, 10, 0.1), 0 46px 84px -30px rgba(70, 50, 10, 0.5);

    /* Gold as type: the podium's percentages, a smooth fall from the pale
       sheen to deep amber. Large figures only — the small text-safe gold is
       still --gold-text. (Buttons and the hero's accent words wear the
       logo's own hard bands instead; see --logo-bands.) */
    --gold-type:  linear-gradient(176deg, #d9a400 0%, #b98400 55%, #8a5f00 100%);

    --topbar-bg: #fbfaf6;
}

:root[data-theme="dark"] {
    /* Deeper than the hard style's ground, so the scene has a night to sit in. */
    --bg:            #08080a;
    --surface:       #131316;
    --surface-2:     #18181c;
    --surface-3:     #212126;
    --surface-sunk:  #0d0d10;
    --border:        #25252b;
    --border-strong: #33333b;

    --ground-1:       rgba(250, 190, 20, 0.11);
    --ground-2:       rgba(140, 90, 255, 0.07);
    --ground-3:       transparent;
    --ground-fall:    none;
    --grid-mask:      radial-gradient(ellipse 75% 62% at 50% 22%, #000 10%, transparent 72%);
    --grid-line:      rgba(255, 255, 255, 0.035);
    --vignette:       rgba(0, 0, 0, 0.6);
    --grain:          0.06;

    --glass:          rgba(19, 19, 23, 0.62);
    --glass-strong:   rgba(17, 17, 21, 0.84);
    --glass-card:     rgba(18, 18, 22, 0.80);
    --glass-pane:     rgba(20, 19, 22, 0.72);
    --glass-inset:    rgba(20, 19, 22, 0.58);
    --glass-chip:     rgba(20, 19, 22, 0.58);
    --hairline:       rgba(255, 255, 255, 0.075);
    --hairline-strong: rgba(255, 255, 255, 0.14);
    --sheen:          inset 0 1px 0 rgba(255, 255, 255, 0.055);
    --pill-on:        rgba(255, 255, 255, 0.08);

    --shadow-sm:  0 1px 1px rgba(0, 0, 0, 0.5), 0 14px 34px -18px rgba(0, 0, 0, 0.9);
    --shadow:     0 2px 4px rgba(0, 0, 0, 0.5), 0 26px 50px -22px rgba(0, 0, 0, 0.95);
    --shadow-lg:  0 4px 12px rgba(0, 0, 0, 0.55), 0 50px 90px -30px rgba(0, 0, 0, 1);

    --gold-type:  linear-gradient(176deg, #fff3b0 0%, #ffd43a 42%, #f5a300 100%);

    --topbar-bg: #0b0b0d;
}

/* ================================================================ ground */

/* The page itself is only the night colour now. The light and texture
   that used to be implied by flat blocks live on the stage behind it. */
body { background: var(--bg); }

/* The stage: four fixed layers behind everything — the warm light in the
   sky, a faint grid that fades out towards the edges, the 3D canvas, and
   the vignette and grain that make it all one picture.
 *
 * As tall as the *largest* viewport (lvh), not the current one. On a phone
 * the browser's bars slide away as you scroll, and a stage sized to the
 * window would be resized under the reader on every scroll — the canvas
 * reallocated, the scene jumping. Sized to the largest, it never changes;
 * the strip the bars cover is simply not seen. */
.stage {
    position: fixed; left: 0; right: 0; top: 0; z-index: 0;
    height: 100vh; height: 100lvh;
    pointer-events: none; overflow: hidden;
}
.stage > * { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

.stage-ground {
    background:
        radial-gradient(70rem 42rem at 80% -14%, var(--ground-1), transparent 62%),
        radial-gradient(56rem 40rem at -12% 38%, var(--ground-2), transparent 64%),
        radial-gradient(48rem 30rem at 40% 18%, var(--ground-3), transparent 70%),
        var(--ground-fall);
}
.stage-grid {
    background-image:
        linear-gradient(var(--grid-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
    background-size: 4.5rem 4.5rem;
    background-position: 50% 0;
    -webkit-mask-image: var(--grid-mask);
            mask-image: var(--grid-mask);
}
/* Pools of coloured light drifting through the ground, so the page under the
 * hero is not one flat colour all the way down: the theme's gold, an orange
 * and a violet, each a soft radial glow far
 * larger than the screen, on a slow loop of its own length, so the ground is
 * never quite the same twice. They are the loader's tides, calmer.
 *
 * And they move with the page: as it scrolls, each slides at its own rate
 * (a scroll-driven `translate`, alongside the drift's `transform`), so going
 * down a long list the light shifts behind it, the way distant lights pass
 * slower than near ones. Both are transforms of layers painted once, so all
 * of it runs on the compositor. Held still where motion is not wanted, and
 * where scroll timelines are not supported the scroll part simply does not
 * happen. */
/* By day the night's three — gold, orange, violet — held gentler: stronger,
   or with a rose in place of the violet, they pooled into orange-salmon
   stains in the empty column under the sidebar. */
:root {
    --tide-1: rgba(255, 184, 28, 0.22);
    --tide-2: rgba(255, 135, 45, 0.13);
    --tide-3: rgba(140, 90, 255, 0.12);
}
:root[data-theme="dark"] {
    --tide-1: rgba(250, 175, 20, 0.2);
    --tide-2: rgba(255, 100, 20, 0.15);
    --tide-3: rgba(140, 90, 255, 0.19);
}
.stage-tides > i {
    position: absolute; display: block;
    border-radius: 50%;
    background: radial-gradient(closest-side, var(--tide), transparent);
    will-change: transform;
}
/* Placed where the ground shows between the panes — the gutters either side
   and the column under the sidebar — rather than behind the list's cards. */
.stage-tides > i:nth-child(1) { --tide: var(--tide-1); width: 90vmax; height: 90vmax; right: -44vmax; top: -18vmax; }
.stage-tides > i:nth-child(2) { --tide: var(--tide-2); width: 80vmax; height: 80vmax; left: -44vmax; top: 22vh; }
.stage-tides > i:nth-child(3) { --tide: var(--tide-3); width: 72vmax; height: 72vmax; right: -34vmax; top: 58vh; }
@media (prefers-reduced-motion: no-preference) {
    .stage-tides > i:nth-child(1) { animation: tide-1 31s ease-in-out infinite alternate; }
    .stage-tides > i:nth-child(2) { animation: tide-2 37s ease-in-out -9s infinite alternate; }
    .stage-tides > i:nth-child(3) { animation: tide-3 43s ease-in-out -21s infinite alternate; }
    @supports (animation-timeline: scroll()) {
        .stage-tides > i:nth-child(1) {
            animation: tide-1 31s ease-in-out infinite alternate, tide-scroll-1 linear both;
            animation-timeline: auto, scroll(root);
        }
        .stage-tides > i:nth-child(2) {
            animation: tide-2 37s ease-in-out -9s infinite alternate, tide-scroll-2 linear both;
            animation-timeline: auto, scroll(root);
        }
        .stage-tides > i:nth-child(3) {
            animation: tide-3 43s ease-in-out -21s infinite alternate, tide-scroll-3 linear both;
            animation-timeline: auto, scroll(root);
        }
    }
}
@keyframes tide-1 { to { transform: translate3d(-14vw, 26vh, 0) scale(1.1); } }
@keyframes tide-2 { to { transform: translate3d(12vw, -18vh, 0) scale(0.92); } }
@keyframes tide-3 { to { transform: translate3d(-16vw, -24vh, 0) scale(1.14); } }
@keyframes tide-scroll-1 { to { translate: 0 -34vh; } }
@keyframes tide-scroll-2 { to { translate: 0 40vh; } }
@keyframes tide-scroll-3 { to { translate: 0 -58vh; } }

/* Invisible until stage.js has drawn its first frame, so a slow or failed
   load never shows an empty black box — only the ground under it. Then
   there at once, at full strength: no fade, so the cube and the margin's
   blocks are on the page from the first frame they exist. */
.stage-gl { opacity: 0; }
.stage-gl.is-ready { opacity: 1; }

/* The hero's cube, on a canvas of its own at the top of the page — not on
 * the stage, which is fixed to the screen. Drawn there, the cube had to be
 * redrawn wherever the scroll had taken the hero, and the page scrolls on
 * a thread of its own, ahead of anything a script draws: while the page
 * was busy — straight after it loaded, above all — the cube fell frames
 * behind the hero and chased it down the screen. Here it is part of the
 * page, and the browser moves it with the hero itself. Over the stage and
 * under the page (main is a layer up); as tall as the cube's glow reaches,
 * which stage.js works out. */
.stage-hero {
    position: absolute; left: 0; top: 0; z-index: 0;
    width: 100%; height: 100vh; height: 100lvh;
    display: block; pointer-events: none;
    opacity: 0;
}
.stage-hero.is-ready { opacity: 1; }
.stage-vignette {
    background: radial-gradient(ellipse 120% 95% at 50% 35%, transparent 55%, var(--vignette) 100%);
}
/* Film grain, so large flat areas of glass read as material rather than as
   a fill. Plain opacity, no blend mode: a blended full-screen layer would
   be recomposited against everything under it on every scrolled frame. */
.stage-grain {
    opacity: var(--grain);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.5 0 0 0 0 0.5 0 0 0 0 0.5 0 0 0 1.4 -0.2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

::selection { background: rgba(250, 204, 21, 0.38); color: var(--ink); }

/* ========================================================== light, tuned */

/* The header and the crumb bar under it, as white frosted glass by day
 * rather than glass tinted with the page's cream. Tinted, the two read as
 * two beige stripes of slightly different colours stacked over the page;
 * white, they are one clean pane the page scrolls under — as at night,
 * where both melt into the dark. Higher in specificity than the header's
 * own rules, so where this sits in the file does not matter. */
:root:not([data-theme="dark"]) .topbar { background: rgba(255, 255, 255, 0.68); }
:root:not([data-theme="dark"]) .topbar.is-scrolled {
    background: rgba(255, 255, 255, 0.82);
    box-shadow: 0 16px 34px -26px rgba(70, 50, 10, 0.45);
}
:root:not([data-theme="dark"]) .subbar { background: rgba(255, 255, 255, 0.6); }
@media (prefers-reduced-transparency: reduce) {
    :root:not([data-theme="dark"]) .topbar,
    :root:not([data-theme="dark"]) .topbar.is-scrolled,
    :root:not([data-theme="dark"]) .subbar { background: var(--topbar-bg); }
}

/* The light on a phone. The ground's glows are sized for a desktop window
 * — the gold one is over a thousand pixels across — so on a phone each one
 * covered the whole screen and the page went one even cream-yellow, with no
 * shape and so no depth. Here they are sized to the screen instead: a gold
 * sun in the top corner, a white bloom over the hero where the cube stands,
 * a peach light low on the left, and the page falling from bright to warm —
 * the same scene as on a desktop, at a phone's scale. And the vignette is
 * lighter: across a narrow screen its brown reached in far enough to muddy
 * the corners. */
@media (max-width: 720px) {
    :root:not([data-theme="dark"]) .stage-ground {
        background:
            radial-gradient(125vw 90vw at 105% -10%, rgba(255, 186, 25, 0.34), transparent 64%),
            radial-gradient(95vw 75vw at 50% 22%, rgba(255, 255, 255, 0.9), transparent 70%),
            radial-gradient(120vw 110vw at -30% 70%, rgba(255, 145, 60, 0.13), transparent 62%),
            linear-gradient(180deg, rgba(255, 255, 255, 0.55) 0%, rgba(255, 255, 255, 0) 38%, rgba(150, 105, 30, 0.07) 100%);
    }
    :root:not([data-theme="dark"]) { --vignette: rgba(150, 110, 45, 0.1); }
}

/* ============================================================ scrollbar */

/* The ordinary scrollbar, in glass: a neutral pill floating in a track the
 * colour of the page, with an arrow button at each end, in place of the
 * system's grey bar. The pill is translucent ink by day and translucent
 * white by night, with a faint line of light down its edge like the panes
 * it scrolls past, and the track carries a hairline where it meets the
 * page. Under the pointer the pill swells a little into its track and comes
 * up a step stronger; held, a step more.
 *
 * It floats on a transparent border (background-clip keeps the fill inside
 * it), which is what lets it swell without the track moving.
 *
 * The arrows are small rounded chevrons in the pill's own colour, one per
 * direction and theme (--scroll-up and the rest, below), on the track's
 * ground, tinting a step under the pointer and another when pressed. One at
 * each end: the bar can also draw a second pair, back to back, and those
 * are switched off.
 *
 * Chromium and Safari draw this from the ::-webkit-scrollbar parts. Firefox
 * has none of those and takes only two colours, so it gets a bar in the
 * same two. The two are kept apart with @supports: Chromium also
 * understands the standard properties, and setting them there would switch
 * the drawn pill off in favour of the flat one.
 *
 * Inner scrollers — a long suggestion list, the phone menu — take the same
 * bar. The sub-bar's hidden one stays hidden: its own rule is more specific.
 *
 * The two sets of colours are chosen by the theme, except while the theme
 * is being swapped. The swap is revealed through a growing circle drawn
 * from a picture of the page, and the window's scrollbar is not in that
 * picture, so it would change the moment the theme did, well ahead of the
 * page. app.js marks the root .scroll-hold-light or .scroll-hold-dark for
 * the length of the reveal, and that wins over the theme. The selectors
 * exclude one another, so no rule has to outrank another. */
:root:not([data-theme="dark"]):not(.scroll-hold-dark),
:root.scroll-hold-light {
    --scroll-track:  #ece7dd;
    --scroll-edge:   rgba(60, 45, 15, 0.08);
    --scroll-thumb:  rgba(45, 35, 15, 0.26);
    --scroll-hover:  rgba(45, 35, 15, 0.42);
    --scroll-active: rgba(45, 35, 15, 0.55);
    --scroll-light:  rgba(255, 255, 255, 0.45);
    --scroll-up: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 10 10%27%3E%3Cpath d=%27M2.5 6.25 5 3.75l2.5 2.5%27 fill=%27none%27 stroke=%27%237a6f5f%27 stroke-width=%271.6%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27/%3E%3C/svg%3E");
    --scroll-down: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 10 10%27%3E%3Cpath d=%27M2.5 3.75 5 6.25l2.5-2.5%27 fill=%27none%27 stroke=%27%237a6f5f%27 stroke-width=%271.6%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27/%3E%3C/svg%3E");
    --scroll-left: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 10 10%27%3E%3Cpath d=%27M6.25 2.5 3.75 5l2.5 2.5%27 fill=%27none%27 stroke=%27%237a6f5f%27 stroke-width=%271.6%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27/%3E%3C/svg%3E");
    --scroll-right: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 10 10%27%3E%3Cpath d=%27M3.75 2.5 6.25 5l-2.5 2.5%27 fill=%27none%27 stroke=%27%237a6f5f%27 stroke-width=%271.6%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27/%3E%3C/svg%3E");
}
:root[data-theme="dark"]:not(.scroll-hold-light),
:root.scroll-hold-dark {
    --scroll-track:  #0d0d10;
    --scroll-edge:   rgba(255, 255, 255, 0.06);
    --scroll-thumb:  rgba(255, 255, 255, 0.16);
    --scroll-hover:  rgba(255, 255, 255, 0.28);
    --scroll-active: rgba(255, 255, 255, 0.38);
    --scroll-light:  rgba(255, 255, 255, 0.08);
    --scroll-up: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 10 10%27%3E%3Cpath d=%27M2.5 6.25 5 3.75l2.5 2.5%27 fill=%27none%27 stroke=%27%239a9aa4%27 stroke-width=%271.6%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27/%3E%3C/svg%3E");
    --scroll-down: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 10 10%27%3E%3Cpath d=%27M2.5 3.75 5 6.25l2.5-2.5%27 fill=%27none%27 stroke=%27%239a9aa4%27 stroke-width=%271.6%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27/%3E%3C/svg%3E");
    --scroll-left: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 10 10%27%3E%3Cpath d=%27M6.25 2.5 3.75 5l2.5 2.5%27 fill=%27none%27 stroke=%27%239a9aa4%27 stroke-width=%271.6%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27/%3E%3C/svg%3E");
    --scroll-right: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 10 10%27%3E%3Cpath d=%27M3.75 2.5 6.25 5l-2.5 2.5%27 fill=%27none%27 stroke=%27%239a9aa4%27 stroke-width=%271.6%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27/%3E%3C/svg%3E");
}

@supports selector(::-webkit-scrollbar) {
    ::-webkit-scrollbar { width: 16px; height: 16px; }
    ::-webkit-scrollbar-track {
        background: var(--scroll-track);
        box-shadow: inset 1px 0 0 var(--scroll-edge);
    }
    ::-webkit-scrollbar-track:horizontal { box-shadow: inset 0 1px 0 var(--scroll-edge); }
    ::-webkit-scrollbar-thumb {
        background: var(--scroll-thumb) padding-box;
        border: 4px solid transparent;
        border-radius: 99px;
        box-shadow: inset 1px 1px 0 var(--scroll-light);
        min-height: 40px; min-width: 40px;
    }
    ::-webkit-scrollbar-thumb:hover  { border-width: 3px; background-color: var(--scroll-hover); }
    ::-webkit-scrollbar-thumb:active { border-width: 3px; background-color: var(--scroll-active); }

    ::-webkit-scrollbar-button {
        display: block; width: 16px; height: 16px;
        background-color: var(--scroll-track);
        background-repeat: no-repeat; background-position: center; background-size: 10px;
        box-shadow: inset 1px 0 0 var(--scroll-edge);
    }
    ::-webkit-scrollbar-button:horizontal { box-shadow: inset 0 1px 0 var(--scroll-edge); }
    ::-webkit-scrollbar-button:hover  { background-color: color-mix(in srgb, var(--scroll-track), #808080 8%); }
    ::-webkit-scrollbar-button:active { background-color: color-mix(in srgb, var(--scroll-track), #808080 16%); }
    ::-webkit-scrollbar-button:vertical:decrement   { background-image: var(--scroll-up); }
    ::-webkit-scrollbar-button:vertical:increment   { background-image: var(--scroll-down); }
    ::-webkit-scrollbar-button:horizontal:decrement { background-image: var(--scroll-left); }
    ::-webkit-scrollbar-button:horizontal:increment { background-image: var(--scroll-right); }
    /* One arrow at each end, not a pair at each. */
    ::-webkit-scrollbar-button:start:increment,
    ::-webkit-scrollbar-button:end:decrement { display: none; }

    ::-webkit-scrollbar-corner { background: var(--scroll-track); }
}
@supports not selector(::-webkit-scrollbar) {
    :root { scrollbar-color: var(--scroll-thumb) var(--scroll-track); }
}

/* ============================================================== type */

h1 {
    font-family: var(--font-display); font-stretch: normal;
    font-weight: 600; letter-spacing: -0.035em;
}
/* A level name stays in the text face, as it always has: names are long,
   mixed-case and read, not looked at. */
.level-titles h1 { font-family: var(--font); font-weight: 760; letter-spacing: -0.03em; }

/* The figures. Every one of these was the semi-expanded Archivo cut. */
.level-pct,
.level-rank,
.level-title-rank,
.tier-count,
.stat-value,
.stat-joy .stat-value small,
.stat-split b,
.progress-value,
.big-404,
.side-stats span,
.card-rank {
    font-family: var(--font-display); font-stretch: normal;
}
.stat-value, .tier-count, .level-pct { font-weight: 600; letter-spacing: -0.04em; }
/* The % after a card's or a level's figure: a unit, centred on the figures'
   height. On the baseline, a size down and a weight lighter, it read as a
   subscript squeezed against the last nought. Unbounded's figures stand
   0.77em and its % 0.76em; at 0.55 the size, centre meets centre when the
   sign's baseline rises 0.385 / 0.55 − 0.38 = 0.32 of its own em.
 *
 * The card's sign is inline text, lifted with no line height so the lift
 * never deepens the line. The level's is a grid item on the figure's
 * baseline, where vertical-align does nothing: slid up instead, which
 * moves nothing else. */
.level-pct small {
    font-size: 0.55em; font-weight: 600; letter-spacing: 0;
    margin-left: 0.14em;
}
.level-pct small { translate: 0 -0.32em; }
/* The hardest level's name is a name, not a figure. */
.stat-link { font-family: var(--font); }

/* The small labels: bold capitals in the text face, tracked out. Only the
   ones already set in capitals — the chart captions on the stats page are
   sentences, and stay in the text face. */
.side-panel h2, .panel > h2, .stat-label, .stats-latest-label, .eyebrow,
.foot-nav h2 {
    font-family: var(--font-label); font-stretch: normal; font-weight: 700;
    letter-spacing: 0.1em;
}
figure.panel figcaption h2 { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.02em; }

/* ============================================================ header */

.topbar {
    background: color-mix(in srgb, var(--topbar-bg) 64%, transparent);
    -webkit-backdrop-filter: var(--glass-blur);
            backdrop-filter: var(--glass-blur);
    border-bottom-color: var(--hairline);
    transition: background-color .45s var(--ease-out), box-shadow .45s var(--ease-out);
}
.topbar.is-scrolled {
    background: color-mix(in srgb, var(--topbar-bg) 80%, transparent);
    box-shadow: 0 18px 40px -28px rgba(0, 0, 0, 0.55);
}
@media (prefers-reduced-transparency: reduce) {
    .topbar, .topbar.is-scrolled { background: var(--topbar-bg); -webkit-backdrop-filter: none; backdrop-filter: none; }
}

/* How far down the page you are: a thread of gold along the header's foot,
   drawn by the scroll position itself. Browsers without scroll timelines
   simply have no thread. */
@supports (animation-timeline: scroll()) {
    .topbar::after {
        content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
        background: linear-gradient(90deg, rgba(250, 204, 21, 0), #facc15 18%, #fff1a6 50%, #f59e0b 82%, rgba(245, 158, 11, 0));
        transform-origin: 0 50%; transform: scaleX(0);
        animation: stage-read linear both;
        animation-timeline: scroll(root block);
        pointer-events: none;
    }
    @keyframes stage-read { to { transform: scaleX(1); } }
}

/* The lift on hover is the wordmark's box's, so the glint over the letters
   (below) rises with them; the glow is the picture's own. */
.brand-logo { transition: transform .5s var(--ease-spring); }
.brand-wordmark { transition: filter .5s var(--ease-out); }
.brand:hover .brand-logo { transform: translateY(-1px) scale(1.015); }
.brand:hover .brand-wordmark {
    filter: var(--shadow-logo) drop-shadow(0 6px 18px rgba(250, 190, 20, 0.35));
}

/* The wordmark's glint: the loading screen's (.loader-glint) crossing the
 * header's wordmark now and then. A band of light, brightest in its middle
 * and slanted as that one is, masked to the wordmark's own shape (--logo,
 * the same picture, laid as the picture is: contained, to the left), so
 * only the letters catch it. As wide for its height as that band is, which
 * on this much longer mark is a narrower share of its width (12% to the SDL
 * mark's 38%), and crossing at about the same pace, so it reads as the same
 * glint. Far less often than there, every 10 seconds rather than 2.8,
 * since this one is on screen all the time: the crossing itself takes as
 * long as it did (11.25% of the round), and the rest of the round it waits.
 * Moved by transform alone; with motion switched off it never crosses. */
.brand-glint {
    position: absolute; inset: 0; overflow: hidden;
    -webkit-mask: var(--logo) left center / contain no-repeat;
            mask: var(--logo) left center / contain no-repeat;
    pointer-events: none;
}
.brand-glint::before {
    content: ""; position: absolute; top: -10%; bottom: -10%; left: 0;
    width: 12%;
    background: linear-gradient(105deg,
        transparent 18%, rgba(255, 255, 255, 0.4) 38%,
        #fff 48%, #fff 52%,
        rgba(255, 255, 255, 0.4) 62%, transparent 82%);
    opacity: .9;
    transform: translateX(-110%);
    will-change: transform;
}
@media (prefers-reduced-motion: no-preference) {
    .brand-glint::before { animation: brand-glint 10s 1.2s cubic-bezier(.4, 0, .2, 1) infinite; }
}
@keyframes brand-glint {
    0%           { transform: translateX(-110%); }
    11.25%, 100% { transform: translateX(850%); }
}

/* The nav as one glass capsule with the current page lit inside it — on a
   screen wide enough to have the nav out on the header's row. Narrower, the
   same links are the rows of the phone menu, which style.css draws. */
@media (min-width: 861px) and (min-height: 561px), (min-width: 861px) and (pointer: fine) {
    /* --nav-inset is the room round a lit pill: from the capsule's edge, and
       the same again between pills — at half that, the one under the pointer
       ran right up against the current page's. */
    .topnav {
        --nav-inset: 0.25rem;
        padding: var(--nav-inset); gap: var(--nav-inset);
        background: var(--glass); border: 1px solid var(--hairline);
        border-radius: 62.5rem;
        box-shadow: var(--sheen), var(--shadow-sm);
    }
    .topnav > a, .navmenu > summary {
        margin: 0; padding: calc(0.4375rem + var(--lift)) 0.875rem calc(0.4375rem - var(--lift)); border-radius: 62.5rem;
        border-bottom: 0;
        transition: color .25s var(--ease-out), background-color .25s var(--ease-out), box-shadow .25s var(--ease-out);
    }
    .navmenu { margin: 0; }
    .topnav > a:hover, .navmenu > summary:hover {
        background: var(--pill-on); text-decoration: none;
    }
    .topnav > a.is-active, .navmenu.is-active > summary {
        background: var(--glass-strong);
        box-shadow: var(--sheen), 0 0 0 1px var(--hairline-strong), 0 6px 16px -10px rgba(0, 0, 0, 0.5);
    }

    .navmenu-panel {
        top: calc(100% + 0.75rem); left: 0; padding: 0.4375rem;
        background: var(--glass-strong);
        -webkit-backdrop-filter: var(--glass-blur);
                backdrop-filter: var(--glass-blur);
        border: 1px solid var(--hairline-strong); border-radius: 1rem;
        box-shadow: var(--sheen), var(--shadow-lg);
        transform-origin: 20% 0;
        animation: stage-drop .32s var(--ease-out);
    }
}
@keyframes stage-drop {
    from { opacity: 0; transform: translateY(-0.375rem) scale(.97); }
}
/* The list's sections, as rows of either menu: the dropdown above, and the
   phone menu's, where they open in place under The List. */
.navmenu-item {
    border-left: 0; border-radius: 0.625rem;
    transition: color .2s, background-color .2s;
}
.navmenu-item:hover { background: var(--pill-on); }
.navmenu-item.is-current {
    background: color-mix(in srgb, var(--gold) 14%, transparent);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--gold) 30%, transparent);
}
.navmenu-count { border-radius: 62.5rem; }

/* The phone menu, in the glass of the nav it is folded from.
 *
 * A sheet dropped under the bar, inset from the screen's edges and rounded,
 * edged and lit like the popups' glass but solid: it is read, not seen
 * through, and it cannot be frosted anyway — it hangs inside the bar, whose
 * own blur makes the bar the only thing a blur on the sheet could see, so the
 * page came through it sharp. It drops in from the menu button's corner, as
 * the wide nav's dropdown drops from its trigger.
 *
 * Its rows are rounded blocks, and the page you are on is lit exactly as the
 * wide nav lights it — the same glass, fine edge and soft shadow, so the
 * current page looks the same in either menu. The theme switch and Sign out are the
 * site's glass buttons (style.css sets them side by side), rounded into pills
 * like the header's own controls. */
@media (max-width: 860px) and (orientation: portrait),
       (max-width: 860px) and (orientation: landscape) and (pointer: fine),
       (max-height: 560px) and (orientation: landscape) and (pointer: coarse) {
    :root[data-js] .topnav {
        top: calc(100% + 0.5rem);
        left: max(0.5rem, env(safe-area-inset-left, 0px));
        right: max(0.5rem, env(safe-area-inset-right, 0px));
        gap: 0.1875rem; padding: 0.5rem;
        background: var(--topbar-bg);
        border: 1px solid var(--hairline-strong); border-radius: 1.25rem;
        box-shadow: var(--sheen), var(--shadow-lg);
        transform-origin: calc(100% - 1.375rem) 0;
        animation: stage-drop .32s var(--ease-out);
    }
    :root[data-js] .topnav > a,
    :root[data-js] .navmenu > summary {
        gap: 0.625rem;
        padding: calc(0.6875rem + var(--lift)) 0.75rem calc(0.6875rem - var(--lift));
        border-radius: 0.875rem;
        font-weight: 600; color: var(--ink-2);
        transition: color .2s, background-color .2s, border-color .2s, box-shadow .2s;
    }
    :root[data-js] .topnav > a:hover,
    :root[data-js] .navmenu > summary:hover { background: var(--pill-on); color: var(--ink); text-decoration: none; }
    :root[data-js] .topnav > a.is-active,
    :root[data-js] .navmenu.is-active > summary {
        background: var(--glass-strong); color: var(--ink); font-weight: 700;
        border-color: transparent;
        box-shadow: var(--sheen), 0 0 0 1px var(--hairline-strong), 0 6px 16px -10px rgba(0, 0, 0, 0.5);
    }
    :root[data-js] .navmenu-panel { gap: 0.125rem; }
    :root[data-js] .topnav-tools { border-top-color: var(--hairline-strong); }
    :root[data-js] .topnav-row { border-radius: 62.5rem; }
}

.subbar {
    background: color-mix(in srgb, var(--topbar-bg) 60%, transparent);
    -webkit-backdrop-filter: var(--glass-blur);
            backdrop-filter: var(--glass-blur);
    border-color: var(--hairline);
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}
@media (max-width: 640px), (max-height: 560px) and (orientation: landscape) and (pointer: coarse) {
    .subbar { border-radius: 0; }
}

/* The level's bar, in the header's own materials. The way back and Edit are
 * the ordinary glass buttons, rounded into pills to sit beside the pager.
 * The pager is one glass capsule, as the header's nav is, with the step you
 * reach for lit inside it the way the current page is lit there; the
 * neighbours' pictures framed and shadowed like the list's thumbnails; and
 * the place in the display face over a rail of the wordmark's gold, the bead
 * on it glowing. */
.levelbar .levelbar-back { border-radius: 62.5rem; }
/* The way back zooms under the pointer whole, as Edit beside it does. Its
   label takes a smaller nudge down than the other buttons' (--lift): with
   the full one it rested a pixel low and was redrawn a pixel higher once
   zoomed, so it hopped on hover. At this one it rests where the hop took it,
   and stays there. */
.levelbar .levelbar-back { --lift: 0.03em; }
/* --pager-inset is the room round a hovered step's pill: from the pager's own
   edge, and the same again from the rules either side of the place — without
   it, the pill ran right up against those lines. */
.levelbar-pager {
    --pager-inset: 0.25rem;
    padding: var(--pager-inset);
    background: var(--glass); border: 1px solid var(--hairline);
    border-radius: 62.5rem;
    box-shadow: var(--sheen), var(--shadow-sm);
}
/* The settings page's jump links: the same capsule, the same pill under the
   pointer. */
.levelbar-sections {
    padding: 0.25rem;
    background: var(--glass); border: 1px solid var(--hairline);
    border-radius: 62.5rem;
    box-shadow: var(--sheen), var(--shadow-sm);
}
.levelbar-section { min-height: 2.25rem; border-radius: 62.5rem; transition: background-color .25s var(--ease-out), box-shadow .25s var(--ease-out), color .15s; }
.levelbar-section:hover {
    background: var(--glass-strong);
    box-shadow: var(--sheen), 0 0 0 1px var(--hairline-strong), 0 8px 18px -12px rgba(0, 0, 0, 0.55);
}
@media (max-width: 640px) {
    .levelbar-sections { padding: 0.1875rem; }
    .levelbar-section { width: 2.25rem; min-height: 2.25rem; }
}
.levelbar-step { border-radius: 62.5rem; transition: background-color .25s var(--ease-out), box-shadow .25s var(--ease-out); }
a.levelbar-step:hover {
    background: var(--glass-strong);
    box-shadow: var(--sheen), 0 0 0 1px var(--hairline-strong), 0 8px 18px -12px rgba(0, 0, 0, 0.55);
}
/* The level form's heading card: a pane of the same glass as the pager,
   rounded so the picture inside it sits on the same curve a step in. */
.levelbar-heading {
    background: var(--glass); border-color: var(--hairline);
    border-radius: 1rem;
    box-shadow: var(--sheen), var(--shadow-sm);
}
.levelbar-heading-thumb { border-radius: 0.75rem; }
.levelbar-heading-thumb:not(.is-new) {
    box-shadow: 0 0 0 1px var(--hairline-strong), 0 8px 16px -10px rgba(0, 0, 0, 0.6);
}
.levelbar-thumb,
.level-nav-thumb {
    border-radius: 0.5rem;
    box-shadow: 0 0 0 1px var(--hairline-strong), 0 8px 16px -10px rgba(0, 0, 0, 0.6);
}
.levelbar-place { border-color: var(--hairline-strong); margin-inline: var(--pager-inset); }
.levelbar-place-text b { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.03em; }
.levelbar-rail { background: var(--pill-on); box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.1); }
.levelbar-rail i { background: linear-gradient(90deg, #fdf478, #fdd405 30%, #fca903 75%, #f98c02); }
.levelbar-tools { border-left-color: var(--hairline-strong); }
.levelbar .levelbar-edit { border-radius: 62.5rem; }
@media (max-width: 640px) {
    .levelbar-pager { --pager-inset: 0.1875rem; }
    /* The steps are circles here, and a circle meets an upright rule at its
       widest point, along most of its height — the inset alone left the
       pressed one all but touching it, its ring closing what gap there was. */
    .levelbar-place { margin-inline: 0.375rem; }
}
/* Except where the pager has no width to spare (see style.css). */
@media (max-width: 340px) {
    .levelbar-place { margin-inline: var(--pager-inset); }
}

/* =========================================================== buttons */

.btn, .tier-chip, .tier-clear, .icon-btn, .theme-toggle, .nav-burger,
.auth-btn, .level-nav a {
    transition: transform .4s var(--ease-out), box-shadow .4s var(--ease-out),
                background-color .25s, border-color .25s, color .25s;
}
.btn:hover  { transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(.975); transition-duration: .08s; }

/* Labels centred top to bottom.
 *
 * The hard style ran every button's bottom padding a few pixels heavier
 * than its top, to stand the label clear of the band along its foot. Glass
 * has no band, so every label sat 1.3–2.3px high. Here the same total is
 * split evenly — no button changes height — and the top takes a hair more
 * than the bottom (--lift): Archivo's capitals sit a little above the middle
 * of their own line, so even padding alone still reads about a pixel high.
 * In em, so the nudge is the same proportion at every size.
 *
 * Top and bottom only, so each control keeps its width, its side padding,
 * and the sizes its breakpoints give it. */
:root { --lift: 0.06em; }
.btn            { padding-top: calc(0.65625rem + var(--lift)); padding-bottom: calc(0.65625rem - var(--lift)); }
.btn-sm         { padding-top: calc(0.40625rem + var(--lift)); padding-bottom: calc(0.40625rem - var(--lift)); }
.btn-lg         { padding-top: calc(0.84375rem + var(--lift)); padding-bottom: calc(0.84375rem - var(--lift)); }
.foot-signout .btn { padding-top: calc(0.25rem + var(--lift)); padding-bottom: calc(0.25rem - var(--lift)); }
.tier-chip,
.tier-clear     { padding-top: calc(0.34375rem + var(--lift)); padding-bottom: calc(0.34375rem - var(--lift)); }
/* The count's plate, and the figure in it, both measured centred. The chip
   nudges its contents down for the label's sake (the padding above), which
   carried the plate a pixel low with it; `top` takes the chip's nudge back
   off the plate alone — 0.06em of the chip's own size. The figure inside
   takes a nudge of its own, smaller than the 0.13em it had, which sat it a
   pixel low in the plate. */
.tier-chip em   { --lift: 0.04em; padding-top: calc(1.5px + var(--lift)); padding-bottom: calc(1.5px - var(--lift));
                  position: relative; top: -0.046875rem; }
.badge          { padding-top: calc(3.5px + var(--lift));      padding-bottom: calc(3.5px - var(--lift)); }
.badge-copy     { padding-top: calc(4px + var(--lift));        padding-bottom: calc(4px - var(--lift)); }
/* The ID is all figures, which stand as tall as the capitals do, so the
   nudge meant for a capital's high line left it a measured pixel low. */
.badge-copy     { --lift: 0em; }
.account-toggle { padding-top: calc(0.40625rem + var(--lift)); padding-bottom: calc(0.40625rem - var(--lift)); }
.account-add > summary { padding-top: calc(0.46875rem + var(--lift)); padding-bottom: calc(0.46875rem - var(--lift)); }
/* At the large size even padding is already within half a pixel, so it
   takes half the nudge. */
.btn-lg         { --lift: 0.03em; }
/* A fixed height, its label centred in it: only the band's 3px had to go —
   measured, the label is then centred without any nudge. */
.auth-btn       { padding-top: 0; padding-bottom: 0; }
/* These were evenly padded already, so they take the nudge alone: the menu
   under The List, its counts, and the pickers on the level form. (The
   header's own links take it in their rule below.) */
.navmenu-item   { padding-top: calc(0.5625rem + var(--lift)); padding-bottom: calc(0.5625rem - var(--lift)); }
.navmenu-count  { padding-top: calc(1px + var(--lift));       padding-bottom: calc(1px - var(--lift)); }
.segment-body   { padding-top: calc(0.5rem + var(--lift));    padding-bottom: calc(0.5rem - var(--lift)); }
.tier-body      { padding-top: calc(0.625rem + var(--lift));  padding-bottom: calc(0.625rem - var(--lift)); }

/* Gold: built like the wordmark's letters.
 *
 * Those letters are pixel art, and a button in gold is drawn the same way:
 *
 *   the fill    the logo's own ramp in hard bands, no blending — a pale
 *               sheen along the top, the yellow face, then amber, orange
 *               and burnt orange towards the foot (--logo-bands)
 *   the line    a thick near-black keyline all the way round
 *   the block   the letter's extrusion: a solid dark-brown block offset
 *               down and to the right, keylined in the same black
 *
 * and it moves like a block. Under the pointer it rises up off its
 * extrusion, which grows to match; pressed, it drops all the way down
 * onto it and the extrusion disappears — flush with the page, the way
 * a key bottoms out. */
:root {
    --logo-bands: linear-gradient(180deg,
        #fdf478 0 13%,
        #fdd405 13% 50%,
        #fdb604 50% 68%,
        #fca903 68% 84%,
        #f98c02 84% 100%);
    --logo-ink:   #140b00;
    --logo-block: #8b3c01;
}
.btn-primary {
    background: var(--logo-bands);
    border: 2px solid var(--logo-ink);
    border-radius: 0.25rem;
    color: var(--logo-ink);
    font-weight: 800;
    text-shadow: 0 1px 0 rgba(255, 246, 180, 0.65);
    box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.45),
                4px 4px 0 0 var(--logo-block),
                4px 4px 0 2px var(--logo-ink);
}
.btn-primary:hover {
    transform: translate(-2px, -2px);
    box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.45),
                6px 6px 0 0 var(--logo-block),
                6px 6px 0 2px var(--logo-ink);
}
.btn-primary:active {
    transform: translate(4px, 4px);
    box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.3),
                0 0 0 0 var(--logo-block),
                0 0 0 0 var(--logo-ink);
    transition-duration: .06s;
}

/* The block reaches 6px past the button on the right and below — a 4px
   offset and its 2px keyline — and stays there on hover, where the button
   rises by as much as the block grows. So a gold button told to fill its
   column gives that back: its face is 6px short, and the block finishes
   level with the full-width buttons beside it rather than poking past them.
   In the Editing panel it also keeps 6px clear underneath, so the gap below
   the block is the same as the gap between the buttons under it. */
.btn-primary.btn-block { width: calc(100% - 6px); }
.side-admin .btn-primary { margin-bottom: 6px; }

/* A chip switched on keeps its colour and is lifted out of the row, rather
 * than painted another colour: a solid face where the others are glass, a
 * firmer edge, a deeper shadow under it, its label heavier, and its count
 * on a solid gold plate with dark figures, the same in both themes.
 *
 * And while any are on, the ones that are off step back: faded, their
 * demon faces gone grey, until the pointer reaches them. So the chosen
 * tiers are the only coloured, solid things in the row; with every chip on,
 * nothing is faded and the row is simply even. */
:root { --chip-on-face: #ffffff; }
:root[data-theme="dark"] { --chip-on-face: #2a2a31; }
.tier-chip.is-on,
.tier-chip.is-on:hover {
    background: var(--chip-on-face);
    border: 1px solid color-mix(in srgb, var(--ink) 24%, transparent);
    color: var(--ink); font-weight: 750;
    text-shadow: none;
    box-shadow: var(--sheen), 0 2px 4px rgba(0, 0, 0, 0.08), 0 10px 22px -12px rgba(0, 0, 0, 0.5);
}
/* The count's plate takes the wordmark's gold, in the letters' own bands, but
   flat: the same plate as the chip's off state, the same size, with no
   keyline round it, no block under it and no bevel, so it does not stand up
   off the chip. The figure in the letters' own black. */
.tier-chip.is-on em {
    background: var(--logo-bands);
    color: var(--logo-ink); font-weight: 800;
    text-shadow: none;
    box-shadow: none;
}
/* Under the pointer it zooms and takes the yellow edge every button does,
   keeping its solid face — the plain chips' hover would otherwise repaint
   it as glass. */
.tier-chip.is-on:hover  { border-color: var(--gold); transform: scale(var(--zoom)); }
.tier-chip.is-on:active { transform: scale(.96); }

.tier-chip { transition: transform .22s var(--ease-out), border-color .15s, box-shadow .15s, color .15s, opacity .2s; }
.tier-chip .gd-icon { transition: filter .2s; }
.tier-filter:has(.tier-chip.is-on) .tier-chip:not(.is-on):not(:hover) { opacity: .55; }
.tier-filter:has(.tier-chip.is-on) .tier-chip:not(.is-on):not(:hover) .gd-icon {
    filter: grayscale(1) var(--shadow-sprite);
}

/* The focus ring has to clear the extrusion, which sits down and right. */
:root[data-input="key"] .btn-primary:focus-visible { outline-offset: 6px; }

/* Neutral: glass with a hairline. Reached for, it grows a little and its
 * one-pixel edge turns yellow — a fine line rather than a ring, the
 * hairline itself lit.
 *
 * Icon-only buttons grow further than the ones with a label: four per cent
 * of a 26px square is about a pixel, which nobody sees, so they take
 * eight. Pressed, any of them gives a little, back below its own size. */
.btn-ghost,
.auth-btn-out,
.theme-toggle,
.nav-burger,
.icon-btn,
.level-nav a,
.tier-chip,
.tier-clear,
.scroll-btn {
    --zoom: 1.04;
    background: var(--glass-strong);
    border: 1px solid var(--hairline-strong);
    box-shadow: var(--sheen), 0 1px 2px rgba(0, 0, 0, 0.12), 0 8px 20px -14px rgba(0, 0, 0, 0.5);
    transition: transform .22s var(--ease-out), border-color .15s, box-shadow .15s, color .15s;
}
.icon-btn,
.theme-toggle,
.nav-burger,
.scroll-btn { --zoom: 1.08; }

/* Restated in full on hover — the resting shadow, unchanged — because the
   hard style underneath (style.css) gives several of these its own hover
   background, edge and offset block at the same strength. */
.btn-ghost:hover,
.auth-btn-out:hover,
.theme-toggle:hover,
.nav-burger:hover,
.icon-btn:hover,
.level-nav a:hover,
.tier-chip:hover,
.tier-clear:hover,
.scroll-btn:hover {
    background: var(--glass-strong); color: var(--ink);
    border-color: var(--gold);
    box-shadow: var(--sheen), 0 1px 2px rgba(0, 0, 0, 0.12), 0 8px 20px -14px rgba(0, 0, 0, 0.5);
    transform: scale(var(--zoom));
}
.btn-ghost:active,
.auth-btn-out:active,
.theme-toggle:active,
.nav-burger:active,
.icon-btn:active,
.level-nav a:active,
.tier-chip:active,
.tier-clear:active,
.scroll-btn:active {
    transform: scale(.96);
    transition-duration: .08s;
}

/* The other icon-only buttons that are not destructive — the jump arrows on
   a level — turn their icon the gold of their outline, on a faint gold
   ground, as they grow. The same gold in both themes, so the icon and its
   edge always match. */
.icon-btn:not(.icon-danger):hover { background: var(--gold-50); color: var(--gold); }

/* Edit has a colour of its own: blue — edge, pencil and a faint blue
   ground — so it stands apart both from Delete's red beside it and from
   the gold every other button lights up in. Brighter by night, where the
   deeper blue would sink into the dark. */
:root { --edit: #2563eb; --edit-tint: #eaf1ff; }
:root[data-theme="dark"] { --edit: #6aa8ff; --edit-tint: rgba(106, 168, 255, 0.12); }
/* Qualified with .icon-btn to outrank the gold rule above, which matches
   edit too and counts its :not() as a class. */
.icon-btn.icon-edit:hover {
    background: var(--edit-tint); color: var(--edit);
    border-color: var(--edit);
}

/* The light and dark switch, as tall as the nav's capsule beside it, with
   its sun and moon to match: it is the one control here that changes the
   whole page. Except on a phone on its side, where the header has to stay
   short (style.css shrinks it there too).
 *
 * The phone's menu button the same way: it is the only control in a phone's
 * header, and at 36px it read as an afterthought beside the wordmark. 44px,
 * the size a finger is promised, with its lines to match; a little less on
 * a phone on its side. It reaches into the header's padding by what it grew
 * (the negative margin), so the header stays the height it was — the bar
 * under it and everything that measures from it stay put. */
.theme-toggle { width: 3rem; height: 3rem; padding: 0; }
.theme-toggle .icon { width: 1.5rem; height: 1.5rem; }
.nav-burger { width: 2.75rem; height: 2.75rem; margin-block: -0.25rem; }
.nav-burger .icon { width: 1.375rem; height: 1.375rem; }
@media (max-height: 560px) and (orientation: landscape) and (pointer: coarse) {
    .theme-toggle { width: 1.875rem; height: 1.875rem; }
    .theme-toggle .icon { width: 1.0625rem; height: 1.0625rem; }
    .nav-burger { width: 2.5rem; height: 2.5rem; margin-block: -0.125rem; }
    .nav-burger .icon { width: 1.25rem; height: 1.25rem; }
}

/* Delete and Sign out light their edge red instead, their icon and label
   turning red on a faint red ground — taking a level off the list never
   looks like editing it, and leaving never looks like going somewhere. Sign
   out is the header's button, the phone menu's and the footer's. The shadow
   is restated because the hard style's own red hover on the footer's button
   is stronger than the rule above, and would draw it a solid offset block. */
.icon-danger:hover,
.auth-btn-out:hover,
.btn.topnav-signout:hover,
.foot-signout .btn:hover {
    background: var(--tint-danger); color: var(--danger);
    border-color: var(--danger);
    box-shadow: var(--sheen), 0 1px 2px rgba(0, 0, 0, 0.12), 0 8px 20px -14px rgba(0, 0, 0, 0.5);
}

/* Clear, at the end of the difficulty filters, is plain glass like the
   chips until it is reached for; then it turns red — label, ×, edge and a
   faint red ground — as it zooms, the way Delete does, since it takes every
   filter off at once. Its × follows the label's colour; the hard style
   underneath (style.css) would keep it red at rest. After the neutral rules
   above, which would otherwise give its hover a gold edge. */
.tier-clear .icon { color: currentColor; }
.tier-clear:hover,
.tier-clear:active {
    background: var(--tint-danger); color: var(--danger);
    border-color: var(--danger);
}

/* The corner scroll buttons fade in and out, so their own fade has to stay
   in the list alongside the hover's. And their padding goes: it was there
   to lift the arrow clear of the hard style's band along the bottom, which
   glass does not have. */
.scroll-btn {
    padding: 0;
    transition: opacity .18s, visibility 0s .18s,
                transform .22s var(--ease-out), border-color .15s, box-shadow .15s, color .15s;
}

.theme-toggle, .nav-burger { border-radius: 62.5rem; }

/* Red, lit from above, on the same soft neutral shadow as everything else —
   no red glow round it, as no other button has a coloured one. Under the
   pointer it zooms like the rest.
 *
 * The face is the same in every state, restated for each, and lightens or
 * darkens through a filter. The hard style underneath swaps in a flat red
 * on hover and press through the `background` shorthand, which drops the
 * gradient at once and fades the colour in from transparent — so for the
 * first part of every hover the button was the pale panel behind it with
 * white letters on top, all but blank. A filter fades both ways. */
.btn-danger,
.btn-danger:hover,
.btn-danger:active {
    background: linear-gradient(180deg, #d9493a, var(--btn-danger)) var(--btn-danger);
}
.btn-danger {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), inset 0 -2px 0 rgba(0, 0, 0, 0.2),
                0 1px 2px rgba(0, 0, 0, 0.12), 0 8px 20px -14px rgba(0, 0, 0, 0.5);
    transition: transform .4s var(--ease-out), box-shadow .4s var(--ease-out),
                filter .2s, border-color .25s, color .25s;
}
.btn-danger:hover {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), inset 0 -2px 0 rgba(0, 0, 0, 0.2),
                0 1px 2px rgba(0, 0, 0, 0.12), 0 8px 20px -14px rgba(0, 0, 0, 0.5);
    filter: brightness(1.08);
    transform: scale(1.04);
}
.btn-danger:active {
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.3);
    filter: brightness(.94);
    transform: scale(.96);
}

.tier-chip em { background: var(--pill-on); }

/* ========================================================== surfaces */

/* Glass. Every block the page is built from sits over the stage as a pane
   of it: a translucent fill, a hairline edge, a line of light along the
   top, and a long soft shadow under it.
 *
 * The list's cards and a level's card are frosted like the sidebar's
 * panels, so the ground's drifting light shows through them. They were
 * nearly opaque, to spare a backdrop blur redone every frame the scene
 * behind moves; a list shows five or six at a time, which is the price of
 * the light reaching them. The stats page's tiles and panels stay nearly
 * opaque. */
.card, .side-panel, .panel, .stat, .stats-head, .tier-filter,
.empty-state, .modal, .toast, .form-busy-card, .cal, .combo-menu {
    border-color: var(--hairline);
    box-shadow: var(--sheen), var(--shadow-sm);
}
.stat, .panel, .empty-state {
    background-color: var(--glass-card);
}
.card,
.side-panel, .tier-filter, .stats-head, .modal, .toast, .form-busy-card {
    background-color: var(--glass);
    -webkit-backdrop-filter: var(--glass-blur);
            backdrop-filter: var(--glass-blur);
}
/* The page's own panes — the list's cards, the sidebar, the difficulty
   tray — a step nearer the rows and chips inside them (--glass-inset), and
   a step short of it, so the two still part. A level has no pane of its
   own: its parts stand on the ground (style.css, .level-col). */
.card, .side-panel, .tier-filter { background-color: var(--glass-pane); }
.modal, .toast, .form-busy-card, .cal, .combo-menu { box-shadow: var(--sheen), var(--shadow-lg); }
.cal, .combo-menu { background: var(--glass-strong); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); }

@media (prefers-reduced-transparency: reduce) {
    .card, .side-panel, .panel, .stat, .stats-head, .tier-filter,
    .empty-state, .modal, .toast, .form-busy-card, .cal, .combo-menu {
        background-color: var(--surface);
        -webkit-backdrop-filter: none; backdrop-filter: none;
    }
}

/* Fields: a well of glass, lit gold when in use. */
.searchbox,
input[type="text"], input[type="url"], input[type="number"], input[type="password"],
input[type="date"], textarea, select, .date-trigger {
    background-color: color-mix(in srgb, var(--field-well) 72%, transparent);
    border-color: var(--hairline-strong);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.12);
    transition: border-color .25s, box-shadow .3s var(--ease-out), background-color .25s;
}
.searchbox input[type="search"] { background: none; box-shadow: none; }
.searchbox:focus-within,
input[type="text"]:focus, input[type="url"]:focus, input[type="number"]:focus,
input[type="password"]:focus, textarea:focus, select:focus {
    background-color: var(--glass-strong);
    border-color: color-mix(in srgb, var(--gold) 75%, transparent);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1), 0 0 0 4px color-mix(in srgb, var(--gold) 16%, transparent),
                0 10px 30px -16px rgba(234, 179, 8, 0.55);
}
/* The list's rank box is a figure, not a form field — it keeps its own
   bare look from style.css. */
.card-rank .card-rank-input,
.card-rank .card-rank-input:focus { background-color: transparent; border: 0; }
.card-rank .card-rank-input:focus { box-shadow: inset 0 0 0 2px var(--gold-deep); }

/* ============================================================ the hero */

/* The list's opening: the section's name set large, three figures under
   it, and the cube — the stage's cube, which stands in the box on the
   right. That box is only a place on the page: stage.js reads where it is
   and puts the 3D cube there. Until the stage has drawn (or if it never
   does) a picture of the cube floats in it instead. */
.list-hero {
    position: relative;
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr);
    align-items: center; gap: 2rem;
    min-height: clamp(24rem, 56svh, 34rem);
    padding: 2rem 0 3rem;
    anchor-name: --list-hero;
}
.list-hero-copy { min-width: 0; position: relative; z-index: 1; }

/* The headline, in the level names' own letters: Archivo at its heaviest
   and normal width, as .card-title sets them, only larger — and tracked
   in tighter, as heavy type has to be once it is this big.
 *
 * Its own measure, 8em, so it stands stacked as it always has — "The
 * hardest / levels / I've beaten." — however wide the page around it: the
 * accent is one unbreakable phrase (below), and at 8em neither line can take
 * the word beside it. Across the full-width page it would otherwise have run
 * out to one long line. Up to 6rem on a wide screen, where 5 left it small
 * against the width. */
.list-hero-title {
    margin: 0 0 1.375rem;
    max-width: 8em;
    font: 800 clamp(2.75rem, 5.4vw, 6rem)/0.98 var(--font-hero);
    font-stretch: normal;
    letter-spacing: -0.035em; color: var(--ink);
    text-wrap: balance;
}
/* The accent words, lettered like the gold buttons: the wordmark's colour
   bands for a face, a black keyline round every letter, and a brown block
   stepped down and to the right under it, keylined too — the button's
   face, border and extrusion, as type. The same in both themes, as the
   buttons are.
 *
 * Built in two layers, because a gradient face and text-shadow cannot share
 * one: a face clipped out of a background is painted under the element's
 * text-shadows, which would cover it. So the word itself carries the
 * keyline and the block, as rings and steps of text-shadow, and ::after
 * lays a copy of it on top (from data-text, set in views/list.php) wearing
 * the bands. Same font, same tracking, same box — so the copy lands on the
 * word exactly. The copy is decoration: its alt text is empty, so nothing
 * reads the words out twice.
 *
 * Rings of text-shadow rather than -webkit-text-stroke: Archivo is a
 * variable font, its letters are built from overlapping shapes, and a
 * stroke draws every overlap as a line through the middle of the letter.
 *
 * The bands are set in em from the top of the line box, so they land on
 * the letters at any size: the title's 0.98 line puts the baseline 0.825em
 * down and the top of the lowercase 0.295em down, and the button's own
 * proportions are laid across that span — a pale sheen across the tops,
 * the face, then amber into orange at the feet.
 *
 * Tracked out a little from the title's tight setting, or the keylines of
 * neighbouring letters run together; and an inline block, so the phrase
 * stays on one line, with room kept on the right for the block's overhang. */
.list-hero-title em {
    position: relative;
    display: inline-block;
    font-style: normal;
    color: var(--logo-ink);
    letter-spacing: -0.008em;
    margin-right: 0.12em;
    text-shadow:
        /* the keyline round the letters */
        0.032em 0em 0 var(--logo-ink),
        0.028em 0.016em 0 var(--logo-ink),
        0.016em 0.028em 0 var(--logo-ink),
        0em 0.032em 0 var(--logo-ink),
        -0.016em 0.028em 0 var(--logo-ink),
        -0.028em 0.016em 0 var(--logo-ink),
        -0.032em 0em 0 var(--logo-ink),
        -0.028em -0.016em 0 var(--logo-ink),
        -0.016em -0.028em 0 var(--logo-ink),
        0em -0.032em 0 var(--logo-ink),
        0.016em -0.028em 0 var(--logo-ink),
        0.028em -0.016em 0 var(--logo-ink),
        /* the block, stepped down and right */
        0.01em 0.01em 0 var(--logo-block),
        0.02em 0.02em 0 var(--logo-block),
        0.03em 0.03em 0 var(--logo-block),
        0.04em 0.04em 0 var(--logo-block),
        0.05em 0.05em 0 var(--logo-block),
        0.06em 0.06em 0 var(--logo-block),
        0.07em 0.07em 0 var(--logo-block),
        0.08em 0.08em 0 var(--logo-block),
        /* and the keyline round the block */
        0.052em 0.02em 0 var(--logo-ink),
        0.043em 0.043em 0 var(--logo-ink),
        0.02em 0.052em 0 var(--logo-ink),
        -0.003em 0.043em 0 var(--logo-ink),
        -0.012em 0.02em 0 var(--logo-ink),
        -0.003em -0.003em 0 var(--logo-ink),
        0.02em -0.012em 0 var(--logo-ink),
        0.043em -0.003em 0 var(--logo-ink),
        0.072em 0.04em 0 var(--logo-ink),
        0.063em 0.063em 0 var(--logo-ink),
        0.04em 0.072em 0 var(--logo-ink),
        0.017em 0.063em 0 var(--logo-ink),
        0.008em 0.04em 0 var(--logo-ink),
        0.017em 0.017em 0 var(--logo-ink),
        0.04em 0.008em 0 var(--logo-ink),
        0.063em 0.017em 0 var(--logo-ink),
        0.092em 0.06em 0 var(--logo-ink),
        0.083em 0.083em 0 var(--logo-ink),
        0.06em 0.092em 0 var(--logo-ink),
        0.037em 0.083em 0 var(--logo-ink),
        0.028em 0.06em 0 var(--logo-ink),
        0.037em 0.037em 0 var(--logo-ink),
        0.06em 0.028em 0 var(--logo-ink),
        0.083em 0.037em 0 var(--logo-ink),
        0.112em 0.08em 0 var(--logo-ink),
        0.103em 0.103em 0 var(--logo-ink),
        0.08em 0.112em 0 var(--logo-ink),
        0.057em 0.103em 0 var(--logo-ink),
        0.048em 0.08em 0 var(--logo-ink),
        0.057em 0.057em 0 var(--logo-ink),
        0.08em 0.048em 0 var(--logo-ink),
        0.103em 0.057em 0 var(--logo-ink);
}
.list-hero-title em::after {
    content: attr(data-text);
    content: attr(data-text) / "";
    position: absolute; left: 0; top: 0;
    white-space: nowrap; pointer-events: none;
    text-shadow: none;
    background: linear-gradient(180deg,
        #fdf478 0 0.364em,
        #fdd405 0.364em 0.56em,
        #fdb604 0.56em 0.655em,
        #fca903 0.655em 0.74em,
        #f98c02 0.74em);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent; color: transparent;
}
.list-hero-lede {
    color: var(--ink-2); font-size: clamp(1rem, 1.1vw, 1.125rem); line-height: 1.6;
    max-width: 44ch;
}

.list-hero-stats {
    display: grid; grid-template-columns: repeat(3, minmax(0, max-content)); gap: 0.625rem;
    margin: 2rem 0 0; padding: 0;
}
.list-hero-stat {
    margin: 0; min-width: 0;
    padding: 0.8125rem 1.125rem 0.875rem;
    background-color: var(--glass); border: 1px solid var(--hairline); border-radius: var(--radius-sm);
    -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
    box-shadow: var(--sheen), var(--shadow-sm);
}
.list-hero-stat dt {
    display: flex; align-items: center; gap: 0.4375rem;
    font: 700 0.6875rem/1.2 var(--font-label); letter-spacing: 0.09em; text-transform: uppercase;
    color: var(--muted); white-space: nowrap;
}
.list-hero-stat dt .gd-icon { filter: var(--shadow-sprite); }
.list-hero-stat dd {
    margin: 0.4375rem 0 0;
    font: 800 1.75rem/1 var(--font-hero); font-stretch: normal;
    letter-spacing: -0.025em;
    color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap;
}
/* The super card: two figures in one card, each label over its figure, a
   hairline standing between the pair. Column-first, so the markup's order —
   label, figure, label, figure — fills it down and then across. The line is
   drawn on both halves of the second column, and the gap above each figure
   is padding rather than margin, so the line runs unbroken from the top of
   the label to the foot of the figure. */
.list-hero-pair {
    display: grid; grid-auto-flow: column; grid-template-rows: auto auto;
    justify-content: start;
}
.list-hero-pair > dd { margin-top: 0; padding-top: 0.4375rem; }
.list-hero-pair > dt:nth-of-type(2),
.list-hero-pair > dd:nth-of-type(2) {
    margin-left: 1.125rem; padding-left: 1.125rem;
    border-left: 1px solid var(--hairline-strong);
}

/* The buttons stand a little apart so the gold one's extrusion has room.
   The one beside it is the site's ordinary glass button — the same as
   Renumber ranks and Settings in the Editing panel — only at the large size
   the gold one is set at. */
.list-hero-cta { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 2.125rem; }
.list-hero-cta .btn-lg { min-height: 3.25rem; padding-inline: 1.5rem; font-size: 1rem; }
.list-hero-cta .btn .icon { transition: transform .4s var(--ease-out); }
.list-hero-cta .btn:hover .icon { transform: translateX(3px); }

/* The cube stands in the middle of its box, and the box sits level with
   the text beside it (the row centres both), so the cube's middle is the
   text's middle. It is 60% of the box wide — stage.js draws it at that
   size, and the picture of it a device with no 3D gets is drawn at it too. */
.list-hero-stage {
    position: relative; justify-self: center;
    width: min(100%, clamp(28rem, 28vw, 36rem)); aspect-ratio: 1;
}
/* The link to the player's profile (or a plain box when there is none),
   the stage's own size, so the cube and the tag are placed off it exactly
   as they were off the stage. It takes no pointer itself — only the tag and
   the picture of the cube under the 3D one do — so the box's empty corners
   are not a link. */
.hero-profile {
    position: absolute; inset: 0;
    display: grid; place-items: center;
    pointer-events: none;
}
a.hero-profile .hero-tag,
a.hero-profile .list-hero-art { pointer-events: auto; cursor: pointer; }
a.hero-profile:focus-visible { outline: none; }
a.hero-profile:focus-visible .hero-tag {
    outline: 2px solid var(--gold); outline-offset: 0.375rem; border-radius: 0.25rem;
}
/* The picture of the cube: what the hero shows where there is no 3D stage,
   and what the stage takes its cube's face from. Not lazy, and fetched
   early, so the stage finds it already in hand. */
.list-hero-art {
    width: 60%; height: auto; display: block;
    filter: drop-shadow(0 28px 36px rgba(0, 0, 0, 0.35)) drop-shadow(0 0 40px rgba(250, 190, 20, 0.35));
    transition: opacity .9s var(--ease-out);
}
@media (prefers-reduced-motion: no-preference) {
    .list-hero-art { animation: stage-float 5.5s ease-in-out infinite; }
}
@keyframes stage-float {
    0%, 100% { transform: translateY(0) rotate(-4deg); }
    50%      { transform: translateY(-0.875rem) rotate(3deg); }
}
.has-stage .list-hero-art { opacity: 0; }
/* As a link, the picture grows a little under the pointer, as the 3D cube
   does in its place (stage.js). `scale` rather than transform, which the
   float above is using. */
a.hero-profile .list-hero-art { transition: opacity .9s var(--ease-out), scale .35s var(--ease-out); }
a.hero-profile:has(.hero-tag:hover, .list-hero-art:hover) .list-hero-art { scale: 1.05; }
/* Not shown at all while the 3D cube is on its way — under the sign-in
   splash too, where the cube is built while the splash plays — so the page
   never paints the flat picture and then swaps it for the model. Only if
   the stage gives up (stage-expected is taken off) does the picture
   appear. */
.stage-expected .list-hero-art { opacity: 0; transition: none; }

/* The player's nametag, over the cube as a Minecraft nametag hangs over a
   player's head: white pixel letters on a translucent dark plate, always
   facing you. Sized from the box (its height a share of the box's) so it
   keeps its proportion to the cube at every width, and drawn pixel-sharp.
 *
   It floats with the picture where that is shown in place of the cube;
   over the 3D cube, stage.js moves it with the cube's own bob instead,
   through --bob. On the dark page the game's plate would vanish into black,
   so it is a lifted grey there. */
:root { --tag-bg: rgba(0, 0, 0, 0.25); }
:root[data-theme="dark"] { --tag-bg: rgba(255, 255, 255, 0.13); }
/* The tag, with the AREDL mark on its plate before the name (drawn into the
   same SVG, Helpers::nametag()), centred over the cube.
 *
 * A layer of its own, drawn once and slid. Painted in place on every frame
 * of the bob instead, the pixel letters — drawn crisp — snapped to the
 * nearest whole pixel while the mark beside them glided between pixels:
 * the name stepped and the mark slid, out of step by up to a pixel. Rounding
 * the bob to whole pixels kept them together but made both step. As one
 * layer they are one picture, and it glides. */
.hero-tag {
    position: absolute; left: 50%; top: 2%;
    height: 10%;
    display: flex; align-items: center;
    transform: translate(-50%, var(--bob, 0px));
    will-change: transform;
}
.hero-tag .nametag {
    height: 100%; width: auto; display: block;
    image-rendering: pixelated;
}
/* The mark is painted art, not pixels: smoothed, unlike the letters. */
.nametag-badge { image-rendering: auto; }
.nametag-bg   { fill: var(--tag-bg); transition: fill .2s; }
.nametag-ink  { fill: #fff; }
/* The rule between the mark and the name: the letters' white, held well
   back, so it parts them without drawing the eye. */
.nametag-rule { fill: rgba(255, 255, 255, 0.3); }
/* Reached for: the plate darkens, as the game's does when you look at a
   player, and the cube grows a little (stage.js, or the picture below). */
a.hero-profile:has(.hero-tag:hover, .list-hero-art:hover) .nametag-bg { fill: rgba(0, 0, 0, 0.42); }
:root[data-theme="dark"] a.hero-profile:has(.hero-tag:hover, .list-hero-art:hover) .nametag-bg { fill: rgba(255, 255, 255, 0.24); }
@media (prefers-reduced-motion: no-preference) {
    .hero-tag { animation: tag-float 5.5s ease-in-out infinite; }
}
@keyframes tag-float {
    0%, 100% { transform: translate(-50%, 0); }
    50%      { transform: translate(-50%, -0.875rem); }
}
.has-stage .hero-tag { animation: none; }
/* Over an empty box it would be a name tag on no one: held back with the
   picture while the cube is coming, and there in the same frame as the
   cube. */
.stage-expected .hero-tag { opacity: 0; }
.has-stage .hero-tag { opacity: 1; }

/* The wall behind the hero: the section's top levels, their pictures in
 * three rows on a wall tilted away into the page, drifting slowly past
 * behind the cube — alternate rows in opposite directions. Held well back
 * (a third of their strength, a little of their colour taken out) and
 * faded into the ground on every side, so it is part of the page's light
 * rather than a picture laid on it: full strength only round the cube,
 * thinning out towards the headline, gone under the header and before the
 * list starts.
 *
 * Laid at the top of the page by the layout, before the cube's canvas, so
 * the cube and its glow stand in front of it (see views/layout.php). It
 * reaches down to the foot of the hero, wherever that falls, by anchoring
 * to it; where anchoring is not supported the height is the hero's at a
 * typical width, which the fade at the bottom hides.
 *
 * Each row is a run of six pictures written twice, and slides one run's
 * width per loop, so the end of a loop looks exactly like its start. The
 * wall is one run wide and centred on --wall-x: the second copy hangs out to
 * the right, and whichever way a row drifts, the run's width either side of
 * the middle is covered at every moment of the loop. Margins rather than
 * gap between the pictures, so that the two copies are exactly half the row.
 * Only transforms move, so the drift is left to the compositor. */
.hero-backdrop {
    --tile: clamp(16rem, 20vw, 27rem);
    --wall-gap: clamp(1rem, 1.3vw, 1.625rem);
    --wall-x: 65%;
    --wall-alpha: 0.36;
    --wall-mask:
        linear-gradient(180deg, transparent 4.5rem, #000 19rem, #000 62%, transparent 97%),
        radial-gradient(ellipse 66% 100% at var(--wall-x) 52%, #000 34%, rgba(0, 0, 0, 0.35) 66%, transparent 92%);
    position: absolute; left: 0; top: 0; z-index: 0;
    width: 100%; height: calc(12rem + clamp(28rem, 28vw, 36rem));
    overflow: hidden; pointer-events: none;
    contain: layout paint;
    -webkit-mask-image: var(--wall-mask);
    -webkit-mask-composite: source-in;
            mask-image: var(--wall-mask);
            mask-composite: intersect;
}
@supports (anchor-name: --a) {
    .hero-backdrop { height: auto; bottom: anchor(--list-hero bottom); }
}
/* At night the pictures are lit screens in the dark, and need less. */
:root[data-theme="dark"] .hero-backdrop { --wall-alpha: 0.32; }
.hero-wall {
    position: absolute; left: var(--wall-x); top: 50%;
    width: calc(6 * (var(--tile) + var(--wall-gap)));
    display: flex; flex-direction: column; gap: var(--wall-gap);
    opacity: var(--wall-alpha);
    transform: translate(-50%, -50%) perspective(1800px) rotateX(12deg) rotateY(-22deg) rotateZ(-10deg);
}
.hero-wall-row { display: flex; width: max-content; }
/* Staggered, as bricks are, so the pictures don't stand in columns. */
.hero-wall-row:nth-child(2) { margin-left: calc(var(--tile) * -0.55); }
.hero-wall-row:nth-child(3) { margin-left: calc(var(--tile) * -0.2); }
.hero-wall img {
    display: block; flex: none;
    width: var(--tile); height: auto; aspect-ratio: 16 / 9; object-fit: cover;
    margin-right: var(--wall-gap);
    border-radius: var(--radius-sm);
    filter: saturate(0.85);
}
@media (prefers-reduced-motion: no-preference) {
    .hero-wall-row { animation: wall-drift 120s linear infinite; }
    .hero-wall-row:nth-child(2) { animation-direction: reverse; }
}
@keyframes wall-drift { to { transform: translateX(-50%); } }

/* A level's picture behind the top of its page (views/level.php), uploaded
 * for it on the level's form: most of the page's width from the right,
 * fading out towards the left, where the title and the player stand, and
 * into the ground before the neighbours. Held back like the list's wall, so
 * it is the page's light in the level's colours rather than a picture laid
 * on it. Laid where the wall goes (the layout's $heroBackdrop), over the
 * stage's ground and under the page. It starts under the header and the
 * level's bar (--header-h, which app.js keeps to their real height), so the
 * whole picture is seen rather than its top third going under them. 16:9,
 * as the form asks for; any other shape is cropped to it from the middle. */
.level-backdrop {
    --art-alpha: 0.5;
    /* Full strength by 40% of the way in: from the facts and the notes
       across, so the picture shows through their glass as much as through
       the sidebar's, while the title, further left, stays on the ground. */
    --art-mask:
        linear-gradient(90deg, transparent, #000 40%),
        linear-gradient(180deg, #000 45%, transparent 96%);
    position: absolute; right: 0; top: var(--header-h); z-index: 0;
    width: 70%; aspect-ratio: 16 / 9; max-height: 100vh;
    overflow: hidden; pointer-events: none;
    contain: layout paint;
    -webkit-mask-image: var(--art-mask);
    -webkit-mask-composite: source-in;
            mask-image: var(--art-mask);
            mask-composite: intersect;
}
/* At night the picture is a lit screen in the dark, and needs less. */
:root[data-theme="dark"] .level-backdrop { --art-alpha: 0.42; }
.level-backdrop img {
    display: block; width: 100%; height: 100%; object-fit: cover;
    opacity: var(--art-alpha);
    filter: saturate(0.9);
}
/* On a phone the page is one column and the title runs most of the way
   across it: the picture goes across the top, clear only towards the right
   edge and gone under the name, which would otherwise be read off the
   picture's own lettering. */
@media (max-width: 720px) {
    .level-backdrop {
        width: 100%;
        --art-mask:
            linear-gradient(90deg, transparent 38%, #000 100%),
            linear-gradient(180deg, #000 35%, transparent 92%);
    }
}

/* The same picture, the same fade, behind the stats page's Hardest card
   (views/stats.php): anchored at its top right, clear towards the left and
   gone by the foot, under the card's own content and inside its corners. */
.stat-hardest.has-art { position: relative; isolation: isolate; overflow: hidden; }
.stat-art {
    --art-alpha: 0.5;
    --art-mask:
        linear-gradient(90deg, transparent, #000 40%),
        linear-gradient(180deg, #000 45%, transparent 96%);
    position: absolute; inset: 0; z-index: -1; pointer-events: none;
    -webkit-mask-image: var(--art-mask);
    -webkit-mask-composite: source-in;
            mask-image: var(--art-mask);
            mask-composite: intersect;
}
:root[data-theme="dark"] .stat-art { --art-alpha: 0.42; }
/* The card's words lie over the picture's own busy lines: a soft halo of
   the card's colour under them keeps them reading. */
.stat-hardest.has-art :is(.stat-label, .stat-link, .stat-sub) {
    text-shadow: 0 0 0.5rem var(--surface), 0 0 0.1875rem var(--surface), 0 0 1px var(--surface);
}
.stat-art img {
    display: block; width: 100%; height: 100%; object-fit: cover; object-position: right top;
    opacity: var(--art-alpha);
    filter: saturate(0.9);
}

/* The list's own head, under the hero: the count as a small label on the
   left, the search box on the right, the difficulty tray beneath. */
.list-blurb {
    font: 700 0.75rem/1.3 var(--font-label); letter-spacing: 0.1em; text-transform: uppercase;
    color: var(--muted);
}
.list-blurb strong { color: var(--ink); font-weight: 700; }

@media (max-width: 1000px), (max-height: 560px) and (orientation: landscape) and (pointer: coarse) {
    .list-hero { grid-template-columns: minmax(0, 1fr) minmax(0, 0.7fr); gap: 1.5rem; min-height: 0; padding-top: 1.5rem; }
    /* The cube's column is narrower here, and further right. */
    .hero-backdrop { --tile: clamp(12rem, 22vw, 16rem); --wall-x: 74%; }
}
@media (max-width: 720px) {
    .list-hero { grid-template-columns: minmax(0, 1fr); gap: 0.5rem; padding: 0.5rem 0 2rem; }
    /* On a phone the cube stands above the headline, so the wall goes behind
       it there, centred under the cube (whose box starts just under the
       header and is 17rem at most) and faded out before the headline. */
    .hero-backdrop {
        --tile: 11rem; --wall-gap: 0.75rem; --wall-x: 50%;
        --wall-mask:
            linear-gradient(180deg, transparent 4.25rem, #000 8rem, #000 16rem, transparent 25rem),
            radial-gradient(ellipse 80% 16rem at 50% 13.5rem, #000 40%, transparent 100%);
    }
    .hero-wall { top: 13.5rem; }
    .list-hero-stage { order: -1; width: min(68vw, 17rem); }
    .list-hero-title { font-size: clamp(2.5rem, 11.5vw, 3.5rem); margin: 1.125rem 0 1rem; }
    /* The super card holds two figures, so it takes two shares of the row. */
    .list-hero-stats { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 0.4375rem; margin-top: 1.5rem; }
    .list-hero-stat { padding: 0.625rem 0.75rem 0.6875rem; }
    .list-hero-pair { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .list-hero-pair > dt:nth-of-type(2),
    .list-hero-pair > dd:nth-of-type(2) { margin-left: 0.625rem; padding-left: 0.625rem; }
    .list-hero-stat dd { font-size: 1.3125rem; }
    /* Three to a phone's row: the label may take two lines, and its art
       comes down to fit beside it. */
    .list-hero-stat dt { font-size: 0.5625rem; letter-spacing: 0.1em; white-space: normal; gap: 0.3125rem; }
    .list-hero-stat dt .gd-icon { width: 0.875rem; height: auto; }
    .list-hero-cta { margin-top: 1.5rem; }
    .list-hero-cta .btn { flex: 1 1 auto; }
}

/* ===================================================== admin and forms */

/* The settings page and the level form, brought onto the same glass. These
 * are the controls style.css still drew in the hard style — a solid face, a
 * band along the foot and an offset block — because none of the rules above
 * named them. */

/* Buttons the browser or a <summary> draws, which cannot take the button
   classes: the file chooser, Add an account, an account's Manage, and the
   copy-the-ID chip on a level. Glass at rest; under the pointer they zoom
   and take the thin yellow edge, like every other button. */
input[type="file"]::file-selector-button,
.import-form input[type="file"]::file-selector-button,
.account-add > summary,
.account-toggle,
.badge-copy {
    background: var(--glass-strong); color: var(--ink);
    border: 1px solid var(--hairline-strong);
    box-shadow: var(--sheen), 0 1px 2px rgba(0, 0, 0, 0.12), 0 8px 20px -14px rgba(0, 0, 0, 0.5);
    transition: transform .22s var(--ease-out), border-color .15s, box-shadow .15s, color .15s;
}
input[type="file"]::file-selector-button { padding: 0.4375rem 0.875rem; }
input[type="file"]::file-selector-button:hover,
.account-add > summary:hover,
.account-more > summary:hover .account-toggle,
.badge-copy:hover {
    background: var(--glass-strong); color: var(--ink);
    border-color: var(--gold);
    box-shadow: var(--sheen), 0 1px 2px rgba(0, 0, 0, 0.12), 0 8px 20px -14px rgba(0, 0, 0, 0.5);
    transform: scale(1.04);
}
.account-add > summary:active,
.account-more > summary:active .account-toggle,
.badge-copy:active {
    background: var(--glass-strong);
    box-shadow: var(--sheen), inset 0 2px 5px rgba(0, 0, 0, 0.16);
    transform: scale(.96); transition-duration: .08s;
}

/* Faces: a fine edge and a soft shadow, where they stood on an offset block. */
.avatar {
    border-color: var(--hairline-strong);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12), 0 6px 14px -8px rgba(0, 0, 0, 0.45);
}

/* The two pickers on the level form — difficulty and status — work like the
 * difficulty filters on the list. Every option is glass; the chosen one keeps
 * its colour and is lifted out of the set — a solid face, a firmer edge, a
 * deeper shadow, its label heavier — while the others step back, their art
 * gone grey, until the pointer reaches them. Under the pointer an option
 * takes the thin yellow edge and grows a touch; they are big tiles, so a
 * touch is plenty. */
.tier-body,
.segment-body,
.honour-body {
    background: var(--glass-strong); color: var(--ink-2);
    border: 1px solid var(--hairline-strong);
    box-shadow: var(--sheen), 0 1px 2px rgba(0, 0, 0, 0.1);
    transition: transform .22s var(--ease-out), border-color .15s, box-shadow .15s,
                background-color .15s, color .15s, opacity .2s;
}
.tier-body .gd-icon, .segment-body .gd-icon { transition: filter .2s; }
.tier:hover .tier-body,
.segment:hover .segment-body,
.honour:hover .honour-body {
    background: var(--glass-strong);
    border-color: var(--gold);
    transform: scale(1.02);
}
.tier input:checked + .tier-body,
.segment input:checked + .segment-body,
.honour input:checked + .honour-body {
    background: var(--chip-on-face); color: var(--ink); font-weight: 750;
    border-color: color-mix(in srgb, var(--ink) 24%, transparent);
    box-shadow: var(--sheen), 0 2px 4px rgba(0, 0, 0, 0.08), 0 10px 22px -12px rgba(0, 0, 0, 0.5);
}
.tier:hover input:checked + .tier-body,
.segment:hover input:checked + .segment-body,
.honour:hover input:checked + .honour-body { border-color: var(--gold); }
/* The badge tiles are wide, so a lighter grow under the pointer; on, the
   name takes the weight the picked status's label does. Their tick disc is
   the theme's glass while off. */
.honour:hover .honour-body { transform: scale(1.01); }
.honour input:checked + .honour-body strong { font-weight: 750; }
.honour-tick { border-color: var(--hairline-strong); background: var(--glass-chip); }
.tiers:has(input:checked) .tier:not(:hover) input:not(:checked) + .tier-body,
.segmented:has(input:checked) .segment:not(:hover) input:not(:checked) + .segment-body { opacity: .62; }
.tiers:has(input:checked) .tier:not(:hover) input:not(:checked) + .tier-body .gd-icon,
.segmented:has(input:checked) .segment:not(:hover) input:not(:checked) + .segment-body .gd-icon {
    filter: grayscale(1) var(--shadow-sprite);
}

/* The folded "More details" panel is a pane of the same glass as the rest. */
.form-more {
    background-color: var(--glass-card);
    border-color: var(--hairline);
    box-shadow: var(--sheen), var(--shadow-sm);
}

/* The Videos panel's rows: panes of glass inside it, as the side lists' rows
   are; the rows for new videos stay open slots, edged and empty. */
.vids { border-top-color: var(--hairline); }
.vid {
    background: color-mix(in srgb, var(--surface-2) 60%, transparent);
    border-color: var(--hairline);
    border-radius: 0.875rem;
    box-shadow: var(--sheen);
}
.vid-new { background: transparent; border-color: var(--hairline-strong); box-shadow: none; }
.vid-thumb {
    border-radius: 0.5rem;
    box-shadow: 0 0 0 1px var(--hairline-strong), 0 8px 16px -10px rgba(0, 0, 0, 0.6);
}
.vid-thumb:hover { box-shadow: 0 0 0 2px var(--gold), 0 8px 16px -10px rgba(0, 0, 0, 0.6); }

/* The save bar, as an island: a capsule of frosted glass floating over the
 * foot of the form, only as wide as what it holds and centred under it,
 * rather than a strip across the page. It sticks a little above the bottom
 * edge (clear of a phone's home bar) while the form scrolls under it, and
 * comes to rest at the form's end.
 *
 * It is dynamic, as the name says: change anything in the form and it
 * widens to make room for a pulsing gold dot and "Unsaved changes" ahead of
 * the buttons (app.js adds .island-status, and .is-dirty while the form
 * differs from how it loaded); put everything back and it closes up again.
 * The widening is the status's own column opening from nothing (0fr to
 * 1fr), so the island grows smoothly rather than jumping.
 *
 * Inside it the buttons follow its shape — the neutral ones, Save and keep
 * editing and Cancel alike, become pills — except the gold one, which keeps
 * the wordmark's blocky letterform. Its extrusion reaches 6px down and right
 * of its face, and the eye takes the face and the block under it as one
 * shape — so the block is given its room in the layout (a margin the size of
 * it, below; see .btn-primary under this), and the pills are centred on that
 * whole shape rather than on the face alone, which left them looking a few
 * pixels high beside it. The padding is generous and even on purpose: the
 * buttons stand clear of the island's edge rather than filling it to the
 * rim. */
.form-actions {
    position: sticky; bottom: calc(1rem + env(safe-area-inset-bottom, 0px)); z-index: 5;
    justify-self: center; width: fit-content; max-width: 100%;
    margin: 0.75rem auto 0;
    display: flex; align-items: center; flex-wrap: nowrap; gap: 0.75rem;
    padding: 0.75rem 0.75rem 0.75rem 1.25rem;
    border: 1px solid var(--hairline-strong); border-radius: 62.5rem;
    background: var(--glass-strong);
    -webkit-backdrop-filter: var(--glass-blur);
            backdrop-filter: var(--glass-blur);
    box-shadow: var(--sheen),
                0 2px 6px rgba(0, 0, 0, 0.08),
                0 22px 44px -18px rgba(0, 0, 0, 0.5);
}
@media (prefers-reduced-transparency: reduce) {
    .form-actions { background: var(--surface); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
.form-actions > .btn-primary { margin: 0 calc(6px + 0.25rem) 6px 0; }
.form-actions > .btn-ghost { border-radius: 62.5rem; }

/* The status: a gold dot and its words, in a column that is closed until
   the form has changes in it. The divider after it opens with it. */
.island-status {
    display: grid; grid-template-columns: 0fr;
    align-self: stretch; align-items: center;
    /* Closed, it takes back the gap after it, so it costs the island nothing. */
    margin-right: -0.75rem;
    transition: grid-template-columns .45s var(--ease-out), margin-right .45s var(--ease-out);
}
.island-status > span {
    min-width: 0; overflow: hidden; white-space: nowrap;
    display: flex; align-items: center; gap: 0.5rem;
    font: 650 0.8125rem/1 var(--font-ui); color: var(--ink-2);
}
.island-status > span::after {
    content: ""; flex: none;
    width: 1px; height: 1.375rem; margin-left: 0.5rem;
    background: var(--hairline-strong);
}
.island-dot {
    flex: none; width: 0.5rem; height: 0.5rem; margin-left: 0.125rem; border-radius: 50%;
    background: var(--gold);
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--gold) 55%, transparent);
}
.form-actions.is-dirty .island-status { grid-template-columns: 1fr; margin-right: 0; }
@media (prefers-reduced-motion: no-preference) {
    .form-actions.is-dirty .island-dot { animation: island-pulse 1.8s var(--ease-out) infinite; }
}
@keyframes island-pulse {
    0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--gold) 55%, transparent); }
    70%  { box-shadow: 0 0 0 0.4375rem color-mix(in srgb, var(--gold) 0%, transparent); }
    100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--gold) 0%, transparent); }
}

/* On a phone the island spans the width, its buttons sharing the rows the
   layout gives them (style.css), and the status takes a row of its own
   above them while there is something to say. */
@media (max-width: 640px) {
    .form-actions {
        width: auto; justify-self: stretch; margin-inline: 0;
        flex-wrap: wrap; border-radius: 1.75rem; row-gap: 0.625rem;
        padding: 0.75rem;
    }
    .form-actions > .btn-primary { margin-right: 6px; }
    /* Centred on the gold button and its block together, as on a wide
       screen — stretched, it would grow to the pair's full height and stand
       a block taller than Cancel under it. Should its label wrap, it is the
       taller one, and the gold button stretches to it instead. */
    .form-actions > button.btn-ghost { align-self: center; }
    .island-status { display: none; }
    .form-actions.is-dirty .island-status {
        display: flex; flex: 1 1 100%; justify-content: center; margin: 0.125rem 0 0;
    }
    .island-status > span::after { display: none; }
    /* The corner scroll buttons stand above the island instead of on it. */
    body:has(.form-actions) .scroll-tools {
        bottom: calc(1rem + env(safe-area-inset-bottom, 0px) + var(--island-h, 7rem) + 0.625rem);
    }
}

/* An account's new-password field, at the size of every other field. It had
   a compact rule of its own (style.css) and sat a size smaller and shorter
   than the fields above it; the Reset button beside it stretches to its
   height. */
.account-reset input {
    padding: 0.625rem 0.8125rem; font: 0.875rem var(--font);
    border-radius: 0.625rem;
}
.account-reset .field-reveal input { padding-right: 2.75rem; }
.account-reset .reveal-btn {
    width: 1.875rem; height: 1.875rem; right: 0.375rem; border-radius: 0.4375rem;
}
.account-reset .reveal-btn svg { width: 1.125rem; height: 1.125rem; }
.account-reset { gap: 0.5rem; align-items: stretch; }
.account-reset .btn { align-self: stretch; min-height: 0; padding-inline: 1rem; }

/* ============================================================== popups */

/* Every popup stands over the page the way the save popup does: the page
 * frosted behind it — washed with the page's own colour and blurred — and
 * the card a pane of the same glass. One scrim for all of them:
 *
 *   the save popup     .form-busy, which this was taken from
 *   a confirm dialog   .modal-backdrop
 *   a toast            body::after, while one is showing — the toasts'
 *                      own box spans the screen and takes no pointer
 *                      events, so the scrim cannot live inside it, and it
 *                      has to sit under the squares a toast throws (89),
 *                      which sit under the toast itself (90)
 */
:root { --popup-scrim: color-mix(in srgb, var(--bg) 82%, transparent); }
.form-busy,
.modal-backdrop {
    background: var(--popup-scrim);
    -webkit-backdrop-filter: blur(3px);
            backdrop-filter: blur(3px);
}
body::after {
    content: ""; position: fixed; inset: 0; z-index: 88; pointer-events: none;
    background: var(--popup-scrim);
    -webkit-backdrop-filter: blur(3px);
            backdrop-filter: blur(3px);
    opacity: 0; visibility: hidden;
    transition: opacity .3s ease, visibility 0s linear .3s;
}
body:has(#toasts .toast:not(.is-leaving))::after {
    opacity: 1; visibility: visible; transition-delay: 0s;
}
@media (prefers-reduced-motion: reduce) {
    .form-busy, .modal-backdrop, body::after { -webkit-backdrop-filter: none; backdrop-filter: none; }
}

/* A confirm dialog is laid out as the save card is: everything centred, the
   title and its line set as the card's, the answers side by side under them. */
.modal {
    width: min(25rem, 100%);
    padding: 1.625rem 1.625rem 1.75rem;
    text-align: center;
}
.modal-title { font: 700 1.0625rem/1.3 var(--font-ui); color: var(--ink); margin: 0 0 0.3125rem; }
.modal-body  { font-size: 0.875rem; line-height: 1.5; }
.modal-actions { justify-content: center; margin-top: 1.375rem; }

/* The confirm dialog (askConfirm in app.js) carries the save card's mark
 * over its words: a delete the error's red disc with the bin struck across
 * it in white, anything else a gold one with a question mark. It arrives on
 * the save card's spring, and its glyph rises in as the disc settles.
 *
 * The line under the title is balanced so it never leaves "undone." alone
 * on a line of its own. The answers share the card's width as two equal
 * halves, Cancel first and plain glass, the action solid beside it. */
.modal-confirm {
    display: grid; justify-items: center;
    animation: save-arrive .5s cubic-bezier(.2, 1.35, .4, 1) both;
}
.confirm-mark { margin-bottom: 0.875rem; }
.save-mark.is-ask { --disc: #f59e0b; }
.confirm-glyph {
    position: relative; width: 1.625rem; height: 1.625rem;
    color: #fff; filter: none;
    animation: save-rise .4s .16s cubic-bezier(.16, 1, .3, 1) both;
}
.modal-confirm .modal-title { text-wrap: balance; }
.modal-confirm .modal-body  { color: var(--ink-2); max-width: 21rem; text-wrap: balance; }
.modal-confirm .modal-actions {
    display: grid; grid-template-columns: 1fr 1fr; gap: 0.625rem;
    justify-self: stretch; margin-top: 1.5rem;
}
.modal-confirm .modal-actions .btn { width: 100%; min-height: 2.75rem; }
/* The gold face stands its block 6px out to the right; it gives that back
   from its width, as .btn-block does, so both halves end on one line. */
.modal-confirm .modal-actions .btn-primary { width: calc(100% - 6px); }
.modal-confirm .btn .icon { --sz: 16; }

/* Stepping back out: the card lifts away as the frost clears. */
.modal-backdrop.is-leaving { pointer-events: none; animation: save-clear .18s ease forwards; }
.modal-backdrop.is-leaving .modal { animation: save-out .18s cubic-bezier(.5, 0, .9, .4) forwards; }

/* The squares a popup throws, built as the page-edge mosaic's 3D blocks
 * once were: a thick tile — as deep as 0.42 of
 * its edge — facing you, its face the flat colour of its tone, the top a
 * shade lighter, the sides a shade darker, the underside darker still, and
 * see-through to a degree of its own (--fo). The tile (style.css) flies the
 * path and fades; the block inside it leans as it goes, from one gentle
 * lean to another (--tx/--ty to --tx2/--ty2, from mosaicField in app.js),
 * so its depth shows the way the margin's do as they drift.
 *
 * The see-through is on each face rather than the block: an opacity on the
 * block would flatten its six faces into one picture. Faces turned away are
 * hidden, so a pale front never shows the back of the block through it.
 *
 * Perspective is set on each tile and scaled to its size, so a small block
 * and a big slab show the same depth. */
.pop-tile {
    background: none; box-shadow: none;
    perspective: calc(var(--s) * 5);
}
/* The block's depth is 0.42 of its size, written into each face's rule
   rather than declared once on the block: the block is what animates, and
   an animated element that declares values of its own has every child's
   style worked out again with it on every frame — six faces for each of
   the loading screen's 44 blocks, which slowed the very loading it covers. */
.pop-cube {
    position: absolute; inset: 0; display: block;
    transform-style: preserve-3d;
    animation: pop-lean var(--dur) var(--delay) ease-in-out both;
}
.pop-field--warp .pop-cube { animation-iteration-count: infinite; animation-direction: alternate; }
.pop-cube > i {
    position: absolute; left: 0; top: 0; width: var(--s); height: var(--s);
    background-color: var(--c);
    background-image: linear-gradient(var(--shade, transparent), var(--shade, transparent));
    opacity: var(--fo, .85);
    -webkit-backface-visibility: hidden; backface-visibility: hidden;
}
/* front and back, a depth apart */
.pop-cube > i:nth-child(1) { transform: translateZ(calc(var(--s) * 0.21)); }
.pop-cube > i:nth-child(2) { transform: rotateY(180deg) translateZ(calc(var(--s) * 0.21)); --shade: rgba(0, 0, 0, 0.22); }
/* the two sides: as tall as the block, as wide as it is deep */
.pop-cube > i:nth-child(3),
.pop-cube > i:nth-child(4) { width: calc(var(--s) * 0.42); left: calc(var(--s) * 0.29); --shade: rgba(0, 0, 0, 0.22); }
.pop-cube > i:nth-child(3) { transform: rotateY(90deg)  translateZ(calc(var(--s) / 2)); }
.pop-cube > i:nth-child(4) { transform: rotateY(-90deg) translateZ(calc(var(--s) / 2)); }
/* top and underside: as wide as the block, as tall as it is deep */
.pop-cube > i:nth-child(5),
.pop-cube > i:nth-child(6) { height: calc(var(--s) * 0.42); top: calc(var(--s) * 0.29); }
.pop-cube > i:nth-child(5) { transform: rotateX(90deg)  translateZ(calc(var(--s) / 2)); --shade: rgba(255, 255, 255, 0.22); }
.pop-cube > i:nth-child(6) { transform: rotateX(-90deg) translateZ(calc(var(--s) / 2)); --shade: rgba(0, 0, 0, 0.38); }
@keyframes pop-lean {
    from { transform: rotateX(var(--tx))  rotateY(var(--ty)); }
    to   { transform: rotateX(var(--tx2)) rotateY(var(--ty2)); }
}

/* ============================================================= splash */

/* The moment after signing in or out, on the stage.
 *
 * The hard style builds a wall of flat squares over the screen. Here the
 * screen goes to the stage instead — the page's own ground, its colour, its
 * warm light and its grid, with a gold light in the middle — and the
 * margin's blocks gather round in depth (see $splashBlocks in the layout),
 * each hanging at a distance of its own and leaning as it hangs, the way
 * the margin's do as they drift. The card is glass: it swings up out of the
 * stage into place, a sheen crosses it, and its meter runs. Then it falls
 * back into the depth it came from, the blocks fly back out to the margins,
 * and the ground opens from the middle outward onto the page.
 *
 * The ground is opaque, as the wall is. The page being left is held under
 * the splash until .95s (see "Moving between pages" in style.css), and it
 * is the ground, fully in by then, that hides the change to the new one.
 *
 * The hard style's wall is still in the markup, for the page without this
 * file, and simply not drawn. app.js listens for the ground starting to
 * open (stage-splash-open, which hands the scrollbar back) and for
 * splash-done and splash-skip-done, the end.
 *
 * It plays while the page under it is still arriving — being parsed, laid
 * out, given its fonts — all of which holds the main thread. So everything
 * that moves here moves on the compositor, which carries on regardless:
 * transform and opacity only, and one animation to an element, in and out
 * together. (A browser hands an element's animations to the compositor only
 * if they can all go; two moving the same property cannot, and the blocks'
 * and the card's separate entrances and exits kept every one of them on the
 * main thread, stuttering whenever the page under them did work.) Only the
 * meter's digits and the ground's opening are drawn on the main thread, the
 * opening once the page has finished arriving. The stage's scene is built
 * underneath while it plays, a step at a time, and only starts moving as
 * it opens — see afterSplash in stage.js.
 *
 * In seconds:
 *   0    – .5    ground in
 *   .04  – 1.4   blocks in from the margins, landing at their depth
 *   .2   – 1.1   card swings up
 *   .45  – .9    picture, name and badge (style.css)
 *   .5   – 1.5   meter runs (style.css)
 *   .9   – 2     sheen crosses the card
 *   1.95 – 2.37  card falls back
 *   2.02 – 2.85  blocks out
 *   2.05 – 2.8   ground opens from the middle
 *   2.85         gone */
.splash { animation: splash-done .01s 2.85s forwards; }
.splash-wall { display: none; }

:root {
    --splash-light: rgba(255, 196, 40, 0.34);
    --splash-sheen: rgba(255, 255, 255, 0.75);
    --splash-glow:  rgba(214, 150, 10, 0.4);
}
:root[data-theme="dark"] {
    --splash-light: rgba(250, 180, 20, 0.17);
    --splash-sheen: rgba(255, 255, 255, 0.09);
    --splash-glow:  rgba(250, 180, 20, 0.22);
}

/* How far the ground has opened, from the middle. Starts a soft edge's
   width short of nothing, so the ground is whole until it moves. */
@property --splash-hole {
    syntax: '<length>';
    inherits: false;
    initial-value: 0px;
}
/* The loading screen's ground (.loader-veil, below) is this one. */
.splash-veil,
.loader-veil {
    --splash-hole: -24vmax;
    position: absolute; inset: 0;
    background:
        radial-gradient(44rem 30rem at 50% 50%, var(--splash-light), transparent 70%),
        radial-gradient(70rem 42rem at 80% -14%, var(--ground-1), transparent 62%),
        radial-gradient(56rem 40rem at -12% 38%, var(--ground-2), transparent 64%),
        var(--bg);
    -webkit-mask-image: radial-gradient(circle at 50% 50%, transparent var(--splash-hole), #000 calc(var(--splash-hole) + 24vmax));
            mask-image: radial-gradient(circle at 50% 50%, transparent var(--splash-hole), #000 calc(var(--splash-hole) + 24vmax));
}
.splash-veil {
    animation:
        stage-splash-ground .5s ease-out both,
        stage-splash-open .75s 2.05s cubic-bezier(.55, 0, .3, 1) forwards;
}
/* The stage's grid, faded out towards the edges round the light, and its
   vignette. */
.splash-veil::before,
.splash-veil::after,
.loader-veil::before,
.loader-veil::after { content: ""; position: absolute; inset: 0; }
.splash-veil::before,
.loader-veil::before {
    background-image:
        linear-gradient(var(--grid-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
    background-size: 4.5rem 4.5rem;
    background-position: 50% 50%;
    -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, #000 10%, transparent 72%);
            mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, #000 10%, transparent 72%);
}
.splash-veil::after,
.loader-veil::after {
    background: radial-gradient(ellipse 120% 95% at 50% 50%, transparent 55%, var(--vignette) 100%);
}

/* The blocks. Each is placed from the middle of the screen (--x, --y) at its
 * depth (--z), and holds the margin popups' six-sided block (.pop-cube,
 * above), leaning back and forth from one angle to another for as long as
 * it hangs. Perspective on the field places them in depth; perspective on
 * each, scaled to its size, gives every block the same depth of its own. */
.splash-field {
    --splash-spread: 1;
    position: absolute; inset: 0;
    perspective: 1100px;
    pointer-events: none;
}
/* On a screen taller than it is wide the card takes nearly its whole width,
   and the depth draws the blocks in towards the middle: across, they bunched
   into two columns above and below it. Spread wider there, some partly off
   the edges, they stand round it again. */
@media (max-aspect-ratio: 3/4) {
    .splash-field { --splash-spread: 1.35; }
}
.splash-block {
    position: absolute; left: 50%; top: 50%;
    width: var(--s); height: var(--s);
    margin: calc(var(--s) / -2) 0 0 calc(var(--s) / -2);
    perspective: calc(var(--s) * 5);
    transform: translate3d(calc(var(--x) * var(--splash-spread)), var(--y), var(--z)) rotate(var(--rz));
    animation: stage-splash-block 2.5s var(--din) linear both;
}
.splash-block .pop-cube {
    animation: pop-lean var(--lean) calc(var(--lean) * -.5) ease-in-out infinite alternate;
}
/* A block never leans far enough to show its back, so the back is not
   drawn: one fewer layer for the compositor, per block. */
.splash-block .pop-cube > i:nth-child(2) { display: none; }

/* The card, a pane of the glass the page's panels are made of, with a line
 * of gold light along its top edge. It swings up from below, tipped back,
 * and falls away into the stage at the end.
 *
 * Nearly solid, and not frosted. A frosted pane over blocks still flying in
 * has its blur redrawn on every frame, and at this strength the frosting
 * barely showed. */
.splash-panel {
    background: color-mix(in srgb, var(--surface) 95%, transparent);
    border: 1px solid var(--hairline-strong);
    border-radius: 1.5rem;
    box-shadow: var(--sheen), var(--shadow-lg), 0 40px 110px -46px var(--splash-glow);
    transform-origin: 50% 85%;
    animation: stage-splash-card 2.17s .2s linear both;
}
.splash-panel::before,
.splash-panel::after { content: ""; position: absolute; pointer-events: none; }
.splash-panel::before {
    left: 12%; right: 12%; top: 0; height: 1px; z-index: 1;
    background: linear-gradient(90deg, transparent, rgba(250, 204, 21, 0.9) 30%, #fff4c2 50%, rgba(250, 204, 21, 0.9) 70%, transparent);
}
/* The sheen, crossing once. Parked off the card's edge, so with motion
   switched off it is simply not there. */
.splash-panel::after {
    inset: 0; z-index: 2;
    background: linear-gradient(105deg, transparent 38%, var(--splash-sheen) 50%, transparent 62%);
    transform: translateX(-110%);
    animation: stage-splash-sheen 1.1s .9s cubic-bezier(.3, 0, .2, 1) forwards;
}

/* Inside: one pane of glass rather than a strip on a card. */
.splash-head { background: transparent; border-bottom-color: var(--hairline); }
.splash-status { box-shadow: var(--sheen); }

/* The picture ringed in light — gold coming in, quiet going out — on a
   soft shadow rather than the hard block under it. */
.splash-monogram,
.splash-monogram.has-photo {
    border-color: transparent;
    box-shadow: 0 0 0 2px var(--splash-ring, #facc15), 0 0 26px -6px var(--splash-ring, #facc15), var(--shadow-sm);
}
.splash-monogram:not(.has-photo) {
    box-shadow: inset 0 -0.25rem 0 var(--btn-gold-edge),
                0 0 0 2px var(--splash-ring, #facc15), 0 0 26px -6px var(--splash-ring, #facc15), var(--shadow-sm);
}
.splash-out { --splash-ring: var(--hairline-strong); }

/* The greeting is a label, the name a title in the display face. */
.splash-title {
    font: 700 0.75rem/1.3 var(--font-label); letter-spacing: 0.12em;
    text-transform: uppercase; color: var(--muted);
}
.splash-title strong {
    margin-top: 0.4375rem;
    font: 700 clamp(1.5rem, 3vw, 2rem)/1.1 var(--font-display); font-stretch: normal;
    letter-spacing: -0.02em; text-transform: none; color: var(--ink);
}

/* The meter: a recessed glass groove with a bar of gold in it, the bar
 * drawn the way the gold button and the wordmark's letters are — their
 * hard bands, pale along the top down to burnt orange at the foot — keyed
 * in with a fine dark line and lit from inside. While it runs, light passes
 * along it and its leading end glows. The figure is in the display face,
 * in the letters' own black where the gold is under it. */
:root {
    --splash-groove: rgba(60, 45, 15, 0.075);
    --splash-groove-shade: inset 0 2px 5px rgba(70, 50, 10, 0.16), inset 0 -1px 0 rgba(255, 255, 255, 0.8);
}
:root[data-theme="dark"] {
    --splash-groove: rgba(0, 0, 0, 0.35);
    --splash-groove-shade: inset 0 2px 6px rgba(0, 0, 0, 0.6), inset 0 -1px 0 rgba(255, 255, 255, 0.06);
}
.splash-track {
    background: var(--splash-groove);
    border-color: var(--hairline-strong);
    box-shadow: var(--splash-groove-shade);
}
.splash-fill {
    background: var(--logo-bands);
    box-shadow: inset 0 0 0 1px rgba(139, 60, 1, 0.45),
                inset 0 2px 0 rgba(255, 255, 255, 0.5),
                0 0 18px -2px rgba(250, 180, 20, 0.65);
}
/* The light passing along it, and the glow at its leading end. */
.splash-fill::before,
.splash-fill::after { content: ""; position: absolute; top: 0; bottom: 0; pointer-events: none; }
.splash-fill::before {
    left: 0; width: 60%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.7) 50%, transparent);
    transform: translateX(-100%);
    animation: stage-splash-shimmer 1.15s .45s ease-in-out infinite;
}
.splash-fill::after {
    right: 0; width: 1.25rem;
    background: radial-gradient(closest-side at 70% 50%, rgba(255, 255, 255, 0.9), rgba(255, 244, 194, 0.4) 55%, transparent);
}
@keyframes stage-splash-shimmer { to { transform: translateX(170%); } }
.splash-pct {
    color: var(--ink-2);
    font-family: var(--font-display); font-weight: 700; font-size: 0.8125rem; font-stretch: normal;
    letter-spacing: 0;
}
.splash-fill .splash-pct { color: var(--logo-ink); }

/* A press cuts it short (app.js): the ground opens at once, the blocks go,
   the card drops. Names of their own, so they start rather than carry on
   the runs already under way — see .is-leaving in style.css. */
.splash.is-leaving .splash-veil {
    animation: stage-splash-open-skip .55s cubic-bezier(.55, 0, .3, 1) forwards;
}
.splash.is-leaving .splash-block {
    animation: stage-splash-block-skip .45s var(--dskip) cubic-bezier(.55, 0, .75, .3) forwards;
}

@keyframes stage-splash-ground { from { opacity: 0; } }
@keyframes stage-splash-open      { to { --splash-hole: 75vmax; } }
@keyframes stage-splash-open-skip { to { --splash-hole: 75vmax; } }
/* A block's whole run in one animation, from its delay (--din): in from
   the margin over its first 1.05s, landing with the page's easing, hanging
   there, and falling away back to the margin over its last .53s — so each
   leaves about two seconds after it arrived, the early ones first. */
@keyframes stage-splash-block {
    0% {
        opacity: 0;
        transform: translate3d(calc(var(--x) * var(--splash-spread) + var(--fx)), calc(var(--y) + var(--fy)), -700px) rotate(var(--rin)) scale(.5);
        animation-timing-function: cubic-bezier(.16, 1, .3, 1);
    }
    14.7% { opacity: 1; }
    42% {
        transform: translate3d(calc(var(--x) * var(--splash-spread)), var(--y), var(--z)) rotate(var(--rz)) scale(1);
    }
    79% {
        opacity: 1;
        transform: translate3d(calc(var(--x) * var(--splash-spread)), var(--y), var(--z)) rotate(var(--rz)) scale(1);
        animation-timing-function: cubic-bezier(.55, 0, .75, .3);
    }
    100% {
        opacity: 0;
        transform: translate3d(calc(var(--x) * var(--splash-spread) + var(--ex)), calc(var(--y) + var(--ey)), -800px) rotate(var(--rout)) scale(.5);
    }
}
@keyframes stage-splash-block-skip {
    to {
        opacity: 0;
        transform: translate3d(calc(var(--x) * var(--splash-spread) + var(--ex)), calc(var(--y) + var(--ey)), -800px) rotate(var(--rout)) scale(.5);
    }
}
/* The card's whole run in one animation, from .2s: swinging up over .9s,
   held, and falling back over its last .42s, from 1.95s. */
@keyframes stage-splash-card {
    0% {
        opacity: 0;
        transform: perspective(75rem) rotateX(30deg) translate3d(0, 3.5rem, -160px) scale(.92);
        animation-timing-function: cubic-bezier(.16, 1, .3, 1);
    }
    16.6% { opacity: 1; }
    41.5% { transform: perspective(75rem) rotateX(0deg) translate3d(0, 0, 0) scale(1); }
    80.6% {
        opacity: 1;
        transform: perspective(75rem) rotateX(0deg) translate3d(0, 0, 0) scale(1);
        animation-timing-function: cubic-bezier(.4, 0, .7, .25);
    }
    100% {
        opacity: 0;
        transform: perspective(75rem) rotateX(-16deg) translate3d(0, -1rem, -260px) scale(.9);
    }
}
/* The hard style's skip, redrawn in depth — the same name, which style.css
   sets on a press. */
@keyframes splash-panel-skip {
    to { opacity: 0; transform: perspective(75rem) rotateX(-16deg) translate3d(0, -1rem, -260px) scale(.9); }
}
@keyframes stage-splash-sheen { to { transform: translateX(110%); } }

/* No motion: the ground, the blocks where they hang and the card are simply
   there, and fade together, as the hard style's wall and card do. */
@media (prefers-reduced-motion: reduce) {
    .splash-veil,
    .splash-field { animation: splash-fade .3s 1.6s ease forwards !important; }
    .splash.is-leaving .splash-veil,
    .splash.is-leaving .splash-field { animation: splash-fade-skip .25s ease forwards !important; }
}

/* ============================================================= loader */

/* The loading screen: over the page from its first frame until the page is
 * ready to be seen — app.js decides when — and then opening onto it.
 *
 * Up on a refresh and on a visit's first page, the two loads with no page
 * before them to hold on screen. The stage's ground, as the sign-in splash's
 * is, with two slow tides of gold light moving in it and a cluster of the
 * margin's blocks in the corners they start from; in the middle the SDL
 * mark in a soft gold glow, which is the meter too: it comes up without its
 * colour and takes it on from left to right, run by app.js from what the
 * page has really finished, since nothing here can know in advance how long
 * that takes. The ground itself never fades in: behind it is the page it is
 * hiding.
 *
 * Out, once the mark is full: it swells towards you and fades, and the
 * ground lifts away — swelling a little as it clears — onto the page rising
 * into place beneath it.
 *
 * Smoothness is the whole point of it, and the page under it is at its
 * busiest — being parsed, laid out, given its fonts, its scene built — with
 * the main thread held for a few hundred milliseconds at a time. So every
 * part that moves moves by transform or opacity alone, on the plain
 * transform property, never translate/rotate/scale, which not every engine
 * hands to the compositor; the compositor carries them on through any hold.
 * The colour glides by transition for the same reason (app.js). The ground
 * used to open as a hole widening from the middle, a mask redrawn on the
 * main thread every frame — and it opened just as the page's rise was being
 * set up there, so it stuttered. It now lifts by opacity, and the rise is
 * set up a beat before, under cover (is-counted; see afterSplash in
 * stage.js). */
/* The light's colours: a deeper, stronger gold on the pale page, where a
   faint one would wash out, and a softer, brighter one in the dark, where
   it glows. The mark before its colour is a pale silver on the pale page
   and a dim pewter in the dark, so it reads as unlit on either. */
:root {
    --loader-halo:        rgba(255, 186, 20, 0.5);
    --loader-tide-a:      rgba(255, 196, 40, 0.34);
    --loader-tide-b:      rgba(255, 150, 30, 0.2);
    --loader-empty:       grayscale(1) brightness(1.12) opacity(0.8);
}
:root[data-theme="dark"] {
    --loader-halo:        rgba(255, 170, 0, 0.3);
    --loader-tide-a:      rgba(250, 175, 20, 0.16);
    --loader-tide-b:      rgba(255, 110, 20, 0.1);
    --loader-empty:       grayscale(1) brightness(0.62);
}
.loader { display: none; }
/* As wide as the whole window (100vw), the scrollbar's strip included, not
   as wide as the page: so when the scrollbar comes back (below) and the page
   narrows under it, the screen and everything centred on it stay where they
   are. */
:root.is-loading .loader {
    position: fixed; top: 0; bottom: 0; left: 0; z-index: 210;
    width: 100vw;
    display: grid; place-items: center;
    padding: 1.5rem; overflow: hidden;
}
.loader.is-opening { pointer-events: none; }
/* No scrollbar while it is up: the page's own, down the right edge of a
 * screen that covers the page. It comes back as the screen starts to open,
 * when the loading is done — not before, at "Ready", where it showed over
 * the finished screen. The page under the screen narrows for it then, a
 * relayout that shifts it a few pixels; the screen is still whole for that
 * frame and the next few (its ground fades from .06s, slowly at first), so
 * it happens unseen. */
:root.is-loading:not(.loader-opening) { scrollbar-width: none; }
:root.is-loading:not(.loader-opening)::-webkit-scrollbar { display: none; }

/* The ground's two tides of light: soft pools of the theme's gold, each a
 * radial glow, drifting slowly across it and back on loops of their own
 * lengths, so the ground is never quite still. Under the stage's grid and
 * its vignette, which are lifted over them for it. Moved by transform. */
.loader-veil::before { z-index: 1; }
.loader-veil::after  { z-index: 2; }
.loader-tide {
    position: absolute; width: 80vmax; height: 80vmax;
    border-radius: 50%;
    background: radial-gradient(closest-side, var(--tide), transparent);
    will-change: transform;
}
.loader-tide:nth-child(1) { --tide: var(--loader-tide-a); left: -24vmax; top: -34vmax; }
.loader-tide:nth-child(2) { --tide: var(--loader-tide-b); right: -26vmax; bottom: -38vmax; }
@media (prefers-reduced-motion: no-preference) {
    .loader-tide:nth-child(1) { animation: loader-tide-a 13s ease-in-out infinite alternate; }
    .loader-tide:nth-child(2) { animation: loader-tide-b 17s ease-in-out -6s infinite alternate; }
}
@keyframes loader-tide-a { to { transform: translate3d(34vw, 26vh, 0) scale(1.12); } }
@keyframes loader-tide-b { to { transform: translate3d(-30vw, -24vh, 0) scale(.9); } }

/* The blocks in the top left and bottom right corners (see $loaderBlocks in
 * the layout): the margin popups' six-sided block (.pop-cube), each placed
 * from the middle of the screen (--x, --y) at a depth of its own (--z), and
 * the further back, the fainter (--fo), as the margin's are.
 *
 * Seen as the margin's are, by one eye in the middle of the screen: the
 * field's perspective reaches every face (preserve-3d on the block), so a
 * block out in a corner shows the sides turned towards the middle, as the
 * margin's blocks show theirs. Each leans gently from one angle to another
 * for as long as the screen is up. Drawn by the page itself, so there is
 * nothing to wait on: they fly in with the screen's first frame (below).
 *
 * A block never leans far enough to show its back, so the back is not
 * drawn. With motion switched off they stand still. */
:root                    { --loader-blocks: 1; }
:root[data-theme="dark"] { --loader-blocks: .82; }
.loader-field {
    position: absolute; inset: 0;
    perspective: 1100px;
    pointer-events: none;
}
.loader-block {
    position: absolute; left: 50%; top: 50%;
    width: var(--s); height: var(--s);
    margin: calc(var(--s) / -2) 0 0 calc(var(--s) / -2);
    transform-style: preserve-3d;
    /* The turns at nothing, so they line up one for one with the ones the
       entrance starts from, and each turn runs down on its own. */
    transform: translate3d(var(--x), var(--y), var(--z)) rotate(0deg) rotateX(0deg) rotateY(0deg);
}
/* In: each flies in from past its corner (--fx, --fy, worked out in the
 * layout to start off the screen) and from nearer you, tumbling, and lands
 * at its place with the page's easing — the ones in the corner first
 * (--din), so the cluster spreads out from it. Off the screen to start
 * with, so none needs to fade in: an opacity on a block would flatten its
 * faces into one picture. Over by about 1.3s, with the mark's entrance. */
@media (prefers-reduced-motion: no-preference) {
    .loader-block { animation: loader-block-in .95s var(--din) cubic-bezier(.16, 1, .3, 1) both; }
}
@keyframes loader-block-in {
    from {
        transform: translate3d(calc(var(--x) + var(--fx)), calc(var(--y) + var(--fy)), calc(var(--z) + 200px))
                   rotate(var(--rin)) rotateX(var(--tin)) rotateY(var(--tin2));
    }
}
.loader-block .pop-cube {
    animation: none;
    transform: rotateX(var(--tx)) rotateY(var(--ty));
}
.loader-block .pop-cube > i { opacity: calc(var(--fo) * var(--loader-blocks)); }
.loader-block .pop-cube > i:nth-child(2) { display: none; }
/* By day each drops a soft shadow onto the ground behind it, down and to
   the right, warm brown, as the margin's tiles do — without it a block on
   the cream reads as a sticker. None at night, where a shadow on black is
   nothing. */
.loader-block::before {
    content: ""; position: absolute; inset: -20%;
    background: radial-gradient(closest-side, #5c3d06, transparent);
    opacity: calc(var(--fo) * .4);
    transform: translate3d(12%, 18%, calc(var(--s) * -0.67));
}
:root[data-theme="dark"] .loader-block::before { display: none; }
/* The lean runs here until app.js takes it over, figures written in, and
   stops this one (is-driven): read through var(), it was worked out again for
   every block on every frame. So this is the lean until the script arrives,
   or with none. */
@media (prefers-reduced-motion: no-preference) {
    .loader-block .pop-cube {
        animation: pop-lean var(--lean) calc(var(--lean) * -.5) ease-in-out infinite alternate;
    }
    .loader.is-driven .loader-block .pop-cube { animation: none; }
}

/* The centrepiece: the SDL mark in a soft glow of gold.
 *
 * The glow breathes behind it; the mark floats over it, rising and
 * settling, and every so often a glint crosses its letters (a band of light
 * masked to the mark's own shape, through --sdl). Each part has a transform
 * of its own: the glow's entrance on .loader-light, its breath on the halo,
 * the float on .loader-mark, the glint on its band — so none of them fight,
 * and all of them stay on the compositor.
 *
 * Sized from the screen's width, so on a phone the mark takes most of it. */
.loader-core {
    /* The mark's width: no more than 19rem, a bit over half a phone's
       width, or half the screen's height — so on a phone on its side it
       still leaves room above and below. */
    --mark-w: min(19rem, 58vw, 52vh);
    position: relative;
    display: grid; justify-items: center;
    width: min(24rem, 100%);
    will-change: transform, opacity;
}
.loader-emblem {
    --light: min(34rem, 140vw);
    position: relative;
    width: var(--mark-w);
    aspect-ratio: 300 / 164;
}
.loader-light {
    position: absolute; left: 50%; top: 50%;
    width: var(--light); height: var(--light);
    margin: calc(var(--light) / -2) 0 0 calc(var(--light) / -2);
    pointer-events: none;
}
.loader-halo {
    position: absolute; inset: 18%;
    border-radius: 50%;
    background: radial-gradient(closest-side, var(--loader-halo), transparent);
    will-change: transform, opacity;
}
.loader-mark { position: absolute; inset: 0; will-change: transform; }
.loader-sdl {
    position: relative; display: block;
    width: 100%; height: auto;
    filter: var(--loader-empty) var(--shadow-logo);
}

/* The mark as its own meter. Over the uncoloured mark, the coloured one,
 * seen through a window (.loader-fill) as wide as the mark: app.js slides
 * the window in from the left by as much of the mark as is done and the
 * coloured mark inside it (.loader-fill-in) back by the same, so the mark
 * stands still and the colour's edge sweeps across it. The shadow under
 * both is the uncoloured mark's, which the coloured one covers exactly.
 *
 * At the edge, a light (.loader-edge), masked to the letters as the glint
 * is and moved with the window, so the colour reads as running in rather
 * than being uncovered. It goes as the mark fills (is-counted).
 *
 * Moved by transform alone, by a transition — see app.js. */
.loader-fill,
.loader-edge {
    position: absolute; inset: 0; overflow: hidden;
    pointer-events: none;
}
.loader-fill,
.loader-fill-in,
.loader-edge i { will-change: transform; }
.loader-fill    { transform: translateX(-100%); }
.loader-fill-in { position: absolute; inset: 0; transform: translateX(100%); }
.loader-fill-in img { display: block; width: 100%; height: auto; }
.loader-edge {
    -webkit-mask: var(--sdl) center / contain no-repeat;
            mask: var(--sdl) center / contain no-repeat;
    transition: opacity .35s ease;
}
.loader-edge i {
    position: absolute; inset: 0;
    transform: translateX(-100%);
}
.loader-edge i::after {
    content: ""; position: absolute; top: 0; bottom: 0; right: 0;
    width: 16%;
    background: linear-gradient(90deg,
        transparent, rgba(255, 244, 194, 0.45) 55%,
        rgba(255, 255, 255, 0.95) 92%, transparent);
}
.loader.is-counted .loader-edge { opacity: 0; }
@media (prefers-reduced-motion: no-preference) {
    .loader-fill,
    .loader-fill-in,
    .loader-edge i { transition: transform .8s cubic-bezier(.25, .8, .35, 1); }
}

.loader-glint {
    position: absolute; inset: 0; overflow: hidden;
    -webkit-mask: var(--sdl) center / contain no-repeat;
            mask: var(--sdl) center / contain no-repeat;
    pointer-events: none;
}
.loader-glint::before {
    content: ""; position: absolute; top: -10%; bottom: -10%; left: 0;
    width: 38%;
    background: linear-gradient(105deg,
        transparent 18%, rgba(255, 255, 255, 0.4) 38%,
        #fff 48%, #fff 52%,
        rgba(255, 255, 255, 0.4) 62%, transparent 82%);
    opacity: .9;
    transform: translateX(-110%);
    will-change: transform;
}

/* The footer's sign-off line in the screen's bottom left corner — the one
   the blocks leave empty — where the footer itself starts it: small, in the
   muted ink, in from the edge by the page's own gutter, and clear of a
   phone's notch and home bar. */
.loader-credit {
    position: absolute;
    left: calc(var(--topbar-pad, 1.5rem) + env(safe-area-inset-left, 0px));
    right: 1rem;
    bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px));
    margin: 0; text-align: left;
    color: var(--muted); font-size: 0.78125rem;
    /* Its own layer for as long as the screen is up, not just while it
       rises: text the compositor only takes over for an animation is drawn
       again by the page when it ends, a touch crisper, and that change at
       the end read as the line popping into place. */
    will-change: transform, opacity;
}
/* On a phone, in the bottom left as on a desktop (it was centred, and ran
   into the bottom right corner's blocks), in by the phone's 1rem gutter. */
@media (max-width: 640px), (max-height: 560px) and (orientation: landscape) and (pointer: coarse) {
    .loader-credit {
        left: calc(1rem + env(safe-area-inset-left, 0px));
        right: calc(1rem + env(safe-area-inset-right, 0px));
    }
}

/* In: the glow opens out from the middle and the mark springs up into it,
 * and the sign-off rises in under them. Then, for as long as the screen is
 * up, the glow breathes, the mark floats and the glint passes. */
@media (prefers-reduced-motion: no-preference) {
    .loader-light  { animation: loader-light-in .9s cubic-bezier(.16, 1, .3, 1) both; }
    .loader-emblem { animation: loader-emblem-in .75s .05s cubic-bezier(.2, 1.25, .35, 1) both; }
    /* Slower and evenly eased, a short way up: with the page's sharp
       ease-out it was nearly all there in its first tenth of a second. */
    .loader-credit { animation: loader-credit-in 1.1s .3s cubic-bezier(.33, 0, .2, 1) both; }

    .loader-halo  { animation: loader-breathe 2.4s ease-in-out infinite alternate; }
    .loader-mark  { animation: loader-float 2.4s ease-in-out infinite alternate; }
    .loader-glint::before { animation: loader-glint 2.8s .7s cubic-bezier(.4, 0, .2, 1) infinite; }
}
@keyframes loader-light-in  { from { opacity: 0; transform: scale(.55); } }
@keyframes loader-emblem-in { from { opacity: 0; transform: translateY(0.75rem) scale(.8); } }
@keyframes loader-credit-in { from { opacity: 0; transform: translateY(0.3125rem); } }
@keyframes loader-breathe {
    from { opacity: .7; transform: scale(.88); }
    to   { opacity: 1;  transform: scale(1.08); }
}
@keyframes loader-float { to { transform: translateY(-0.625rem); } }
@keyframes loader-glint {
    0%        { transform: translateX(-110%); }
    40%, 100% { transform: translateX(250%); }
}

/* The ground carries the splash's mask, there for its opening hole; this
   one lifts instead, so it needs none. */
.loader-veil { -webkit-mask-image: none; mask-image: none; will-change: opacity, transform; }

/* Out: the mark and its light swell towards you and fade, and the ground
   lifts away onto the page, swelling a little as it clears — and the
   blocks with it, the same swell carrying them out into their corners. */
.loader.is-opening .loader-veil,
.loader.is-opening .loader-field {
    animation: loader-open .6s .06s cubic-bezier(.45, 0, .25, 1) forwards;
}
.loader.is-opening .loader-core {
    animation: loader-core-out .42s cubic-bezier(.4, 0, .7, .25) forwards;
}
/* A name of its own: app.js lifts the screen away when one called
   loader-fade or loader-open ends, and this one ends first. */
.loader.is-opening .loader-credit { animation: loader-credit-out .3s ease forwards; }
@keyframes loader-credit-out { to { opacity: 0; } }
@keyframes loader-open     { to { opacity: 0; transform: scale(1.1); } }
@keyframes loader-core-out { to { opacity: 0; transform: scale(1.16); } }

/* No motion: the light and the mark simply stand, the mark fills, and the
   screen fades. */
@media (prefers-reduced-motion: reduce) {
    .loader.is-opening { animation: loader-fade .25s ease forwards; }
    .loader.is-opening .loader-veil,
    .loader.is-opening .loader-field,
    .loader.is-opening .loader-core,
    .loader.is-opening .loader-credit { animation: none; }
}
@keyframes loader-fade { to { opacity: 0; } }

/* ============================================================== cards */

.cards { gap: 0.875rem; }

.card {
    transition: transform .55s var(--ease-out), box-shadow .55s var(--ease-out),
                border-color .3s, background-color .3s;
}
.card:hover {
    transform: translateY(-3px);
    border-color: var(--hairline-strong);
    box-shadow: var(--sheen), var(--shadow);
}

/* The thumbnail: framed in a hairline, eased in a little under the pointer,
   with one pass of light across it. */
.card-thumb {
    position: relative; border-color: var(--hairline);
    box-shadow: 0 10px 24px -14px rgba(0, 0, 0, 0.65);
}
.card-thumb > img { transition: transform .9s var(--ease-out); }
.card-thumb::after {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background: linear-gradient(112deg, transparent 32%, rgba(255, 255, 255, 0.28) 47%, transparent 62%);
    transform: translateX(-130%);
}
@media (hover: hover) and (pointer: fine) {
    .card:hover .card-thumb > img { transform: scale(1.06); }
    .card:hover .card-thumb::after { transform: translateX(130%); transition: transform 1.1s var(--ease-out); }
}

.card-rank { font-weight: 600; letter-spacing: -0.03em; }
.card-title { font-weight: 760; letter-spacing: -0.02em; }
.card-dash { color: var(--muted); opacity: .7; }

/* The podium. Its bar down the left becomes a ring round the whole card in
   the trophy's colour — two pixels of it at full strength: the border, and
   an inset line inside it, so the card is not resized to carry the extra
   width — with light travelling round it and a faint wash of that colour
   coming in from the left. Still the three cards' alone. No coloured glow
   underneath: it sits on the same soft shadow as every other card, so the
   edge is what marks it, not a halo. */
.card-podium {
    border-color: var(--podium);
    background-image: linear-gradient(100deg, color-mix(in srgb, var(--podium) 9%, transparent), transparent 40%);
    box-shadow: var(--sheen), inset 0 0 0 1px var(--podium), var(--shadow-sm);
}
.card-podium:hover {
    border-color: var(--podium);
    box-shadow: var(--sheen), inset 0 0 0 1px var(--podium), var(--shadow);
}
@property --podium-turn {
    syntax: "<angle>"; inherits: false; initial-value: 0deg;
}
.card-podium::before {
    left: 0; top: 0; right: 0; bottom: 0; width: auto;
    padding: 1px; border-radius: inherit; pointer-events: none;
    background: conic-gradient(from var(--podium-turn),
        transparent 0deg 200deg,
        color-mix(in srgb, var(--podium) 40%, transparent) 250deg,
        var(--podium) 300deg,
        #fff 318deg,
        var(--podium) 330deg,
        transparent 360deg);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
            mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
            mask-composite: exclude;
}
@media (prefers-reduced-motion: no-preference) {
    .card-podium::before { animation: stage-orbit 5.5s linear infinite; }
    .card-podium-2::before { animation-duration: 6.4s; animation-delay: -2s; }
    .card-podium-3::before { animation-duration: 6s; animation-delay: -4s; }
}
/* Held still while the sign-in splash or the loading screen covers the
   page: the light is drawn on the main thread every frame, unseen, while
   the cover needs it. The loading screen lets go of it a beat before it
   opens (is-counted), not as it opens: a change to the screen's classes
   that this rule reads has the whole page after it restyled, a tenth of a
   second of work that, at the opening, stalled the opening's first frame. */
#splash:not(.is-opening) ~ main .card-podium::before,
#loader:not(.is-counted) ~ main .card-podium::before { animation-play-state: paused; }
@keyframes stage-orbit { to { --podium-turn: 360deg; } }

/* The podium also leans towards the pointer (stage.js sets how far). */
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
    .card-podium:hover {
        transform: perspective(70rem) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(-3px);
    }
}
.cards.is-sorting .card-podium:hover { transform: none; }

/* A dragged copy is read, not seen through. */
.card-drag-proxy { background-color: var(--surface); box-shadow: var(--shadow-lg); }

/* ============================================================ sidebar */

.side-stats li {
    background: var(--glass-inset);
    border-color: var(--hairline);
    box-shadow: var(--sheen);
    transition: border-color .25s, background-color .25s, transform .4s var(--ease-out);
}
.side-stats li:hover { border-color: var(--hairline-strong); transform: translateX(2px); }
.side-stats span { font-weight: 600; letter-spacing: -0.03em; }

/* Grinding and queued: each level a small card of its own inside the
   panel, built like the At a glance rows above them — a recessed glass
   tile with a hairline edge — so the sidebar's rows all read as one kind
   of thing. Closer together than the list's own gap, since each now has
   an edge to stand apart by. */
.side-list { gap: 0.5rem; }
.side-list li {
    padding: 0.5rem 0.5rem 0.5625rem;
    background: var(--glass-inset);
    border: 1px solid var(--hairline);
    border-radius: var(--radius-sm);
    box-shadow: var(--sheen);
}
.mini-thumb, .card-thumb { border-radius: var(--radius-xs); }
.mini-thumb-bar > span {
    background: linear-gradient(90deg, #f59e0b, #facc15);
    box-shadow: 0 0 10px rgba(250, 190, 20, 0.8);
}

/* The column of blocks under the sidebar (see $sideDeco in views/list.php
 * and Helpers::sideBlocks()): the blocks the page's margins had before the
 * page went full width, down the stretch the sidebar leaves empty beside a
 * long list. The grid gives the column the list's height less the
 * sidebar's, and on to the footer (style.css). Its first and last 1.5rem
 * are always clear — the gap the list keeps from the sidebar — and every
 * block in it is whole: none is placed where it could drift, swell or lean
 * into the gap at the top (Helpers::sideBlocks()), and at the foot, which
 * moves with the list, stage.js leaves out every one that could reach the
 * gap there (is-past). Nothing is faded or cut at either end.
 *
 * Each is the margin's tile, colour for colour: a thick tile, 0.42 of its
 * edge deep, facing you — its face the flat colour of its tone, the side it
 * shows a shade darker, its top a shade lighter, its underside darker
 * still. See-through to a strength of its own (--o), and on the cream it
 * drops a soft brown shadow down and to the right, without which a tile on
 * paper reads as a sticker. None at night, where a shadow on black is
 * nothing.
 *
 * Drawn by the page rather than the stage's WebGL: the column scrolls with
 * the page, and a canvas redrawn to follow it trails the scroll by a frame.
 * These are the page, so the browser carries them with it.
 *
 * And drawn flat, each face the shape it makes on the screen, rather than
 * built in CSS 3D. Built, every face is a layer of its own for the
 * compositor — over a thousand of them with the column on screen. Seen
 * from straight in front, as the stage's camera saw its tiles, a turned
 * block is its projection exactly: the face, the side it turns towards you
 * and the end, each a parallelogram worked out from the block's turn
 * (--ax about the x axis, --ay about the y, in radians; matrix() is the
 * turned plane, translate() where its middle lands). So each block paints
 * as one picture. It keeps its turn, which shows its depth, and drifts and
 * swells on a cycle of its own as the margin's did. Which side and which
 * end show is the turn's (is-r, is-t); the other three faces are never seen
 * and not drawn.
 *
 * In runs of 20rem down the column (.side-run), and only the runs on the
 * screen move (is-near, from stage.js): every moving block costs the main
 * thread a little on every frame, and a long list has hundreds. Each run's
 * box reaches 6rem above its stretch and 14rem below, as far as its blocks
 * can drift, swell and cast, so a run is off the screen only once every one
 * of its blocks is. Off it, a block has no animation at all and stands at
 * rest, costing nothing; back on it, it starts its cycle from the
 * beginning, which is rest, so it simply sets off from where it stood,
 * wherever on the screen that is.
 * Not paused, which keeps every block a layer of its own for the
 * compositor. (The column's own height changing while it was a size
 * container restarted every block mid-cycle — see the mask's switch below.)
 *
 * Runs well off the screen are also set aside altogether
 * (content-visibility), so the browser does not work their styles out at
 * all. Each block's is a page of sums, and the whole page's styles are
 * worked out again on every change of theme — every one of Unlisted's 1,800
 * blocks held the theme's wave back for almost half a second before it
 * started. Set aside, a run is no cost until it comes near. This once
 * restarted runs mid-cycle as they came back, in a jump on screen; it can
 * no longer, since a run off the screen stands at rest and the browser
 * brings a run back well before it reaches the screen.
 * Keep 20 in step with $sideDeco. */
:root                    { --side-blocks: 1.275; }
:root[data-theme="dark"] { --side-blocks: 1.15; }
/* The mask is the column's switch. Where the list is barely longer than the
   sidebar, a few blocks squeezed into the gap would read as a mistake, so
   under 18rem the column shows nothing: the mask's edge sits at
   (height - 18rem) x 1000, past the foot of any column taller than that
   and above the top of any shorter. Not a container query: a size container
   restarted every block's animation whenever its height changed — by a
   pixel, as the list settles while it scrolls — which froze the column and
   snapped it back. */
/* Everything in a column is measured in em of the column's own font size,
   which is 1rem unless a page scales the whole pattern down for a narrower
   column (the stats page does): sizes, places, drift and the gaps at either
   end all shrink together, so a narrow column is the same column smaller
   rather than the same blocks crammed in. stage.js reads the same size. */
.side-deco {
    position: relative; overflow: clip;
    pointer-events: none;
    font-size: 1rem;
    -webkit-mask-image: linear-gradient(#000 calc((100% - 18rem) * 1000), transparent 0);
            mask-image: linear-gradient(#000 calc((100% - 18rem) * 1000), transparent 0);
}
.side-block.is-past { display: none; }
.side-run {
    position: absolute; left: 0; right: 0;
    top: calc(var(--run) * 20em - 6em); height: 40em;
    content-visibility: auto;
}
/* Three boxes, one inside the next: the block holds its own values (the
 * style attribute) and its place; the drift inside it (.side-drift) is the
 * one that moves; the shape inside that (.side-shape) is everything drawn —
 * the shadow, the face, the side and the end, and the sums that turn them.
 *
 * Split so, because a drifting element's style is worked out again on every
 * frame — the stage's 3D draws every frame, and the browser brings every
 * running animation's element up to date for it, composited or not. With
 * the faces on the moving block itself that was the block and all five of
 * its parts, 433 elements a frame for the hundred blocks on the screen,
 * nearly 2ms of every frame — at the 240 frames a second this site is seen
 * at, nearly half of each. And an element with values of its own has its
 * children redone with it, so the one that moves declares none: only the
 * bare drift boxes are redone, and what they hold is left alone. */
.side-block {
    --sz: calc(var(--s) * 1em);
    /* The side on the left (-1) or right, the end at the foot (1) or top. */
    --fx: -1; --fy: 1;
    position: absolute;
    /* A quarter of its size kept free either side, for the side it shows. */
    left: calc((100% - var(--sz) * 1.5) * var(--x) + var(--sz) * .25);
    top: calc((var(--y) - var(--side-lift, 0)) * 1em + 6em);
    width: var(--sz); height: var(--sz);
}
.side-block.is-r { --fx: 1; }
.side-block.is-t { --fy: -1; }
.side-drift { display: block; position: absolute; inset: 0; }
.side-shape {
    --dp: calc(var(--sz) * .42);
    --a: min(1, calc(var(--o) * var(--side-blocks)));
    --cx: cos(calc(var(--ax) * 1rad)); --sx: sin(calc(var(--ax) * 1rad));
    --cy: cos(calc(var(--ay) * 1rad)); --sy: sin(calc(var(--ay) * 1rad));
    display: block; position: absolute; inset: 0;
}
/* The shadow: thrown down and to the right by the face itself — the same
   box, turned the same way — and drawn only outside it, as an outer shadow
   is. So it lies on the page round the block's foot, under the side and the
   end at most, and never under the face, where it showed through as a
   muddy stain; and it stays close, where a soft blob twice the block's size
   had hung a dim halo round every one. */
.side-shape::before {
    content: ""; position: absolute; inset: 0;
    transform: matrix(var(--cy), calc(var(--sy) * var(--sx)), 0, var(--cx), 0, 0);
    box-shadow: calc(var(--sz) * .08) calc(var(--sz) * .12) calc(var(--sz) * .22)
                rgb(92 61 6 / min(.3, calc(var(--a) * .5)));
}
:root[data-theme="dark"] .side-shape::before { display: none; }
/* The side and the end are <b>'s, the face the shape's own ::after, so the
   face paints last, over the edges it shares with them. Each is laid out
   centred on the block and turned from there. */
.side-shape > b,
.side-shape > b::before,
.side-shape > b::after,
.side-shape::after { content: ""; display: block; position: absolute; inset: 0; margin: auto; }
.side-shape::after {
    background: color-mix(in srgb, var(--c) calc(var(--a) * 100%), transparent);
    transform: matrix(var(--cy), calc(var(--sy) * var(--sx)), 0, var(--cx), 0, 0);
}
/* The side: as tall as the block, as wide as it is deep, running back from
   the face's edge. */
.side-shape > b::before {
    width: var(--dp); height: var(--sz);
    background: color-mix(in srgb, color-mix(in srgb, var(--c), #000 22%) calc(var(--a) * 100%), transparent);
    transform:
        translate(calc(var(--fx) * var(--sz) / 2 * var(--cy) - var(--dp) / 2 * var(--sy)),
                  calc(var(--fx) * var(--sz) / 2 * var(--sy) * var(--sx) + var(--dp) / 2 * var(--cy) * var(--sx)))
        matrix(var(--sy), calc(-1 * var(--cy) * var(--sx)), 0, var(--cx), 0, 0);
}
/* The end: as wide as the block, a shade darker underneath than on top. */
.side-shape > b::after {
    width: var(--sz); height: var(--dp);
    background: color-mix(in srgb, color-mix(in srgb, var(--c), #000 38%) calc(var(--a) * 100%), transparent);
    transform:
        translate(calc(var(--dp) / -2 * var(--sy)),
                  calc(var(--fy) * var(--sz) / 2 * var(--cx) + var(--dp) / 2 * var(--cy) * var(--sx)))
        matrix(var(--cy), calc(var(--sy) * var(--sx)), var(--sy), calc(-1 * var(--cy) * var(--sx)), 0, 0);
}
.side-block.is-t .side-shape > b::after {
    background: color-mix(in srgb, color-mix(in srgb, var(--c), #fff 22%) calc(var(--a) * 100%), transparent);
}
/* Out and back, eased at both ends, as the margin's drifted: half the
   cycle each way. stage.js runs it itself, each block's figures written in,
   and stops this one as it takes over (is-driven): read through var(), they
   were worked out again for every moving block on every frame. So this is
   the drift until the script arrives, or with none. */
@media (prefers-reduced-motion: no-preference) {
    .side-drift { animation: side-drift calc(var(--t) * .5s) calc(var(--dl) * 1s) ease-in-out infinite alternate; }
    .side-deco.is-driven .side-drift { animation: none; }
}
@keyframes side-drift {
    to { transform: translate(calc(var(--dx) * 1em), calc(var(--dy) * 1em)) scale(var(--sc)); }
}

/* ========================================================= level page */

/* The level's chips as the list card's badges: the theme's glass with a
   hairline edge and a sheen, the words in ink — the ID's copy chip already
   was. Grinding and the list's section keep their own colour of word. */
.level-head .badge:not(.badge-copy) {
    background: var(--glass-strong); color: var(--ink);
    border-color: var(--hairline-strong);
    box-shadow: var(--sheen), var(--shadow-sm);
}
/* With no card behind it, the ID's copy chip stands on the ground like the
   chips beside it: lifted on the same shadow, at rest and under the pointer. */
.level-head .badge-copy,
.level-head .badge-copy:hover { box-shadow: var(--sheen), var(--shadow-sm); }
/* The AREDL chip, which leads to the player's AREDL profile, answers the
   pointer as the copy chip does: the gold edge and the small zoom, and a
   little give when pressed — on the level's page and on the list's cards. */
:is(.level-head, .card-chips) a.badge-link {
    transition: transform .22s var(--ease-out), border-color .15s, box-shadow .15s, color .15s;
}
:is(.level-head, .card-chips) a.badge-link:hover  { border-color: var(--gold); transform: scale(1.04); }
:is(.level-head, .card-chips) a.badge-link:active { transform: scale(.96); transition-duration: .08s; }
.level-head .badge-grind:not(.badge-copy)  { color: var(--progress); }
.level-head .badge-legacy:not(.badge-copy) { color: var(--rank-3); }
.level-head .badge-queued:not(.badge-copy) { color: var(--muted); }
/* The facts and the notes stand on the ground now — there is no card round
   the level any more — so each is a pane of its own, as the sidebar's
   panels are: the same glass, a hairline edge, a line of light along the
   top and the long soft shadow under it. Clear glass, not frosted: the
   page's picture shows through them as itself. Frosted, they showed it
   clear only while the page rose into place (its rise makes the level a
   layer of its own, with nothing behind it to blur) and then misted over
   a second later, which read as the see-through going away. The facts'
   cells add no tint of their own (one over the pane made the strip near
   solid); their dividers were the strip's own colour showing through the
   gaps between the cells, which would tint the cells too, so each cell
   draws the line along its right and bottom edges instead (the strip's
   overflow clips the outer ones). */
.facts, .notes {
    background-color: var(--glass-pane);
    border-color: var(--hairline);
    box-shadow: var(--sheen), var(--shadow-sm);
}
.fact {
    background: transparent;
    box-shadow: 1px 0 0 var(--hairline), 0 1px 0 var(--hairline);
}
.media-frame { box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.8), 0 0 0 1px var(--hairline); }
/* The ways on to the neighbours, on the same shadow as the panes above them
   rather than a button's small one, at rest and under the pointer. They grow
   far less than a button does under the pointer: each is half the row wide,
   and a button's four per cent of that is more than the gap between the
   two, so the one under the pointer met the other. */
.level-nav a,
.level-nav a:hover { box-shadow: var(--sheen), var(--shadow-sm); }
.level-nav a { --zoom: 1.015; }

/* The level's videos under the player: lit stills, each lifting under the
   pointer, the one playing ringed in gold and glowing. A hairline of light
   round every card's edge keeps a dark still from melting into the night
   theme. The figure in the caption is set in the display face, as the big
   figures are everywhere else. */
.reel-tile {
    border-radius: 0.75rem;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), 0 0 0 1px var(--hairline), var(--shadow-sm);
    transition: transform .3s var(--ease-out), box-shadow .3s var(--ease-out);
}
.reel-tile:hover {
    transform: translateY(-3px);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12), 0 0 0 1px var(--hairline-strong),
                0 18px 30px -16px rgba(0, 0, 0, 0.6);
}
.reel-tile.is-on {
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1), 0 0 0 2px #facc15,
                0 0 30px -6px rgba(250, 190, 20, 0.55), var(--shadow-sm);
}
.reel-tile.is-on:hover { transform: none; }
/* On a phone the cards ride in a sideways scroller, which clips whatever
   reaches past its edges: the glow and the drop shadow were cut off square
   along the strip, a hard-edged band across the page. Only what fits in its
   few pixels of padding is kept — the ring and the hairline. */
@media (max-width: 640px) {
    .reel-tile { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), 0 0 0 1px var(--hairline-strong); }
    .reel-tile.is-on { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1), 0 0 0 2px #facc15; }
}
.reel-text strong { font: 600 0.875rem/1.15 var(--font-display); letter-spacing: -0.02em; }
.reel-text small { font-family: var(--font-label); }

/* ========================================================== stats page */

/* Plain glass, like every other card: no gold wash behind the portrait (the
   hard style underneath draws one too, so it is switched off outright), no
   glow round it — only its gold ring — and no wash at the top of the lead
   stat, which keeps just its gold line along the top edge. */
.stats-head { background-image: none; }
.stats-head h1 { letter-spacing: -0.045em; }
.stats-avatar {
    box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px #facc15;
}
.stats-latest { border-color: var(--hairline); }
.stat-beaten {
    border-top: 1px solid var(--hairline);
    background-image: none;
    box-shadow: var(--sheen), inset 0 2px 0 #facc15, var(--shadow-sm);
}
.tier-counts { background: var(--hairline); border-color: var(--hairline); }
.tier-counts li { background: var(--glass-card); transition: background-color .3s; }
.tier-counts li:hover { background: var(--glass-strong); }

/* ========================================================== on the glass */

/* The chips and buttons on a see-through pane — a card's difficulty and ID,
 * the difficulty tray's chips, the sidebar's buttons — as a veil of light
 * over the pane
 * (--glass-chip) rather than the near-solid glass they wear elsewhere, which
 * stood on the frosted panes as solid tiles. Under the pointer they keep the
 * gold edge and the zoom; a difficulty chip that is on keeps its gold. Later
 * in the file than the rules they override, at the same weight or more. */
:is(.card, .side-panel) :is(.meta-tier, .badge-copy, .card-honour),
:is(.card, .side-panel) :is(.badge-copy:hover, .badge-copy:active, a.card-honour:hover, a.card-honour:active),
.side-panel .btn-ghost, .side-panel .btn-ghost:hover,
.tier-filter .tier-chip:not(.is-on), .tier-filter .tier-clear, .tier-filter .tier-clear:hover {
    background: var(--glass-chip);
}

/* The search box beside the difficulty tray, frosted like the tray, where it
   was a grey well. */
.list-head .searchbox {
    background-color: var(--glass);
    -webkit-backdrop-filter: var(--glass-blur);
            backdrop-filter: var(--glass-blur);
}
@media (prefers-reduced-transparency: reduce) {
    :root, :root[data-theme="dark"] { --glass-pane: var(--surface); --glass-inset: var(--surface-2); --glass-chip: var(--surface-2); }
    .list-head .searchbox { background-color: var(--field-well); -webkit-backdrop-filter: none; backdrop-filter: none; }
}

/* ============================================================== footer */

/* The header's own glass (see .topbar): the bar's colour at the same
   strength, frosted the same way, so the two ends of the page are one
   material and the ground shows through the footer as it does through the
   header. The panes' whiter glass, with a gold glow along its foot, read
   as a solid band under them. Its counts and buttons are the panes' rows
   and chips. */
.sitefoot {
    background: color-mix(in srgb, var(--topbar-bg) 64%, transparent);
    -webkit-backdrop-filter: var(--glass-blur);
            backdrop-filter: var(--glass-blur);
    border-top-color: var(--hairline);
    overflow: hidden;
}
@media (prefers-reduced-transparency: reduce) {
    .sitefoot { background: var(--topbar-bg); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
.foot-nav h2 { color: var(--muted); }
.foot-section em {
    background: var(--glass-inset);
    box-shadow: inset 0 0 0 1px var(--hairline);
}
.sitefoot .btn-ghost, .sitefoot .btn-ghost:hover { background: var(--glass-chip); }
.sitefoot-base { border-top-color: var(--hairline); }

/* Breathing room above the base line, where the giant outlined name used
   to stand: a little over half the room the name took (0.96em of its
   size, plus the 0.5rem above it), growing with the window as it did. */
.foot-spacer {
    font-size: clamp(2.25rem, 9vw, 8.5rem);
    height: 0.55em;
    margin-top: 0.5rem;
}

/* =============================================================== motion */

/* Held back until stage.js reveals them — see "reveal" there. rv-boot is
   set before first paint by the layout and taken off within the same task
   that marks each block .rv, so no frame shows the handover.

   A page reached from another page of the site (rv-solid, set by the
   layout) holds them solid instead, at the start of their slide: the page
   being left dissolves straight into them, and those on the screen only
   slide into place. Faded in as well, the two pages met half see-through,
   with the empty ground showing through both. From one level to the next
   (rv-step) they are held in place, not even sliding. */
.rv-boot:not(.rv-solid) :is(.list-hero-copy > *, .list-head, .cards > .card, .list-side > section, .level-head, .level,
             .stats-head, .stat, .stats-page > .panel, .stats-page > section,
             .stats-page > div:not(.stat-row, .stat-wrap), .empty-state),
.rv:not(.is-in) { opacity: 0; }
.rv-boot.rv-solid:not(.rv-step) :is(.list-hero-copy > *, .list-head, .cards > .card, .list-side > section, .level-head, .level,
             .stats-head, .stat, .stats-page > .panel, .stats-page > section,
             .stats-page > div:not(.stat-row, .stat-wrap), .empty-state) { transform: translate3d(0, 1.75rem, 0) scale(.985); }

/* Changing list in place (app.js). What is leaving fades out quickly — the
   headline, the cards, and the sidebar when the page is about to move — and
   takes no clicks meanwhile; what arrives as one piece rather than rising,
   the picture wall behind the hero and the column of blocks, fades in. */
.list-leaving { opacity: 0 !important; pointer-events: none; transition: opacity .18s ease-in; }
.list-arriving { animation: list-arrive .6s ease both; }
@keyframes list-arrive { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
    .list-leaving { transition: none; }
    .list-arriving { animation: none; }
}

@media print {
    .rv, .rv-boot * { opacity: 1 !important; }
    .stage, .stage-hero, .hero-backdrop, .level-backdrop, .loader, .side-deco { display: none; }
}

/* No light show where motion is not wanted: the podium's travelling edge
   holds still as a plain coloured rule, and the hover lifts go. */
@media (prefers-reduced-motion: reduce) {
    .card:hover, .btn:hover, .btn-ghost:hover, .icon-btn:hover, .tier-chip:hover,
    .theme-toggle:hover, .nav-burger:hover, .level-nav a:hover,
    .auth-btn-out:hover, .tier-clear:hover, .scroll-btn:hover { transform: none; animation: none; }
    .card-podium::before { background: var(--podium); opacity: .5; }
}

/* Off the screen (stage.js, holdAway): the loops hold still until they come
   back. Only the loops, by name — a list arriving fades the wall in with an
   animation of its own, and that one has to finish wherever the wall is. And
   the hero's picture of the cube, which loops on unseen behind the 3D one. */
.hero-backdrop.is-away .hero-wall-row,
.card-podium.is-away, .card-podium.is-away::before, .card-podium.is-away .card-trophy,
.card-trophy.is-away,
.has-stage .list-hero-art { animation-play-state: paused; }
/* And all of them under the loading screen, until it starts to open: unseen
   there, they only took frames from the page being put together beneath it,
   which kept the screen up the longer. They set off as it opens. */
:root.is-loading:not(.loader-opening) :is(.stage-tides > i, .hero-wall-row, .card-podium, .card-trophy,
    .list-hero-art, .hero-tag),
:root.is-loading:not(.loader-opening) .brand-glint::before { animation-play-state: paused; }
