@font-face {
    font-family: "Svatopluk";
    src: url("/assets/fonts/Svatopluk-Regular.otf") format("opentype");
    font-weight: 400;
    font-style: normal;
    font-display: block;
}

@font-face {
    font-family: "Svatopluk";
    src: url("/assets/fonts/Svatopluk-Medium.otf") format("opentype");
    font-weight: 500;
    font-style: normal;
    font-display: block;
}

@font-face {
    font-family: "IBM Plex Mono";
    src: url("/assets/fonts/IBMPlexMono-Regular.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: block;
}

@font-face {
    font-family: "IBM Plex Mono";
    src: url("/assets/fonts/IBMPlexMono-Medium.woff2") format("woff2");
    font-weight: 500;
    font-style: normal;
    font-display: block;
}

:root {
    /* Switzerland: the red and white of the federal coat of arms */
    --swiss-red: #DA291C;
    --swiss-white: #FFFFFF;

    /* Surfaces: white with red accents, like the issuer's */
    --bg: var(--swiss-white);
    --surface: #F6F3F0;

    /* Ink */
    --ink-dark: #1D1A18;
    --text: var(--ink-dark);
    --text-secondary: rgba(29, 26, 24, 0.62);
    --text-faint: rgba(29, 26, 24, 0.42);
    --hairline: rgba(29, 26, 24, 0.14);

    /* Accents */
    --accent: var(--swiss-red);
    --positive: #1E9E5A;
    --idle: rgba(29, 26, 24, 0.28);

    /* The night of the werewolf bar: its sky, its horizon, its moon */
    --night: #0B1020;
    --night-glow: #1C2546;
    --night-ink: #ECE9E1;
    --moon: #F4F1E8;
    --moon-shade: #D9D5C8;
    --moon-halo: rgba(244, 241, 232, 0.3);
    --moon-crater: rgba(29, 26, 24, 0.055);

    /* Type families */
    --font-display: "Svatopluk", system-ui, sans-serif;
    --font-body: "Svatopluk", system-ui, sans-serif;
    --font-mono: "IBM Plex Mono", ui-monospace, monospace;

    /* Spacing scale */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.5rem;
    --space-6: 2rem;
    --space-7: 3rem;
    --space-8: 4rem;

    /* Type scale */
    --text-2xs: 0.625rem;
    --text-xs: 0.6875rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-md: 1.0625rem;
    --text-lg: 1.25rem;
    --text-xl: 1.75rem;
    --text-2xl: 2.25rem;
    --text-3xl: 3.25rem;
    --text-display: 5.5rem;

    /* Small capitals in the mono face: hints, labels, small print */
    --caps-tracking: 0.14em;
    --role-tracking: 0.42em;

    /* Lines */
    --outline: 1.5px;

    /* Radii */
    --radius-pill: 999px;
    --radius-round: 50%;
    --radius-box: 1.375rem;

    /* A square with continuous corners: a superellipse of exponent 5 */
    --squircle: polygon(100.00% 50.00%, 99.97% 65.36%, 99.89% 70.26%, 99.75% 73.81%, 99.56% 76.68%, 99.31% 79.12%, 99.01% 81.26%, 98.64% 83.17%, 98.22% 84.89%, 97.74% 86.46%, 97.20% 87.89%, 96.60% 89.21%, 95.94% 90.43%, 95.20% 91.54%, 94.40% 92.58%, 93.53% 93.53%, 92.58% 94.40%, 91.54% 95.20%, 90.43% 95.94%, 89.21% 96.60%, 87.89% 97.20%, 86.46% 97.74%, 84.89% 98.22%, 83.17% 98.64%, 81.26% 99.01%, 79.12% 99.31%, 76.68% 99.56%, 73.81% 99.75%, 70.26% 99.89%, 65.36% 99.97%, 50.00% 100.00%, 34.64% 99.97%, 29.74% 99.89%, 26.19% 99.75%, 23.32% 99.56%, 20.88% 99.31%, 18.74% 99.01%, 16.83% 98.64%, 15.11% 98.22%, 13.54% 97.74%, 12.11% 97.20%, 10.79% 96.60%, 9.57% 95.94%, 8.46% 95.20%, 7.42% 94.40%, 6.47% 93.53%, 5.60% 92.58%, 4.80% 91.54%, 4.06% 90.43%, 3.40% 89.21%, 2.80% 87.89%, 2.26% 86.46%, 1.78% 84.89%, 1.36% 83.17%, 0.99% 81.26%, 0.69% 79.12%, 0.44% 76.68%, 0.25% 73.81%, 0.11% 70.26%, 0.03% 65.36%, 0.00% 50.00%, 0.03% 34.64%, 0.11% 29.74%, 0.25% 26.19%, 0.44% 23.32%, 0.69% 20.88%, 0.99% 18.74%, 1.36% 16.83%, 1.78% 15.11%, 2.26% 13.54%, 2.80% 12.11%, 3.40% 10.79%, 4.06% 9.57%, 4.80% 8.46%, 5.60% 7.42%, 6.47% 6.47%, 7.42% 5.60%, 8.46% 4.80%, 9.57% 4.06%, 10.79% 3.40%, 12.11% 2.80%, 13.54% 2.26%, 15.11% 1.78%, 16.83% 1.36%, 18.74% 0.99%, 20.88% 0.69%, 23.32% 0.44%, 26.19% 0.25%, 29.74% 0.11%, 34.64% 0.03%, 50.00% 0.00%, 65.36% 0.03%, 70.26% 0.11%, 73.81% 0.25%, 76.68% 0.44%, 79.12% 0.69%, 81.26% 0.99%, 83.17% 1.36%, 84.89% 1.78%, 86.46% 2.26%, 87.89% 2.80%, 89.21% 3.40%, 90.43% 4.06%, 91.54% 4.80%, 92.58% 5.60%, 93.53% 6.47%, 94.40% 7.42%, 95.20% 8.46%, 95.94% 9.57%, 96.60% 10.79%, 97.20% 12.11%, 97.74% 13.54%, 98.22% 15.11%, 98.64% 16.83%, 99.01% 18.74%, 99.31% 20.88%, 99.56% 23.32%, 99.75% 26.19%, 99.89% 29.74%, 99.97% 34.64%);

    /* Sizes */
    --dot-size: 0.4375rem;
    --card-height: 10.625rem;
    --card-min: 11rem;
    --card-moon: 4.25rem;
    --surface-size: 20rem;
    --code-size: 16.25rem;
    --moon-size: 23.5rem;
    --moon-code: 14.25rem;
    --spinner-size: 2.5rem;
    --trouble-size: 4.5rem;
    --check-size: 6.5rem;
    --check-small: 3.5rem;
    --back-icon: 1rem;
    --action-width: 13rem;
    --ask-width: 21ch;
    --learns-width: 42ch;
    --hero-width: 88ch;

    /* Shadows */
    --shadow-lift: 0 1.125rem 2.5rem rgba(29, 26, 24, 0.18);
    --shadow-plate: 0 1.5rem 3rem rgba(0, 0, 0, 0.22);

    /* Layout */
    --page-padding: var(--space-7);
    --bar-height: 4.25rem;
    --foot-height: 2.75rem;

    /* How far above the true center a centered page sits: a true center reads as low */
    --optical-lift: 3vh;

    /* Motion */
    --transition: 160ms ease;
    --entrance: 520ms cubic-bezier(0.2, 0.8, 0.2, 1);
    --entrance-rise: 0.875rem;
    --glide: 360ms cubic-bezier(0.2, 0.8, 0.2, 1);
    --lift: -4px;
    --pop: 420ms cubic-bezier(0.2, 1.4, 0.4, 1);
    --draw: 420ms cubic-bezier(0.6, 0, 0.2, 1);
    --spin: 900ms linear;
    --pulse: 1.6s ease-in-out;
    --twinkle: 5s ease-in-out;
    --tilt: -1.6deg;
    --skew: -2.5deg;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

/* Everything is sized off the root: a page fills a projector the way it fills a laptop */
html {
    font-size: clamp(13.5px, min(1.25vw, 2.2vh), 21px);
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: var(--text-base);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

h1, h2, p, dl, dd {
    margin: 0;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font: inherit;
    cursor: pointer;
}

@keyframes entrance {
    from {
        opacity: 0;
        transform: translateY(var(--entrance-rise));
    }

    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes pop {
    from {
        opacity: 0;
        scale: 0.8;
    }

    to {
        opacity: 1;
        scale: 1;
    }
}

@keyframes spin {
    to {
        rotate: 1turn;
    }
}

@keyframes draw {
    from {
        stroke-dashoffset: 1;
    }

    to {
        stroke-dashoffset: 0;
    }
}

@keyframes pulse {
    50% {
        opacity: 0.35;
    }
}

@keyframes bump {
    30% {
        scale: 1.5;
        color: var(--positive);
    }
}

@keyframes twinkle {
    50% {
        opacity: 0.35;
    }
}

/* The name of the thing, and what it does here: on every page */
.brand {
    display: flex;
    align-items: baseline;
    gap: var(--space-3);

    .name {
        color: var(--accent);
        font-family: var(--font-display);
        font-size: var(--text-xl);
        line-height: 1;
        letter-spacing: -0.02em;
    }

    .role {
        font-family: var(--font-mono);
        font-size: var(--text-xs);
        font-weight: 500;
        letter-spacing: var(--role-tracking);
        text-transform: uppercase;
    }
}

.bar {
    display: flex;
    flex: none;
    align-items: center;
    justify-content: space-between;
    height: var(--bar-height);
}

.foot {
    display: flex;
    flex: none;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-5);
    height: var(--foot-height);
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    font-weight: 500;
    letter-spacing: var(--caps-tracking);
    text-transform: uppercase;

    .host {
        text-transform: none;
        letter-spacing: 0.04em;
    }
}

/* The index: what this is, then every scenario as a card */
.index {
    display: flex;
    flex-direction: column;
    padding: 0 var(--page-padding);

    .content {
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: center;
        padding: var(--space-2) 0 var(--space-4);
    }

    .title {
        font-family: var(--font-display);
        font-size: var(--text-3xl);
        font-weight: 400;
        line-height: 1.02;
        letter-spacing: -0.025em;
        animation: entrance var(--entrance) both;
    }

    .text {
        max-width: var(--hero-width);
        margin-top: var(--space-4);
        color: var(--text-secondary);
        font-size: var(--text-md);
        animation: entrance var(--entrance) 60ms both;
    }

    /* Two columns of groups, read down the first then down the second: three cards a row on
       the left, two on the right */
    .groups {
        display: grid;
        grid-template-columns: 3fr 2fr;
        grid-template-rows: auto auto;
        grid-auto-flow: column;
        gap: var(--space-5) var(--space-6);
        margin-top: var(--space-5);
    }

    .label {
        color: var(--text-faint);
        font-family: var(--font-mono);
        font-size: var(--text-xs);
        font-weight: 500;
        letter-spacing: var(--caps-tracking);
        text-transform: uppercase;
        animation: entrance var(--entrance) 100ms both;
    }

    .cards {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(var(--card-min), 1fr));
        gap: var(--space-4);
        margin-top: var(--space-3);
    }

    /* A scenario, in the color of the credential it asks for: the color its page floods with */
    .card {
        position: relative;
        display: flex;
        flex-direction: column;
        height: var(--card-height);
        padding: var(--space-4) var(--space-5);
        overflow: hidden;
        border-radius: var(--radius-box);
        background: var(--tone);
        color: var(--tone-ink);
        transition:
            translate var(--glide),
            rotate var(--glide),
            box-shadow var(--glide),
            scale var(--transition);
        animation: entrance var(--entrance) both;

        --quiet: color-mix(in srgb, var(--tone-ink) 76%, transparent);

        &:hover {
            translate: 0 var(--lift);
            box-shadow: var(--shadow-lift);

            .gets svg {
                translate: 4px 0;
            }
        }

        &:active {
            scale: 0.985;
        }
    }

    .group:nth-child(1) .card {
        animation-delay: calc(120ms + var(--place, 0) * 50ms);
    }

    .group:nth-child(2) .card {
        animation-delay: calc(270ms + var(--place, 0) * 50ms);
    }

    .group:nth-child(3) .card {
        animation-delay: calc(220ms + var(--place, 0) * 50ms);
    }

    .group:nth-child(4) .card {
        animation-delay: calc(370ms + var(--place, 0) * 50ms);
    }

    .card:nth-child(2) {
        --place: 1;
    }

    .card:nth-child(3) {
        --place: 2;
    }

    .credential,
    .gets {
        color: var(--quiet);
        font-family: var(--font-mono);
        font-size: var(--text-2xs);
        font-weight: 500;
        letter-spacing: var(--caps-tracking);
        text-transform: uppercase;
    }

    .asker {
        margin-top: var(--space-3);
        font-family: var(--font-display);
        font-size: var(--text-xl);
        line-height: 1.05;
        letter-spacing: -0.02em;
    }

    .ask {
        margin-top: var(--space-2);
        color: var(--quiet);
        font-size: var(--text-sm);
        line-height: 1.35;
    }

    /* What the website gets out of it, at the foot of the card */
    .gets {
        position: relative;
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-top: auto;

        svg {
            width: var(--back-icon);
            height: var(--back-icon);
            color: var(--tone-ink);
            transition: translate var(--glide);
        }
    }

    /* The werewolf bar keeps its night at all times, a moon in its corner */
    .card[data-theme = "night"] {
        background:
            radial-gradient(1.5px 1.5px at 14% 30%, var(--night-ink) 50%, transparent 52%),
            radial-gradient(1px 1px at 32% 14%, var(--night-ink) 50%, transparent 52%),
            radial-gradient(1.5px 1.5px at 52% 36%, var(--night-ink) 50%, transparent 52%),
            radial-gradient(1px 1px at 8% 58%, var(--night-ink) 50%, transparent 52%),
            radial-gradient(1px 1px at 44% 8%, var(--night-ink) 50%, transparent 52%),
            var(--night);
        &::after {
            content: "";
            position: absolute;
            top: calc(var(--card-moon) * -0.34);
            right: calc(var(--card-moon) * -0.3);
            width: var(--card-moon);
            height: var(--card-moon);
            border-radius: var(--radius-round);
            background: radial-gradient(circle at 36% 32%, var(--swiss-white), var(--moon) 55%, var(--moon-shade));
            box-shadow: 0 0 1.5rem var(--moon-halo);
            transition: box-shadow var(--glide), scale var(--glide);
        }

        &:hover::after {
            scale: 1.08;
            box-shadow: 0 0 3rem var(--moon-halo), 0 0 0.75rem var(--moon-halo);
        }
    }

    /* The suspicious bar does not quite sit straight, until someone looks */
    .card[data-theme = "off"] {
        rotate: var(--tilt);

        &:hover {
            rotate: 0deg;
        }
    }

    .foot {
        color: var(--text-faint);
    }

    .service {
        display: flex;
        align-items: center;
        gap: var(--space-2);
    }

    .service .dot {
        width: var(--dot-size);
        height: var(--dot-size);
        border-radius: var(--radius-round);
        background: var(--idle);
        transition: background var(--glide);
    }

    .foot[data-reached = "true"] .service .dot {
        background: var(--positive);
    }

    .count {
        transition: opacity var(--glide);
    }

    .foot[data-reached = "false"] .count {
        opacity: 0;
    }

    .number {
        display: inline-block;
        color: var(--text);
        font-weight: 500;

        &.bumped {
            animation: bump 700ms ease-out;
        }
    }
}

/* A scenario: the page takes the color of the credential it asks for. Who asks and what on
   one side, the code and what comes of it on the other. */
.scenario {
    display: flex;
    flex-direction: column;
    padding: 0 var(--page-padding);
    background: var(--tone);
    color: var(--tone-ink);

    --soft: color-mix(in srgb, var(--tone-ink) 74%, transparent);
    --line: color-mix(in srgb, var(--tone-ink) 28%, transparent);

    .sky {
        display: none;
    }

    .bar,
    .content,
    .foot {
        position: relative;
    }

    .back {
        display: inline-flex;
        align-items: center;
        gap: var(--space-2);
        padding: var(--space-2) var(--space-4) var(--space-2) var(--space-3);
        border: var(--outline) solid var(--line);
        border-radius: var(--radius-pill);
        font-size: var(--text-base);
        font-weight: 500;
        line-height: 1.2;
        transition: background var(--glide), scale var(--transition);

        svg {
            width: var(--back-icon);
            height: var(--back-icon);
            transition: translate var(--glide);
        }

        &:hover {
            background: color-mix(in srgb, var(--tone-ink) 10%, transparent);

            svg {
                translate: -3px 0;
            }
        }

        &:active {
            scale: 0.97;
        }
    }

    .brand .name {
        color: inherit;
    }

    .content {
        flex: 1;
        display: grid;
        grid-template-columns: 1.1fr 1fr;
        align-items: center;
        gap: var(--space-7);
        padding-bottom: var(--optical-lift);
    }

    .credential {
        color: var(--soft);
        font-family: var(--font-mono);
        font-size: var(--text-xs);
        font-weight: 500;
        letter-spacing: var(--caps-tracking);
        text-transform: uppercase;
        animation: entrance var(--entrance) both;
    }

    .asker {
        margin-top: var(--space-4);
        font-family: var(--font-display);
        font-size: var(--text-display);
        font-weight: 400;
        line-height: 0.95;
        letter-spacing: -0.03em;
        animation: entrance var(--entrance) 60ms both;
    }

    .ask {
        max-width: var(--ask-width);
        margin-top: var(--space-5);
        font-size: var(--text-xl);
        font-weight: 500;
        line-height: 1.2;
        letter-spacing: -0.01em;
        text-wrap: balance;
        animation: entrance var(--entrance) 120ms both;
    }

    .learns {
        max-width: var(--learns-width);
        margin-top: var(--space-5);
        color: var(--soft);
        font-size: var(--text-md);
        text-wrap: pretty;
        animation: entrance var(--entrance) 180ms both;
    }

    .answer {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    /* The white surface the code sits on: once the wallet answered, it holds the answer */
    .plate {
        filter: drop-shadow(var(--shadow-plate));
        animation: pop var(--pop) 120ms both;
    }

    .surface {
        position: relative;
        display: grid;
        place-items: center;
        width: var(--surface-size);
        height: var(--surface-size);
        background: var(--swiss-white);
        color: var(--ink-dark);
        clip-path: var(--squircle);

        > * {
            grid-area: 1 / 1;
        }
    }

    .spinner {
        width: var(--spinner-size);
        height: var(--spinner-size);
        opacity: 0;
        animation: spin var(--spin) infinite;
        transition: opacity var(--glide);
    }

    .code {
        width: var(--code-size);
        height: var(--code-size);
        opacity: 0;
        scale: 0.94;
        transition: opacity var(--glide), scale var(--glide), filter var(--glide);
    }

    .lapsed {
        padding: var(--space-2) var(--space-4);
        border-radius: var(--radius-pill);
        background: var(--ink-dark);
        color: var(--swiss-white);
        font-family: var(--font-mono);
        font-size: var(--text-xs);
        font-weight: 500;
        letter-spacing: var(--caps-tracking);
        text-transform: uppercase;
        opacity: 0;
        scale: 0.9;
        transition: opacity var(--glide), scale var(--glide);
    }

    .trouble {
        width: var(--trouble-size);
        height: var(--trouble-size);
        color: var(--text-faint);
        opacity: 0;
        scale: 0.9;
        transition: opacity var(--glide), scale var(--glide);
    }

    .receipt {
        display: none;
        flex-direction: column;
        align-items: center;
        width: var(--code-size);
    }

    &[data-state = "opening"] .spinner,
    &[data-state = "waiting"] .code {
        opacity: 1;
        scale: 1;
    }

    &[data-state = "expired"] {
        .code {
            opacity: 0.14;
            scale: 1;
            filter: blur(5px);
        }

        .lapsed {
            opacity: 1;
            scale: 1;
        }
    }

    &[data-state = "unreachable"] {
        .code {
            opacity: 0;
        }

        .trouble {
            opacity: 1;
            scale: 1;
        }
    }

    &[data-state = "success"] {
        .code {
            opacity: 0;
            scale: 0.9;
        }

        .receipt {
            display: flex;
        }
    }

    /* A drawn check, then what the website was told: by name, or nothing at all */
    .check {
        width: var(--check-size);
        height: var(--check-size);
        animation: pop var(--pop) both;

        .disc {
            fill: var(--positive);
        }

        .tick {
            stroke: var(--swiss-white);
            stroke-width: 4;
            stroke-dasharray: 1;
            animation: draw var(--draw) 220ms both;
        }
    }

    .receipt .label {
        margin-top: var(--space-4);
        font-family: var(--font-mono);
        font-size: var(--text-xs);
        font-weight: 500;
        letter-spacing: var(--role-tracking);
        text-indent: var(--role-tracking);
        text-transform: uppercase;
        animation: entrance var(--entrance) 200ms both;
    }

    .nothing {
        margin-top: var(--space-2);
        color: var(--text-secondary);
        font-size: var(--text-sm);
        animation: entrance var(--entrance) 280ms both;
    }

    .reveals {
        display: none;
        flex-direction: column;
        width: 100%;
        margin-top: var(--space-3);

        .row {
            display: flex;
            align-items: baseline;
            justify-content: space-between;
            gap: var(--space-4);
            padding: var(--space-2) 0;
            border-top: 1px solid var(--hairline);
            animation: entrance var(--entrance) both;

            &:nth-child(1) {
                animation-delay: 280ms;
            }

            &:nth-child(2) {
                animation-delay: 340ms;
            }

            &:nth-child(3) {
                animation-delay: 400ms;
            }
        }

        dt {
            flex: none;
            color: var(--text-faint);
            font-family: var(--font-mono);
            font-size: var(--text-2xs);
            font-weight: 500;
            letter-spacing: var(--caps-tracking);
            text-transform: uppercase;
        }

        dd {
            min-width: 0;
            font-size: var(--text-md);
            font-weight: 500;
            line-height: 1.25;
            text-align: right;
            overflow-wrap: anywhere;
        }
    }

    /* With something revealed, the check steps aside for it */
    .receipt[data-reveals = "true"] {
        .check {
            width: var(--check-small);
            height: var(--check-small);
        }

        .label {
            margin-top: var(--space-3);
        }

        .reveals {
            display: flex;
        }

        .nothing {
            display: none;
        }
    }

    /* Under the surface: what to do, or what happened */
    .status {
        display: flex;
        flex-direction: column;
        align-items: center;
        min-height: 7.5rem;
        margin-top: var(--space-5);
        text-align: center;
    }

    .hint {
        font-family: var(--font-mono);
        font-size: var(--text-xs);
        font-weight: 500;
        letter-spacing: var(--caps-tracking);
        text-transform: uppercase;
    }

    .waiting {
        display: none;
        align-items: center;
        gap: var(--space-2);
        margin-top: var(--space-3);
        color: var(--soft);
        font-size: var(--text-base);

        .dot {
            width: var(--dot-size);
            height: var(--dot-size);
            border-radius: var(--radius-round);
            background: currentColor;
            animation: pulse var(--pulse) infinite;
        }
    }

    .welcome {
        display: none;
        font-family: var(--font-display);
        font-size: var(--text-2xl);
        font-weight: 400;
        line-height: 1.05;
        letter-spacing: -0.02em;
        animation: entrance var(--entrance) 320ms both;
    }

    .again {
        display: none;
        min-width: var(--action-width);
        margin-top: var(--space-4);
        padding: var(--space-3) var(--space-5);
        border: var(--outline) solid var(--tone-ink);
        border-radius: var(--radius-pill);
        background: var(--tone-ink);
        color: var(--tone);
        font-size: var(--text-base);
        font-weight: 500;
        transition: scale var(--transition), opacity var(--glide);
        animation: entrance var(--entrance) 120ms both;

        &:hover {
            opacity: 0.9;
        }

        &:active {
            scale: 0.97;
        }
    }

    &[data-state = "waiting"] .waiting {
        display: flex;
    }

    &[data-state = "success"] {
        .hint {
            display: none;
        }

        .welcome {
            display: block;
        }

        /* Asking again is the lesser thing to do once the answer is in */
        .again {
            display: block;
            background: none;
            border-color: var(--line);
            color: var(--tone-ink);
            animation-delay: 420ms;
        }
    }

    &[data-state = "expired"] .again,
    &[data-state = "unreachable"] .again {
        display: block;
    }

    .foot {
        justify-content: center;
        color: var(--soft);
    }

    /* The suspicious bar: the bar's page, a shade off and not quite straight */
    &[data-theme = "off"] {
        .plate {
            rotate: var(--tilt);
        }

        .asker {
            transform-origin: left bottom;
            transform: skewX(var(--skew));
        }
    }

    /* The werewolf bar: a night sky, and the code on the full moon */
    &[data-theme = "night"] {
        background: radial-gradient(120% 90% at 72% 115%, var(--night-glow), var(--night) 62%);

        .sky {
            display: block;
            position: fixed;
            inset: 0;
            pointer-events: none;

            &::before,
            &::after {
                content: "";
                position: absolute;
                inset: 0;
                animation: twinkle var(--twinkle) infinite;
            }

            &::before {
                background:
                    radial-gradient(1.5px 1.5px at 6% 22%, var(--night-ink) 50%, transparent 52%),
                    radial-gradient(1px 1px at 14% 64%, var(--night-ink) 50%, transparent 52%),
                    radial-gradient(2px 2px at 23% 12%, var(--night-ink) 50%, transparent 52%),
                    radial-gradient(1px 1px at 31% 82%, var(--night-ink) 50%, transparent 52%),
                    radial-gradient(1.5px 1.5px at 41% 16%, var(--night-ink) 50%, transparent 52%),
                    radial-gradient(1px 1px at 52% 90%, var(--night-ink) 50%, transparent 52%),
                    radial-gradient(1.5px 1.5px at 58% 9%, var(--night-ink) 50%, transparent 52%),
                    radial-gradient(1px 1px at 92% 16%, var(--night-ink) 50%, transparent 52%),
                    radial-gradient(2px 2px at 96% 62%, var(--night-ink) 50%, transparent 52%);
            }

            &::after {
                background:
                    radial-gradient(1px 1px at 3% 78%, var(--night-ink) 50%, transparent 52%),
                    radial-gradient(1.5px 1.5px at 18% 40%, var(--night-ink) 50%, transparent 52%),
                    radial-gradient(1px 1px at 27% 56%, var(--night-ink) 50%, transparent 52%),
                    radial-gradient(1px 1px at 36% 6%, var(--night-ink) 50%, transparent 52%),
                    radial-gradient(1.5px 1.5px at 47% 72%, var(--night-ink) 50%, transparent 52%),
                    radial-gradient(1px 1px at 55% 30%, var(--night-ink) 50%, transparent 52%),
                    radial-gradient(1.5px 1.5px at 88% 88%, var(--night-ink) 50%, transparent 52%),
                    radial-gradient(1px 1px at 97% 34%, var(--night-ink) 50%, transparent 52%);
                animation-delay: calc(var(--twinkle) / -2);
            }
        }

        .plate {
            filter: drop-shadow(0 0 2.5rem var(--moon-halo)) drop-shadow(0 0 0.5rem var(--moon-halo));
        }

        .surface {
            width: var(--moon-size);
            height: var(--moon-size);
            border-radius: var(--radius-round);
            background:
                radial-gradient(circle at 7.5% 46%, var(--moon-crater) 0 4.2%, transparent 4.5%),
                radial-gradient(circle at 60% 6%, var(--moon-crater) 0 3%, transparent 3.3%),
                radial-gradient(circle at 44% 4.5%, var(--moon-crater) 0 1.6%, transparent 1.9%),
                radial-gradient(circle at 93% 58%, var(--moon-crater) 0 3.4%, transparent 3.7%),
                radial-gradient(circle at 56% 95%, var(--moon-crater) 0 2.6%, transparent 2.9%),
                radial-gradient(circle at 10% 68%, var(--moon-crater) 0 1.8%, transparent 2.1%),
                radial-gradient(circle at 36% 30%, var(--swiss-white), var(--moon) 58%, var(--moon-shade));
            clip-path: none;
        }

        .code,
        .receipt {
            width: var(--moon-code);
        }

        .code {
            height: var(--moon-code);
        }

        .status {
            margin-top: var(--space-4);
        }
    }
}

/* Nothing at this address */
.missing {
    display: flex;
    flex-direction: column;
    padding: 0 var(--page-padding);

    .content {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        justify-content: center;
        padding-bottom: calc(var(--bar-height) + var(--optical-lift));
    }

    .label {
        color: var(--accent);
        font-family: var(--font-mono);
        font-size: var(--text-xs);
        font-weight: 500;
        letter-spacing: var(--role-tracking);
        animation: entrance var(--entrance) both;
    }

    .title {
        margin-top: var(--space-4);
        font-family: var(--font-display);
        font-size: var(--text-3xl);
        font-weight: 400;
        line-height: 1.02;
        letter-spacing: -0.025em;
        animation: entrance var(--entrance) 60ms both;
    }

    .home {
        margin-top: var(--space-6);
        padding: var(--space-3) var(--space-5);
        border-radius: var(--radius-pill);
        background: var(--accent);
        color: var(--swiss-white);
        font-weight: 500;
        transition: scale var(--transition);
        animation: entrance var(--entrance) 120ms both;

        &:active {
            scale: 0.97;
        }
    }
}

/* A narrow window: groups one under the other, the code under the question */
@media (max-width: 900px) {
    .index .groups {
        grid-template-columns: 1fr;
        grid-auto-flow: row;
    }

    .scenario .content {
        grid-template-columns: 1fr;
        padding: var(--space-6) 0;
    }
}
