:root {
    --red: #ff3b3b;
    --dark-red: #8b1a1a;
    --window-gray: #bdbdbd;
}

html {
    scroll-snap-type: y mandatory;
}

body {
    margin: 0;
    overflow-x: hidden;
}

main {
    width: 100vw;
}

section {
    height: 100vh;
    scroll-snap-align: start;
    position: relative;
}

#hero {
    background-color: black;
    overflow-x: hidden;
    position: relative;

    nav,
    #hero-content {
        position: relative;
        z-index: 2;
    }

    nav {
        font-family: "DotGothic16", sans-serif;
        font-size: 24px;

        text-align: center;
        padding-top: 25px;
    }

    nav a {
        color: #fff;
        text-decoration: none;
        transition: 100ms;
    }

    nav a:first-child {
        color: #fff;
    }

    nav a:hover {
        color: var(--red);
    }

    nav a::after {
        content: " |";
        color: #666;
    }

    nav a:last-child::after {
        content: none;
    }

    h1 {
        font-family: "Press Start 2P";
        font-size: 48px;
        color: #fff;
        text-align: center;
        text-shadow: #c40606 2px 4px;
        margin-block: 65px 20px;
    }

    h2 {
        font-family: "DotGothic16", sans-serif;
        font-size: 28px;
        color: #fff;
        text-align: center;
        margin-block: 20px;
    }

    #countdown {
        font-family: "DotGothic16", sans-serif;
        color: #fff;
        margin-top: 50px;
        text-align: center;

        & :nth-child(odd) {
            font-size: 64px;
        }
        & :nth-child(even) {
            font-size: 28px;
        }
    }

    #register-cta,
    #volunteer-cta,
    #logout-cta {
        display: block;
        text-align: center;
        margin-top: 75px;

        color: #fff;
        font-family: "VT323";
        font-size: 36px;
        text-decoration: none;
    }

    #register-cta::before,
    #volunteer-cta::before,
    #logout-cta::before {
        content: "> ";
        color: var(--red);
    }

    #register-cta::after,
    #volunteer-cta::after,
    #logout-cta::after {
        content: " <";
        color: var(--red);
    }

    #register-cta:hover,
    #register-cta:focus-visible,
    #volunteer-cta:hover,
    #volunteer-cta:focus-visible,
    #logout-cta:hover,
    #logout-cta:focus-visible {
        color: var(--red);
    }

    #volunteer-cta,
    #logout-cta {
        margin-top: 16px;
    }

    #logout-cta {
        background: none;
        border: 0;
        padding: 0;
        width: 100%;
        cursor: pointer;
    }

    #mlh-trust-badge {
        display: none;
        max-width: 100px;
        min-width: 60px;
        position: absolute;
        right: 50px;
        top: 0;
        width: 10%;
        z-index: 10000;

        img {
            width: 100%;
        }
    }

    #hero-img-bottom {
        position: absolute;
        width: 100%;
        height: 69px;
        bottom: 0px;
        left: 0px;
        background-image: url("/static/img/video-game-tiles.png");
        background-repeat: repeat;
    }

    #hero-img-left,
    #hero-img-right {
        position: absolute;
        z-index: 0;
        bottom: 69px;
        aspect-ratio: 1 / 2;
        pointer-events: none;
        width: 300px;
        background: url("/static/img/heroLeftTiles.png") center / 300px 600px
            no-repeat;
        image-rendering: pixelated;
    }

    #hero-img-left {
        left: clamp(12px, 3vw, 48px);
    }

    #hero-img-right {
        right: clamp(12px, 3vw, 48px);
        background-image: url("/static/img/heroRightTiles.png");
    }
}

#about {
    background: #bd4f4f;

    .status-menu-bar {
        font-family: "AppleFontNarrow";

        height: 64px;
        border: 4px solid black;
        background: white;

        display: flex;

        img {
            margin: 14px 36px;
        }

        a {
            text-decoration: none;
            color: black;
            font-size: 32px;
            padding: 15px 12px;

            &:nth-child(3),
            &:hover {
                background-color: #b3b3b3;
            }
        }
    }

    #appleii-screen {
        font-family: "AppleFont";

        width: 100vw;
        height: calc(100vh - 72px);
        position: relative;
        overflow: hidden;

        --window-width: 586px;

        .appleii-window {
            width: var(--window-width);
            background-color: white;
            position: absolute;
            border: 4px solid black;
            container-type: inline-size;

            /* 9-slice of the 4x pixel-art header: the close and zoom box
               caps (132px of the 120px-tall art) scale with the height only,
               and the uniform stripe run between them fills any width */
            .drag-header {
                --hdr: 60px;

                box-sizing: border-box;
                height: var(--hdr);
                display: flex;
                justify-content: center;
                border-style: solid;
                border-width: 0 calc(var(--hdr) * 132 / 120);
                border-image: url("/static/img/appleii-header.png") 0 132 fill
                    stretch;
                image-rendering: pixelated;
                /* content box = the stripe band (art rows 22-90) */
                padding: calc(var(--hdr) * 22 / 120) 0
                    calc(var(--hdr) * 30 / 120);

                user-select: none;
                touch-action: none;
                cursor: grab;

                &:active {
                    cursor: grabbing;
                }
            }

            h2 {
                display: flex;
                align-items: center;
                min-width: 0;
                /* bleed into the white around the band so no stripe edge
                   peeks out when --hdr lands the band on fractional pixels */
                margin: -1px 0;
                padding: 0 0.5em;
                font-size: clamp(16px, 5cqi, 32px);
                white-space: nowrap;
                overflow: hidden;
                text-overflow: ellipsis;
                background-color: white;
            }

            p {
                font-size: 24px;
                line-height: 32px;
                padding: 30px;
                margin: 0;
            }

            &:nth-child(1) {
                left: 3vw;
                top: 14vh;
                z-index: 103;
            }
            &:nth-child(2) {
                left: 52vw;
                top: 4vh;
                z-index: 101;
            }
            &:nth-child(3) {
                left: 36vw;
                top: 51vh;
                z-index: 102;
            }
        }
    }
}

#faq {
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    font-family: Tahoma, Verdana, sans-serif;

    .outset {
        position: relative;
        background-color: var(--window-gray);
        box-sizing: border-box;
        border: 4px outset var(--window-gray);
        padding: 6px;
    }
    .outset::before {
        content: "";
        position: absolute;
        border-radius: 1px;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        border-top: 2px solid white;
        border-left: 2px solid white;
        pointer-events: none;
    }

    .inset {
        display: inline-block;
        position: relative;
        background-color: var(--window-gray);
        box-sizing: border-box;
        border: 4px inset var(--window-gray);
        padding: 2px;
    }
    .inset::before {
        content: "";
        position: absolute;
        border-radius: 1px;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        border-bottom: 2px solid white;
        border-right: 2px solid white;
        pointer-events: none;
    }

    .browser-window {
        flex: 1;
        min-height: 0;
        display: flex;
        flex-direction: column;
    }

    hr {
        margin: 0;
        border-inline: none;
        border-width: 2px;
        flex: 0 0 auto;
    }

    .browser-title {
        flex: 0 0 auto;
        width: 100%;
        box-sizing: border-box;
        background-color: var(--dark-red);
        color: white;
        font-family: "VT323";
        font-size: 22px;
        padding: 5px 10px;
    }

    .browser-menu {
        flex: 0 0 auto;
        display: flex;
        flex-wrap: wrap;

        a {
            padding: 4px 10px;
            color: black;
            text-decoration: none;
            font-size: 15px;

            span {
                text-decoration: underline;
            }
        }

        a:hover {
            background-color: var(--dark-red);
            color: white;
        }
    }

    .browser-toolbar {
        flex: 0 0 auto;
        display: flex;
        align-items: center;
        gap: 6px;
        padding: 5px 6px;
    }

    .toolbar-btn {
        display: inline-block;
        position: relative;
        background-color: var(--window-gray);
        box-sizing: border-box;
        border: 2px outset var(--window-gray);
        font-family: "VT323";
        font-size: 16px;
        padding: 3px 10px;
        cursor: pointer;
        flex: 0 0 auto;
    }

    .toolbar-btn:active:not(:disabled) {
        border-style: inset;
    }

    .toolbar-btn:disabled {
        color: #888;
        cursor: default;
    }

    .browser-searchbar {
        flex: 1;
        display: flex;
        align-items: center;
        min-width: 0;
        padding: 0 8px;
        background-color: white;
        font-family: "VT323";
        font-size: 18px;
        color: #333;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .browser-main {
        flex: 1;
        min-height: 0;
        width: 100%;
        background-color: white;
        padding: 8px 20px;
        overflow-y: auto;
        box-sizing: border-box;

        /* the inset bevel scrolls with the content and cuts through the text; it's invisible on white anyway */
        &::before {
            display: none;
        }

        h2 {
            font-family: "VT323";
            font-size: 32px;
            color: var(--dark-red);
        }

        .faq-item {
            max-width: 75ch;
            margin-bottom: 18px;

            h3 {
                &::before {
                    content: "Q: ";
                }
                font-family: "VT323";
                font-size: 22px;
                color: var(--dark-red);
                margin: 0 0 4px;
            }

            p {
                &::before {
                    content: "A: ";
                }
                font-size: 16px;
                line-height: 1.4;
                margin: 0 0 0 20px;

                a {
                    color: #a40000;
                }
            }
        }
    }
}

#schedule {
    --label-width: 150px;
    --hour-width: 80px;
    --row-height: 70px;

    display: flex;

    flex-direction: column;
    font-family: "Tahoma", "Verdana", sans-serif;

    .xp-header {
        border-radius: 5px 5px 0 0;
        display: flex;
        align-items: center;
        justify-content: space-between;
        background: linear-gradient(
            180deg,
            #ff8a80 0%,
            #ff5252 8%,
            #e63946 40%,
            #e63946 86%,
            #d62828 100%
        );
        height: 40px;
        padding: 0 4px 0 6px;
        flex-shrink: 0;

        div {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .xp-icon {
            font-size: 18px;
        }

        .xp-controls {
            gap: 2px;

            span {
                width: 21px;
                height: 21px;
                display: flex;
                align-items: center;
                justify-content: center;
                box-sizing: border-box;
                border: 1px solid #fff;
                border-radius: 3px;
                background: linear-gradient(180deg, #ff9a90, #d9483b);
                color: #fff;
                font-size: 14px;
                font-weight: bold;
                line-height: 1;
            }

            .xp-close {
                background: linear-gradient(180deg, #f0826a, #b3200e);
                font-size: 17px;
            }
        }

        p {
            margin: 0;
            color: #fff;
            font-weight: bold;
            font-size: 15px;
            text-shadow: 0 1px 1px rgba(0, 0, 0, 0.4);
            letter-spacing: 0.5px;
        }
    }

    /* fade the right edge so it reads as horizontally scrollable */
    .schedule-body {
        overflow: auto;
        background: #f1e6e1;
        mask-image: linear-gradient(
            to right,
            #000 calc(100% - 28px),
            transparent
        );
    }

    .schedule-grid {
        display: flex;
        flex-direction: column;
        height: calc(100vh - 64px);
        width: fit-content;
    }

    .schedule-date-row,
    .schedule-hour-row,
    .schedule-row {
        display: flex;
        flex-shrink: 0;
    }

    .schedule-label {
        flex: 0 0 var(--label-width);
        width: var(--label-width);
        position: sticky;
        left: 0;
        z-index: 2;
        display: flex;
        align-items: center;
        padding: 0 12px;
        box-sizing: border-box;
        font-size: 13px;
        font-weight: bold;
        color: #7c1d1d;
        background: linear-gradient(180deg, #fefefe, #eeded2);
        border-right: 2px solid #9fa8b7;
        border-bottom: 1px solid #c4c4b8;
    }

    .schedule-date-row {
        height: 26px;

        .schedule-label {
            background: linear-gradient(180deg, #fefefe, #eeded2);
        }
    }

    .schedule-date {
        flex: none;
        width: calc(var(--hour-width) * var(--hours) - 2px);
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 12px;
        font-weight: bold;
        color: #7c1d1d;
        background: linear-gradient(180deg, #f5f3ea, #e6e2d2);
        border-right: 2px solid #9fa8b7;
        border-bottom: 1px solid #c4c4b8;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    .schedule-hour-row {
        height: 30px;

        .schedule-label {
            border-bottom: 2px solid #9fa8b7;
        }
    }

    .schedule-hour {
        flex: none;
        width: var(--hour-width);
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 12px;
        color: #333;
        background: linear-gradient(180deg, #fefefe, #ece9d8);
        border-right: 1px solid #d4d0c0;
        border-bottom: 2px solid #9fa8b7;
        box-sizing: border-box;
    }

    .schedule-row {
        border-bottom: 1px solid #c4c4b8;

        .schedule-label {
            background: #f5f3ea;
            border-bottom: none;
        }
    }

    .schedule-lane {
        flex: 1;
        display: flex;
        flex-direction: column;
    }

    .schedule-track {
        display: flex;
        height: var(--row-height);
        background-image: repeating-linear-gradient(
            to right,
            transparent 0,
            transparent calc(var(--hour-width) - 1px),
            #e2ded0 calc(var(--hour-width) - 1px),
            #e2ded0 var(--hour-width)
        );
    }

    .schedule-gap {
        flex: none;
        width: calc(var(--hour-width) * var(--hours));
    }

    .schedule-event {
        flex: none;
        width: calc(var(--hour-width) * var(--hours) - 3px);
        align-self: stretch;
        margin: 4px 2px 4px 1px;
        border-radius: 3px;
        padding: 4px 8px;
        box-sizing: border-box;
        font-size: 12px;
        line-height: 1.3;
        color: #1c1c1c;
        border: 1px solid rgba(0, 0, 0, 0.25);
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);

        > * {
            display: block;
            position: sticky;
            left: calc(var(--label-width) + 8px);
            width: fit-content;
            max-width: 100%;
            overflow: hidden;
            white-space: nowrap;
            text-overflow: ellipsis;
        }

        .event-time {
            font-size: 10px;
            font-weight: normal;
            opacity: 0.75;
        }
    }
}

#about .appleii-hint {
    position: absolute;
    right: 24px;
    bottom: 24px;
    font-family: "AppleFont";
    font-size: 20px;
    color: #fff;
}

#tracks {
    background: #000;
    color: #ccc;
    font-family: "VT323", monospace;
    display: flex;
    flex-direction: column;

    .dos-menubar {
        background: #ccc;
        border-bottom: 4px solid #888;

        nav {
            font-family: "DotGothic16", sans-serif;
            font-size: 20px;
            text-align: center;
            padding: 14px 0;
        }

        nav a {
            color: #333;
            text-decoration: none;
            transition: 100ms;
        }

        nav a:first-child {
            color: #000;
            font-weight: bold;
        }

        nav a:hover {
            color: var(--dark-red);
        }

        nav a::after {
            content: " |";
            color: #999;
        }

        nav a:last-child::after {
            content: none;
        }
    }

    .dos-screen {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 30px;
        box-sizing: border-box;
        gap: 14px;
    }

    .dos-window {
        width: min(900px, 90vw);
        border: 3px solid #888;
        background: #050505;
        box-shadow: 0 0 0 1px #333 inset;
    }

    .dos-titlebar {
        background: #888;
        color: #000;
        font-size: 22px;
        padding: 4px 12px;
    }

    .dos-cols {
        display: flex;
        min-height: 320px;
    }

    .dos-list {
        flex: 0 0 260px;
        border-right: 2px solid #333;
        display: flex;
        flex-direction: column;
        padding: 10px 0;
    }

    .dos-item {
        display: flex;
        align-items: center;
        gap: 6px;
        background: none;
        border: none;
        color: #9c9c9c;
        font-family: "VT323", monospace;
        font-size: 22px;
        text-align: left;
        padding: 6px 16px;
        cursor: pointer;

        /* always rendered so the glyph's line height is the same on every
           item; only shown on the current one */
        i {
            width: 14px;
            color: var(--red);
            font-style: normal;
            visibility: hidden;
        }

        u {
            text-decoration: none;
        }
    }

    .dos-item:hover {
        color: #fff;
    }

    .dos-item[aria-current="true"] {
        color: #fff;
        background: #1a1a1a;

        i {
            visibility: visible;
        }
    }

    .dos-detail {
        flex: 1;
        display: grid;
        padding: 20px 26px;
    }

    .dos-panel {
        grid-area: 1 / 1;
        visibility: hidden;
    }

    .dos-panel.active {
        visibility: visible;
    }

    .dos-panel h3 {
        margin: 0 0 8px;
        font-size: 28px;
        color: var(--track-color, var(--red));
        letter-spacing: 1px;
    }

    .dos-panel .rule {
        height: 1px;
        background: #333;
        margin-bottom: 14px;
    }

    .dos-panel p {
        font-size: 20px;
        line-height: 1.4;
        margin: 0 0 16px;
    }

    .dos-winners {
        display: flex;
        flex-direction: column;
        gap: 4px;
        margin-bottom: 16px;
        font-size: 18px;

        h4 {
            margin: 0 0 2px;
            font-size: 16px;
            font-weight: normal;
            color: #666;
            letter-spacing: 1px;
        }

        div {
            display: flex;
            gap: 12px;
        }

        b {
            flex: 0 0 auto;
            font-weight: normal;
            color: var(--track-color, var(--red));
        }

        a {
            color: #999;
        }

        a:hover {
            color: #fff;
        }
    }

    /* subtracks sit apart from the tracks, since they aren't a pick */
    .dos-item-sub {
        margin-top: 10px;
        border-top: 1px dashed #333;
        padding-top: 14px;
    }

    .dos-subtracks {
        display: flex;
        flex-direction: column;
        gap: 14px;

        div {
            display: flex;
            flex-direction: column;
            gap: 2px;
        }

        b {
            color: var(--track-color, var(--red));
            font-weight: normal;
            font-size: 22px;
        }

        span {
            color: #999;
            font-size: 18px;
            padding-left: 18px;
        }
    }

    .dos-note {
        font-size: 15px;
        color: #666;
        line-height: 1.4;
    }

    .dos-jump {
        background: none;
        border: none;
        padding: 0;
        font: inherit;
        color: #999;
        text-decoration: underline;
        cursor: pointer;
    }

    .dos-jump:hover {
        color: #fff;
    }

    .dos-keys {
        display: flex;
        gap: 24px;
        border-top: 2px solid #333;
        padding: 8px 16px;
        font-size: 16px;
        color: #666;

        b {
            color: #999;
            margin-right: 4px;
        }
    }

    .dos-cmd {
        width: min(900px, 90vw);
        margin: 0;
        font-size: 20px;
        color: var(--red);
    }

    .dos-caret {
        display: inline-block;
        width: 10px;
        height: 18px;
        background: var(--red);
        margin-left: 4px;
        vertical-align: middle;
        animation: dos-blink 1s steps(1) infinite;
    }
}

@keyframes dos-blink {
    50% {
        opacity: 0;
    }
}

#schedule .xp-menu {
    flex-shrink: 0;
    display: flex;
    gap: 4px;
    background: #ece9d8;
    border-bottom: 1px solid #aca899;
    padding: 2px 6px;
    font-family: "Tahoma", "Verdana", sans-serif;
    font-size: 12px;

    a {
        color: #000;
        text-decoration: none;
        padding: 2px 8px;
        border-radius: 2px;
    }

    a:hover {
        background: #d0483a;
        color: #fff;
    }
}

#sponsors {
    background-image: url("/static/img/wood-panel.avif");
    background-size: cover;
    background-position: center;

    #bulletin-board {
        --frame: clamp(12px, 1.7cqw, 22px);

        background: url("/static/img/bulletin-board/cork.webp");
        /* Both dimensions are queried by the board contents. */
        container-type: size;
        box-shadow: 0px 10px 15px 10px rgba(0, 0, 0, 0.5);

        /* the textures tile, so the board can take any shape: fill the
           section, leaving a gutter of wall around it */
        position: absolute;
        inset: 0;
        margin: auto;
        width: min(1280px, 100% - 64px);
        height: min(800px, 100% - 64px);

        /* the frame casts a shadow onto the cork, light from bottom-left */
        &::before {
            content: "";
            position: absolute;
            inset: var(--frame);
            box-shadow:
                inset -5px 6px 12px rgba(0, 0, 0, 0.6),
                inset 0 0 5px rgba(0, 0, 0, 0.35);
            pointer-events: none;
        }
    }

    /* each frame edge is a repeating wood strip, clipped at 45deg so the
       corners meet in a mitre whatever shape the board is */
    .frame {
        position: absolute;
        background-repeat: repeat;
    }

    .frame-top,
    .frame-bottom {
        left: 0;
        right: 0;
        height: var(--frame);
        background-size: auto 100%;
    }

    .frame-left,
    .frame-right {
        top: 0;
        bottom: 0;
        width: var(--frame);
        background-size: 100% auto;
    }

    .frame-top {
        top: 0;
        background-image: url("/static/img/bulletin-board/frame-top.webp");
        clip-path: polygon(
            0 0,
            100% 0,
            calc(100% - var(--frame)) 100%,
            var(--frame) 100%
        );
    }

    .frame-bottom {
        bottom: 0;
        background-image: url("/static/img/bulletin-board/frame-bottom.webp");
        clip-path: polygon(
            var(--frame) 0,
            calc(100% - var(--frame)) 0,
            100% 100%,
            0 100%
        );
    }

    .frame-left {
        left: 0;
        background-image: url("/static/img/bulletin-board/frame-left.webp");
        clip-path: polygon(
            0 0,
            100% var(--frame),
            100% calc(100% - var(--frame)),
            0 100%
        );
    }

    .frame-right {
        right: 0;
        background-image: url("/static/img/bulletin-board/frame-right.webp");
        clip-path: polygon(
            0 var(--frame),
            100% 0,
            100% 100%,
            0 calc(100% - var(--frame))
        );
    }

    /* everything pinned to the board is sized in --u so it scales with the
       board instead of the viewport. The cqw term lets two notes sit side
       by side on a phone, the cqh term keeps a short board from pushing
       them off the bottom, and the cap stops them ballooning on desktop */
    .board-content {
        --u: min(2.4cqw, 2.8cqh, 14px);

        position: absolute;
        inset: 0;
        box-sizing: border-box;
        padding: calc(var(--frame) + 2.5cqw) calc(var(--frame) + 4cqw);
        container-type: size;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: calc(2.5 * var(--u));
        font-family: "VT323", monospace;
    }

    /* the title stays at the top; the notes, a size down from it, are
       centred in the cork below, sized against the space left under the
       title rather than the whole board. The cqw term keeps at least three
       notes to a row, so they never need more than two rows of height */
    .board-notes {
        flex: 1;
        min-height: 0;
        width: 100%;
        container-type: size;
    }

    .notes-grid {
        --u: min(1.6cqw, 3cqh, 11.5px);

        height: 100%;
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        align-content: center;
        gap: calc(3 * var(--u)) calc(4 * var(--u));
    }

    .pinned {
        --tilt: -2deg;
        --tack: #d62828;

        position: relative;
        box-sizing: border-box;
        color: #1c1c1c;
        text-decoration: none;
        box-shadow: calc(0.3 * var(--u)) calc(0.8 * var(--u))
            calc(1.2 * var(--u)) rgba(0, 0, 0, 0.4);
        /* hang from the tack, so tilting swings the note around it */
        transform-origin: 50% calc(1.8 * var(--u));
        transform: rotate(var(--tilt));
        transition: transform 200ms ease;
    }

    /* scatter the tilts and tack colours so the board looks hand-pinned */
    .board-notes .pinned:nth-child(4n + 1) {
        --tilt: 2.5deg;
        --tack: #ff8c42;
    }
    .board-notes .pinned:nth-child(4n + 2) {
        --tilt: -1.5deg;
        --tack: #ff5ca8;
    }
    .board-notes .pinned:nth-child(4n + 3) {
        --tilt: 1deg;
        --tack: #ffd166;
    }
    .board-notes .pinned:nth-child(4n) {
        --tilt: -3deg;
        --tack: #d62828;
    }

    a.pinned:hover,
    a.pinned:focus-visible {
        transform: rotate(calc(var(--tilt) * -1.5));
    }

    a.pinned:focus-visible {
        outline: 3px solid #1c1c1c;
        outline-offset: 3px;
    }

    .tack {
        position: absolute;
        top: calc(0.6 * var(--u));
        left: 50%;
        z-index: 1;
        width: calc(2.2 * var(--u));
        aspect-ratio: 1;
        translate: -50% 0;
        border-radius: 50%;
        background: radial-gradient(
            circle at 35% 30%,
            #fff8 0 12%,
            var(--tack) 32%,
            color-mix(in srgb, var(--tack), #000 55%) 100%
        );
        box-shadow: calc(0.35 * var(--u)) calc(0.6 * var(--u))
            calc(0.5 * var(--u)) rgba(0, 0, 0, 0.5);
    }

    /* index card with a red header rule and faint blue lines. Every line
       box is one --line tall and the blue rules start under the red one,
       so the text sits on the lines instead of being struck through */
    .board-title {
        --tilt: -1deg;
        --head: calc(4 * var(--u));
        --line: calc(3 * var(--u));

        max-width: 100%;
        padding: var(--head) calc(4 * var(--u)) calc(0.8 * var(--line));
        text-align: center;
        background:
            linear-gradient(#e63946, #e63946) 0
                calc(var(--head) - 0.2 * var(--u)) / 100% calc(0.2 * var(--u))
                no-repeat,
            linear-gradient(#fdfaf2, #fdfaf2) 0 0 / 100% var(--head) no-repeat,
            linear-gradient(transparent calc(100% - 1px), #9ec5e8 0) 0
                var(--head) / 100% var(--line),
            #fdfaf2;
        background-origin: border-box;

        h2 {
            margin: 0;
            font-family: "Press Start 2P", monospace;
            font-size: calc(2.6 * var(--u));
            line-height: var(--line);
            font-weight: normal;
            color: var(--dark-red);
        }

        p {
            margin: 0;
            font-size: calc(2 * var(--u));
            line-height: var(--line);
        }
    }

    .sponsor-note {
        width: calc(18 * var(--u));
        aspect-ratio: 3 / 2;
        padding: calc(3 * var(--u)) calc(1.6 * var(--u)) calc(1.4 * var(--u));
        display: flex;
        align-items: center;
        justify-content: center;
        background: #fff;
        font-size: calc(2.6 * var(--u));
        text-align: center;

        img {
            width: 100%;
            height: 100%;
            object-fit: contain;
        }
    }

    .sticky-note {
        width: calc(15 * var(--u));
        aspect-ratio: 1;
        padding: calc(3.4 * var(--u)) calc(1.4 * var(--u)) calc(1.4 * var(--u));
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: calc(0.8 * var(--u));
        text-align: center;
        background: linear-gradient(170deg, #ffe58a, #ffd166);

        b {
            font-weight: normal;
            font-size: calc(2.4 * var(--u));
            line-height: 1;
        }

        span:last-child {
            font-size: calc(1.7 * var(--u));
            text-decoration: underline;
            overflow-wrap: anywhere;
        }
    }
}

/* ---------- Mobile responsiveness ---------- */

@media (max-width: 820px) {
    /* sections can be taller than the viewport here; proximity lets
       users scroll through tall content instead of being snapped past it */
    html {
        scroll-snap-type: y proximity;
    }

    section {
        height: auto;
        min-height: 100svh;
    }

    #hero-img-left,
    #hero-img-right {
        display: none;
    }

    /* hero: nav on top, content centred in the space above the floor tiles */
    #hero {
        display: flex;
        flex-direction: column;
        min-height: min(100svh, 680px);
    }

    #hero #hero-content {
        margin-block: auto;
        padding: 24px 16px 101px;
    }

    #hero h1 {
        font-size: clamp(20px, 6vw, 40px);
        margin-block: 0 clamp(12px, 3vw, 24px);
        text-shadow: #c40606 2px 3px;
    }

    #hero h2 {
        font-size: clamp(16px, 3.6vw, 24px);
    }

    #hero nav {
        font-size: clamp(16px, 3vw, 20px);
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0 6px;
        padding: 12px 8px 0;
    }

    #hero nav a {
        padding: 6px 4px;
    }

    #hero nav a::after {
        content: none;
    }

    #hero #countdown {
        margin-top: clamp(28px, 6vw, 48px);
    }

    #hero #countdown :nth-child(odd) {
        font-size: clamp(30px, 9vw, 56px);
    }

    #hero #countdown :nth-child(even) {
        font-size: clamp(15px, 3.6vw, 24px);
    }

    #hero #register-cta,
    #hero #volunteer-cta {
        font-size: clamp(22px, 5.5vw, 32px);
        padding: 8px;
    }

    #hero #register-cta {
        margin-top: clamp(32px, 7vw, 56px);
    }

    #hero #volunteer-cta {
        margin-top: 12px;
    }

    /* about: capped at one screen; the window stack fills whatever the
       menu bar leaves over */
    #about {
        height: 100svh;
        min-height: 0;
        display: flex;
        flex-direction: column;
    }

    /* menu stays one row, scrolling sideways if it has to */
    #about .status-menu-bar {
        flex: none;
        height: auto;
        align-items: stretch;
        overflow-x: auto;
        scrollbar-width: none;
    }

    #about .status-menu-bar img {
        flex: none;
        align-self: center;
        margin: 8px 10px;
        height: 32px;
    }

    #about .status-menu-bar a {
        font-size: 16px;
        padding: 21px 6px;
    }

    /* Keep the phone layout within the screen rather than scrolling it. */
    #about #appleii-screen {
        flex: 1 1 0;
        height: auto;
        min-height: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: min(12px, 1.5svh);
        padding: min(12px, 1.5svh) 10px 12px;
        box-sizing: border-box;
        overflow-x: hidden;
        overflow-y: hidden;
    }

    #about #appleii-screen .appleii-window {
        position: relative;
        width: calc(100% - 8px);
        box-sizing: border-box;
    }

    /* a slight stagger so it reads as a pile of movable windows,
       without giving up the width the text needs */
    #about #appleii-screen .appleii-window:nth-child(odd) {
        align-self: flex-start;
    }

    #about #appleii-screen .appleii-window:nth-child(even) {
        align-self: flex-end;
    }

    /* set by index.js on first drag: windows leave the flow and keep
       the pixel positions they were stacked at */
    #about #appleii-screen.floating .appleii-window {
        position: absolute;
    }

    #about #appleii-screen .appleii-window:nth-child(1),
    #about #appleii-screen .appleii-window:nth-child(2),
    #about #appleii-screen .appleii-window:nth-child(3) {
        left: auto;
        top: auto;
    }

    #about #appleii-screen .appleii-window .drag-header {
        --hdr: 45px;
    }

    #about #appleii-screen .appleii-window p {
        font-size: 15px;
        line-height: 1.4;
        padding: min(14px, 1.6svh) 16px;
    }

    #about .appleii-hint {
        /* Keep the affordance visible when the stacked windows overflow the
           short, internally-scrollable version of this section. */
        position: absolute;
        right: 12px;
        bottom: 12px;
        /* The windows retain their desktop stacking levels (101–103). */
        z-index: 104;
        margin: 0;
        font-size: 18px;
        text-shadow: 1px 1px #000;

        span {
            display: none;
        }
    }

    /* schedule menu must wrap or it widens the whole page on phones */
    #schedule .xp-menu {
        flex-wrap: wrap;
    }

    /* faq */
    #faq .browser-title {
        font-size: 20px;
    }

    #faq .browser-menu a {
        font-size: 15px;
        padding: 6px 8px;
    }

    #faq .toolbar-btn {
        font-size: 16px;
        min-height: 32px;
        padding: 2px 10px;
    }

    #faq .browser-searchbar {
        font-size: 16px;
        align-self: stretch;
    }

    #faq .browser-main {
        padding: 6px 14px;
    }

    #faq .browser-main h2 {
        font-size: 26px;
    }

    #faq .browser-main .faq-item {
        margin-bottom: 16px;
    }

    #faq .browser-main .faq-item h3 {
        font-size: 21px;
    }

    #faq .browser-main .faq-item p {
        font-size: 15px;
        line-height: 1.45;
        margin-left: 10px;
    }

    #schedule {
        --label-width: 92px;
        --hour-width: 72px;
        --row-height: 72px;
    }

    #schedule .xp-menu {
        font-size: 14px;

        a {
            padding: 6px 8px;
        }
    }

    #schedule .schedule-grid {
        height: auto;
    }

    #schedule .schedule-body {
        flex: 1;
    }

    #schedule .schedule-label {
        font-size: 12px;
        padding: 0 6px;
        overflow-wrap: break-word;
    }

    #schedule .schedule-date,
    #schedule .schedule-hour {
        font-size: 12px;
    }

    #schedule .schedule-event {
        font-size: 13px;

        > :first-child {
            white-space: normal;
            display: -webkit-box;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 2;
            line-clamp: 2;
        }

        .event-time {
            font-size: 12px;
        }
    }

    /* tracks */
    #tracks .dos-menubar nav {
        font-size: clamp(15px, 2.6vw, 20px);
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0 6px;
        padding: 6px;
    }

    #tracks .dos-menubar nav a {
        padding: 5px 4px;
    }

    #tracks .dos-menubar nav a::after {
        content: none;
    }

    #tracks .dos-screen {
        padding: 16px 10px;
        gap: 10px;
    }

    #tracks .dos-window,
    #tracks .dos-cmd {
        width: min(900px, 96vw);
    }

    #tracks .dos-titlebar {
        font-size: 20px;
    }

    #tracks .dos-cols {
        min-height: 0;
        flex-direction: column;
    }

    #tracks .dos-list {
        flex: 0 0 auto;
        display: grid;
        grid-template-columns: 1fr 1fr;
        border-right: none;
        border-bottom: 2px solid #333;
        padding: 6px;
    }

    #tracks .dos-item {
        font-size: clamp(18px, 3.2vw, 22px);
        padding: 8px 10px;
    }

    #tracks .dos-detail {
        padding: 14px 16px;
    }

    #tracks .dos-panel h3 {
        font-size: clamp(24px, 4vw, 28px);
    }

    #tracks .dos-panel p {
        font-size: 20px;
    }

    /* the list is two columns here, so give subtracks its own row */
    #tracks .dos-item-sub {
        grid-column: 1 / -1;
        margin-top: 4px;
        padding-top: 10px;
    }

    #tracks .dos-note {
        font-size: 17px;
        color: #888;
    }

    #tracks .dos-keys {
        font-size: 16px;
        gap: 14px;
        flex-wrap: wrap;
    }

    #sponsors #bulletin-board {
        width: calc(100% - 32px);
        height: calc(100% - 48px);
    }

    /* two notes side by side, so three rows of them have to fit */
    #sponsors .notes-grid {
        --u: min(2.4cqw, 2.1cqh, 11.5px);
    }
}

@media (max-width: 480px) {
    /* the logo costs the room the last menu items need */
    #about .status-menu-bar {
        justify-content: space-between;

        img {
            display: none;
        }

        a {
            font-size: 11px;
            padding: 16px 4px;
        }
    }
}

/* keyboard hints mean nothing on touch screens */
@media (hover: none) {
    #tracks .dos-keys {
        display: none;
    }
}

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

    *,
    *::before,
    *::after {
        transition: none !important;
    }
}

#register {
    grid-template-rows: 1fr auto;
}

#site-footer {
    scroll-snap-align: end;
    grid-column: 1 / -1;
    position: relative;
    z-index: 2;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 24px;
    padding: 20px 16px;
    background-color: #11232a;
    font-family: "Geist", system-ui, sans-serif;
    font-size: 14px;

    a {
        color: rgba(255, 255, 255, 0.72);
        text-decoration: none;
    }

    a:hover,
    a:focus-visible {
        color: #fff;
        text-decoration: underline;
    }
}
