/* Khairil Hodgson — terminal landing page styles */
:root {
    --bg: #000;
    --bg-2: #0a0a0a;
    --fg: #c8d3c8;
    --fg-dim: #6d7d6d;
    --fg-faint: #2c362c;
    --green: #63f29a;
    --green-dim: #2f8f56;
    --amber: #f0c060;
    --red: #ff6b5e;
    --line: #1d261d;
    --glow: rgba(99, 242, 154, .18);
    --radius: 6px;
    --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--fg);
    font: 15px/1.6 var(--mono);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

::selection {
    background: var(--green);
    color: var(--bg);
}

/* subtle CRT: scanlines + vignette + faint flicker */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 5;
    background: repeating-linear-gradient(0deg, rgba(0, 0, 0, .14) 0 1px, transparent 1px 3px);
    mix-blend-mode: multiply;
    opacity: .55;
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 4;
    background: radial-gradient(ellipse at 50% 40%, transparent 55%, rgba(0, 0, 0, .55) 100%);
    animation: flicker 9s infinite;
}

@keyframes flicker {

    0%,
    100% {
        opacity: 1
    }

    92% {
        opacity: 1
    }

    93% {
        opacity: .92
    }

    94% {
        opacity: 1
    }

    97% {
        opacity: .96
    }

    98% {
        opacity: 1
    }
}

.screen {
    min-height: 100dvh;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 1;
}

/* top bar */
/* terminal window = title bar + body; the head floats inside the body's top-right corner */
.term-wrap {
    position: relative;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    /* old-TV switch-on: a blinding horizontal line that swells open, overshoots, then settles.
       Fill is 'backwards', not 'both': a lingering transform/filter would make this box the
       containing block for the position:fixed head, so it would move with the console. */
    transform-origin: 50% 50%;
    animation: tv-on 1.1s cubic-bezier(.25, .9, .3, 1) backwards;
}

@keyframes tv-on {
    0% {
        opacity: 0;
        transform: scale(.6, .002);
        filter: brightness(12) blur(2px);
    }

    12% {
        opacity: 1;
        transform: scale(1.04, .004);
        filter: brightness(14) blur(3px);
    }

    36% {
        transform: scale(1.03, .01);
        filter: brightness(9) blur(2px);
    }

    58% {
        transform: scale(1.015, 1.03);
        filter: brightness(2.6) contrast(1.5) saturate(.3) blur(.6px);
    }

    78% {
        transform: scale(.995, .99);
        filter: brightness(1.25) contrast(1.15) saturate(.8);
    }

    100% {
        opacity: 1;
        transform: none;
        filter: none;
    }
}

/* the whole screen gets a brief phosphor flash as the tube warms up */
html::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 6;
    pointer-events: none;
    background: radial-gradient(ellipse at 50% 50%, rgba(220, 255, 235, .9), rgba(99, 242, 154, .35) 40%, transparent 70%);
    opacity: 0;
    animation: tv-flash 1.1s ease-out both;
}

@keyframes tv-flash {
    0% {
        opacity: 0;
    }

    12% {
        opacity: .85;
    }

    40% {
        opacity: .35;
    }

    100% {
        opacity: 0;
    }
}

.bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    color: var(--fg-dim);
    font-size: 12px;
    letter-spacing: .04em;
    background: rgba(99, 242, 154, .08);
    border: 1px solid rgba(99, 242, 154, .22);
    border-bottom: 1px solid rgba(99, 242, 154, .18);
    border-radius: var(--radius) var(--radius) 0 0;
}

.bar .dots {
    display: flex;
    gap: 6px;
}

.bar .dots i {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--fg-faint);
    display: block;
}

.bar .dots i:first-child {
    background: var(--green-dim);
}

.bar .title {
    margin-left: 4px;
}

.bar .clock {
    margin-left: auto;
    font-variant-numeric: tabular-nums;
}

/* main */
/* window sits just below the top of the page; room is left for three rows of hints + footer */
main {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    text-align: center;
    padding: 20px 0 48px;
}

.avatar {
    position: absolute;
    top: 56px;
    right: 26px;
    z-index: 3;
    width: clamp(130px, 16vw, 240px);
    aspect-ratio: 1;
    border-radius: 50%;
    overflow: hidden;
    filter: drop-shadow(0 8px 24px rgba(0, 0, 0, .7));
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    -webkit-user-drag: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: none;
    transition: transform .15s ease;
}

.avatar:hover {
    transform: scale(1.06);
}

.avatar.grabbed {
    cursor: grabbing;
    transform: scale(1.1);
    transition: none;
}

/* once dragged, the head lives on the viewport rather than in the terminal corner */
.avatar.loose {
    position: fixed;
    z-index: 60;
}

.avatar.flying {
    transform: none;
    transition: none;
}

.avatar.dancing {
    transition: none;
}

/* hover speech bubble, positioned beside the head by site.js (headBubble) */
.head-bubble {
    position: fixed;
    z-index: 61;
    max-width: 220px;
    padding: 7px 11px;
    font-size: 12px;
    line-height: 1.35;
    color: var(--green);
    background: rgba(0, 0, 0, .86);
    border: 1px solid rgba(99, 242, 154, .5);
    border-radius: 10px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .55);
    pointer-events: none;
    opacity: 0;
    transform: translateX(6px) scale(.96);
    transition: opacity .15s ease, transform .15s ease;
}

.head-bubble.right {
    transform: translateX(-6px) scale(.96);
}

.head-bubble.show {
    opacity: 1;
    transform: none;
}

/* the tail: a small rotated square on the side facing the head */
.head-bubble::after {
    content: "";
    position: absolute;
    top: 50%;
    right: -6px;
    width: 10px;
    height: 10px;
    margin-top: -5px;
    background: inherit;
    border: inherit;
    border-width: 0 1px 1px 0;
    border-radius: 0 0 2px 0;
    transform: rotate(-45deg);
}

.head-bubble.right::after {
    right: auto;
    left: -6px;
    transform: rotate(135deg);
}

@media (prefers-reduced-motion: reduce) {
    .head-bubble,
    .head-bubble.right {
        transform: none;
        transition: opacity .1s;
    }
}

.avatar img {
    width: 100%;
    height: 100%;
    display: block;
    pointer-events: none;
    -webkit-user-drag: none;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

@keyframes rise {
    to {
        opacity: 1;
        transform: none;
    }
}

h1 {
    margin: 26px 0 0;
    font-weight: 500;
    font-size: clamp(20px, 3.4vw, 28px);
    letter-spacing: .12em;
    text-transform: lowercase;
    color: var(--fg);
    opacity: 0;
    animation: rise .8s .7s cubic-bezier(.2, .7, .2, 1) forwards;
}

h1 .prompt {
    color: var(--green);
    margin-right: .4em;
}

.caret {
    display: inline-block;
    width: .55em;
    height: 1.05em;
    background: var(--green);
    vertical-align: -.15em;
    margin-left: .15em;
    animation: blink 1s steps(1) infinite;
}

@keyframes blink {
    50% {
        opacity: 0
    }
}

/* typed console */
.console {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    text-align: left;
    font-size: 15px;
    line-height: 1.5;
    color: var(--fg-dim);
    /* viewport minus: page top, title bar, three rows of hint chips, footer */
    height: calc(100dvh - 20px - 42px - 132px - 48px);
    min-height: 320px;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 14px 16px;
    background: rgba(99, 242, 154, .045);
    border: 1px solid rgba(99, 242, 154, .22);
    border-top: 0;
    border-radius: 0 0 var(--radius) var(--radius);
    box-shadow: inset 0 0 40px rgba(99, 242, 154, .05), 0 0 30px rgba(99, 242, 154, .06);
    scrollbar-width: thin;
    scrollbar-color: rgba(99, 242, 154, .35) transparent;
}

.console::-webkit-scrollbar { width: 8px; }
.console::-webkit-scrollbar-thumb { background: rgba(99, 242, 154, .3); border-radius: 4px; }
.console::-webkit-scrollbar-track { background: transparent; }

.console .line {
    white-space: pre-wrap;
    word-break: break-word;
    min-height: 1.5em;
}

/* one source line of reflowed file text (fitText in site.js): wrapped rows hang under its text */
.console .hang {
    display: block;
    padding-left: var(--hang, 0);
    text-indent: calc(-1 * var(--hang, 0));
}

.console .p {
    color: var(--green);
}

.console .out {
    color: var(--fg);
}

.console .hi {
    color: var(--amber);
}

.console .ok {
    color: var(--green);
}

.console .err {
    color: var(--red);
}

.console .dir {
    color: var(--green);
    font-weight: 500;
}

.console .exec {
    color: var(--amber);
}

.avatar.dancing {
    position: fixed;
    z-index: 60;
    right: auto;
    will-change: transform;
}

canvas.matrix {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 49;
    mix-blend-mode: screen;
}

canvas.confetti {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 50;
}

.console .cf-inline {
    margin: 6px 0;
    min-height: 65px;
    max-width: 320px;
}

.console {
    cursor: text;
}

.console .banner {
    min-height: 1.5em;
}

.console .dim {
    color: var(--fg-dim);
}

/* adventure.sh: story text, the numbered choices, Ben's narration, and the running tally */
.console .story {
    color: #dfe9df;
}

.console .choice {
    color: var(--amber);
}

.console .choice.dim {
    color: rgba(240, 192, 96, .6);
}

/* clickable game options (optLine in site.js): whole line is the target, no link underline */
.console a.opt {
    display: inline-block;
    border-bottom: 0;
    border-radius: 4px;
    padding: 0 4px;
    margin-left: -4px;
    cursor: pointer;
}

.console a.opt:hover,
.console a.opt:focus-visible {
    color: #000;
    background: var(--amber);
    text-shadow: none;
}

.console a.opt:hover .ok,
.console a.opt:focus-visible .ok {
    color: #000;
}

/* options from a question already answered: plain text again */
.console a.opt.spent {
    color: rgba(240, 192, 96, .55);
    background: none;
    cursor: default;
    pointer-events: none;
}

.console .dm {
    color: #c4a7ff;
    font-style: italic;
}

.console .status {
    color: var(--green-dim);
    font-size: .9em;
}

.console b {
    color: var(--fg);
    font-weight: 500;
}

.hints {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    align-self: start;
    padding-top: 12px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 8px;
    font-size: 13px;
}

.hints-label {
    color: var(--green);
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    font-size: 11px;
    margin-right: 4px;
    white-space: nowrap;
}

.hint {
    font: inherit;
    font-size: 13px;
    font-weight: 500;
    color: var(--green);
    background: rgba(99, 242, 154, .10);
    border: 1px solid rgba(99, 242, 154, .45);
    border-radius: 6px;
    padding: 6px 12px;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06);
    transition: color .15s, border-color .15s, background .15s, box-shadow .15s, transform .1s;
    animation: hint-in .35s ease-out both;
}

.hint::before {
    content: "$ ";
    color: var(--green-dim);
}

.hint:active,
.hint:focus-visible {
    color: #000;
    background: var(--green);
    border-color: var(--green);
    box-shadow: 0 0 18px rgba(99, 242, 154, .45);
    outline: none;
}

@media (hover: hover) {
    .hint:hover {
        color: #000;
        background: var(--green);
        border-color: var(--green);
        box-shadow: 0 0 18px rgba(99, 242, 154, .45);
    }

    .hint:hover::before {
        color: rgba(0, 0, 0, .55);
    }

    .hint.choice:hover {
        color: #000;
        background: var(--amber);
        border-color: var(--amber);
        box-shadow: 0 0 18px rgba(240, 192, 96, .45);
    }
}

.hints-label::before {
    content: "▶ ";
    animation: blink 1.2s steps(1) infinite;
}

.hint:active::before,
.hint:focus-visible::before {
    color: rgba(0, 0, 0, .55);
}

.hint.choice::before {
    content: "";
}

.hint.choice {
    color: var(--amber);
    background: rgba(240, 192, 96, .10);
    border-color: rgba(240, 192, 96, .45);
}

.hint.choice:active,
.hint.choice:focus-visible {
    color: #000;
    background: var(--amber);
    border-color: var(--amber);
    box-shadow: 0 0 18px rgba(240, 192, 96, .45);
}

.hint:active {
    transform: translateY(1px);
}

@keyframes hint-in {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

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

/* ---- floating menu under the head (public.menu in config / a running program's options) ---- */
.head-menu {
    --head-w: clamp(130px, 16vw, 240px);
    position: absolute;
    top: calc(56px + var(--head-w) + 10px);
    /* centred under the head: right edge at the head's middle, then shifted half its own width */
    right: calc(26px + var(--head-w) / 2);
    transform: translateX(50%);
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    min-width: var(--head-w);
    max-width: min(380px, 45vw);
    max-height: 60vh;
    overflow-y: auto;
    overscroll-behavior: contain;
    text-align: left;
    font-size: 12px;
    scrollbar-width: none;
}

.head-menu::-webkit-scrollbar {
    display: none;
}

.head-menu[hidden] {
    display: none;
}

/* once the head has been dragged the menu is pinned to the viewport by site.js */
.head-menu.loose {
    position: fixed;
    right: auto;
    transform: none;
    z-index: 60;
}

/* the label doubles as the collapse / expand toggle */
/* never shrink to fit max-height: the menu scrolls instead */
.head-menu > * {
    flex-shrink: 0;
}

.head-menu-label {
    font: inherit;
    color: var(--green);
    background: none;
    border: 0;
    cursor: pointer;
    text-align: left;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    font-size: 10px;
    padding: 0 2px 2px;
    white-space: nowrap;
}

.head-menu-label::before {
    content: "▶";
    display: inline-block;
    margin-right: .5em;
    transform: rotate(90deg);
    transition: transform .2s;
    animation: blink 1.2s steps(1) infinite;
}

.head-menu-label::after {
    content: " [−]";
    color: var(--green-dim);
}

.head-menu-label:focus-visible {
    outline: 1px dashed var(--green);
    outline-offset: 2px;
}

.head-menu.collapsed .head-menu-label::before {
    transform: none;
}

.head-menu.collapsed .head-menu-label::after {
    content: " [+]";
}

.head-menu.collapsed .item {
    display: none;
}

.head-menu .item {
    font: inherit;
    font-size: 12px;
    font-weight: 500;
    color: var(--green);
    background: rgba(0, 0, 0, .78);
    border: 1px solid rgba(99, 242, 154, .4);
    border-radius: 6px;
    padding: 5px 10px;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .06);
    transition: color .15s, border-color .15s, background .15s, box-shadow .15s;
    animation: menu-in .3s ease-out both;
}

.head-menu .item::before {
    content: "▸ ";
    color: var(--green-dim);
}

/* a label that starts with its own icon (📁 …) drops the arrow */
.head-menu .item.icon::before {
    content: none;
}

/* highlight only on a real hover (mouse) or a press: on touch screens the browser keeps a sticky
   :hover on whatever lands under the finger, which would light up one option as soon as a new
   list appears */
.head-menu .item:active,
.head-menu .item:focus-visible {
    color: #000;
    background: var(--green);
    border-color: var(--green);
    box-shadow: 0 0 18px rgba(99, 242, 154, .45);
    outline: none;
}

.head-menu .item:active::before,
.head-menu .item:focus-visible::before {
    color: rgba(0, 0, 0, .55);
}

@media (hover: hover) {
    .head-menu .item:hover {
        color: #000;
        background: var(--green);
        border-color: var(--green);
        box-shadow: 0 0 18px rgba(99, 242, 154, .45);
    }

    .head-menu .item:hover::before {
        color: rgba(0, 0, 0, .55);
    }

    .head-menu .item.choice:hover {
        color: #000;
        background: var(--amber);
        border-color: var(--amber);
        box-shadow: 0 0 18px rgba(240, 192, 96, .45);
    }
}

/* a program's choices (numbered options, yes/no…) use the amber of the bottom chips */
.head-menu .item.choice {
    color: var(--amber);
    border-color: rgba(240, 192, 96, .45);
}

.head-menu .item.choice:active,
.head-menu .item.choice:focus-visible {
    color: #000;
    background: var(--amber);
    border-color: var(--amber);
    box-shadow: 0 0 18px rgba(240, 192, 96, .45);
}

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

    to {
        opacity: 1;
    }
}

.console .input-line {
    position: relative;
}

.console .typed {
    color: var(--fg);
}

.console .hidden-input {
    position: absolute;
    left: 0;
    top: 0;
    width: 1px;
    height: 1px;
    opacity: 0;
    border: 0;
    padding: 0;
    pointer-events: none;
}

.console a {
    color: var(--amber);
    text-decoration: none;
    border-bottom: 1px dashed var(--amber);
    transition: color .2s, border-color .2s, text-shadow .2s;
}

.console a:hover,
.console a:focus-visible {
    color: #fff;
    border-color: #fff;
    text-shadow: 0 0 12px rgba(240, 192, 96, .6);
    outline: none;
}

.btn {
    font: inherit;
    font-size: 14px;
    letter-spacing: .06em;
    color: var(--green);
    background: transparent;
    border: 1px solid var(--green-dim);
    border-radius: var(--radius);
    padding: 10px 18px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: background .2s, color .2s, box-shadow .2s, border-color .2s;
}

.btn:hover,
.btn:focus-visible {
    background: var(--green);
    color: var(--bg);
    border-color: var(--green);
    box-shadow: 0 0 24px var(--glow);
    outline: none;
}

.btn.secondary {
    color: var(--fg-dim);
    border-color: var(--line);
}

.btn.secondary:hover {
    background: var(--bg-2);
    color: var(--fg);
    border-color: var(--fg-dim);
    box-shadow: none;
}

.btn[disabled] {
    opacity: .5;
    cursor: progress;
}

footer {
    position: fixed;
    bottom: env(safe-area-inset-bottom, 0px);
    left: 50%;
    transform: translateX(-50%);
    width: min(100%, 960px);
    padding: 0 20px 16px;
    z-index: 2;
    color: var(--fg-faint);
    font-size: 12px;
    text-align: center;
    letter-spacing: .04em;
    pointer-events: none;
}

footer span {
    color: var(--fg-dim);
}

/* modal */
.modal {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: grid;
    place-items: center;
    padding: 20px;
    visibility: hidden;
}

.modal.open {
    visibility: visible;
}

.modal .backdrop {
    position: absolute;
    inset: 0;
    background: rgba(3, 5, 3, .78);
    backdrop-filter: blur(3px);
    opacity: 0;
    transition: opacity .3s;
}

.modal.open .backdrop {
    opacity: 1;
}

.win {
    position: relative;
    width: min(560px, 100%);
    background: var(--bg-2);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 30px 80px rgba(0, 0, 0, .6), 0 0 0 1px rgba(99, 242, 154, .06), 0 0 80px rgba(99, 242, 154, .07);
    transform: translateY(14px) scale(.985);
    opacity: 0;
    transition: transform .35s cubic-bezier(.2, .8, .2, 1), opacity .25s;
    max-height: calc(100dvh - 40px);
    display: flex;
    flex-direction: column;
}

.modal.open .win {
    transform: none;
    opacity: 1;
}

.win-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--line);
    color: var(--fg-dim);
    font-size: 12px;
}

.win-bar .dots {
    display: flex;
    gap: 6px;
}

.win-bar .dots i {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--fg-faint);
    display: block;
}

.modal.app .win {
    width: min(1400px, 100%);
    height: calc(100dvh - 32px);
    max-height: none;
}

.modal.app iframe {
    flex: 1;
    width: 100%;
    border: 0;
    background: #000;
    border-radius: 0 0 var(--radius) var(--radius);
}

/* video mode: pull the iframe up under the title bar so the embed's own title overlay is clipped */
.modal.app.video .win {
    overflow: hidden;
}

.modal.app.video .win-bar {
    position: relative;
    z-index: 1;
    background: var(--bg-2);
}

.modal.app.video iframe {
    margin-top: -80px;
}

.win-bar .pop {
    margin-left: auto;
    color: var(--fg-dim);
    text-decoration: none;
    padding: 2px 6px;
    border-radius: 4px;
}

.win-bar .pop:hover {
    color: var(--green);
    background: rgba(99, 242, 154, .08);
}

.win-bar .pop + .x {
    margin-left: 0;
}

.win-bar .x {
    margin-left: auto;
    background: none;
    border: 0;
    color: var(--fg-dim);
    font: inherit;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
}

.win-bar .x:hover {
    color: var(--red);
    background: rgba(255, 107, 94, .08);
}

.win-body {
    padding: 18px 18px 20px;
    overflow: auto;
}

.win-body .lead {
    color: var(--fg-dim);
    font-size: 13px;
    margin: 0 0 16px;
}

.win-body .lead b {
    color: var(--green);
    font-weight: 500;
}

.field {
    display: block;
    margin-bottom: 12px;
}

.field span {
    display: block;
    font-size: 12px;
    color: var(--fg-dim);
    margin-bottom: 4px;
    letter-spacing: .04em;
}

.field span::before {
    content: "$ ";
    color: var(--green-dim);
}

.field input,
.field textarea {
    width: 100%;
    font: inherit;
    font-size: 14px;
    color: var(--fg);
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 9px 11px;
    transition: border-color .2s, box-shadow .2s;
    caret-color: var(--green);
}

.field textarea {
    min-height: 120px;
    resize: vertical;
}

.field input:focus,
.field textarea:focus {
    outline: none;
    border-color: var(--green-dim);
    box-shadow: 0 0 0 3px rgba(99, 242, 154, .10);
}

.hp {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.cf {
    margin: 4px 0 14px;
    min-height: 65px;
}

.form-foot {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.status {
    font-size: 13px;
    color: var(--fg-dim);
    min-height: 1.6em;
}

.status.err {
    color: var(--red);
}

.status.ok {
    color: var(--green);
}

.sent {
    text-align: left;
}

.sent .line {
    color: var(--fg-dim);
}

.sent .line b {
    color: var(--green);
    font-weight: 500;
}

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }

    h1 {
        opacity: 1;
        transform: none;
    }

    body::after {
        animation: none;
    }

    .term-wrap,
    html::before {
        animation: none;
    }
}

@media (max-width: 480px) {
    .screen {
        padding: 0 16px;
    }

    .bar {
        padding: 8px 12px;
    }

    main {
        padding: 12px 0 calc(12px + env(safe-area-inset-bottom, 0px));
    }

    /* no footer on phones: the terminal gets the space instead */
    footer {
        display: none;
    }

    .avatar {
        top: 50px;
        right: 14px;
        width: 96px;
    }

    /* under the head, right-aligned to it (centring would push it off screen) */
    .head-menu {
        --head-w: 96px;
        top: calc(50px + var(--head-w) + 8px);
        right: 14px;
        transform: none;
        min-width: 0;
        max-width: 58vw;
        max-height: 45vh;
        font-size: 11px;
        gap: 3px;
    }

    .head-menu .item {
        font-size: 11px;
        padding: 4px 8px;
    }

    .console {
        font-size: 13px;
        /* viewport minus: page top, title bar, one scrolling row of hint chips, bottom padding */
        height: calc(100dvh - 12px - 40px - 52px - 12px - env(safe-area-inset-bottom, 0px));
    }

    .bar .title {
        display: none;
    }

    /* hints stay on one line and scroll sideways instead of stacking over the footer */
    .hints {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding: 8px 0 4px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .hints::-webkit-scrollbar {
        display: none;
    }
}

/* ---- on-screen keyboard open (body.kb set from visualViewport in site.js) ---- */
body.kb footer {
    display: none;
}

/* the menu stays up with the keyboard, capped to what is left of the visual viewport under the head */
body.kb .head-menu {
    max-height: calc(var(--vvh, 100dvh) - 50px - var(--head-w) - 8px - 20px);
}

body.kb main {
    min-height: 0;
    padding-bottom: 8px;
}

body.kb .hints {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 8px 0 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

body.kb .hints::-webkit-scrollbar {
    display: none;
}

body.kb .console {
    /* visual viewport minus: page top, title bar, one row of hints, breathing room */
    height: calc(var(--vvh, 100dvh) - 12px - 40px - 52px - 12px);
    min-height: 160px;
}
