/*
 * overlord-app.com: the app's own look, carried over. Dark forest, VT323
 * pixel lettering, parchment scrolls with ink and sealing wax, red cloth
 * banners on wooden poles (src/components/scroll/ in the app).
 */

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

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

:root {
    --bg: #0a120c;
    --bg-deep: #050806;
    --ink: #e8efe4;
    --mute: #a7b5a8;
    --line: rgba(190, 210, 180, 0.28);
    --accent: #3f8f6b;

    /* Parchment (src/components/scroll/parchment.css) */
    --p-ink: #3b2412;
    --p-ink-soft: #7a5a36;
    --p-ink-faint: rgba(59, 36, 18, 0.35);
    --wax: #7d2a17;
    --wax-dark: #55190c;
    --vellum: #f6ead0;
    --vellum-shade: #d9c08a;

    /* Cloth banners and wood (TitleBanner.vue) */
    --outline: #2a1208;
    --wood: #83502a;
    --wood-light: #b0713f;
    --wood-dark: #57321b;
    --rope: #c9a56a;
    --cloth: #8c2a1a;
    --cloth-light: #a8402a;
    --cloth-fold: #6e1f13;
    --trim: #d9a441;
    --trim-light: #f2cf6b;

    --pixel: "VT323", "SF Mono", Menlo, monospace;
    --mono: ui-monospace, SFMono-Regular, Menlo, monospace;

    color-scheme: dark;
    font-family: var(--pixel);
    font-size: 21px;
    line-height: 1.25;
    color: var(--ink);
    background: var(--bg-deep);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(ellipse at 50% 0%, rgba(63, 143, 107, 0.08), transparent 60%),
        var(--bg-deep);
}

img {
    image-rendering: pixelated;
}

a {
    color: var(--trim-light);
    text-underline-offset: 3px;
}

a:hover {
    color: #fff3c4;
}

:focus-visible {
    outline: 3px solid var(--trim-light);
    outline-offset: 3px;
}

code,
pre {
    font-family: var(--mono);
    font-size: 0.72rem;
}

.skip-link {
    position: absolute;
    left: 12px;
    top: -60px;
    z-index: 100;
    padding: 6px 12px;
    background: var(--vellum);
    color: var(--p-ink);
}

.skip-link:focus {
    top: 12px;
}

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

.topbar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 14px clamp(16px, 4vw, 40px);
    pointer-events: none;
}

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

.topbar.is-solid {
    position: sticky;
    background: rgba(5, 8, 6, 0.94);
    border-bottom: 3px solid #1b2a1f;
    backdrop-filter: blur(4px);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 1.6rem;
    color: #fbf0cc;
    text-decoration: none;
    text-shadow: 3px 3px 0 #000;
}

.brand img {
    width: 34px;
    height: 34px;
}

.topnav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 22px;
    font-size: 1.25rem;
}

.topnav a {
    color: #e8dcc0;
    text-decoration: none;
    text-shadow: 2px 2px 0 #000;
}

.topnav a:hover,
.topnav a[aria-current="page"] {
    color: var(--trim-light);
    text-decoration: underline;
}

/* ---------- Buttons: chunky ink blocks; the main one is sealing wax ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 46px;
    padding: 4px 20px;
    border: 3px solid var(--p-ink);
    background: #f1e2b6;
    color: var(--p-ink);
    font: inherit;
    font-size: 1.35rem;
    line-height: 1;
    text-decoration: none;
    box-shadow: inset -3px -3px 0 #cdaf72, 4px 4px 0 rgba(0, 0, 0, 0.45);
    cursor: pointer;
}

.btn:hover {
    background: #fbf0cc;
    color: var(--p-ink);
}

.btn:active {
    box-shadow: inset 3px 3px 0 #cdaf72;
    transform: translate(2px, 2px);
}

.btn.is-primary {
    background: var(--wax);
    color: #fbf0cc;
    border-color: var(--outline);
    box-shadow: inset -3px -3px 0 var(--wax-dark), 4px 4px 0 rgba(0, 0, 0, 0.45);
}

.btn.is-primary:hover {
    background: #933520;
    color: #fff;
}

.btn.is-primary:active {
    box-shadow: inset 3px 3px 0 var(--wax-dark);
}

.btn.is-big {
    min-height: 58px;
    padding: 6px 28px;
    font-size: 1.7rem;
}

.btn svg {
    width: 22px;
    height: 22px;
    flex: none;
}

/* ---------- The stage (home page hero) ---------- */

.stage {
    position: relative;
    height: max(560px, min(100svh, 980px));
    overflow: hidden;
    background: #000;
    container-type: size;
}

/* Behind the scenery: the bare back wall of the stage. */
.stage-back {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 50% 70%, rgba(255, 150, 64, 0.07), transparent 55%),
        repeating-linear-gradient(90deg, #0b0806 0 46px, #0e0a07 46px 48px),
        #0b0806;
}

.scenery {
    position: absolute;
    inset: 0;
}

/*
 * A flat: one painted cutout, hung on two ropes from the fly loft. Every flat
 * is the full painting at its own aspect ratio, covering the stage, bottom
 * edge on the boards, so a point on the painting is the same point on the
 * flat whatever the window's size (the ropes are pinned to the paint).
 */
.flat {
    position: absolute;
    left: 50%;
    bottom: 0;
    width: max(100cqw, 180cqh);
    aspect-ratio: 1800 / 1000;
    margin-left: calc(max(100cqw, 180cqh) / -2);
    transform: translateY(-140cqh);
    transform-origin: 50% 0;
    will-change: transform;
}

.flat > img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    /* The cut edge throws a shadow on the flat behind it. */
    filter: drop-shadow(0 -6px 0 rgba(0, 0, 0, 0.5)) drop-shadow(10px 4px 0 rgba(0, 0, 0, 0.35));
}

.flat.is-backdrop > img {
    filter: none;
}

.rope {
    position: absolute;
    bottom: calc(100% - var(--attach, 0%));
    width: 6px;
    height: 220cqh;
    margin-left: -3px;
    background:
        repeating-linear-gradient(170deg, #d8b47a 0 3px, #a9834c 3px 6px);
    border-left: 1px solid #4a3218;
    border-right: 1px solid #4a3218;
    z-index: -1;
}

.rope::after {
    /* The knot where it's tied to the flat's batten. */
    content: "";
    position: absolute;
    left: -5px;
    bottom: -4px;
    width: 14px;
    height: 10px;
    background: #a9834c;
    border: 2px solid #4a3218;
}

.rope.l {
    left: var(--rope-l, 18%);
}

.rope.r {
    left: var(--rope-r, 82%);
}

/* The campfire flat: the loading screen's fire and dancing goblins. */
.fire-flat .fire-anchor {
    position: absolute;
    left: 50%;
    top: 84%;
    width: 0;
    height: 0;
    transform: scale(var(--k, 0.5));
}

.fire-flat .loading-screen {
    position: absolute;
    inset: auto;
    left: 0;
    top: 0;
    width: 0;
    height: 0;
    overflow: visible;
    background: transparent;
}

.fire-flat .ls-stage {
    left: 0;
    top: 0;
}

/* Proscenium: curtains, valance and the boards, in front of everything. */
.curtain {
    position: absolute;
    top: 0;
    bottom: 0;
    z-index: 20;
    width: clamp(36px, 7vw, 110px);
    background:
        repeating-linear-gradient(90deg,
            #4e120a 0 6px,
            #7a2014 6px 12px,
            #9a2c1a 12px 20px,
            #7a2014 20px 26px,
            #5e160c 26px 30px),
        #6e1f13;
    box-shadow: 0 0 0 3px var(--outline);
}

.curtain.left {
    left: 0;
    border-right: 6px solid var(--trim);
    -webkit-mask: linear-gradient(90deg, #000 70%, rgba(0, 0, 0, 0.92));
}

.curtain.right {
    right: 0;
    border-left: 6px solid var(--trim);
}

.curtain::after {
    /* Tie-back halfway down. */
    content: "";
    position: absolute;
    top: 58%;
    left: -6px;
    right: -6px;
    height: 12px;
    background: var(--trim);
    border-top: 3px solid var(--trim-light);
    border-bottom: 3px solid #8a6420;
}

.valance {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 21;
    height: clamp(70px, 10cqh, 100px);
    background:
        linear-gradient(180deg, transparent calc(100% - 30px), var(--trim) calc(100% - 30px) calc(100% - 24px), transparent calc(100% - 24px)),
        repeating-linear-gradient(90deg, #6e1f13 0 10px, #8c2a1a 10px 22px, #6e1f13 22px 28px),
        #6e1f13;
    /* Swags: a scalloped hem, cut in whole pixels. */
    -webkit-mask:
        linear-gradient(#000, #000) top / 100% calc(100% - 24px) no-repeat,
        radial-gradient(ellipse 50% 100% at 50% 0, #000 98%, transparent 100%) bottom / 90px 24px repeat-x;
    mask:
        linear-gradient(#000, #000) top / 100% calc(100% - 24px) no-repeat,
        radial-gradient(ellipse 50% 100% at 50% 0, #000 98%, transparent 100%) bottom / 90px 24px repeat-x;
    filter: drop-shadow(0 6px 0 rgba(0, 0, 0, 0.5));
}

.boards {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 19;
    height: 26px;
    background:
        linear-gradient(180deg, #b0713f 0 3px, #83502a 3px 14px, #57321b 14px 100%);
    border-top: 3px solid var(--outline);
}

.boards::before {
    /* Plank joints. */
    content: "";
    position: absolute;
    inset: 3px 0 0;
    background: repeating-linear-gradient(90deg, transparent 0 117px, var(--outline) 117px 120px);
    opacity: 0.6;
}

.footlights {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 26px;
    z-index: 18;
    height: 90px;
    background: linear-gradient(0deg, rgba(255, 190, 110, 0.16), transparent);
    pointer-events: none;
}

/* The play's title, on a cloth banner that's lowered once and stays. */
.title-board {
    position: absolute;
    left: 50%;
    top: clamp(64px, 12cqh, 120px);
    z-index: 15;
    display: flex;
    flex-direction: column;
    align-items: center;
    transform: translate(-50%, -150cqh);
    transform-origin: 50% 0;
}

.title-board .rope {
    height: 200cqh;
    bottom: calc(100% - 8px);
}

.title-board .rope.l {
    left: 14%;
}

.title-board .rope.r {
    left: 86%;
}

.title-banner {
    position: relative;
    filter: drop-shadow(0 8px 0 rgba(0, 0, 0, 0.45));
}

.title-banner canvas {
    display: block;
    image-rendering: pixelated;
}

.title-banner h1 {
    position: absolute;
    inset: 0;
    margin: 0;
    padding-top: 0.14em;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 400;
    font-size: var(--title-size, 7rem);
    line-height: 1;
    letter-spacing: 0.08em;
    color: #fbf0cc;
    text-shadow: 6px 6px 0 #3b1208;
}

/* The overlord on his swing, hanging from the middle of the banner's hem:
   the app's OverlordSwing, ropes continued in CSS with his golden twist. */
.swing {
    --s: 3px;
    position: relative;
    z-index: -1;
    width: calc(80 * var(--s));
    margin-top: calc(-4 * var(--s));
    padding-top: clamp(14px, 3cqh, 36px);
    transform-origin: 50% 0;
    animation: swing-sway 3.4s ease-in-out infinite alternate;
    filter: drop-shadow(0 6px 0 rgba(0, 0, 0, 0.4));
}

.swing img {
    display: block;
    width: calc(80 * var(--s));
    height: calc(90 * var(--s));
}

.swing-rope {
    position: absolute;
    top: 0;
    height: calc(100% - 80 * var(--s));
    width: calc(4 * var(--s));
    border-left: var(--s) solid #5a3a10;
    border-right: var(--s) solid #5a3a10;
    background: repeating-linear-gradient(#f2cf6b 0 calc(2 * var(--s)), #c48f2e calc(2 * var(--s)) calc(3 * var(--s)));
}

.swing-rope.l {
    left: calc(16 * var(--s));
}

.swing-rope.r {
    left: calc(60 * var(--s));
}

@keyframes swing-sway {
    from { transform: rotate(-2deg); }
    to { transform: rotate(2deg); }
}

@media (max-width: 900px) {
    .swing {
        --s: 2px;
    }
}

@media (max-width: 480px) {
    .swing {
        --s: 1.5px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .swing {
        animation: none;
    }
}

.title-tag {
    position: relative;
    z-index: 1;
    margin: 10px 0 0;
    padding: 6px 18px;
    background: var(--vellum);
    color: var(--p-ink);
    border: 3px solid var(--p-ink);
    box-shadow: inset -3px -3px 0 var(--vellum-shade), 5px 5px 0 rgba(0, 0, 0, 0.5);
    font-size: clamp(1.15rem, 2.4cqw, 1.6rem);
    text-align: center;
}

.stage-cta {
    position: absolute;
    left: 50%;
    bottom: 56px;
    z-index: 22;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 14px;
    transform: translateX(-50%);
    width: max-content;
    max-width: calc(100% - 2 * clamp(36px, 7vw, 110px) - 24px);
}

.stage-hint {
    position: absolute;
    right: calc(clamp(36px, 7vw, 110px) + 16px);
    bottom: 34px;
    z-index: 22;
    font-size: 1rem;
    color: #8c7a5a;
}

@media (max-width: 640px) {
    .stage-hint {
        display: none;
    }
}

/* Reduced motion: the scenery is simply set, nothing flies. */
@media (prefers-reduced-motion: reduce) {
    .flat,
    .title-board {
        transform: none !important;
    }

    .title-board {
        transform: translateX(-50%) !important;
    }
}

/* ---------- Page sections ---------- */

main {
    display: block;
}

.section {
    padding: clamp(56px, 9vw, 110px) clamp(16px, 5vw, 48px);
}

.wrap {
    max-width: 1080px;
    margin: 0 auto;
}

.section.forest {
    background:
        linear-gradient(180deg, var(--bg-deep), rgba(5, 8, 6, 0.82) 30%, rgba(5, 8, 6, 0.9)),
        url(forest/4.png) center bottom / cover;
    image-rendering: pixelated;
}

.kicker {
    margin: 0 0 6px;
    font-size: 1.2rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--trim);
}

h2 {
    margin: 0 0 18px;
    font-size: clamp(2.2rem, 5vw, 3.2rem);
    font-weight: 400;
    line-height: 1;
    color: #fbf0cc;
    text-shadow: 4px 4px 0 #000;
}

h3 {
    font-weight: 400;
}

.lede {
    max-width: 44em;
    margin: 0 0 18px;
    font-size: 1.35rem;
    color: #d9e2d4;
}

/* A scroll: vellum with wooden rollers top and bottom. */
.scroll {
    position: relative;
    margin: 18px 0;
    padding: 30px clamp(18px, 4vw, 44px);
    background: var(--vellum);
    color: var(--p-ink);
    border-left: 3px solid var(--p-ink);
    border-right: 3px solid var(--p-ink);
    box-shadow: inset 6px 0 0 #fbf3dc, inset -6px 0 0 var(--vellum-shade), 8px 8px 0 rgba(0, 0, 0, 0.45);
}

.scroll::before,
.scroll::after {
    content: "";
    position: absolute;
    left: -15px;
    right: -15px;
    height: 15px;
    background: linear-gradient(180deg, var(--wood-light) 0 3px, var(--wood) 3px 9px, var(--wood-dark) 9px 100%);
    border: 3px solid var(--outline);
}

.scroll::before {
    top: -12px;
}

.scroll::after {
    bottom: -12px;
}

.scroll a {
    color: var(--wax);
}

.scroll a:hover {
    color: var(--wax-dark);
}

.scroll p {
    margin: 0 0 12px;
}

.scroll p:last-child {
    margin-bottom: 0;
}

.scroll code {
    padding: 0 4px;
    background: rgba(59, 36, 18, 0.1);
}

.problem-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 22px;
    margin-top: 28px;
}

.problem {
    padding: 18px 20px;
    background: rgba(12, 22, 16, 0.88);
    border: 3px solid #26382b;
    box-shadow: inset 0 0 0 3px #0d1710, 6px 6px 0 rgba(0, 0, 0, 0.5);
}

.problem h3 {
    margin: 0 0 8px;
    font-size: 1.55rem;
    color: var(--trim-light);
}

.problem p {
    margin: 0;
    color: #c7d2c4;
}

/* What you get: one row per feature, a scene beside its words, alternating. */
.showcase {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
    gap: clamp(24px, 4vw, 56px);
    align-items: center;
    margin-top: clamp(40px, 6vw, 72px);
}

.showcase.is-flipped {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr);
}

.showcase.is-flipped .scene {
    order: 2;
}

@media (max-width: 820px) {
    .showcase,
    .showcase.is-flipped {
        grid-template-columns: 1fr;
    }

    .showcase.is-flipped .scene {
        order: 0;
    }
}

.showcase-text h3 {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 12px;
    font-size: clamp(1.7rem, 3vw, 2.2rem);
    line-height: 1;
    color: #fbf0cc;
    text-shadow: 3px 3px 0 #000;
}

.showcase-text .num {
    display: inline-grid;
    place-items: center;
    flex: none;
    width: 40px;
    height: 40px;
    font-size: 1.6rem;
    color: #fbf0cc;
    background: var(--cloth);
    border: 3px solid var(--outline);
    box-shadow: inset 0 3px 0 var(--trim-light), inset 0 -3px 0 var(--trim);
    text-shadow: 2px 2px 0 #3b1208;
}

.showcase-text p {
    margin: 0 0 12px;
    color: #d9e2d4;
}

.showcase-text strong {
    font-weight: 400;
    color: var(--trim-light);
}

.showcase-text .checklist {
    margin: 0 0 14px;
    color: #d9e2d4;
}

.showcase-text .checklist li::before {
    background: var(--trim);
    box-shadow: 0 0 0 3px var(--outline);
}

.showcase-text .more {
    color: var(--trim-light);
}

/* A scene: a little painted set in a wooden frame. */
.scene {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    border: 6px solid var(--wood-dark);
    box-shadow: 0 0 0 3px var(--outline), inset 0 0 0 3px var(--wood), 8px 8px 0 3px rgba(0, 0, 0, 0.5);
    background:
        linear-gradient(180deg, rgba(5, 8, 6, 0.35), rgba(5, 8, 6, 0.75)),
        url(forest/4.png) center 70% / cover;
    image-rendering: pixelated;
}

/* 1. Camps as the app draws them (assets/camps.js, after the app's
   CampfirePresenter and its styles in src/styles.css). */
.camp-scene {
    background:
        linear-gradient(180deg, rgba(5, 8, 6, 0.25), rgba(5, 8, 6, 0.55)),
        url(forest/1.png) center bottom / cover,
        url(forest/4.png) center bottom / cover;
}

/* Wider than the frame, like the app's row of camps running off the edges. */
.ws-row {
    position: absolute;
    left: -5%;
    right: -5%;
    bottom: 5%;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    align-items: end;
}

.ws-camp {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 0;
}

.ws-scene-box {
    position: relative;
    width: 100%;
}

.ws-scene {
    position: absolute;
    left: 0;
    top: 0;
    transform-origin: 0 0;
}

.ws-fire,
.ws-goblin {
    position: absolute;
    background-repeat: no-repeat;
    image-rendering: pixelated;
}

.ws-fire {
    z-index: 2;
}

.ws-goblin {
    width: 64px;
    height: 64px;
}

.ws-goblin.faces-left {
    transform: scaleX(-1);
}

.ws-glow {
    position: absolute;
    z-index: 0;
    width: 0;
    height: 0;
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

.fire-roaring .ws-glow {
    width: 150px;
    height: 96px;
    background: radial-gradient(closest-side, rgba(255, 196, 92, 0.55), rgba(246, 120, 40, 0.28) 55%, rgba(214, 64, 30, 0) 100%);
    animation: ws-flicker 0.9s ease-in-out infinite alternate;
}

.fire-small .ws-glow {
    width: 84px;
    height: 52px;
    background: radial-gradient(closest-side, rgba(255, 186, 92, 0.32), rgba(246, 120, 40, 0.12) 60%, rgba(214, 64, 30, 0) 100%);
    animation: ws-flicker 1.6s ease-in-out infinite alternate;
}

.fire-smoking .ws-glow {
    width: 44px;
    height: 22px;
    background: radial-gradient(closest-side, rgba(204, 62, 30, 0.22), rgba(204, 62, 30, 0));
    animation: ws-flicker 3.2s ease-in-out infinite alternate;
}

/* Fire light catches the goblins sitting round it. */
.fire-roaring .ws-goblin {
    filter: brightness(1.12) sepia(0.18) saturate(1.15);
}

.fire-smoking .ws-scene {
    filter: brightness(0.88);
}

@keyframes ws-flicker {
    from { opacity: 0.8; }
    to { opacity: 1; }
}

.ws-label {
    margin-top: -2px;
    font-size: 1rem;
    line-height: 1.1;
    color: var(--ink);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85), 2px 2px 0 #000;
    white-space: nowrap;
}

.ws-counts {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    font-size: 0.85rem;
    line-height: 1;
    text-shadow: 1px 1px 0 #000;
}

.ws-count.is-active { color: #7dce6a; }
.ws-count.is-thinking { color: #e0b35a; }
.ws-count.is-idle { color: #c5d2c6; }
.ws-count.is-sleeping { color: #9aa6b5; }
.ws-count.is-dead { color: #7a7380; }

@media (prefers-reduced-motion: reduce) {
    .ws-glow {
        animation: none;
    }
}

/* 2-4. Captures of the real app (with made-up workspaces and threads). */
.scene.shot {
    background: #000;
    image-rendering: auto;
}

.scene.shot > img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.scene.shot > img.phone-shot {
    inset: auto 3% -6% auto;
    width: 25%;
    height: auto;
    border: 5px solid #111;
    border-radius: 14px;
    box-shadow: 0 0 0 2px #3a3a42, 8px 8px 0 rgba(0, 0, 0, 0.5);
}

.scene.shot {
    cursor: zoom-in;
}

.scene.shot:focus-visible {
    outline: 3px solid var(--trim-light);
    outline-offset: 6px;
}

.zoom-hint {
    position: absolute;
    right: 8px;
    top: 8px;
    padding: 0 8px;
    font-size: 0.9rem;
    color: #fbf0cc;
    background: rgba(5, 8, 6, 0.8);
    border: 2px solid var(--wood);
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.scene.shot:hover .zoom-hint,
.scene.shot:focus-visible .zoom-hint {
    opacity: 1;
}

/* The lightbox: a capture at full size. */
.lightbox {
    max-width: min(96vw, 1300px);
    max-height: 94vh;
    padding: 0;
    border: 6px solid var(--wood-dark);
    background: #000;
    box-shadow: 0 0 0 3px var(--outline);
}

.lightbox::backdrop {
    background: rgba(0, 0, 0, 0.82);
}

.lightbox img {
    display: block;
    max-width: 100%;
    max-height: calc(94vh - 12px);
    cursor: zoom-out;
}

/* Scenes on small screens: smaller sprites, smaller writing. */
@media (max-width: 560px) {
    .ws-label {
        font-size: 0.8rem;
    }

    .ws-counts {
        font-size: 0.7rem;
    }
}

/* Download. */
.download {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: clamp(24px, 4vw, 48px);
    align-items: start;
}

@media (max-width: 820px) {
    .download {
        grid-template-columns: 1fr;
    }
}

.download .actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin: 22px 0 10px;
}

.small {
    font-size: 1.05rem;
    color: var(--mute);
}

.scroll .small {
    color: var(--p-ink-soft);
}

.coffee {
    margin: 6px 0 0;
    font-size: 1rem;
    color: #c7d2c4;
}

.coffee a {
    color: var(--trim-light);
}

.checklist {
    margin: 0;
    padding: 0;
    list-style: none;
}

.checklist li {
    position: relative;
    padding: 4px 0 4px 30px;
}

.checklist li::before {
    content: "";
    position: absolute;
    left: 2px;
    top: 11px;
    width: 12px;
    height: 12px;
    background: var(--wax);
    box-shadow: 0 0 0 3px var(--p-ink);
}

.oss {
    display: flex;
    flex-wrap: wrap;
    gap: 22px;
    align-items: center;
    justify-content: space-between;
    margin-top: 40px;
    padding: 22px 24px;
    border: 3px dashed var(--line);
}

.oss .oss-claim {
    margin: 0;
    font-size: 1.7rem;
    line-height: 1.2;
    color: #fbf0cc;
}

pre.terminal {
    margin: 12px 0 0;
    padding: 14px 16px;
    overflow-x: auto;
    background: #0b0f0c;
    color: #cfe3c6;
    border: 3px solid #26382b;
    line-height: 1.5;
}

/* ---------- Footer ---------- */

.footer {
    padding: 34px clamp(16px, 5vw, 48px) 46px;
    border-top: 3px solid #1b2a1f;
    background: #030504;
    color: var(--mute);
    font-size: 1.1rem;
}

.footer .wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 28px;
    justify-content: space-between;
}

.footer nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 22px;
}

.footer a {
    color: #d8c9a4;
}

/* ---------- Docs ---------- */

.docs-layout {
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
    gap: clamp(20px, 4vw, 48px);
    max-width: 1200px;
    margin: 0 auto;
    padding: 34px clamp(16px, 4vw, 40px) 80px;
}

@media (max-width: 880px) {
    .docs-layout {
        grid-template-columns: 1fr;
    }
}

.docs-nav {
    position: sticky;
    top: 86px;
    align-self: start;
    max-height: calc(100vh - 110px);
    overflow-y: auto;
    padding: 16px 18px;
    background: rgba(12, 22, 16, 0.88);
    border: 3px solid #26382b;
    box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.5);
    scrollbar-width: thin;
}

@media (max-width: 880px) {
    .docs-nav {
        position: static;
        max-height: none;
    }
}

.docs-nav h2 {
    margin: 0 0 8px;
    font-size: 1.5rem;
    text-shadow: none;
}

.docs-nav ol {
    margin: 0;
    padding: 0;
    list-style: none;
}

.docs-nav li a {
    display: block;
    padding: 3px 0;
    color: #c7d2c4;
    text-decoration: none;
    font-size: 1.15rem;
}

.docs-nav li a:hover,
.docs-nav li a.is-here {
    color: var(--trim-light);
}

.docs-nav li a.is-here::before {
    content: "▸ ";
}

.doc {
    min-width: 0;
    padding: 34px clamp(18px, 4vw, 48px);
    background: var(--vellum);
    color: var(--p-ink);
    border-left: 3px solid var(--p-ink);
    border-right: 3px solid var(--p-ink);
    box-shadow: inset 6px 0 0 #fbf3dc, inset -6px 0 0 var(--vellum-shade), 8px 8px 0 rgba(0, 0, 0, 0.45);
    position: relative;
    margin-top: 12px;
}

.doc::before,
.doc::after {
    content: "";
    position: absolute;
    left: -15px;
    right: -15px;
    height: 15px;
    background: linear-gradient(180deg, var(--wood-light) 0 3px, var(--wood) 3px 9px, var(--wood-dark) 9px 100%);
    border: 3px solid var(--outline);
}

.doc::before {
    top: -12px;
}

.doc::after {
    bottom: -12px;
}

.doc h1 {
    margin: 0 0 6px;
    font-size: clamp(2.4rem, 5vw, 3.2rem);
    font-weight: 400;
    line-height: 1;
}

.doc h2 {
    margin: 46px 0 12px;
    padding-bottom: 4px;
    font-size: 2.1rem;
    color: var(--p-ink);
    text-shadow: none;
    border-bottom: 3px dashed var(--p-ink-faint);
    scroll-margin-top: 90px;
}

.doc h3 {
    margin: 26px 0 8px;
    font-size: 1.55rem;
    scroll-margin-top: 90px;
}

.doc p,
.doc ul,
.doc ol {
    margin: 0 0 12px;
}

.doc li {
    margin: 3px 0;
}

.doc a {
    color: var(--wax);
}

.doc a:hover {
    color: var(--wax-dark);
}

.doc code {
    padding: 0 4px;
    background: rgba(59, 36, 18, 0.1);
}

.doc pre {
    margin: 0 0 14px;
    padding: 12px 14px;
    overflow-x: auto;
    background: #2a1b0e;
    color: #f6ead0;
    border: 3px solid var(--p-ink);
    line-height: 1.5;
}

.doc pre code {
    padding: 0;
    background: none;
}

.doc kbd {
    font-family: inherit;
    padding: 0 5px;
    border: 2px solid var(--p-ink);
    box-shadow: inset -2px -2px 0 var(--vellum-shade);
}

.doc table {
    width: 100%;
    margin: 0 0 16px;
    border-collapse: collapse;
    font-size: 1.1rem;
}

.doc th,
.doc td {
    padding: 5px 10px;
    border: 2px solid var(--p-ink-faint);
    text-align: left;
    vertical-align: top;
}

.doc th {
    background: rgba(59, 36, 18, 0.08);
    font-weight: 400;
    color: var(--p-ink-soft);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 1rem;
}

.table-wrap {
    overflow-x: auto;
}

.note {
    margin: 0 0 14px;
    padding: 10px 14px;
    border: 3px solid var(--wax);
    background: rgba(125, 42, 23, 0.08);
}

.note strong {
    color: var(--wax);
    font-weight: 400;
}

/* ---------- 404 ---------- */

.lost {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 40px 16px;
    text-align: center;
    background:
        linear-gradient(rgba(5, 8, 6, 0.55), rgba(5, 8, 6, 0.8)),
        url(forest/4.png) center / cover;
}

.lost h1 {
    margin: 0 0 8px;
    font-size: clamp(4rem, 14vw, 8rem);
    font-weight: 400;
    line-height: 1;
    color: #fbf0cc;
    text-shadow: 6px 6px 0 #3b1208;
}

/* ---------- Small screens ---------- */

@media (max-width: 640px) {
    :root {
        font-size: 19px;
    }

    .topbar {
        padding: 10px 14px;
    }

    .topnav {
        gap: 4px 14px;
        font-size: 1.1rem;
    }

    .topnav .wide-only {
        display: none;
    }

    .brand {
        font-size: 1.35rem;
    }

    .brand img {
        width: 26px;
        height: 26px;
    }

    .stage-cta {
        bottom: 40px;
        gap: 10px;
    }

    .stage-cta .btn.is-big {
        min-height: 46px;
        padding: 4px 14px;
        font-size: 1.3rem;
    }

    .title-tag {
        margin-top: 12px;
        white-space: nowrap;
    }
}
