/* ===========================================================================
   site.css - everything that is not the tube: layout, the monitor cabinet,
   the terminal surface, and the marketing sections around it.
   =========================================================================== */

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 5.5rem;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--bg-deep);
    color: var(--fg);
    font-family: var(--mono);
    font-size: clamp(14px, 0.55vw + 12px, 16px);
    line-height: var(--leading);
    letter-spacing: 0.01em;
    overflow-x: hidden;
}

/* A faint grid, like a phosphor screen at rest. */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(80% 60% at 50% 0%, rgba(38, 166, 76, 0.10), transparent 70%),
        linear-gradient(to bottom, #0a0d0a, #050705 60%, #040504);
}

img,
svg {
    max-width: 100%;
    height: auto;
}

a {
    color: var(--link);
    text-decoration-color: rgba(46, 200, 200, 0.4);
    text-underline-offset: 3px;
}

a:hover,
a:focus-visible {
    color: var(--ansi-bright-white);
    text-decoration-color: currentColor;
}

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

h1, h2, h3, h4 {
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.02em;
    margin: 0 0 0.6em;
}

h2 {
    font-size: clamp(1.35rem, 2.6vw, 2rem);
}

h3 {
    font-size: 1.05rem;
}

p {
    margin: 0 0 1em;
    max-width: 70ch;
}

code,
kbd,
samp {
    font-family: var(--mono);
}

code {
    color: var(--ansi-bright-green);
    background: rgba(57, 211, 83, 0.08);
    border: 1px solid rgba(57, 211, 83, 0.16);
    border-radius: 3px;
    padding: 0.05em 0.35em;
    font-size: 0.92em;
}

kbd {
    display: inline-block;
    background: #11170f;
    border: 1px solid var(--rule);
    border-bottom-width: 2px;
    border-radius: 3px;
    padding: 0.05em 0.45em;
    font-size: 0.85em;
    color: var(--ansi-bright-yellow);
}

hr {
    border: 0;
    border-top: 1px solid var(--rule-soft);
    margin: 2.5rem 0;
}

.wrap {
    width: min(100% - 2rem, var(--page));
    margin-inline: auto;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--accent);
    color: #04170a;
    padding: 0.6rem 1rem;
    z-index: 1000;
    font-weight: 700;
}

.skip-link:focus {
    left: 0.5rem;
    top: 0.5rem;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* --- ANSI colour classes, used by the terminal and by prose ---------------- */
.c-r  { color: var(--ansi-bright-red); }
.c-g  { color: var(--ansi-bright-green); }
.c-y  { color: var(--ansi-bright-yellow); }
.c-b  { color: var(--ansi-bright-blue); }
.c-m  { color: var(--ansi-bright-magenta); }
.c-c  { color: var(--ansi-bright-cyan); }
.c-w  { color: var(--ansi-bright-white); }
.c-d  { color: var(--muted); }
.c-hi { color: var(--ansi-bright-white); background: rgba(57, 211, 83, 0.18); }
.c-u  { text-decoration: underline; text-underline-offset: 2px; }
.c-inv { color: var(--bg); background: var(--fg); }

/* ===========================================================================
   Boot overlay
   =========================================================================== */
.boot {
    position: fixed;
    inset: 0;
    z-index: 700;
    background: #030403;
    display: grid;
    align-content: center;
    padding: clamp(1rem, 6vw, 5rem);
    overflow: hidden;
}

.boot[hidden] {
    display: none;
}

.boot__log {
    font-size: clamp(11px, 1.5vw, 14px);
    line-height: 1.45;
    color: var(--ansi-bright-green);
    white-space: pre-wrap;
    margin: 0;
    max-height: 80vh;
    overflow: hidden;
    text-shadow: 0 0 10px rgba(57, 211, 83, 0.35);
}

.boot__skip {
    position: absolute;
    right: clamp(1rem, 4vw, 3rem);
    bottom: clamp(1rem, 4vw, 3rem);
    color: var(--muted);
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    background: none;
    border: 1px solid var(--rule-soft);
    border-radius: var(--radius);
    padding: 0.4rem 0.8rem;
    cursor: pointer;
    font-family: inherit;
}

.boot__skip:hover {
    color: var(--fg);
    border-color: var(--rule);
}

/* The power-on flash: a bright line that opens into the full screen. */
.boot--off .boot__log {
    visibility: hidden;
}

body.booting {
    overflow: hidden;
}

/* ===========================================================================
   Header
   =========================================================================== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 800;
    backdrop-filter: blur(6px);
    background: linear-gradient(to bottom, rgba(4, 6, 4, 0.94), rgba(4, 6, 4, 0.72));
    border-bottom: 1px solid var(--rule-soft);
}

.site-header__inner {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-height: 3.4rem;
}

.brand {
    display: inline-flex;
    align-items: baseline;
    gap: 0.5ch;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--fg);
    text-decoration: none;
    white-space: nowrap;
}

.brand__cursor {
    display: inline-block;
    width: 0.6ch;
    height: 1em;
    background: var(--accent);
    transform: translateY(0.1em);
    animation: caret 1.05s steps(1) infinite;
}

.nav {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: clamp(0.5rem, 1.6vw, 1.4rem);
}

.nav a {
    color: var(--muted);
    text-decoration: none;
    font-size: 0.86rem;
    letter-spacing: 0.06em;
    white-space: nowrap;
}

.nav a:hover,
.nav a:focus-visible {
    color: var(--accent);
}

.nav__sep {
    color: var(--rule);
}

@media (max-width: 860px) {
    .nav .nav__hide-sm {
        display: none;
    }
}

/* ===========================================================================
   Buttons
   =========================================================================== */
.btn {
    --btn-fg: #04170a;
    --btn-bg: var(--accent);
    display: inline-flex;
    align-items: center;
    gap: 0.6ch;
    background: var(--btn-bg);
    color: var(--btn-fg);
    border: 1px solid var(--btn-bg);
    border-radius: var(--radius);
    padding: 0.62rem 1.1rem;
    font: inherit;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 0 0 rgba(57, 211, 83, 0);
    transition: box-shadow 160ms ease, transform 160ms ease, background 160ms ease;
    white-space: nowrap;
}

.btn:hover,
.btn:focus-visible {
    color: var(--btn-fg);
    box-shadow: 0 0 22px rgba(57, 211, 83, 0.45);
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn--ghost {
    --btn-bg: transparent;
    --btn-fg: var(--fg);
    border-color: var(--rule);
}

.btn--ghost:hover,
.btn--ghost:focus-visible {
    --btn-fg: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 0 18px rgba(57, 211, 83, 0.18);
}

.btn--sm {
    padding: 0.35rem 0.7rem;
    font-size: 0.8rem;
    font-weight: 400;
}

/* ===========================================================================
   Hero + the monitor cabinet
   =========================================================================== */
.hero {
    padding: clamp(2rem, 6vw, 4.5rem) 0 clamp(1.5rem, 4vw, 3rem);
}

.hero__grid {
    display: grid;
    gap: clamp(1.5rem, 4vw, 3rem);
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
}

@media (min-width: 1000px) {
    .hero__grid {
        grid-template-columns: minmax(0, 0.86fr) minmax(0, 1.14fr);
    }
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.6ch;
    font-size: 0.76rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--accent-dim);
    border: 1px solid var(--rule);
    border-radius: 999px;
    padding: 0.25rem 0.85rem;
    margin-bottom: 1.2rem;
}

.hero h1 {
    font-size: clamp(2rem, 5.4vw, 3.4rem);
    letter-spacing: 0.01em;
    margin-bottom: 0.5rem;
}

.hero h1 .thin {
    color: var(--muted);
    font-weight: 400;
    display: block;
    font-size: 0.42em;
    letter-spacing: 0.28em;
    margin-bottom: 0.7rem;
}

.hero__lede {
    font-size: 1.02rem;
    color: #b9c2b9;
}

.hero__cta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
    margin: 1.6rem 0 1rem;
}

.hero__meta {
    font-size: 0.8rem;
    color: var(--muted);
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1.2rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.hero__meta li::before {
    content: "▸ ";
    color: var(--accent-dim);
}

/* --- The cabinet ---------------------------------------------------------- */
.monitor {
    --bezel: clamp(10px, 1.6vw, 22px);
    position: relative;
    filter: drop-shadow(0 30px 60px rgba(0, 0, 0, 0.75));
}

.monitor__cabinet {
    background:
        linear-gradient(165deg, #2b2f2a 0%, #1b1f1a 42%, #121511 100%);
    border-radius: 18px;
    padding: var(--bezel);
    border: 1px solid #34392f;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.12),
        inset 0 -2px 6px rgba(0, 0, 0, 0.6);
}

.monitor__screen {
    position: relative;
    border-radius: 12px / 16px;
    background: radial-gradient(120% 120% at 50% 40%, #0b120c 0%, #060906 70%, #030503 100%);
    box-shadow:
        inset 0 0 0 1px #000,
        inset 0 0 42px rgba(0, 0, 0, 0.95),
        0 0 40px rgba(57, 211, 83, 0.06);
    overflow: hidden;
    /* A hair of curvature: enough to read as glass, not enough to blur text. */
    transform: perspective(1400px) rotateX(0.35deg);
}

/* Glass: the specular sweep across the top-left of the tube. */
.monitor__screen::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(150deg, rgba(255, 255, 255, 0.055) 0%, rgba(255, 255, 255, 0.015) 22%, transparent 45%),
        radial-gradient(140% 120% at 50% 50%, transparent 45%, rgba(0, 0, 0, 0.55) 100%);
    opacity: calc(0.4 + 0.6 * var(--crt));
}

.monitor__plate {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.55rem 0.3rem 0.1rem;
    font-size: 0.68rem;
    letter-spacing: 0.24em;
    color: #6d7568;
    text-transform: uppercase;
}

.monitor__led {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 10px var(--accent);
    animation: led 3.2s ease-in-out infinite;
}

.monitor__keys {
    margin-left: auto;
    display: flex;
    gap: 0.35rem;
    letter-spacing: 0;
}

@keyframes led {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.55; }
}

@keyframes caret {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

/* --- The terminal surface -------------------------------------------------- */
.term {
    display: flex;
    flex-direction: column;
    height: clamp(360px, 56vh, 560px);
    padding: clamp(0.7rem, 1.4vw, 1.1rem);
    font-size: clamp(11.5px, 1.05vw, 14px);
    line-height: 1.45;
    color: var(--fg);
    cursor: text;
}

.term__out {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: rgba(57, 211, 83, 0.35) transparent;
}

.term__out::-webkit-scrollbar {
    width: 8px;
}

.term__out::-webkit-scrollbar-thumb {
    background: rgba(57, 211, 83, 0.3);
    border-radius: 4px;
}

.term__line {
    white-space: pre-wrap;
    word-break: break-word;
    min-height: 1.45em;
}

.term__line--sys {
    color: var(--muted);
}

.term__prompt {
    color: var(--accent);
}

.term__prompt .u { color: var(--ansi-bright-green); }
.term__prompt .h { color: var(--ansi-bright-cyan); }
.term__prompt .p { color: var(--ansi-bright-blue); }
.term__prompt .s { color: var(--fg); }

.term__inputline {
    display: flex;
    align-items: flex-start;
    gap: 0;
    padding-top: 0.15em;
}

.term__field {
    position: relative;
    flex: 1;
    min-width: 0;
}

.term__field input {
    width: 100%;
    background: transparent;
    border: 0;
    padding: 0;
    margin: 0;
    color: var(--fg);
    font: inherit;
    letter-spacing: inherit;
    caret-color: transparent;
    outline: none;
}

.term__caret {
    position: absolute;
    top: 0.05em;
    left: 0;
    width: 1ch;
    height: 1.2em;
    background: var(--accent);
    opacity: 0.9;
    pointer-events: none;
    animation: caret 1.05s steps(1) infinite;
    transform: translateX(calc(var(--col, 0) * 1ch));
}

.term--busy .term__caret {
    animation: none;
    opacity: 0.35;
}

.term__ghost {
    position: absolute;
    top: 0.05em;
    left: 0;
    color: var(--muted);
    opacity: 0.45;
    pointer-events: none;
    white-space: pre;
}

/* Command chips - the way in for anyone on a phone, or anyone who would
   rather click than type. */
.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.9rem;
}

.chip {
    font: inherit;
    font-size: 0.78rem;
    color: var(--fg);
    background: rgba(57, 211, 83, 0.06);
    border: 1px solid var(--rule);
    border-radius: 999px;
    padding: 0.28rem 0.75rem;
    cursor: pointer;
    transition: background 140ms ease, color 140ms ease;
}

.chip:hover,
.chip:focus-visible {
    background: rgba(57, 211, 83, 0.18);
    color: var(--ansi-bright-white);
}

.chip::before {
    content: "$ ";
    color: var(--accent);
}

/* --- Mission progress ------------------------------------------------------ */
.progress {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    margin-top: 0.85rem;
    font-size: 0.76rem;
    color: var(--muted);
    letter-spacing: 0.08em;
}

.progress__bar {
    flex: 1;
    height: 6px;
    background: rgba(217, 222, 217, 0.08);
    border: 1px solid var(--rule-soft);
    border-radius: 999px;
    overflow: hidden;
    min-width: 80px;
}

.progress__fill {
    display: block;
    height: 100%;
    width: 0%;
    background: linear-gradient(to right, var(--accent-dim), var(--accent));
    box-shadow: 0 0 12px rgba(57, 211, 83, 0.6);
    transition: width 420ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* ===========================================================================
   Sections
   =========================================================================== */
.section {
    padding: clamp(2.5rem, 7vw, 5.5rem) 0;
    border-top: 1px solid var(--rule-soft);
}

.section__head {
    margin-bottom: clamp(1.5rem, 3vw, 2.5rem);
}

.section__num {
    color: var(--accent-dim);
    font-size: 0.78rem;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    display: block;
    margin-bottom: 0.6rem;
}

.section__lede {
    color: #b0b9b0;
    max-width: 68ch;
}

.grid {
    display: grid;
    gap: var(--gap);
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr));
}

.card {
    background: linear-gradient(180deg, rgba(20, 26, 20, 0.85), rgba(10, 14, 10, 0.85));
    border: 1px solid var(--rule-soft);
    border-radius: var(--radius);
    padding: clamp(1rem, 2vw, 1.4rem);
    position: relative;
    transition: border-color 180ms ease, transform 180ms ease;
}

.card:hover {
    border-color: var(--rule);
    transform: translateY(-2px);
}

.card__icon {
    font-size: 1.4rem;
    line-height: 1;
    color: var(--accent);
    display: block;
    margin-bottom: 0.7rem;
}

.card h3 {
    color: var(--ansi-bright-white);
}

.card p {
    margin-bottom: 0;
    color: #a9b3a9;
    font-size: 0.92rem;
}

.card--tool h3 {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1ch;
}

.tag {
    font-size: 0.68rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent-dim);
    border: 1px solid var(--rule);
    border-radius: 999px;
    padding: 0.1rem 0.6rem;
    white-space: nowrap;
}

.tag--wip {
    color: var(--warn);
    border-color: rgba(234, 193, 79, 0.35);
}

/* Split rows: prose one side, a static terminal frame the other. */
.split {
    display: grid;
    gap: var(--gap);
    align-items: center;
    grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 900px) {
    .split {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .split--flip > :first-child {
        order: 2;
    }
}

.frame {
    background: #060906;
    border: 1px solid var(--rule-soft);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.8);
}

.frame__bar {
    display: flex;
    align-items: center;
    gap: 0.5ch;
    padding: 0.35rem 0.7rem;
    background: #0e120e;
    border-bottom: 1px solid var(--rule-soft);
    font-size: 0.72rem;
    color: var(--muted);
    letter-spacing: 0.1em;
}

.frame__dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #2a2f28;
    margin-right: 0.2rem;
}

.frame pre {
    margin: 0;
    padding: 0.9rem 1rem;
    font-size: clamp(11px, 1vw, 12.6px);
    line-height: 1.5;
    overflow-x: auto;
    white-space: pre;
    color: #c8d0c8;
}

/* --- The layer diagram ----------------------------------------------------- */
.stack {
    display: grid;
    gap: 0.5rem;
}

.stack__layer {
    display: grid;
    grid-template-columns: 10ch minmax(0, 1fr);
    gap: 1ch;
    align-items: baseline;
    border: 1px solid var(--rule-soft);
    border-left: 3px solid var(--accent-dim);
    border-radius: 3px;
    padding: 0.55rem 0.8rem;
    background: rgba(20, 26, 20, 0.6);
    font-size: 0.87rem;
}

.stack__layer b {
    color: var(--ansi-bright-cyan);
    font-weight: 400;
    letter-spacing: 0.08em;
}

.stack__layer span {
    color: #a9b3a9;
}

.stack__layer:nth-child(2) { border-left-color: var(--ansi-cyan); }
.stack__layer:nth-child(3) { border-left-color: var(--ansi-blue); }
.stack__layer:nth-child(4) { border-left-color: var(--ansi-magenta); }
.stack__layer:nth-child(5) { border-left-color: var(--ansi-yellow); }

/* --- Effect toggles -------------------------------------------------------- */
.toggles {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.2rem;
    margin: 1.2rem 0;
    padding: 0;
    list-style: none;
}

.switch {
    display: inline-flex;
    align-items: center;
    gap: 0.6ch;
    cursor: pointer;
    font-size: 0.86rem;
    color: #b0b9b0;
    user-select: none;
}

.switch input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.switch__box {
    width: 2.4ch;
    text-align: center;
    color: var(--accent);
    border: 1px solid var(--rule);
    border-radius: 2px;
}

.switch__box::before {
    content: "·";
}

.switch input:checked + .switch__box::before {
    content: "×";
}

.switch input:focus-visible + .switch__box {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* --- Command table --------------------------------------------------------- */
.table-scroll {
    overflow-x: auto;
    border: 1px solid var(--rule-soft);
    border-radius: var(--radius);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
    min-width: 520px;
}

th,
td {
    text-align: left;
    padding: 0.55rem 0.9rem;
    border-bottom: 1px solid var(--rule-soft);
    vertical-align: top;
}

thead th {
    color: var(--accent-dim);
    font-size: 0.72rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    background: rgba(38, 166, 76, 0.05);
}

tbody tr:last-child td {
    border-bottom: 0;
}

td:first-child {
    color: var(--ansi-bright-green);
    white-space: nowrap;
}

td.run {
    white-space: nowrap;
}

/* --- FAQ ------------------------------------------------------------------- */
details {
    border-bottom: 1px solid var(--rule-soft);
    padding: 0.9rem 0;
}

summary {
    cursor: pointer;
    color: var(--ansi-bright-white);
    font-weight: 700;
    list-style: none;
    display: flex;
    gap: 1ch;
    align-items: baseline;
}

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

summary::before {
    content: "+";
    color: var(--accent);
    width: 1ch;
    flex: none;
}

details[open] summary::before {
    content: "-";
}

details p:last-child {
    margin-bottom: 0;
}

details > *:not(summary) {
    margin-top: 0.8rem;
    color: #a9b3a9;
}

/* --- Call to action band --------------------------------------------------- */
.cta {
    text-align: center;
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    padding: clamp(1.6rem, 5vw, 3rem);
    background:
        radial-gradient(90% 140% at 50% 0%, rgba(38, 166, 76, 0.14), transparent 70%),
        rgba(10, 14, 10, 0.7);
}

.cta h2 {
    margin-bottom: 0.4rem;
}

.cta p {
    margin-inline: auto;
}

.cta__row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
    justify-content: center;
    margin-top: 1.4rem;
}

/* --- Footer ---------------------------------------------------------------- */
.site-footer {
    border-top: 1px solid var(--rule-soft);
    padding: 2.5rem 0 3.5rem;
    color: var(--muted);
    font-size: 0.84rem;
}

.site-footer__grid {
    display: grid;
    gap: var(--gap);
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
    margin-bottom: 2rem;
}

.site-footer h4 {
    color: var(--fg);
    font-size: 0.76rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    margin-bottom: 0.8rem;
}

.site-footer ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.35rem;
}

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

.site-footer a:hover {
    color: var(--accent);
}

.site-footer__legal {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
    justify-content: space-between;
    border-top: 1px solid var(--rule-soft);
    padding-top: 1.2rem;
}

/* ===========================================================================
   Reveal on scroll
   =========================================================================== */
.reveal {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 600ms ease, transform 600ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.reveal.is-in {
    opacity: 1;
    transform: none;
}

@media (prefers-reduced-motion: reduce) {
    .reveal {
        opacity: 1;
        transform: none;
    }
}

/* ===========================================================================
   Toast - achievement pop
   =========================================================================== */
.toasts {
    position: fixed;
    right: clamp(0.6rem, 2vw, 1.4rem);
    bottom: clamp(0.6rem, 2vw, 1.4rem);
    z-index: 930;
    display: grid;
    gap: 0.5rem;
    justify-items: end;
    pointer-events: none;
    max-width: min(92vw, 380px);
}

.toast {
    background: #0b120c;
    border: 1px solid var(--accent);
    border-left-width: 4px;
    border-radius: var(--radius);
    padding: 0.6rem 0.9rem;
    box-shadow: 0 0 30px rgba(57, 211, 83, 0.25);
    font-size: 0.84rem;
    animation: toast-in 260ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.toast b {
    display: block;
    color: var(--accent);
    font-size: 0.7rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.toast--out {
    animation: toast-out 320ms ease forwards;
}

@keyframes toast-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: none; }
}

@keyframes toast-out {
    to { opacity: 0; transform: translateX(14px); }
}

/* ===========================================================================
   The vim trap
   =========================================================================== */
.editor {
    position: fixed;
    inset: 0;
    z-index: 720;
    background: #050705;
    display: grid;
    grid-template-rows: 1fr auto;
    padding: 0;
    font-size: clamp(12px, 1.1vw, 15px);
}

.editor[hidden] {
    display: none;
}

.editor__body {
    padding: 1rem clamp(0.8rem, 3vw, 2rem);
    overflow: auto;
    white-space: pre-wrap;
    color: #c8d0c8;
    margin: 0;
}

.editor__tilde {
    color: var(--ansi-blue);
}

.editor__status {
    background: #0e120e;
    border-top: 1px solid var(--rule-soft);
    padding: 0.4rem clamp(0.8rem, 3vw, 2rem);
    display: flex;
    gap: 1.5ch;
    align-items: center;
    color: var(--muted);
    font-size: 0.85em;
}

.editor__mode {
    background: var(--accent);
    color: #04170a;
    font-weight: 700;
    padding: 0 0.7ch;
}

.editor__cmd {
    margin-left: auto;
    color: var(--fg);
}

/* ===========================================================================
   Print: give press people something sane.
   =========================================================================== */
@media print {
    .crt, .boot, .monitor, .chips, .toasts, .site-header {
        display: none !important;
    }

    body {
        background: #fff;
        color: #000;
    }
}

/* ===========================================================================
   Set pieces: the power-off collapse and the glitch.
   =========================================================================== */
.monitor__screen {
    transition: transform 420ms cubic-bezier(0.6, 0, 0.4, 1), filter 420ms ease;
}

.monitor__screen.is-off {
    transform: perspective(1400px) scaleY(0.004) scaleX(1.03);
    filter: brightness(2.6) saturate(0);
}

.monitor__screen.is-off .term,
.monitor__screen.is-off::after {
    opacity: 0;
}

.monitor__screen.is-glitching {
    animation: glitch 0.9s steps(2) 1;
}

@keyframes glitch {
    0%   { transform: perspective(1400px) translateX(0); filter: none; }
    20%  { transform: perspective(1400px) translateX(-6px) skewX(-1.4deg); filter: hue-rotate(70deg) contrast(1.6); }
    40%  { transform: perspective(1400px) translateX(5px) skewX(1deg); filter: hue-rotate(-40deg) brightness(1.4); }
    60%  { transform: perspective(1400px) translateX(-3px); filter: invert(1); }
    80%  { transform: perspective(1400px) translateX(2px) scaleY(1.02); filter: hue-rotate(120deg); }
    100% { transform: perspective(1400px) rotateX(0.35deg); filter: none; }
}

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