:root {
    --bg: #0b0d10;
    --bg-raised: #12151a;
    --bg-tile: #141820;
    --line: rgba(255, 255, 255, 0.08);
    --line-strong: rgba(255, 255, 255, 0.14);
    --text: #eef1f5;
    --muted: #9ba5b1;
    --dim: #6b7480;
    --accent: #4a9eff;
    --accent-dark: #2b7fe0;
    --warm: #ffb36b;
    --radius: 16px;
    --max: 1200px;
    --display: "Space Grotesk", "Inter", system-ui, sans-serif;
    --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    overflow-x: clip;
    background: var(--bg);
    color: var(--text);
    font: 16.5px/1.65 var(--font);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }

h1, h2, h3, h4 { font-family: var(--display); margin: 0; letter-spacing: -0.02em; }

/* Navigation: floats over the hero, glass once the page scrolls under it. */
.nav {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 40px;
    background: linear-gradient(rgba(11, 13, 16, 0.75), rgba(11, 13, 16, 0));
    transition: background 0.25s, padding 0.25s;
}
/* Below the nav, a fade into the page rather than an edge. */
.nav::after {
    content: "";
    position: absolute;
    left: 0; right: 0; top: 100%;
    height: 36px;
    background: linear-gradient(rgba(11, 13, 16, 0.9), rgba(11, 13, 16, 0));
    opacity: 0;
    transition: opacity 0.25s;
    pointer-events: none;
}
.nav.scrolled, .page .nav { background: rgba(11, 13, 16, 0.9); padding-top: 12px; padding-bottom: 12px; }
.nav.scrolled::after, .page .nav::after { opacity: 1; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-family: var(--display); font-size: 1.15rem; font-weight: 500; }
.brand b { font-weight: 700; }
.nav nav { display: flex; align-items: center; gap: 28px; }
.nav nav a { color: rgba(238, 241, 245, 0.78); font-size: 0.93rem; font-weight: 500; transition: color 0.15s; }
.nav nav a:hover, .nav nav a.active { color: #fff; }
.nav nav a.active:not(.nav-gh) { text-shadow: 0 0 18px rgba(140, 200, 255, 0.6); }
.nav-gh {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 7px 14px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
}

/* Hero: the engine's own frame, full bleed. */
.hero {
    position: relative;
    min-height: min(92vh, 940px);
    display: flex;
    align-items: flex-end;
    overflow: hidden;
    clip-path: polygon(0 0, 100% 0, 100% 94%, 0 100%);
}
.hero-bg {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    object-position: 60% 40%;
    scale: 1.04;
    translate: 0 var(--drift, 0px);
}
.hero-shade {
    position: absolute; inset: 0;
    background:
        linear-gradient(90deg, rgba(11, 13, 16, 0.95) 0%, rgba(11, 13, 16, 0.78) 40%, rgba(11, 13, 16, 0.08) 72%),
        linear-gradient(0deg, rgba(11, 13, 16, 0.9) 0%, rgba(11, 13, 16, 0) 40%);
}
.hero-inner {
    position: relative;
    width: 100%;
    max-width: var(--max);
    margin: 0 auto;
    padding: 140px 40px 16vh;
}
.hero h1 {
    font-size: clamp(2.6rem, 6vw, 5rem);
    line-height: 1.02;
    font-weight: 700;
    max-width: 14ch;
    margin: 22px 0 24px;
}
.hero h1 em {
    font-style: normal;
    background: linear-gradient(90deg, var(--accent), #8cc8ff 25%, var(--warm) 50%, #8cc8ff 75%, var(--accent));
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: shimmer 9s linear infinite;
}
.lead { color: rgba(238, 241, 245, 0.82); font-size: 1.2rem; max-width: 640px; margin: 0 0 34px; }

.pill {
    display: inline-flex; align-items: center; gap: 10px;
    padding: 5px 14px 5px 5px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background: rgba(11, 13, 16, 0.55);
    backdrop-filter: blur(8px);
    color: var(--text);
    font-size: 0.86rem;
}
.pill i { font-style: normal; color: var(--muted); transition: transform 0.15s, color 0.15s; }
.pill:hover i { transform: translateX(3px); color: var(--text); }
.pill span {
    background: var(--accent); color: #fff;
    font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
    padding: 3px 9px; border-radius: 999px;
}

.hero-caption {
    position: absolute;
    right: 92px; bottom: 9vh;
    margin: 0;
    color: rgba(238, 241, 245, 0.5);
    font: 0.78rem var(--mono);
    letter-spacing: 0.02em;
}

.actions { display: flex; gap: 12px; flex-wrap: wrap; }
.actions.center { justify-content: center; margin-top: 40px; }
.button {
    display: inline-flex; align-items: center;
    padding: 13px 24px;
    border-radius: 10px;
    font-weight: 600; font-size: 0.97rem;
    color: var(--text);
    border: 1px solid var(--line-strong);
    transition: transform 0.15s, background 0.15s, border-color 0.15s;
}
.button:hover { transform: translateY(-1px); }
.button.primary { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 8px 30px rgba(74, 158, 255, 0.35); }
.button.primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.button.primary { position: relative; overflow: hidden; }
.button.primary::after {
    content: "";
    position: absolute; inset: 0;
    background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.35) 50%, transparent 70%);
    translate: -120% 0;
    transition: translate 0.7s ease;
}
.button.primary:hover::after { translate: 120% 0; }
.button.glass { background: rgba(255, 255, 255, 0.08); backdrop-filter: blur(8px); }
.button.ghost { background: transparent; }

/* Facts: four statements under the hero. */
.facts {
    max-width: calc(var(--max) - 80px);
    margin: 56px auto 0;
    position: relative;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background: var(--line);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}
.facts div { background: var(--bg-raised); padding: 26px 24px; }
.facts strong { display: block; font-family: var(--display); font-size: 1.08rem; margin-bottom: 6px; }
.facts span { color: var(--muted); font-size: 0.92rem; line-height: 1.5; }
.facts code { font: 0.85em var(--mono); color: var(--text); }

/* Depth behind the content: a faint dot grid, and slow colour glows behind each section. */
main { position: relative; }
main::before {
    content: "";
    position: absolute; inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image: radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 28px 28px;
    mask-image: linear-gradient(transparent, #000 6%, #000 94%, transparent);
}
.block { position: relative; }
.block::before {
    content: "";
    position: absolute;
    z-index: -1;
    pointer-events: none;
    width: 760px; height: 760px;
    top: 20px; right: -240px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(74, 158, 255, 0.11), rgba(74, 158, 255, 0) 65%);
    animation: drift 22s ease-in-out infinite alternate;
}
#showcase::before { right: auto; left: -280px; background: radial-gradient(circle, rgba(255, 179, 107, 0.08), rgba(255, 179, 107, 0) 65%); animation-duration: 26s; }
#download::before { right: auto; left: 50%; margin-left: -380px; top: 140px; animation-duration: 30s; }
#license::before { top: 60px; background: radial-gradient(circle, rgba(255, 179, 107, 0.07), rgba(255, 179, 107, 0) 65%); animation-duration: 24s; }
@keyframes drift { to { transform: translate(-50px, 40px) scale(1.1); } }

/* Sections. */
.block { max-width: var(--max); margin: 0 auto; padding: 120px 40px 0; }
.heading { margin-bottom: 44px; max-width: 720px; }
.heading.center { margin-left: auto; margin-right: auto; text-align: center; }
.heading h2 { font-size: clamp(2rem, 3.8vw, 3rem); line-height: 1.08; font-weight: 700; }
.heading p { color: var(--muted); font-size: 1.08rem; margin: 16px 0 0; }
.eyebrow {
    display: inline-block;
    font-family: var(--mono);
    color: var(--accent);
    font-size: 0.78rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    margin-bottom: 14px;
}

/* Features: four frames, then the rest in a line. */
.feature-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.tile {
    position: relative;
    aspect-ratio: 16 / 9;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: var(--bg-tile);
    overflow: hidden;
}
.tile.image img, .tile.image video {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}
.tile.image:hover img, .tile.image:hover video { transform: scale(1.04); }
.tile.image::after {
    content: "";
    position: absolute; inset: 0;
    background: linear-gradient(0deg, rgba(11, 13, 16, 0.9) 0%, rgba(11, 13, 16, 0.35) 30%, rgba(11, 13, 16, 0) 55%);
}
.tile-text { position: absolute; left: 0; right: 0; bottom: 0; padding: 22px 26px; z-index: 2; }
.tile h3 { font-size: 1.35rem; margin-bottom: 4px; }
.tile p { color: rgba(238, 241, 245, 0.78); font-size: 0.95rem; margin: 0; }

.feature-row {
    list-style: none;
    margin: 16px 0 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: var(--line);
    overflow: hidden;
}
.feature-row li { background: var(--bg-raised); padding: 22px 22px 24px; }
.feature-row svg { width: 26px; height: 26px; margin-bottom: 12px; fill: none; stroke: var(--accent); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.feature-row strong { display: block; font-family: var(--display); font-size: 1.05rem; margin-bottom: 4px; }
.feature-row span { color: var(--muted); font-size: 0.9rem; line-height: 1.5; }

/* Showcase: one large frame and four beside it. */
.gallery {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-auto-rows: minmax(0, 1fr);
    gap: 16px;
}
.gallery figure {
    position: relative;
    margin: 0;
    aspect-ratio: 16 / 9;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    overflow: hidden;
}
.gallery figure.big { grid-column: span 2; grid-row: span 2; aspect-ratio: auto; }
.gallery img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.6s ease; }
.gallery figure:hover img { transform: scale(1.04); }
.gallery figcaption {
    position: absolute; left: 0; right: 0; bottom: 0;
    padding: 28px 16px 12px;
    font-size: 0.86rem;
    color: rgba(238, 241, 245, 0.88);
    background: linear-gradient(0deg, rgba(11, 13, 16, 0.85), rgba(11, 13, 16, 0));
}

/* Links, and the code panel's title bar and syntax colours. */
.link { font-weight: 600; display: inline-flex; gap: 6px; }
.link span { transition: transform 0.15s; }
.link:hover span { transform: translateX(3px); }

.window-bar {
    display: flex; align-items: center; gap: 7px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--line);
    background: #10141a;
}
.window-bar i { width: 11px; height: 11px; border-radius: 50%; background: #2a2f37; }
.window-bar span { margin-left: 10px; color: var(--dim); font: 0.82rem var(--mono); }
:is(.reload-code, .code-window) .k { color: #c792ea; }
:is(.reload-code, .code-window) .t { color: #7fb4ff; }
:is(.reload-code, .code-window) .f { color: #f2d48a; }
:is(.reload-code, .code-window) .n { color: #f78c6c; }
:is(.reload-code, .code-window) .s { color: #a5d6a7; }
:is(.reload-code, .code-window) .c { color: #5f6a76; font-style: italic; }
.reload-code .line { display: inline; transition: background 0.4s; border-radius: 4px; }
.reload-code .line.hidden { display: none; }
.reload-code .line.fresh { background: rgba(255, 179, 107, 0.16); box-shadow: -4px 0 0 rgba(255, 179, 107, 0.16), 4px 0 0 rgba(255, 179, 107, 0.16); }

/* Hot reload: the status chip and the game pane, run by the clip's clock. */
.dl-card p code, .faq code, .all-releases code { white-space: nowrap; font: 0.88em var(--mono); color: var(--text); background: rgba(255, 255, 255, 0.06); padding: 1px 6px; border-radius: 6px; }
.status {
    margin-left: auto;
    display: inline-flex; align-items: center; gap: 8px;
    font: 500 0.74rem var(--mono);
    color: var(--muted);
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--line);
    transition: color 0.2s, background 0.2s, border-color 0.2s;
}
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #3fb950; box-shadow: 0 0 8px #3fb950; }
.status[data-stage="1"] { color: var(--text); }
.status[data-stage="1"]::before { background: var(--warm); box-shadow: 0 0 8px var(--warm); }
.status[data-stage="2"] { color: var(--warm); border-color: rgba(255, 179, 107, 0.35); }
.status[data-stage="2"]::before { background: var(--warm); box-shadow: 0 0 8px var(--warm); animation: blink 0.6s ease-in-out infinite alternate; }
.status[data-stage="3"] { color: #8cc8ff; border-color: rgba(74, 158, 255, 0.4); background: rgba(74, 158, 255, 0.1); }
.status[data-stage="3"]::before { background: var(--accent); box-shadow: 0 0 8px var(--accent); }
@keyframes blink { from { opacity: 1; } to { opacity: 0.25; } }
.screen { position: relative; }
.screen video { display: block; width: 100%; height: 100%; min-height: 100%; object-fit: cover; }

/* Download. */
.download { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; max-width: 900px; margin: 0 auto 28px; }
.dl-card {
    position: relative;
    display: flex; flex-direction: column;
    padding: 28px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: var(--bg-tile);
    transition: border-color 0.2s, transform 0.2s;
}
.dl-card:hover { transform: translateY(-2px); }
.dl-card.yours { border-color: rgba(74, 158, 255, 0.55); box-shadow: 0 0 0 1px rgba(74, 158, 255, 0.2), 0 24px 60px rgba(74, 158, 255, 0.08); }
.dl-card.yours::after {
    content: "Your system";
    position: absolute; top: 16px; right: 16px;
    font: 600 0.68rem var(--mono); letter-spacing: 0.08em; text-transform: uppercase;
    color: var(--accent);
    padding: 3px 9px; border-radius: 999px;
    background: rgba(74, 158, 255, 0.12);
}
.dl-os { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.dl-os svg { width: 40px; height: 40px; padding: 8px; border-radius: 12px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); fill: var(--text); }
.dl-os h3 { font-size: 1.25rem; }
.dl-os span { color: var(--dim); font: 0.8rem var(--mono); }
.dl-card p { color: var(--muted); font-size: 0.94rem; margin: 0 0 22px; flex: 1; }
/* The install line: one command, and a button that copies it. */
.dl-cmd { display: flex; margin: 0 0 14px; border: 1px solid var(--line); border-radius: 8px; background: #0d1015; overflow: hidden; }
.dl-cmd code { flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; white-space: nowrap; padding: 10px 12px; color: #d3d9e0; font: 0.8rem/1.6 var(--mono); }
.dl-cmd button { flex: none; border: 0; border-left: 1px solid var(--line); padding: 0 14px; cursor: pointer; background: rgba(255, 255, 255, 0.04); color: var(--muted); font: 500 0.78rem var(--mono); transition: color 0.2s, background 0.2s; }
.dl-cmd button:hover { color: var(--text); background: rgba(74, 158, 255, 0.14); }
.dl-cmd button.done { color: #3fb950; }
.dl-archive { align-self: flex-start; color: var(--dim); font-size: 0.86rem; }
.dl-archive:hover { color: var(--text); }
.all-releases { text-align: center; margin: 22px 0 0; font-size: 0.93rem; }

/* License: plain answers beside the heading. */
.faq-wrap { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 56px; align-items: start; }
.faq-wrap .heading { margin-bottom: 0; }
.faq-wrap .heading p { margin-bottom: 18px; }
.faq details {
    border-bottom: 1px solid var(--line);
    padding: 4px 0;
}
.faq details:first-child { border-top: 1px solid var(--line); }
.faq summary {
    list-style: none;
    cursor: pointer;
    display: flex; justify-content: space-between; align-items: center; gap: 20px;
    padding: 16px 0;
    font-family: var(--display);
    font-size: 1.1rem;
    font-weight: 600;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font: 400 1.4rem var(--font); color: var(--muted); transition: transform 0.2s; }
.faq details[open] summary::after { transform: rotate(45deg); color: var(--accent); }
.faq details p { color: var(--muted); margin: 0 0 18px; max-width: 600px; }
.faq-note { color: var(--dim); font-size: 0.85rem; margin: 18px 0 0; }

/* Make a game: three numbered steps. */
.steps { list-style: none; margin: 0 auto; padding: 0; max-width: 900px; display: grid; gap: 12px; }
.steps li {
    display: grid;
    grid-template-columns: 34px 90px minmax(0, 1fr);
    align-items: center;
    gap: 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--bg-raised);
    padding: 14px 16px 14px 18px;
}
.step-n {
    display: inline-grid; place-items: center;
    width: 30px; height: 30px;
    border-radius: 50%;
    background: rgba(74, 158, 255, 0.14);
    color: var(--accent);
    font: 600 0.9rem var(--mono);
}
.steps h3 { font-size: 1.05rem; }
.steps code { display: block; color: #d3d9e0; font: 0.86rem/1.6 var(--mono); white-space: nowrap; overflow-x: auto; scrollbar-width: none; padding: 9px 12px; background: #0d1015; border: 1px solid var(--line); border-radius: 8px; }

#license { padding-bottom: 130px; }

/* Footer. */
footer {
    border-top: 1px solid var(--line);
    max-width: var(--max);
    margin: 0 auto;
    padding: 44px 40px 60px;
    display: flex;
    justify-content: space-between;
    gap: 40px;
}
.foot p { color: var(--dim); font-size: 0.9rem; margin: 12px 0 0; }
.foot-links { display: flex; gap: 72px; }
.foot-links div { display: flex; flex-direction: column; gap: 8px; }
.foot-links h4 { font-size: 0.82rem; color: var(--text); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 6px; font-family: var(--mono); font-weight: 500; }
.foot-links a { color: var(--muted); font-size: 0.93rem; }
.foot-links a:hover { color: var(--text); }

@media (max-width: 960px) {
    .nav { padding: 14px 20px; }
    .nav nav a:not(.nav-gh) { display: none; }
    .hero-inner { padding: 120px 22px 14vh; }
    .hero-shade { background: linear-gradient(0deg, rgba(11, 13, 16, 0.95) 10%, rgba(11, 13, 16, 0.45) 100%); }
    .facts { grid-template-columns: repeat(2, 1fr); margin: 36px 20px 0; }
    .block { padding: 90px 20px 0; }
    .feature-grid { grid-template-columns: 1fr; }
    .feature-row { grid-template-columns: 1fr 1fr; }
    .faq-wrap { grid-template-columns: 1fr; gap: 32px; }
    .download { grid-template-columns: minmax(0, 1fr); }
    .gallery { grid-template-columns: 1fr 1fr; }
    .hero-caption { right: 20px; left: 20px; bottom: 7vh; }
    .hero-pause { right: 20px; bottom: calc(7vh + 30px); }
    .steps li { grid-template-columns: 30px minmax(0, 1fr); }
    .steps code { grid-column: 1 / -1; }
    footer { flex-direction: column; padding: 36px 20px 50px; }
    .foot-links { gap: 40px; }
}

.nowrap { white-space: nowrap; }

/* Motion: the hero rises in, sections fade up as they arrive. */
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes settle { from { scale: 1.12; } to { scale: 1.04; } }
.hero-bg { animation: settle 2.4s cubic-bezier(.2,.7,.2,1) both; }
.hero-inner > * { animation: rise 0.9s cubic-bezier(.2,.7,.2,1) both; }
.hero-inner > :nth-child(2) { animation-delay: 0.08s; }
.hero-inner > :nth-child(3) { animation-delay: 0.18s; }
.hero-inner > :nth-child(4) { animation-delay: 0.28s; }
.hero-caption { animation: rise 1.2s 0.6s cubic-bezier(.2,.7,.2,1) both; }
.reveal { opacity: 0; transform: translateY(24px); filter: blur(6px); transition: opacity 0.7s ease, transform 0.7s cubic-bezier(.2,.7,.2,1), filter 0.7s ease; }
.reveal.in { opacity: 1; transform: none; filter: none; }
@keyframes shimmer { to { background-position: -200% center; } }

/* Cards lift a little under the pointer. */
.tile, .gallery figure { transition: transform 0.35s cubic-bezier(.2,.7,.2,1), border-color 0.35s, box-shadow 0.35s; }
.tile:hover, .gallery figure:hover { transform: translateY(-3px); border-color: rgba(140, 200, 255, 0.28); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4); }
.feature-row li { position: relative; transition: background 0.3s; }
.feature-row li:hover { background: #161b22; }
/* Plain pages: About and 404 sit under the nav on their own. */
.page-main { min-height: calc(100vh - 220px); padding-top: 60px; }
.page-main h1 { font-size: clamp(2.4rem, 5vw, 3.8rem); line-height: 1.05; }
.lost { text-align: center; padding-top: 160px; }
.lost p { color: var(--muted); font-size: 1.1rem; margin: 16px 0 0; }

/* Hot reload: the first tile, twice as wide - the code beside the game it runs. */
.reload-tile {
    grid-column: 1 / -1;
    aspect-ratio: auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    background: #0d1015;
}
.reload-code { display: flex; flex-direction: column; border-right: 1px solid var(--line); }
.reload-code pre { flex: 1; display: flex; align-items: center; margin: 0; padding: 18px 22px; font: 11.5px/1.65 var(--mono); color: #d3d9e0; overflow-x: auto; scrollbar-width: thin; scrollbar-color: #2a2f37 transparent; }
.reload-tile .screen { position: relative; min-height: 100%; }
.reload-tile .screen::after {
    content: "";
    position: absolute; inset: 0;
    background: linear-gradient(0deg, rgba(11, 13, 16, 0.9) 0%, rgba(11, 13, 16, 0.35) 30%, rgba(11, 13, 16, 0) 55%);
    pointer-events: none;
}
@media (max-width: 960px) {
    .reload-tile { grid-template-columns: minmax(0, 1fr); }
    .reload-code { border-right: 0; border-bottom: 1px solid var(--line); }
    .reload-code pre { font-size: 11px; padding: 16px; }
    .reload-tile .screen video { aspect-ratio: 2 / 1; height: auto; }
}

/* About. */
.about-head { display: flex; align-items: center; gap: 32px; margin-bottom: 56px; }
.avatar {
    flex: none;
    width: 144px; height: 144px; border-radius: 50%;
    object-fit: cover;
    padding: 4px;
    background: linear-gradient(135deg, var(--accent), #8cc8ff 55%, var(--warm));
    box-shadow: 0 20px 60px rgba(74, 158, 255, 0.25);
}
.about-role { color: var(--muted); font-size: 1.1rem; margin: 10px 0 18px; }
.about-links { display: flex; gap: 10px; flex-wrap: wrap; }
.about-links .button { padding: 9px 18px; }
.about-body { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr); gap: 56px; align-items: start; }
.about-text h2 { font-size: clamp(1.8rem, 3vw, 2.4rem); margin-bottom: 18px; }
.about-text p { color: var(--muted); font-size: 1.05rem; }
.about-side { padding: 28px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--bg-raised); }
.about-side h3 { font: 600 0.78rem var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); margin-bottom: 14px; }
.about-side h3:not(:first-child) { margin-top: 28px; }
.projects { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.projects a strong { font-family: var(--display); font-size: 1.05rem; color: var(--text); }
.projects a:hover strong { color: var(--accent); }
.projects span { display: block; color: var(--muted); font-size: 0.9rem; line-height: 1.5; }
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { font: 0.8rem var(--mono); color: var(--text); padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line-strong); background: rgba(255, 255, 255, 0.03); }
@media (max-width: 960px) {
    .about-head { flex-direction: column; align-items: flex-start; gap: 20px; }
    .about-body { grid-template-columns: 1fr; gap: 32px; }
}

/* The headline rises into view a line at a time. */
.hero h1 { animation: none !important; }
.hero h1 .line { display: block; overflow: hidden; padding-bottom: 0.1em; margin-bottom: -0.1em; }
.hero h1 .line > span { display: inline-block; animation: line-up 1s cubic-bezier(.2,.7,.2,1) both; }
.hero h1 .line + .line > span { animation-delay: 0.14s; }
@keyframes line-up { from { transform: translateY(105%); } to { transform: none; } }

/* A mouse at the foot of the hero, its wheel rolling: there is more below. */
.scroll-cue {
    position: absolute; left: 50%; bottom: 8vh;
    width: 24px; height: 38px; margin-left: -12px;
    border: 2px solid rgba(238, 241, 245, 0.45);
    border-radius: 14px;
    animation: rise 1s 0.9s both;
}
.scroll-cue span {
    position: absolute; left: 50%; top: 7px;
    width: 4px; height: 8px; margin-left: -2px;
    border-radius: 2px;
    background: rgba(238, 241, 245, 0.8);
    animation: wheel 1.8s ease-in-out infinite;
}
@keyframes wheel { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(12px); } }


@media (max-width: 960px) {
    .scroll-cue { display: none; }
}
/* Less motion, not none: what would rise or slide fades in place, and nothing drifts on its own. */
@keyframes fade { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
    .hero-bg, .block::before, .scroll-cue span { animation: none; }
    .hero-inner > *, .hero-caption, .hero h1 .line > span, .scroll-cue { animation-name: fade; }
    .reveal { transform: none; }
}

/* Phones: a taller tile keeps the picture clear of its caption, and the facts read one to a line. */
@media (max-width: 600px) {
    .facts { grid-template-columns: minmax(0, 1fr); }
    .tile.image:not(.reload-tile) { aspect-ratio: 4 / 3; }
    .tile.image::after { background: linear-gradient(0deg, rgba(11, 13, 16, 0.94) 0%, rgba(11, 13, 16, 0.6) 35%, rgba(11, 13, 16, 0) 65%); }
}

/* The hero's footage can be stopped: autoplaying video needs a way to pause it. */
.hero-pause {
    position: absolute;
    right: 40px; bottom: calc(9vh - 12px);
    width: 40px; height: 40px;
    display: grid; place-items: center;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 50%;
    background: rgba(11, 13, 16, 0.45);
    backdrop-filter: blur(6px);
    color: var(--text);
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}
.hero-pause:hover { background: rgba(11, 13, 16, 0.7); border-color: rgba(255, 255, 255, 0.32); }
.hero-pause svg { width: 16px; height: 16px; fill: currentColor; }
.hero-pause .icon-play, .hero-pause.paused .icon-pause { display: none; }
.hero-pause.paused .icon-play { display: block; }

/* Gameplay: the words beside the code they describe. */
.code-wrap {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: 56px;
    align-items: center;
}
.code-wrap .heading { margin-bottom: 0; }
.code-points { list-style: none; margin: 24px 0 26px; padding: 0; display: grid; gap: 12px; }
.code-points li { position: relative; padding-left: 22px; color: var(--muted); font-size: 0.98rem; }
.code-points li::before {
    content: "";
    position: absolute; left: 0; top: 0.62em;
    width: 8px; height: 8px;
    border-radius: 2px;
    background: var(--accent);
}
.code-points strong { color: var(--text); font-weight: 600; }
.code-window {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #0d1015;
    overflow: hidden;
    box-shadow: 0 30px 80px -40px rgba(74, 158, 255, 0.35);
}
.code-window .tabs { display: flex; gap: 4px; margin-left: 10px; }
.code-window .tabs button {
    padding: 4px 10px;
    border: 0;
    border-radius: 6px;
    background: none;
    color: var(--dim);
    font: 0.82rem var(--mono);
    cursor: pointer;
}
.code-window .tabs button[aria-selected="true"] { background: rgba(255, 255, 255, 0.07); color: var(--text); }
.code-window pre {
    margin: 0;
    padding: 20px 22px;
    min-height: 420px;
    font: 12.5px/1.7 var(--mono);
    color: #d3d9e0;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: #2a2f37 transparent;
}
.code-window pre[hidden] { display: none; }

/* Showcase: the lab's gallery, then the other two projects. */
.sub-heading { margin: 0 0 22px; max-width: 720px; }
.sub-heading h3 { font-size: 1.4rem; }
.sub-heading p { color: var(--muted); margin: 8px 0 0; }
.showcase .heading code { font: 0.88em var(--mono); color: var(--text); }
.projects {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 56px;
}
.project figure {
    margin: 0 0 18px;
    aspect-ratio: 16 / 9;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    overflow: hidden;
}
.project img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.6s ease; }
.project figure:hover img { transform: scale(1.04); }
.project h3 { font-size: 1.25rem; margin-bottom: 6px; }
.project p { color: var(--muted); margin: 0; font-size: 0.97rem; }

.dl-size { margin-left: 0.4em; opacity: 0.72; font-weight: 500; }

/* Click a screenshot for the full frame. */
.gallery img, .project img { cursor: zoom-in; }
.lightbox {
    position: fixed; inset: 0;
    z-index: 100;
    display: grid; place-items: center;
    padding: 4vh 4vw;
    background: rgba(5, 6, 8, 0.92);
    backdrop-filter: blur(6px);
    cursor: zoom-out;
    opacity: 0;
    transition: opacity 0.2s;
}
.lightbox.open { opacity: 1; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 10px; box-shadow: 0 30px 90px rgba(0, 0, 0, 0.6); }
.lightbox p { position: absolute; left: 0; right: 0; bottom: 2vh; margin: 0; text-align: center; color: var(--muted); font-size: 0.9rem; }

@media (max-width: 960px) {
    .code-wrap { grid-template-columns: minmax(0, 1fr); gap: 32px; }
    .code-window pre { min-height: 0; font-size: 11.5px; padding: 16px; }
    .projects { grid-template-columns: minmax(0, 1fr); gap: 36px; }
}
