/* KOCHERGIN — the room that grew.
   One room, drawn in ink and watercolour, seen through the years. The page is
   paper by day and ink-blue at night; the room fades into it at the edges. */

@font-face {
    font-family: "KOCHERGIN Wordmark";
    src: url("../assets/fonts/KOCHERGIN-Wordmark.woff2") format("woff2");
    font-display: block;
}

/* Moving between the site's own pages (the Lab, the drawer) is a soft
   cross-fade where the browser can do it, instead of a blank reload. */
@view-transition {
    navigation: auto;
}

::view-transition-old(root),
::view-transition-new(root) {
    animation-duration: 0.45s;
    animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
}

/* The colours of the light are registered, so when the room goes from day to
   night the whole page — header, story, footer — changes as one. */
@property --bg { syntax: "<color>"; inherits: true; initial-value: #f4eee3; }
@property --text { syntax: "<color>"; inherits: true; initial-value: #2b2119; }
@property --text-2 { syntax: "<color>"; inherits: true; initial-value: #6e6153; }
@property --text-3 { syntax: "<color>"; inherits: true; initial-value: #9b8e7e; }
@property --rule { syntax: "<color>"; inherits: true; initial-value: rgba(43, 33, 25, 0.16); }

:root {
    color-scheme: light;
    --paper: #f4eee3;
    --night: #121a2e;
    --dusk: #efe1d0;
    --cinema: #0c0b0a;
    --bg: var(--paper);
    --ink: #2b2119;
    --text: #2b2119;
    --text-2: #6e6153;
    --text-3: #9b8e7e;
    --rule: rgba(43, 33, 25, 0.16);
    --accent: #ff2e00;
    --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
    --ui: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --mark: "KOCHERGIN Wordmark", "Helvetica Neue", Arial, sans-serif;
    --tape: "VT323", ui-monospace, monospace;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
    --spring: cubic-bezier(0.34, 1.4, 0.64, 1);
    --gutter: clamp(16px, 3vw, 36px);
}

html[data-light="night"] {
    --bg: var(--night);
    --text: #efe8db;
    --text-2: #b7ad9c;
    --text-3: #8a8274;
    --rule: rgba(239, 232, 219, 0.16);
}

html[data-light="dusk"] {
    --bg: var(--dusk);
}

/* in the dark, the browser draws its own parts (scrollbars, the bars around
   the page) dark too */
html[data-light="night"],
html.is-film:not(.is-film-paused) {
    color-scheme: dark;
}

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

::selection {
    background: var(--accent);
    color: #fff;
}

html {
    scrollbar-gutter: stable;
    background: var(--bg);
    transition: --bg 1.2s ease, --text 1.2s ease, --text-2 1.2s ease, --text-3 1.2s ease, --rule 1.2s ease;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    min-height: 100svh;
    margin: 0;
    color: var(--text);
    background-color: var(--bg);
    font-family: var(--serif);
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: clip;
}

h1, h2, p, ol, ul, dl, dd, figure {
    margin: 0;
    padding: 0;
}

a {
    color: inherit;
}

button {
    font: inherit;
    color: inherit;
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
}

[hidden] {
    display: none !important;
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 4px;
    border-radius: 2px;
}

.filters {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

.wordmark {
    font-family: var(--mark);
    font-size: 14px;
    line-height: 1;
    white-space: nowrap;
}

.mark {
    display: inline-block;
    width: 10px;
    height: 10px;
    background: var(--accent);
}

/* -------------------------------------------------------------------- bar */

.bar {
    position: fixed;
    inset: 0 0 auto;
    z-index: 30;
    background: linear-gradient(to bottom, var(--bg) 62%, transparent);
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 56px;
    padding: 0 var(--gutter);
    pointer-events: none;
}

.bar > * {
    pointer-events: auto;
}

.bar--solid {
    background: linear-gradient(to bottom, var(--bg) 60%, transparent);
}

.bar__home {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 40px;
    text-decoration: none;
}

.bar__nav {
    display: flex;
    align-items: center;
    gap: clamp(14px, 2.4vw, 26px);
    font-size: 16px;
}

.bar__link {
    text-decoration: none;
    background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1px no-repeat;
    padding-bottom: 2px;
}

.bar__secrets {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 40px;
    font-size: 15px;
    font-variant-numeric: tabular-nums;
    color: var(--text);
    animation: secrets-in 0.9s var(--spring) both;
}

.bar__secrets .gem {
    width: 6.5px;
    height: 6.5px;
    margin: 0 1px;
    vertical-align: 0;
    /* level with the middle of the figures, not of the line */
    translate: 0 -1.5px;
}

/* nothing found yet: the zero is quiet */
.bar__secrets.is-empty {
    color: var(--text-2);
}

@keyframes secrets-in {
    from { opacity: 0; transform: translateY(-6px) scale(0.9); }
}

.bar__style {
    min-height: 40px;
    font-size: 15px;
    font-style: italic;
    color: var(--text-2);
    text-decoration: underline;
    text-decoration-color: color-mix(in srgb, currentColor 40%, transparent);
    text-underline-offset: 4px;
}

.bar__style:hover {
    color: var(--text);
}

/* the sound: a note, and on a wide screen a word saying whether it plays —
   in the same ink as everything else in the bar */
.bar__sound {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 40px;
    font-size: 16px;
    color: var(--text);
}

/* the button is only as wide as what it shows, so the bar's last word sits on
   the same line as the page's edge; a wider invisible pad keeps it easy to hit */
.bar__sound::after {
    content: "";
    position: absolute;
    inset: 0 -10px;
}

.bar__note {
    display: inline-block;
    font-size: 17px;
    line-height: 1;
    transition: color 0.3s ease;
}

/* "on" and "off" take the same room, so nothing in the bar shifts */
.bar__sound-label {
    min-width: 1.2em;
}

.bar__sound[aria-pressed="true"] .bar__note {
    color: var(--accent);
    animation: hum 1.6s ease-in-out infinite;
}

@keyframes hum {
    0%, 100% { transform: translateY(0) rotate(-8deg); }
    50% { transform: translateY(-2px) rotate(8deg); }
}




/* ------------------------------------------------------------- the story */

/* One picture that stays put and a story that scrolls past it, like any page.
   On a wide screen the room hangs on the left and the chapters read down the
   right; on a phone the room stays on top and the chapters scroll beneath. */

.story {
    display: grid;
    grid-template-columns: minmax(0, 2.1fr) minmax(320px, 1fr);
    column-gap: clamp(32px, 4vw, 72px);
    max-width: 1760px;
    margin: 0 auto;
    padding: 0 var(--gutter);
}

.screen {
    position: sticky;
    top: 0;
    align-self: start;
    display: grid;
    place-items: center;
    height: 100svh;
    padding: 64px 0 28px;
}

.stage {
    position: relative;
    width: min(100%, (100svh - 92px) * 1.6);
    aspect-ratio: 1.6;
    overflow: hidden;
    border-radius: 10px;
    background: var(--paper);
    box-shadow: 0 0 0 1px var(--rule), 0 34px 70px -40px rgba(14, 8, 2, 0.6);
    isolation: isolate;
    transition: box-shadow 1.2s ease;
}

.room {
    display: block;
    width: 100%;
    height: 100%;
}

/* the camcorder writes on its own picture: what the tape is doing, and when */
.osd {
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
    font-family: var(--tape);
    font-size: clamp(17px, 1.55vw, 25px);
    line-height: 1;
    letter-spacing: 0.06em;
    color: #fbf8f1;
    text-shadow: 0 0 1px rgba(0, 0, 0, 0.5), 0 1px 6px rgba(0, 0, 0, 0.45);
}

.osd__mode {
    position: absolute;
    left: 3.6%;
    top: 4.4%;
}

/* his words, burnt in at the bottom of the tape while he speaks */
.osd__cc {
    position: absolute;
    left: 50%;
    bottom: 11%;
    max-width: 78%;
    padding: 4px 10px 5px;
    background: rgba(10, 8, 6, 0.62);
    font-size: clamp(16px, 1.45vw, 23px);
    line-height: 1.15;
    letter-spacing: 0.03em;
    text-align: center;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.osd__cc.is-on {
    opacity: 1;
}

.osd__date {
    position: absolute;
    right: 3.6%;
    bottom: 4.4%;
    font-variant-numeric: tabular-nums;
}

.chapters {
    padding: 0 0 22svh;
    list-style: none;
}

.chapter {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 100svh;
    scroll-margin-top: var(--room-bottom, 0px);
}

.chapter__text {
    position: relative;
    display: grid;
    gap: 14px;
    max-width: 30rem;
    padding: 8px 0;
}

html.js .chapter__text {
    opacity: 0.24;
    transition: opacity 0.6s ease;
}

html.js .chapter.is-current .chapter__text {
    opacity: 1;
}

.chapter__when {
    font-family: var(--ui);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-3);
}

.chapter__year {
    font-weight: 650;
    font-variant-numeric: tabular-nums;
    color: var(--accent);
}

.chapter__line {
    font-size: clamp(24px, 0.95rem + 0.95vw, 33px);
    font-weight: 430;
    line-height: 1.2;
    letter-spacing: -0.012em;
    text-wrap: pretty;
}

.chapter__aside {
    font-size: clamp(17px, 0.95rem + 0.3vw, 20px);
    line-height: 1.5;
    color: var(--text-2);
    text-wrap: pretty;
}

/* the words that carry the chapter: the key word in bold, the punchline in
   italics, a small icon before a word, a quiet link to read more */
.chapter__line b,
.chapter__aside b {
    font-weight: 600;
    color: var(--text);
}

.chapter__aside em {
    color: var(--text);
}

.emo {
    font-size: 0.84em;
    line-height: 1;
}

/* the diamond of the twelve secrets, drawn rather than typed, so it is the
   same crisp shape on every screen (a typed ◆ comes from whatever font the
   device happens to have) */
.gem {
    display: inline-block;
    width: 0.32em;
    height: 0.32em;
    margin: 0 0.16em 0 0.14em;
    background: var(--accent);
    /* it stands like a lowercase letter: centred on the middle of the small
       letters (Newsreader's x-height is 0.441em), its points reaching the
       baseline and the top of the x */
    vertical-align: 0.061em;
    transform: rotate(45deg);
}

/* still hidden: the same diamond, drawn in outline */
.gem--empty {
    background: none;
    box-shadow: inset 0 0 0 1.25px currentColor;
}

.ref {
    color: inherit;
    text-decoration: underline 1px;
    text-decoration-color: color-mix(in srgb, currentColor 38%, transparent);
    text-underline-offset: 0.2em;
    transition: text-decoration-color 0.2s ease, color 0.2s ease;
}

.ref:hover {
    color: var(--text);
    text-decoration-color: var(--accent);
}

.chapter--hi .chapter__line {
    font-size: clamp(42px, 1.5rem + 2.4vw, 64px);
    font-weight: 400;
    line-height: 1.02;
    letter-spacing: -0.02em;
}

.chapter__link {
    margin-top: 6px;
}

.chapter__link a,
.rewind {
    font-family: var(--serif);
    font-size: 19px;
    font-style: italic;
    text-decoration: none;
    background: linear-gradient(var(--accent), var(--accent)) 0 100% / 100% 2px no-repeat;
    padding-bottom: 3px;
}

/* the last chapter: one sentence, one clear thing to do */
.chapter--hi .chapter__aside {
    max-width: 24em;
    font-size: clamp(19px, 1rem + 0.45vw, 23px);
    font-style: normal;
    line-height: 1.4;
    color: var(--text);
}

.hello {
    display: grid;
    gap: 14px;
    margin-top: 6px;
}

.hello__voice:empty {
    display: none;
}

/* the friendly name, right under the formal one */
.chapter__sub {
    margin-top: -8px;
    font-size: clamp(17px, 0.9rem + 0.35vw, 20px);
    font-style: italic;
    color: var(--text-2);
}


.chapter__secrets {
    font-family: var(--ui);
    font-size: 13px;
    color: var(--text-3);
}

.chapter__secrets:empty {
    display: none;
}

/* his voice: the same pill as "Watch it as a film" at the start, with a thin
   ring that fills as he speaks */
.voice {
    justify-self: start;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 10px 18px 10px 10px;
    border: 1px solid var(--rule);
    border-radius: 999px;
    font-family: var(--ui);
    font-size: 15px;
    color: var(--text);
    transition: border-color 0.3s ease, background-color 0.3s ease;
}

.voice:hover {
    border-color: var(--text-3);
    background: color-mix(in srgb, var(--text) 6%, transparent);
}

.voice__icon {
    position: relative;
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
}

.voice__icon .icon {
    grid-area: 1 / 1;
    width: 17px;
    height: 17px;
}

.voice__ring {
    position: absolute;
    inset: -4px;
    width: calc(100% + 8px);
    height: calc(100% + 8px);
    transform: rotate(-90deg);
    pointer-events: none;
}

.voice__ring circle {
    fill: none;
    stroke: var(--accent);
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
    opacity: 0;
    transition: stroke-dashoffset 0.25s linear, opacity 0.3s ease;
}

.voice.is-playing .voice__ring circle {
    opacity: 1;
}

.voice__time {
    font-variant-numeric: tabular-nums;
    color: var(--text-3);
}

/* drawn icons: play and pause share a spot, one shows at a time */
.icon {
    display: block;
    fill: currentColor;
}

.icon--pause,
.voice.is-playing .icon--play,
.film-ui__play:not(.is-paused) .icon--play {
    display: none;
}

.voice.is-playing .icon--pause,
.film-ui__play:not(.is-paused) .icon--pause {
    display: block;
}

.finale__cc:empty {
    display: none;
}

.finale__cc {
    min-height: 1.3em;
    margin: -4px 0 0;
    font-family: var(--tape);
    font-size: 19px;
    letter-spacing: 0.03em;
    color: #6e6153;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.finale__cc.is-on {
    opacity: 1;
}

.finale .voice {
    justify-self: center;
    color: #2b2119;
    border-color: rgba(43, 33, 25, 0.2);
}

/* -------------------------------------------------------------- the film */

.chapter__film {
    margin-top: 10px;
}

.film-start {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 10px 18px 10px 10px;
    border: 1px solid var(--rule);
    border-radius: 999px;
    font-family: var(--ui);
    font-size: 15px;
    color: var(--text);
    transition: border-color 0.3s ease, background-color 0.3s ease;
}

.film-start:hover {
    border-color: var(--text-3);
    background: color-mix(in srgb, var(--text) 6%, transparent);
}

.film-start__icon {
    display: inline-grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
}

.film-start__icon .icon {
    width: 17px;
    height: 17px;
}

.film-start__time {
    font-variant-numeric: tabular-nums;
    color: var(--text-3);
}

.film-ui {
    position: absolute;
    left: 50%;
    bottom: 4%;
    z-index: 4;
    display: none;
    align-items: center;
    gap: 12px;
    width: min(380px, 70%);
    padding: 6px 8px 6px 6px;
    border-radius: 999px;
    background: rgba(12, 10, 8, 0.58);
    color: #fbf8f1;
    font-family: var(--ui);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    transform: translateX(-50%);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

/* the controls come up a moment after the picture has started to move */
html.is-film .film-ui {
    display: flex;
    animation: film-ui-in 0.6s ease 0.25s both;
}

@keyframes film-ui-in {
    from { opacity: 0; }
}

.film-ui__play,
.film-ui__close {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    flex: none;
}

.film-ui__play {
    background: #fbf8f1;
    color: #14110e;
}

.film-ui__play .icon {
    width: 15px;
    height: 15px;
}

.film-ui__close {
    color: rgba(251, 248, 241, 0.7);
    font-size: 13px;
}

.film-ui__bar {
    flex: 1;
    height: 2px;
    background: rgba(251, 248, 241, 0.25);
    overflow: hidden;
}

.film-ui__fill {
    display: block;
    height: 100%;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: 0 50%;
}

/* his words under the picture, lighting up as he says them */
.film-subs {
    display: none;
    max-width: 34em;
    margin: 18px auto 0;
    min-height: 2.6em;
    font-size: clamp(20px, 1.1rem + 0.7vw, 30px);
    line-height: 1.3;
    letter-spacing: -0.01em;
    text-align: center;
    text-wrap: balance;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.film-subs span {
    color: var(--text-3);
    transition: color 0.35s ease;
}

.film-subs span.is-said {
    color: var(--text);
}

.film-subs.is-song {
    font-style: italic;
}

.film-subs.is-song::before {
    content: "♪ ";
    color: var(--accent);
}

html.is-film:not(.is-film-paused) .film-subs {
    display: block;
}

.film-subs.is-on {
    opacity: 1;
}

/* his age in seconds, ticking */
.ticker {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* the plan he drew at three, over the song: the camera drifts towards one
   little person, and on the line about "you" it glides there and lights it */
.film-drawing {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: grid;
    place-items: center;
    overflow: hidden;
    background: #1c130d;
    container-type: size;
    opacity: 0;
    visibility: hidden;
    transition: opacity 1.6s ease, visibility 0s linear 1.6s;
    pointer-events: none;
}

.film-drawing.is-on {
    opacity: 1;
    visibility: visible;
    transition: opacity 1.6s ease;
}

.film-drawing__paper {
    position: relative;
    width: min(100cqw, 149.06cqh);
    aspect-ratio: 2528 / 1696;
    transform-origin: var(--x) var(--y);
    transition: transform 14s cubic-bezier(0.25, 0, 0.3, 1);
}

.film-drawing.is-on .film-drawing__paper {
    transform: scale(1.06);
}

/* closer, with "you" in the middle across and the sheet still reaching the bottom */
.film-drawing.is-you .film-drawing__paper {
    transform: translate(calc(50% - var(--x)), calc((100% - var(--y)) * -0.7)) scale(1.7);
    transition: transform 5s cubic-bezier(0.45, 0, 0.2, 1);
}

.film-drawing__paper img {
    display: block;
    width: 100%;
    height: 100%;
}

.film-drawing__you,
.note__you {
    position: absolute;
    left: var(--x);
    top: var(--y);
    width: 12%;
    aspect-ratio: 1;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 234, 166, 0.9) 0%, rgba(255, 214, 128, 0.5) 36%, rgba(255, 200, 110, 0) 68%);
    transform: translate(-50%, -50%) scale(0.4);
    opacity: 0;
    transition: opacity 1.4s ease, transform 1.8s var(--spring);
}

/* and a thin ring around that one little person */
.film-drawing__you::after,
.note__you::after {
    content: "";
    position: absolute;
    inset: 16%;
    border: 1.5px solid rgba(255, 248, 228, 0.95);
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(255, 220, 140, 0.8);
}

.film-drawing.is-you .film-drawing__you,
.note__you {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    animation: you-glow 2.6s ease-in-out 1.8s infinite;
}

@keyframes you-glow {
    50% { transform: translate(-50%, -50%) scale(1.18); }
}

/* in the finale the room around him goes dark, a little more with each line;
   the light stays on him (--fx, --fy) as the camera comes closer */
.film-vignette {
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
    background: radial-gradient(circle at var(--fx, 50%) var(--fy, 42%), rgba(10, 8, 6, 0) 24%, rgba(10, 8, 6, 0.5) 58%, rgba(10, 8, 6, 0.94) 100%);
    opacity: 0;
}

/* while the film plays, the room around the picture is a dark cinema, whatever
   the hour inside it, and the bar steps out of the way */
html.is-film:not(.is-film-paused) {
    --bg: var(--cinema);
    --text: #efe8db;
    --text-2: #b7ad9c;
    --text-3: #8a8274;
    --rule: rgba(239, 232, 219, 0.14);
}

html.is-film:not(.is-film-paused) body > .bar,
html.is-film:not(.is-film-paused) body > .bar > * {
    opacity: 0;
    pointer-events: none;
}

/* Safari 26 colours its own bars from the element just inside the top of the
   page: it reads that element's plain background colour, live. This strip is
   always there and always the colour of the page, cinema included; it has to
   stay touchable, or Safari looks past it. */
.edge-tint {
    position: fixed;
    inset: 0 0 auto;
    z-index: 31;
    height: 10px;
    background-color: var(--bg);
}

body > .bar {
    transition: opacity 0.8s ease;
}

/* while it plays, the picture takes the whole stage and the text steps back */
html.is-film:not(.is-film-paused) .story {
    display: block;
    max-width: none;
}

html.is-film:not(.is-film-paused) .screen {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

html.is-film:not(.is-film-paused) .stage {
    width: min(1180px, 100%, (100svh - 230px) * 1.6);
}

/* the words leave at once, before the picture moves over them; paused, they
   fade back in */
html.is-film:not(.is-film-paused) .chapter__text {
    opacity: 0 !important;
    pointer-events: none;
    transition: none;
}

html.is-film .osd__cc {
    display: none;
}

/* a quiet nudge to start scrolling, gone once you do */
.chapter__cue {
    width: 10px;
    height: 10px;
    margin: 18px 0 0 3px;
    border-right: 1.5px solid var(--text-2);
    border-bottom: 1.5px solid var(--text-2);
    transform: rotate(45deg);
    animation: bob 1.8s ease-in-out infinite;
    transition: opacity 0.4s;
}

html.has-scrolled .chapter__cue {
    opacity: 0;
}

@keyframes bob {
    0%, 100% { transform: translateY(0) rotate(45deg); opacity: 0.45; }
    50% { transform: translateY(6px) rotate(45deg); opacity: 1; }
}

/* the foot of the page */

.site-foot {
    display: grid;
    justify-items: center;
    gap: 14px;
    padding: 64px var(--gutter) max(40px, env(safe-area-inset-bottom));
    border-top: 1px solid var(--rule);
    font-family: var(--ui);
    font-size: 14px;
    color: var(--text-2);
    text-align: center;
}

.site-foot__mark {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
}

.site-foot__links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 22px;
}

.site-foot__links a {
    text-decoration: none;
    color: var(--text);
}

.site-foot__links a:hover {
    text-decoration: underline;
}

.site-foot__style {
    font-family: var(--serif);
    font-size: 16px;
    font-style: italic;
    color: var(--text-2);
    text-decoration: underline;
    text-decoration-color: var(--rule);
    text-underline-offset: 4px;
}

.site-foot__style:hover {
    color: var(--text);
}

.site-foot__small {
    font-size: 12px;
    color: var(--text-3);
}

/* ------------------------------------------------------------- the tape */

.vhs {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0;
    background:
        repeating-linear-gradient(to bottom, rgba(255, 255, 255, 0.06) 0 2px, rgba(0, 0, 0, 0.08) 2px 4px);
    transition: opacity 0.25s;
}

.vhs::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    height: 18%;
    top: -20%;
    background: linear-gradient(to bottom, transparent, rgba(255, 255, 255, 0.28), rgba(0, 0, 0, 0.12), transparent);
}

.vhs__label {
    position: absolute;
    left: 13%;
    top: 14%;
    font-family: var(--tape);
    font-size: clamp(22px, 3.4vw, 40px);
    color: #fff;
    text-shadow: 2px 0 rgba(255, 0, 80, 0.6), -2px 0 rgba(0, 200, 255, 0.6), 0 0 8px rgba(0, 0, 0, 0.5);
    letter-spacing: 0.04em;
}

.stage.is-tape .vhs {
    opacity: 1;
}

.stage.is-tape .vhs::after {
    animation: tracking 0.5s linear infinite;
}

.stage.is-tape .room {
    animation: jitter 0.16s steps(2) infinite;
    filter: contrast(1.12) saturate(1.35) hue-rotate(-6deg);
}

.stage.is-tape .paintings {
    animation: jitter 0.16s steps(2) infinite;
    filter: contrast(1.12) saturate(1.35) hue-rotate(-6deg);
}

.stage.is-tape.is-play .paintings {
    animation: none;
    filter: none;
}

.stage.is-tape.is-play .room {
    animation: none;
    filter: none;
}

.stage.is-tape.is-play .vhs::after {
    animation: none;
    opacity: 0;
}

@keyframes tracking {
    from { top: -20%; }
    to { top: 110%; }
}

@keyframes jitter {
    0% { transform: translate(0, 0); }
    50% { transform: translate(-3px, 1px); }
    100% { transform: translate(2px, -1px); }
}

/* ------------------------------------------------------------ secrets */

.secrets {
    position: fixed;
    top: 58px;
    right: var(--gutter);
    z-index: 40;
    width: min(340px, calc(100vw - 32px));
    max-height: min(72vh, 580px);
    overflow: auto;
    padding: 18px 20px 16px;
    border-radius: 14px;
    background: #fffdf7;
    color: #2b2119;
    box-shadow: 0 0 0 1px rgba(43, 33, 25, 0.08), 0 2px 8px rgba(20, 10, 0, 0.08), 0 24px 60px -24px rgba(20, 10, 0, 0.55);
    transform-origin: calc(100% - 40px) -8px;
    animation: panel-in 0.4s var(--spring);
}

@keyframes panel-in {
    from { opacity: 0; transform: translateY(-6px) scale(0.96); }
}

.secrets__title {
    margin: 0 0 12px;
    font-family: var(--ui);
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #7a6d60;
}

.secrets__list {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 15px;
    line-height: 1.35;
}

.secrets__list li {
    display: grid;
    grid-template-columns: 18px 1fr;
    gap: 6px;
}

.secrets__list b {
    font-weight: 600;
}

.secrets__mark {
    color: #b3a796;
}

.secrets__mark .gem {
    width: 6px;
    height: 6px;
    margin: 0 0 0 2px;
    vertical-align: 0.02em;
}

.secrets__hidden,
.secrets__hint {
    font-style: italic;
    color: #9b8e7e;
}

.secrets__hint {
    margin: 12px 0 0;
    font-size: 13px;
}






/* a secret, found: a quiet paper card drops in under the bar — the same
   paper as the notes — and the twelve marks along its foot fill up */
.toast {
    position: fixed;
    top: 68px;
    left: 50%;
    z-index: 45;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: max-content;
    min-width: 240px;
    max-width: min(360px, calc(100vw - 32px));
    padding: 15px 26px 16px;
    border-radius: 16px;
    background: #fffdf7;
    color: #2b2119;
    text-align: center;
    box-shadow: 0 0 0 1px rgba(43, 33, 25, 0.08), 0 2px 8px rgba(20, 10, 0, 0.08), 0 26px 50px -26px rgba(20, 10, 0, 0.5);
    transform: translate(-50%, -12px);
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.5s var(--spring);
    pointer-events: none;
}

.toast.is-shown {
    opacity: 1;
    transform: translate(-50%, 0);
}

/* a secret found during the film arrives as part of the dark cinema */
html.is-film:not(.is-film-paused) .toast {
    background: #1b1815;
    color: #efe8db;
    box-shadow: 0 0 0 1px rgba(239, 232, 219, 0.1), 0 26px 50px -26px rgba(0, 0, 0, 0.8);
}

html.is-film:not(.is-film-paused) .toast__line {
    color: #b7ad9c;
}

html.is-film:not(.is-film-paused) .toast__progress i:not(.is-found) {
    background: rgba(239, 232, 219, 0.18);
}

.toast__kicker {
    font-family: var(--ui);
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #9b8e7e;
}

.toast__kicker b {
    font-weight: 700;
    color: var(--accent);
}

.toast__name {
    margin-top: 10px;
    font-size: 21px;
    line-height: 1.15;
    letter-spacing: -0.005em;
}

.toast__line {
    margin-top: 5px;
    font-size: 15px;
    font-style: italic;
    line-height: 1.4;
    color: #6e6153;
    text-wrap: balance;
}

.toast__line:only-child {
    margin: 0;
}

/* the card that hangs from the sound button, the first time it plays */

.toast__progress {
    display: flex;
    gap: 4px;
    margin-top: 13px;
}

.toast__progress i {
    width: 12px;
    height: 2px;
    border-radius: 1px;
    background: rgba(43, 33, 25, 0.14);
}

.toast__progress i.is-found {
    background: var(--accent);
}

.toast__progress i.is-new {
    transform-origin: left center;
    animation: mark-in 0.7s var(--ease) 0.35s both;
}

@keyframes mark-in {
    from { transform: scaleX(0); }
}

.finale {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(12, 10, 8, 0.72);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.finale.is-shown {
    opacity: 1;
}

.finale__card {
    display: grid;
    justify-items: center;
    gap: 14px;
    width: min(520px, 100%);
    padding: clamp(28px, 6vw, 48px) clamp(20px, 5vw, 44px);
    background: #fffdf7;
    color: #2b2119;
    text-align: center;
    transform: translateY(14px) scale(0.98);
    transition: transform 0.6s var(--spring);
}

.finale.is-shown .finale__card {
    transform: none;
}

.finale__mark {
    margin: 0;
    line-height: 1;
}

.finale__mark .gem {
    width: 8px;
    height: 8px;
    margin: 0 7px;
    vertical-align: middle;
}

.finale__title {
    margin: 0;
    font-size: clamp(30px, 5vw, 42px);
    font-weight: 380;
    font-style: italic;
}

.finale__text {
    margin: 0;
    font-size: 18px;
    line-height: 1.45;
    color: #6e6153;
}

.finale__cta {
    margin-top: 6px;
    font-size: 20px;
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: var(--accent);
    text-decoration-thickness: 2px;
    text-underline-offset: 5px;
}

.finale__subject {
    margin: 0;
    font-size: 14px;
    color: #9b8e7e;
}

.finale__share {
    margin: 0;
    font-size: 14px;
}

.finale__share a {
    color: #6e6153;
}

.finale__close {
    margin-top: 4px;
    font-size: 15px;
    font-style: italic;
    color: #6e6153;
}

.caption .beat__secrets {
    margin: 10px 0 0;
    font-size: 14px;
    font-style: italic;
    color: var(--text-3);
}

.rewind {
    font-size: 18px;
    font-style: italic;
    background: linear-gradient(var(--accent), var(--accent)) 0 100% / 100% 2px no-repeat;
    padding-bottom: 2px;
}

/* the end of the tape */

.stage.is-end .vhs {
    opacity: 1;
    background:
        repeating-linear-gradient(to bottom, rgba(255, 255, 255, 0.05) 0 2px, rgba(0, 0, 0, 0.1) 2px 4px),
        #1f39b5;
    transition: opacity 1.2s ease;
}

.stage.is-end .vhs__label {
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    animation: no-signal 2.4s steps(1) infinite;
}

@keyframes no-signal {
    0%, 92% { opacity: 1; }
    94% { opacity: 0.2; }
    96% { opacity: 1; }
}

/* ------------------------------------------------- the painted version */

.paintings {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

/* the sketches replace the paintings once they have arrived */
html[data-style="ink"].sketch-ready .paintings,
html[data-style="ink"].sketch-ready .poster {
    display: none;
}

.paintings__scene {
    position: absolute;
    left: 0;
    top: 0;
    width: 960px;
    height: 600px;
    transform-origin: 0 0;
}

/* the paintings (and the poster the page opens on) show their tiny preview at
   once, and sharpen when the real picture arrives */
.paintings img,
.poster {
    position: absolute;
    object-fit: cover;
    background-size: cover;
    background-position: center;
}

/* the next painting fades in on top of the last one, which stays whole until
   it is covered — no dip in the middle of the change */
.paintings img {
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    opacity: 0;
    transition: opacity 0s linear 0.9s;
}

.paintings img.is-on {
    z-index: 2;
    opacity: 1;
    transition: opacity 0.9s ease;
}

.paintings img.is-on.is-under {
    z-index: 1;
}

/* the poster sits above the live paintings and under the drawing's living
   details, by order alone */
.poster {
    max-width: none;
    transition: opacity 0.6s ease;
}

.poster.is-leaving {
    opacity: 0;
}

.room {
    position: relative;
}

/* with paintings, the drawing keeps only its living details: the game on the
   wall, the counter, the board, the things to touch */
html[data-style="paint"] .stage.is-painted .room :is(.wash-layer, .ink-layer, .grain, .fx-slides, .tint, .lamp-glow),
html:not(.sketch-ready) .stage.is-painted .room :is(.wash-layer, .ink-layer, .grain, .fx-slides, .tint, .lamp-glow) {
    visibility: hidden;
}

html .stage.is-painted .room .keep :is(.wash-layer, .ink-layer) {
    visibility: visible;
}

/* the redacted entry, and the drawer page */

.redacted {
    color: var(--text);
    letter-spacing: -0.06em;
    user-select: none;
}

.entry--redacted .entry__icon {
    color: var(--accent);
}

.entry--redacted .entry__premise {
    font-style: italic;
}

.drawer {
    text-align: left;
}

.drawer__mark {
    margin: 0 0 18px;
    font-size: 28px;
    color: var(--accent);
}

.drawer__mark--tape {
    font-family: var(--tape);
    font-size: 30px;
    letter-spacing: 0.06em;
}

.drawer__back a {
    font-size: 18px;
    font-style: italic;
}

/* ----------------------------------------------------------- the notes */

/* a little card that points at what you touched */
.note {
    position: fixed;
    z-index: 12;
    width: max-content;
    max-width: min(280px, calc(100vw - 32px));
    padding: 12px 16px 13px;
    border-radius: 12px;
    background: #fffdf7;
    color: #2b2119;
    box-shadow: 0 0 0 1px rgba(43, 33, 25, 0.08), 0 2px 6px rgba(20, 10, 0, 0.08), 0 18px 40px -16px rgba(20, 10, 0, 0.45);
    font-size: 16px;
    font-style: italic;
    line-height: 1.4;
    text-align: center;
    text-wrap: balance;
    transform-origin: calc(50% + var(--caret, 0px)) calc(100% + 10px);
    transform: translate(-50%, calc(-100% - 18px)) scale(0.9);
    opacity: 0;
    transition: opacity 0.25s ease, transform 0.45s var(--spring);
    pointer-events: none;
}

.note::after {
    content: "";
    position: absolute;
    left: calc(50% + var(--caret, 0px));
    bottom: -6px;
    width: 12px;
    height: 12px;
    background: inherit;
    border-radius: 0 0 3px 0;
    box-shadow: 1px 1px 0 rgba(43, 33, 25, 0.06);
    transform: translateX(-50%) rotate(45deg);
}

.note.is-below {
    transform-origin: calc(50% + var(--caret, 0px)) -10px;
    transform: translate(-50%, 30px) scale(0.9);
}

.note.is-below::after {
    top: -6px;
    bottom: auto;
    border-radius: 3px 0 0 0;
    box-shadow: -1px -1px 0 rgba(43, 33, 25, 0.06);
}

.note.has-picture {
    max-width: min(300px, calc(100vw - 32px));
    padding-top: 10px;
}

.note__picture {
    position: relative;
    display: block;
    width: min(268px, calc(100vw - 64px));
    aspect-ratio: 2528 / 1696;
    margin: 0 auto 10px;
    overflow: hidden;
    border-radius: 6px;
    background: #1c130d;
}

.note__picture img {
    display: block;
    width: 100%;
    height: 100%;
}

.note__you {
    width: 16%;
}

.note.is-shown {
    opacity: 1;
    transform: translate(-50%, calc(-100% - 18px));
}

.note.is-shown.is-below {
    transform: translate(-50%, 30px);
}





/* ------------------------------------------------------------- the room */

.room .ink {
    fill: none;
    stroke: var(--ink);
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.room .ink--thin { stroke-width: 1.2; }
.room .ink--bold { stroke-width: 2.8; }
.room .ink--hair { stroke-width: 0.8; stroke-opacity: 0.5; }
.room .ink--hair-line { stroke-width: 0.9; stroke-opacity: 0.75; }
.room .ink--glasses { stroke: #3a2418; stroke-width: 2.1; }
.room .ink--olive { stroke: #4d5a2c; stroke-width: 2.6; }
.room .ink--stripe { stroke: #8aa6c8; stroke-width: 1.5; stroke-opacity: 0.55; }
.room .ink--red { stroke: #d65a46; stroke-width: 2.2; }
.room .ink--blue { stroke: #3b6fd0; stroke-width: 1.8; }
.room .ink--light { stroke: rgba(255, 255, 255, 0.75); stroke-width: 1; }
.room .ink--limb { stroke-width: 15; }
.room .limb-fill { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.room .ink-fill { fill: var(--ink); }

.room .ink-text {
    fill: var(--ink);
    font-family: var(--serif);
    font-size: 10px;
}

.room .ink-text--tiny { font-size: 6.5px; font-weight: 600; }
.room .ink-text--small { font-size: 9px; font-style: italic; }
.room .ink-text--light { fill: #fbf9f4; }
.room .ink-text--stamp { font-size: 8px; font-weight: 600; letter-spacing: 0.08em; fill: #6b3b2a; }
.room .ink-text--hand { font-size: 10px; font-style: italic; }
.room .ink-text--block { font-size: 11px; font-weight: 600; }
.room .counter { font-family: var(--tape); font-size: 11px; fill: #62b83a; }
.room .chalk text { fill: #f1efe6; font-family: var(--serif); font-style: italic; font-size: 15px; }
.room .chalk-line { fill: none; stroke: #f1efe6; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* line boil: each character is drawn three times, shown one after another */
.room .boil__frame {
    opacity: 0;
}

.room .boil__frame:first-child {
    opacity: 1;
}

.room .obj.on .boil__frame {
    animation: boil 0.51s step-end infinite;
}

.room .obj.on .boil__frame:nth-child(2) { animation-delay: -0.34s; }
.room .obj.on .boil__frame:nth-child(3) { animation-delay: -0.17s; }

@keyframes boil {
    0% { opacity: 1; }
    33.333%, 100% { opacity: 0; }
}

.room .grain {
    pointer-events: none;
}

/* things come and go */

.room .obj {
    opacity: 0;
    transition: opacity 0.75s ease;
}

.room .obj.on {
    opacity: 1;
}

.room .gone {
    display: none;
}

.room .obj[data-anim="pop"] {
    transform: translateY(12px) scale(0.94);
    transition: opacity 0.6s ease, transform 0.9s var(--spring);
}

.room .obj[data-anim="pop"].on {
    transform: none;
}

.room.is-instant .obj,
.room.is-instant .tint,
.room.is-instant .lamp-glow {
    transition: none !important;
}

/* light */

.room .tint {
    pointer-events: none;
    opacity: 0;
    transition: opacity 1.4s ease;
}

.room[data-light="night"] .tint--night { opacity: 1; }
.room[data-light="night"] .tint--sky { opacity: 0.14; }
.room[data-light="dusk"] .tint--dusk { opacity: 0.17; }

.room .lamp-glow {
    pointer-events: none;
    opacity: 0;
    transition: opacity 1.4s ease;
}

.room[data-light="night"] .lamp-glow { opacity: 1; }

/* things that move, only while their beat is on */

.room .fx {
    animation-play-state: paused;
}

.room .obj.on .fx {
    animation-play-state: running;
}

.room .fx-snow circle {
    animation: snow 6s linear infinite;
    animation-play-state: inherit;
}

@keyframes snow {
    from { transform: translateY(-40px); }
    to { transform: translateY(260px); }
}

.room .fx-rain path {
    animation: rain 0.9s linear infinite;
    animation-play-state: inherit;
}

@keyframes rain {
    from { transform: translate(6px, -60px); opacity: 0; }
    20% { opacity: 1; }
    to { transform: translate(-14px, 220px); opacity: 0.6; }
}

.room .fx-slides .slide {
    opacity: 0;
    animation: slides 8.4s ease-in-out infinite;
    animation-play-state: inherit;
}

@keyframes slides {
    0%, 30% { opacity: 1; }
    36%, 94% { opacity: 0; }
    100% { opacity: 1; }
}

.room .fx-plane {
    animation: plane 7s linear infinite;
}

@keyframes plane {
    from { transform: translate(-60px, 20px); }
    to { transform: translate(300px, -30px); }
}

.room .fx-twinkle circle {
    animation: twinkle 3.4s ease-in-out infinite;
    animation-play-state: inherit;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.2; }
    50% { opacity: 1; }
}

/* the sky fills up with stars, one at a time */
.room .fx-stars circle {
    opacity: 0;
}

.room .obj.on .fx-stars circle {
    opacity: var(--o, 1);
    animation: star-in 1.6s ease backwards;
}

@keyframes star-in {
    from { opacity: 0; }
}

/* his foot keeps time: tap, tap, rest */
.room .obj.foot.on {
    transform-origin: 580px 541px;
    animation: tap 3.6s ease-in-out infinite;
}

@keyframes tap {
    0%, 56%, 100% { transform: none; }
    62% { transform: rotate(-11deg); }
    68% { transform: none; }
    74% { transform: rotate(-11deg); }
    80% { transform: none; }
}

.room .fx-blink circle {
    animation: blink 0.8s steps(2) infinite;
    animation-play-state: inherit;
}

@keyframes blink {
    50% { opacity: 0.15; }
}

.room .fx-notify > g {
    opacity: 0;
    animation: notify 2.6s ease-out infinite;
    animation-play-state: inherit;
}

@keyframes notify {
    0% { opacity: 0; transform: translateY(14px); }
    15% { opacity: 1; }
    100% { opacity: 0; transform: translateY(-70px); }
}

.room .fx-confetti rect {
    animation: confetti 3.2s linear infinite;
    animation-play-state: inherit;
}

@keyframes confetti {
    from { transform: translateY(-10px) rotate(0deg); }
    to { transform: translateY(470px) rotate(540deg); }
}

.room .fx-mobile {
    animation: mobile 5s ease-in-out infinite;
}

@keyframes mobile {
    0%, 100% { transform: rotate(-6deg); }
    50% { transform: rotate(6deg); }
}

.room .fx-glow-box {
    animation: glow-box 2s ease-in-out infinite;
}

@keyframes glow-box {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

/* secrets: invisible until touched, outlined only in cheat mode */

.room .secret {
    pointer-events: none;
}

.room .secret.on {
    pointer-events: auto;
    cursor: pointer;
}

.room .secret__hit {
    fill: transparent;
}

.room.is-hinting .secret.on .secret__hit {
    fill: none;
    stroke: var(--accent);
    stroke-width: 1.6;
    stroke-dasharray: 3 4;
    animation: hint 0.9s linear infinite;
}

@keyframes hint {
    to { stroke-dashoffset: -14; }
}

/* the star on the spire says HI in Morse: ···· ·· */
.room .fx-morse {
    opacity: 0;
    animation: morse 5s step-end infinite;
    animation-play-state: inherit;
}

@keyframes morse {
    0% { opacity: 0.95; }
    5% { opacity: 0; }
    10% { opacity: 0.95; }
    15% { opacity: 0; }
    20% { opacity: 0.95; }
    25% { opacity: 0; }
    30% { opacity: 0.95; }
    35% { opacity: 0; }
    50% { opacity: 0.95; }
    55% { opacity: 0; }
    60% { opacity: 0.95; }
    65%, 100% { opacity: 0; }
}

.room.has-key .key {
    display: none;
}

.room [data-n="drawer"] {
    transition: opacity 0.75s ease, transform 0.9s var(--spring);
}

.room.is-drawer-open [data-n="drawer"] {
    transform: translateY(14px);
}

.room:not(.is-drawer-open) .drawer-paper {
    display: none;
}

.room .obj.wave.on {
    transform-origin: 470px 344px;
    animation: wave 2.6s ease-in-out infinite;
}

@keyframes wave {
    0%, 52%, 100% { transform: none; }
    12% { transform: rotate(14deg); }
    24% { transform: rotate(-8deg); }
    36% { transform: rotate(12deg); }
}

.room .obj.on .chalk text {
    animation: chalk-in 0.9s ease backwards;
}

.room .obj.on .chalk text:nth-child(1) { animation-delay: 0.5s; }
.room .obj.on .chalk text:nth-child(2) { animation-delay: 1.1s; }
.room .obj.on .chalk text:nth-child(3) { animation-delay: 1.7s; }
.room .obj.on .chalk text:nth-child(4) { animation-delay: 2.3s; }
.room .obj.on .chalk text:nth-child(5) { animation-delay: 3.4s; }

@keyframes chalk-in {
    from { opacity: 0; }
}

.room .chalk-line {
    stroke-dasharray: 1 1;
}

.room .obj.on .chalk-line {
    animation: chalk-draw 1.3s ease 2.6s backwards;
}

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

.room .chalk .chalk__small {
    font-size: 8.5px;
    font-style: italic;
    fill: #d9d4c4;
}

html[data-beat="hard-years"] .room .lamp-glow {
    animation: flicker 7s steps(1) infinite;
}

@keyframes flicker {
    0%, 61%, 64%, 66%, 100% { opacity: 1; }
    62% { opacity: 0.55; }
    65% { opacity: 0.75; }
}

/* touchable things */

.room .hot {
    opacity: 0;
    pointer-events: none;
    cursor: pointer;
    transition: opacity 0.5s ease 0.9s;
}

.room .hot.on {
    opacity: 1;
    pointer-events: auto;
}

/* the film is for watching: the hints to touch wait for the pause */
html.is-film:not(.is-film-paused) .room .hot.on {
    opacity: 0;
    pointer-events: none;
}

.room .hot__hit {
    fill: transparent;
}

.room .hot:focus {
    outline: none;
}

.room .hot__ring {
    fill: none;
    stroke: var(--accent);
    stroke-width: 1.4;
    transform-box: fill-box;
    transform-origin: center;
    animation: ping 2.4s ease-out infinite;
}

.room .hot__dot {
    fill: var(--accent);
    stroke: #fffdf7;
    stroke-width: 1.2;
}

.room .hot:hover .hot__dot {
    transform-box: fill-box;
    transform-origin: center;
    transform: scale(1.5);
}

@keyframes ping {
    0% { transform: scale(0.6); opacity: 1; }
    100% { transform: scale(1.8); opacity: 0; }
}

/* ------------------------------------------------------------------ lab */

.lab-page {
    scroll-snap-type: none;
}

.lab {
    width: min(760px, calc(100% - 40px));
    margin: 0 auto;
    padding: clamp(100px, 15vh, 150px) 0 110px;
}

.lab__title {
    font-size: clamp(48px, 8vw, 88px);
    font-weight: 380;
    font-style: italic;
    line-height: 0.95;
    letter-spacing: -0.02em;
}

.lab__lede {
    max-width: 34ch;
    text-wrap: pretty;
    margin-top: 22px;
    font-size: clamp(20px, 1.1rem + 0.6vw, 25px);
    line-height: 1.4;
    color: var(--text-2);
}

.lab__group {
    margin-top: clamp(56px, 9vh, 88px);
}

.lab__group-title {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--rule);
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.lab__count {
    font-style: italic;
    font-weight: 380;
    letter-spacing: 0;
    text-transform: none;
    color: var(--text-3);
}

.live {
    width: 8px;
    height: 8px;
    background: var(--accent);
    transform: rotate(14deg);
}

.entries {
    list-style: none;
}

.entry {
    border-bottom: 1px solid var(--rule);
    scroll-margin-top: 90px;
}

.entry summary,
.entry__summary {
    display: grid;
    gap: 4px;
    padding: 16px 0 17px;
    list-style: none;
    cursor: pointer;
}

.entry__summary {
    cursor: default;
}

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

.entry summary::-webkit-details-marker {
    display: none;
}

.entry__line {
    display: flex;
    align-items: baseline;
    gap: 12px;
    font-size: clamp(20px, 1.1rem + 0.5vw, 24px);
}

.entry__icon {
    flex: 0 0 auto;
    width: 1.3em;
    font-size: 0.86em;
}

.entry__name {
    flex: 0 0 auto;
    font-weight: 520;
}

.entry__dots {
    flex: 1 1 auto;
    min-width: 20px;
    height: 1px;
    background: linear-gradient(to right, rgba(43, 33, 25, 0.35) 30%, transparent 0) 0 0 / 6px 1.5px repeat-x;
    transform: translateY(-0.28em);
}

.entry__year {
    flex: 0 0 auto;
    font-size: 0.78em;
    font-style: italic;
    color: var(--text-2);
    font-variant-numeric: tabular-nums;
}

.entry__premise {
    padding-left: calc(1.3em * 0.86 + 12px + 0.1em);
    font-size: 17px;
    line-height: 1.45;
    color: var(--text-2);
}

.entry details[open] summary .entry__name,
.entry summary:hover .entry__name {
    text-decoration: underline;
    text-decoration-color: var(--accent);
    text-decoration-thickness: 2px;
    text-underline-offset: 4px;
}

.entry__more {
    display: grid;
    gap: 12px;
    padding: 0 0 22px calc(1.3em * 0.86 + 12px + 0.1em);
    font-size: 16px;
    line-height: 1.55;
    color: var(--text-2);
}

.entry__inside {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 6px 14px;
}

.entry__inside dt {
    font-style: italic;
    color: var(--text);
}

.entry__form {
    font-size: 14px;
    font-style: italic;
    color: var(--text-3);
}

.entry__link a {
    color: var(--text);
    text-decoration: underline;
    text-decoration-color: var(--accent);
    text-underline-offset: 4px;
}

.entry.is-target {
    animation: target 2.4s ease;
}

@keyframes target {
    0%, 30% { background: color-mix(in srgb, var(--accent) 12%, transparent); }
    100% { background: transparent; }
}

.lab__group--earlier .entry__line {
    color: var(--text-2);
}

.lab__ps {
    margin-top: 22px;
    font-size: 17px;
    font-style: italic;
    color: var(--text-3);
}

/* ------------------------------------------------- the Lab, in the room */

html.is-lab {
    overflow: hidden;
}

.lab-scrim {
    position: fixed;
    inset: 0;
    z-index: 48;
    background: rgba(10, 8, 6, 0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

html.is-lab .lab-scrim {
    opacity: 1;
    pointer-events: auto;
}

/* the Lab is always daylight paper, whatever the hour in the room */
.lab-sheet {
    color-scheme: light;
    --bg: #f4eee3;
    --text: #2b2119;
    --text-2: #6e6153;
    --text-3: #9b8e7e;
    --rule: rgba(43, 33, 25, 0.16);
    position: fixed;
    inset: 0;
    z-index: 50;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: var(--bg);
    color: var(--text);
    box-shadow: -40px 0 80px -40px rgba(0, 0, 0, 0.55);
    transform: translateX(100%);
    visibility: hidden;
    transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1), visibility 0s linear 0.6s;
    outline: none;
}

html.is-lab .lab-sheet {
    transform: none;
    visibility: visible;
    transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1), visibility 0s;
}

.lab-sheet .bar {
    position: sticky;
    top: 0;
    pointer-events: auto;
}

.lab-sheet .lab {
    padding-top: clamp(36px, 8vh, 90px);
}

.lab-sheet .lab__title:focus {
    outline: none;
}

/* ------------------------------------------------------------ on the desk */

.desk {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
    gap: 16px;
    margin-top: 22px;
}

.desk__card {
    display: grid;
    align-content: start;
    gap: 12px;
    padding: 22px 24px 26px;
    border-radius: 18px;
    background: #fffdf7;
    box-shadow: 0 0 0 1px rgba(43, 33, 25, 0.08), 0 22px 44px -32px rgba(20, 10, 0, 0.5);
    scroll-margin-top: 90px;
}

/* the one nobody is allowed to talk about yet */
.desk__card--secret {
    --text-2: #b7ad9c;
    --text-3: #8a8274;
    background: radial-gradient(120% 90% at 100% 0%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 60%), #121a2e;
    color: #efe8db;
    box-shadow: 0 0 0 1px rgba(239, 232, 219, 0.08), 0 26px 50px -28px rgba(0, 0, 0, 0.7);
}

.desk__meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-family: var(--ui);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-3);
}

.desk__name {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-top: 6px;
    font-size: clamp(30px, 1.5rem + 1vw, 40px);
    font-weight: 420;
    line-height: 1;
    letter-spacing: -0.015em;
}

.desk__icon {
    font-size: 0.62em;
}

.desk__premise {
    font-size: 19px;
    line-height: 1.38;
    text-wrap: pretty;
}

.desk__more {
    font-size: 16px;
    line-height: 1.55;
    color: var(--text-2);
    text-wrap: pretty;
}

.desk__card.is-target {
    animation: target 2.4s ease;
}

.desk__link {
    margin-top: 4px;
    font-family: var(--ui);
    font-size: 14px;
    font-weight: 500;
}

.desk__link a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 14px 9px 16px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--accent) 16%, transparent);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent);
    color: inherit;
    text-decoration: none;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.desk__link a:hover {
    background: color-mix(in srgb, var(--accent) 28%, transparent);
    box-shadow: inset 0 0 0 1px var(--accent);
}

/* ------------------------------------------------- the empty slot, No. 24 */

.next {
    display: grid;
    justify-items: start;
    gap: 12px;
    margin-top: clamp(56px, 9vh, 88px);
    padding: clamp(24px, 4vw, 34px) clamp(22px, 4vw, 36px) clamp(26px, 4vw, 34px);
    border: 1.5px dashed color-mix(in srgb, var(--text) 26%, transparent);
    border-radius: 18px;
    transition: border-color 0.4s ease, background-color 0.4s ease;
}

.next:hover {
    border-color: var(--accent);
    background: color-mix(in srgb, var(--accent) 4%, transparent);
}

.next__no {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-family: var(--tape);
    font-size: 22px;
    line-height: 1;
    letter-spacing: 0.06em;
    color: var(--text-3);
}

/* someone is about to type its name */
.next__caret {
    width: 0.5em;
    height: 0.9em;
    background: var(--accent);
    animation: caret 1.05s steps(1) infinite;
}

@keyframes caret {
    50% { opacity: 0; }
}

.next__title {
    font-size: clamp(26px, 1.2rem + 1.2vw, 36px);
    font-weight: 420;
    line-height: 1.12;
    letter-spacing: -0.012em;
    text-wrap: balance;
}

.next__text {
    max-width: 34em;
    font-size: 18px;
    line-height: 1.5;
    color: var(--text-2);
    text-wrap: pretty;
}

.next__cta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 18px;
    margin-top: 8px;
}

.next__pitch {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px 10px 10px;
    border-radius: 999px;
    background: var(--text);
    color: var(--bg);
    font-family: var(--ui);
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
    transition: transform 0.3s var(--spring);
}

.next__pitch:hover {
    transform: translateY(-1px);
}

.next__arrow {
    display: inline-grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-size: 14px;
    transition: transform 0.3s var(--spring);
}

.next__pitch:hover .next__arrow {
    transform: translateX(3px);
}

.next__mail {
    font-size: 16px;
    font-style: italic;
    color: var(--text-2);
    text-decoration: underline;
    text-decoration-color: var(--rule);
    text-underline-offset: 4px;
}

.next__mail:hover {
    color: var(--text);
}

/* ---------------------------------------------------------------- mobile */

@media (max-width: 860px), (max-aspect-ratio: 1/1) {
    /* the room starts under the bar, where it will stay, so the first chapter
       begins below the picture instead of sliding under it */
    .story {
        display: block;
        padding: 56px 16px 0;
    }

    /* the picture sits right under the bar, so nothing may show between them */
    .bar {
        background: var(--bg);
    }


    .screen {
        top: 56px;
        z-index: 5;
        height: auto;
        padding: 0 0 12px;
        background: var(--bg);
    }

    .stage {
        width: 100%;
        height: min(50svh, (100vw - 32px) / 0.84);
        aspect-ratio: auto;
        border-radius: 8px;
    }

    .chapter {
        min-height: var(--below-room, 46svh);
    }

    html.is-film:not(.is-film-paused) .stage {
        width: 100%;
    }

    .film-subs {
        margin-top: 14px;
        font-size: 21px;
    }

    .chapter__text {
        gap: 10px;
        max-width: none;
    }

    .chapter__line {
        font-size: 23px;
    }

    .bar__sound-label {
        display: none;
    }

    /* on a phone, found secrets announce themselves at the bottom, away from
       the room and the notes in it */
    .toast {
        top: auto;
        bottom: max(18px, env(safe-area-inset-bottom));
        transform: translate(-50%, 14px);
    }

    .chapter__aside {
        font-size: 17px;
    }

    .chapter--hi .chapter__line {
        font-size: 40px;
    }

    .entry__premise,
    .entry__more {
        padding-left: 0;
    }
}

/* -------------------------------------------------------- reduced motion */

@media (prefers-reduced-motion: reduce) {
    .chapter__cue,
    .next__caret,
    .bar__note,
    .room .chalk text,
    .room .chalk-line,
    .room .fx,
    .room .fx *,
    .room .foot,
    .room .wave,
    .room .lamp-glow,
    .room .boil__frame,
    .room .hot__ring,
    .bar__sound .bar__note,
    .film-drawing__you,
    .note__you {
        animation: none !important;
    }

    .film-drawing__paper,
    .film-drawing.is-on .film-drawing__paper,
    .film-drawing.is-you .film-drawing__paper {
        transform: none;
        transition: none;
    }

    html.js .chapter__text {
        transition: none;
    }

    .lab-sheet,
    html.is-lab .lab-sheet,
    .lab-scrim {
        transition: none;
    }

    ::view-transition-old(root),
    ::view-transition-new(root) {
        animation: none;
    }
}
