/* ==========================================================================
   u-x.cc — stylesheet
   ========================================================================== */

/* --------------------------------------------------------------- tokens -- */
:root {
    --bg:            #0a0c11;
    --bg-soft:       #0f131a;
    --surface:       #12161e;
    --surface-2:     #171c26;
    --surface-3:     #1d2330;

    --border:        #222835;
    --border-strong: #303849;

    --text:          #e8ebf1;
    --text-dim:      #98a2b3;
    --text-faint:    #6a7488;

    --accent:        #5b9dff;
    --accent-soft:   #7fb4ff;
    --accent-deep:   #2b6fd6;
    --violet:        #8b7cff;
    --mint:          #3ddc97;
    --amber:         #f5b544;

    --radius-sm: 8px;
    --radius:    14px;
    --radius-lg: 20px;

    --shadow:    0 1px 2px rgb(0 0 0 / .4), 0 8px 24px -12px rgb(0 0 0 / .6);
    --shadow-lg: 0 2px 4px rgb(0 0 0 / .4), 0 24px 60px -24px rgb(0 0 0 / .8);

    --font: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto,
            'Helvetica Neue', Arial, sans-serif;
    --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, 'SF Mono', Menlo,
            Consolas, 'Liberation Mono', monospace;

    --shell: min(1180px, 100% - 3rem);
    --ease:  cubic-bezier(.22, .61, .36, 1);
}

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

h1, h2, h3, h4 {
    margin: 0;
    line-height: 1.15;
    letter-spacing: -.022em;
    font-weight: 700;
    color: #fff;
}

p { margin: 0; }

a { color: inherit; text-decoration: none; }

img { max-width: 100%; display: block; }

ul { margin: 0; padding: 0; list-style: none; }

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

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

::selection { background: rgb(91 157 255 / .3); color: #fff; }

/* Scrollbar (WebKit / Blink) */
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border: 3px solid var(--bg);
    border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover { background: #3d465a; }

/* --------------------------------------------------------- icon sprite -- */
/* Holds the <symbol> defs only; never painted directly. */
.sprite {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* Shared look for every sprite mark. Stroke and colour are inherited, so a
   single `color` on the container retints the whole icon. */
.icon-line {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.skip-link {
    position: absolute;
    left: 1rem;
    top: -100px;
    z-index: 200;
    padding: .7rem 1.1rem;
    background: var(--accent);
    color: #04070d;
    font-weight: 600;
    border-radius: var(--radius-sm);
    transition: top .2s var(--ease);
}
.skip-link:focus { top: 1rem; }

/* --------------------------------------------------------------- layout -- */
.shell {
    width: var(--shell);
    margin-inline: auto;
}

.section {
    padding-block: clamp(4.5rem, 10vw, 8rem);
    scroll-margin-top: 76px;
}

.section-head {
    max-width: 60ch;
    margin-bottom: 3rem;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    font-family: var(--mono);
    font-size: .74rem;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 1rem;
}
.eyebrow::before {
    content: "";
    width: 22px;
    height: 1px;
    background: currentColor;
    opacity: .6;
}

.section-head h2 {
    font-size: clamp(1.9rem, 4vw, 2.7rem);
}

.section-head p {
    margin-top: 1rem;
    color: var(--text-dim);
    font-size: 1.05rem;
}

/* --------------------------------------------------------------- header -- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgb(10 12 17 / .72);
    backdrop-filter: blur(14px) saturate(150%);
    -webkit-backdrop-filter: blur(14px) saturate(150%);
    border-bottom: 1px solid transparent;
    transition: border-color .25s var(--ease), background .25s var(--ease);
}
.site-header.is-stuck {
    border-bottom-color: var(--border);
    background: rgb(10 12 17 / .9);
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    height: 68px;
}

.brand {
    display: inline-flex;
    align-items: baseline;
    gap: .1rem;
    font-family: var(--mono);
    font-size: 1.12rem;
    font-weight: 700;
    letter-spacing: -.03em;
    color: #fff;
}
.brand .brand__dot { color: var(--accent); }

.nav__links {
    display: flex;
    align-items: center;
    gap: .35rem;
}

.nav__links a {
    padding: .5rem .85rem;
    border-radius: var(--radius-sm);
    font-size: .93rem;
    font-weight: 500;
    color: var(--text-dim);
    transition: color .18s, background .18s;
}
.nav__links a:hover { color: #fff; background: var(--surface-2); }

.nav__gh {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    margin-left: .5rem;
    padding: .5rem .95rem !important;
    border: 1px solid var(--border-strong);
    color: var(--text) !important;
}
.nav__gh:hover { border-color: var(--accent); }
.nav__gh svg { width: 17px; height: 17px; fill: currentColor; }

.nav__toggle {
    display: none;
    width: 42px;
    height: 42px;
    align-items: center;
    justify-content: center;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    cursor: pointer;
}
.nav__toggle svg { width: 20px; height: 20px; }
.nav__toggle .icon-close { display: none; }
.nav__toggle[aria-expanded="true"] .icon-close { display: block; }
.nav__toggle[aria-expanded="true"] .icon-open  { display: none; }

.nav__mobile {
    display: none;
    flex-direction: column;
    gap: .2rem;
    padding: .5rem 0 1.25rem;
    border-top: 1px solid var(--border);
}
.nav__mobile.is-open { display: flex; }
.nav__mobile a {
    padding: .8rem .5rem;
    color: var(--text-dim);
    font-weight: 500;
    border-radius: var(--radius-sm);
}
.nav__mobile a:hover { color: #fff; background: var(--surface-2); }

/* ------------------------------------------------------------- arcade -- */
.arcade {
    position: relative;
    overflow: hidden;
    background:
        linear-gradient(90deg, rgb(91 157 255 / .05), transparent 28%, transparent 72%, rgb(255 101 216 / .05)),
        #090b12;
    border-bottom: 1px solid var(--border);
}
.arcade::before {
    position: absolute;
    inset: 0;
    pointer-events: none;
    content: "";
    opacity: .24;
    background-image:
        linear-gradient(rgb(255 255 255 / .06) 1px, transparent 1px),
        linear-gradient(90deg, rgb(255 255 255 / .06) 1px, transparent 1px);
    background-size: 34px 34px;
    mask-image: linear-gradient(to bottom, #000, transparent 90%);
    -webkit-mask-image: linear-gradient(to bottom, #000, transparent 90%);
}
.arcade .shell { position: relative; padding-block: 1.25rem 1.45rem; }
.arcade__top {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}
.arcade__eyebrow,
.game-modal__eyebrow,
.game-modal__label {
    font-family: var(--mono);
    font-size: .68rem;
    font-weight: 600;
    letter-spacing: .16em;
    text-transform: uppercase;
}
.arcade__eyebrow {
    display: flex;
    align-items: center;
    gap: .4rem;
    margin-bottom: .3rem;
    color: #8ffcff;
}
.arcade__eyebrow span { font-size: .9rem; }
.arcade__top h2 {
    font-size: clamp(1.25rem, 2.4vw, 1.65rem);
    letter-spacing: -.035em;
}
.arcade__lede {
    margin-top: .25rem;
    color: var(--text-faint);
    font-size: .82rem;
}
.arcade__status {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    flex: none;
    padding: .42rem .7rem;
    border: 1px solid rgb(61 220 151 / .2);
    border-radius: 999px;
    color: var(--text-faint);
    font-family: var(--mono);
    font-size: .68rem;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.arcade__status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--mint);
    box-shadow: 0 0 10px var(--mint);
}
.arcade__rail {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .8rem;
}
.arcade-card {
    position: relative;
    display: flex;
    align-items: center;
    min-width: 0;
    gap: .85rem;
    padding: .7rem;
    overflow: hidden;
    color: var(--text);
    text-align: left;
    background: linear-gradient(135deg, rgb(255 255 255 / .035), transparent 55%), var(--surface);
    border: 1px solid var(--border);
    border-radius: 11px;
    cursor: pointer;
    font: inherit;
    transition: border-color .2s, background .2s, transform .2s var(--ease), box-shadow .2s;
}
.arcade-card::after {
    position: absolute;
    right: -22px;
    bottom: -34px;
    width: 100px;
    height: 100px;
    content: "";
    background: var(--game-accent);
    border-radius: 50%;
    filter: blur(42px);
    opacity: .11;
    pointer-events: none;
}
.arcade-card:hover,
.arcade-card:focus-visible {
    background: linear-gradient(135deg, rgb(255 255 255 / .06), transparent 55%), var(--surface-2);
    border-color: color-mix(in srgb, var(--game-accent) 65%, var(--border-strong));
    box-shadow: 0 0 24px color-mix(in srgb, var(--game-accent) 14%, transparent);
    transform: translateY(-2px);
}
.arcade-card__art {
    position: relative;
    display: block;
    flex: 0 0 42%;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    background: #05070c;
    border: 1px solid color-mix(in srgb, var(--game-accent) 40%, var(--border));
    border-radius: 6px;
}
.arcade-card__art::after,
.game-screen__scanlines {
    position: absolute;
    inset: 0;
    pointer-events: none;
    content: "";
    background: repeating-linear-gradient(to bottom, transparent 0, transparent 3px, rgb(255 255 255 / .055) 4px, transparent 5px);
    mix-blend-mode: screen;
    opacity: .5;
}
.arcade-card__art canvas {
    width: 100%;
    height: 100%;
    image-rendering: pixelated;
}
.arcade-card__copy {
    position: relative;
    z-index: 1;
    display: flex;
    min-width: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: .18rem;
}
.arcade-card__kicker {
    color: var(--game-accent);
    font-family: var(--mono);
    font-size: .6rem;
    letter-spacing: .1em;
    white-space: nowrap;
}
.arcade-card__title {
    color: #fff;
    font-size: clamp(.86rem, 1.5vw, 1rem);
    font-weight: 700;
    line-height: 1.15;
}
.arcade-card__play {
    margin-top: .4rem;
    color: var(--text-faint);
    font-family: var(--mono);
    font-size: .64rem;
    text-transform: uppercase;
    transition: color .2s;
}
.arcade-card:hover .arcade-card__play,
.arcade-card:focus-visible .arcade-card__play { color: var(--game-accent); }

/* ----------------------------------------------------------------- hero -- */
.hero {
    position: relative;
    padding-block: clamp(4rem, 12vw, 8.5rem) clamp(3rem, 7vw, 5rem);
    overflow: hidden;
}

.hero__glow {
    position: absolute;
    inset: -40% 0 auto 0;
    height: 900px;
    pointer-events: none;
    background:
        radial-gradient(46% 40% at 22% 42%, rgb(91 157 255 / .17), transparent 70%),
        radial-gradient(38% 36% at 78% 30%, rgb(139 124 255 / .13), transparent 70%);
    filter: blur(6px);
}

.hero__grid {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(to right, rgb(255 255 255 / .028) 1px, transparent 1px),
        linear-gradient(to bottom, rgb(255 255 255 / .028) 1px, transparent 1px);
    background-size: 64px 64px;
    mask-image: radial-gradient(ellipse 90% 60% at 50% 30%, #000 25%, transparent 78%);
    -webkit-mask-image: radial-gradient(ellipse 90% 60% at 50% 30%, #000 25%, transparent 78%);
}

.hero .shell { position: relative; }

.hero__inner { max-width: 46rem; }

.badge {
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    padding: .38rem .85rem .38rem .5rem;
    margin-bottom: 1.75rem;
    background: var(--surface-2);
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    font-size: .82rem;
    color: var(--text-dim);
}
.badge b { color: var(--text); font-weight: 600; }

.badge .pulse {
    position: relative;
    width: 7px;
    height: 7px;
    margin-left: .35rem;
    border-radius: 50%;
    background: var(--mint);
}
.badge .pulse::after {
    content: "";
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 1px solid var(--mint);
    opacity: .45;
    animation: ping 2.4s var(--ease) infinite;
}
@keyframes ping {
    0%   { transform: scale(.55); opacity: .6; }
    70%  { transform: scale(1.5); opacity: 0; }
    100% { transform: scale(1.5); opacity: 0; }
}

.hero h1 {
    font-size: clamp(2.5rem, 6.4vw, 4.15rem);
    letter-spacing: -.038em;
    line-height: 1.05;
}
.hero h1 .grad {
    background: linear-gradient(100deg, var(--accent-soft) 0%, var(--violet) 55%, #d9a4ff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero__lede {
    margin-top: 1.6rem;
    font-size: clamp(1.05rem, 2vw, 1.22rem);
    color: var(--text-dim);
    max-width: 40rem;
}
.hero__lede + .hero__lede { margin-top: 1.15rem; }
.hero__lede strong { color: var(--text); font-weight: 600; }

/* Inline prose links: tinted and underlined so they read as links, then
   cycling through the site palette while hovered. */
.hero__lede a {
    color: var(--accent-soft);
    font-weight: 500;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    text-decoration-color: rgb(127 180 255 / .4);
    border-radius: 3px;
    transition: color .2s var(--ease), text-decoration-color .2s var(--ease);
}
.hero__lede a:hover,
.hero__lede a:focus-visible {
    text-decoration-color: var(--accent-soft);
}

/* Hover: a palette wave travelling across the glyphs, so each character sits
   at a different point in the cycle. The gradient tile starts and ends on the
   same colour and is exactly one animation period wide, so it loops seamlessly.
   Guarded by @supports — without background-clip:text the transparent fill
   would render the text invisible rather than merely un-animated. */
@supports (-webkit-background-clip: text) or (background-clip: text) {
    .hero__lede a:hover,
    .hero__lede a:focus-visible {
        background-image: linear-gradient(90deg,
            var(--accent-soft)  0%,
            var(--violet)      25%,
            var(--mint)        50%,
            var(--amber)       75%,
            var(--accent-soft) 100%);
        background-size: 150px 100%;
        -webkit-background-clip: text;
        background-clip: text;
        -webkit-text-fill-color: transparent;
        color: transparent;
        animation: link-cycle 1.1s linear infinite;
    }
}

@keyframes link-cycle {
    to { background-position: 150px 0; }
}

.hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: .8rem;
    margin-top: 2.4rem;
}

.hero__stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1px;
    margin-top: 4rem;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.hero__stats div {
    background: var(--bg-soft);
    padding: 1.35rem 1.25rem;
}
.hero__stats dt {
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--text-faint);
}
.hero__stats dd {
    margin: .35rem 0 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -.02em;
}
.hero__stats dd small {
    font-size: .82rem;
    font-weight: 500;
    color: var(--text-dim);
    letter-spacing: 0;
}

/* -------------------------------------------------------------- buttons -- */
.btn {
    --btn-bg: var(--surface-2);
    --btn-fg: var(--text);
    --btn-bd: var(--border-strong);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .55rem;
    padding: .72rem 1.25rem;
    background: var(--btn-bg);
    color: var(--btn-fg);
    border: 1px solid var(--btn-bd);
    border-radius: var(--radius-sm);
    font-size: .93rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    transition: transform .15s var(--ease), background .18s, border-color .18s,
                box-shadow .18s, color .18s;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn svg { width: 16px; height: 16px; flex: none; }

.btn--primary {
    --btn-bg: linear-gradient(180deg, var(--accent) 0%, var(--accent-deep) 100%);
    --btn-fg: #04070d;
    --btn-bd: transparent;
    box-shadow: 0 1px 0 rgb(255 255 255 / .18) inset, 0 8px 20px -10px rgb(91 157 255 / .8);
}
.btn--primary:hover {
    box-shadow: 0 1px 0 rgb(255 255 255 / .22) inset, 0 12px 26px -10px rgb(91 157 255 / .95);
}

.btn--ghost:hover { border-color: var(--accent); color: #fff; }

.btn--sm { padding: .5rem .85rem; font-size: .85rem; }

/* ------------------------------------------------------------- releases -- */
.releases {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.releases a {
    display: block;
    padding: 1.15rem 1.3rem;
    background: var(--surface);
    transition: background .18s;
}
.releases a:hover { background: var(--surface-2); }
.releases .rel__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
}
.releases .rel__name {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    font-weight: 600;
    color: #fff;
}
.releases .rel__name svg {
    flex: none;
    width: 16px;
    height: 16px;
    stroke-width: 2;          /* heavier, so the mark holds up at 16px */
    color: var(--accent);
}
.releases .rel__ver {
    font-family: var(--mono);
    font-size: .78rem;
    padding: .1rem .45rem;
    border-radius: 5px;
    background: rgb(91 157 255 / .12);
    color: var(--accent-soft);
    border: 1px solid rgb(91 157 255 / .2);
}
.releases .rel__date {
    margin-top: .3rem;
    font-size: .82rem;
    color: var(--text-faint);
}

/* ------------------------------------------------------------- filters -- */
.filters {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-bottom: 3rem;
}
.filter {
    padding: .5rem 1rem;
    background: transparent;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    color: var(--text-dim);
    font: inherit;
    font-size: .88rem;
    font-weight: 500;
    cursor: pointer;
    transition: color .18s, background .18s, border-color .18s;
}
.filter:hover { color: #fff; border-color: var(--text-faint); }
.filter[aria-pressed="true"] {
    background: var(--accent);
    border-color: var(--accent);
    color: #04070d;
    font-weight: 600;
}

/* ------------------------------------------------------------- projects -- */
.projects { display: grid; gap: clamp(3.5rem, 7vw, 6rem); }

.project {
    display: grid;
    grid-template-columns: minmax(0, 1.06fr) minmax(0, 1fr);
    gap: clamp(2rem, 4vw, 3.5rem);
    scroll-margin-top: 90px;
}
.project[hidden] { display: none; }
.project:nth-child(even) .project__media { order: 2; }

/* media -------------------------------------------------------------- */
/* The column stretches to the row height so the panel inside can stick,
   keeping the screenshot alongside a long feature list. */
.project__media { align-self: stretch; }

.project__media > .shots {
    position: sticky;
    top: 92px;
}

.shots {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-soft);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.shots__tabs {
    display: flex;
    gap: .25rem;
    padding: .5rem .5rem 0;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}
.shots__tab {
    padding: .5rem .9rem;
    background: none;
    border: 0;
    border-bottom: 2px solid transparent;
    color: var(--text-faint);
    font: inherit;
    font-size: .82rem;
    font-weight: 600;
    cursor: pointer;
    transition: color .18s, border-color .18s;
}
.shots__tab:hover { color: var(--text); }
.shots__tab[aria-selected="true"] {
    color: #fff;
    border-bottom-color: var(--accent);
}

.shots__panel[hidden] { display: none; }

.shot {
    position: relative;
    display: block;
    width: 100%;
    padding: 0;
    background: #05070b;
    border: 0;
    cursor: zoom-in;
    line-height: 0;
    overflow: hidden;
}
.shot img {
    width: 100%;
    height: auto;
    transition: transform .5s var(--ease);
}
.shot:hover img { transform: scale(1.015); }
.shot::after {
    content: "";
    position: absolute;
    inset: 0;
    box-shadow: 0 0 0 1px rgb(255 255 255 / .04) inset;
    pointer-events: none;
}

/* body --------------------------------------------------------------- */
.project__body { padding-top: .35rem; }

.project__title {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .7rem;
}
.project__title h3 { font-size: clamp(1.5rem, 3vw, 1.95rem); }

.project__mark {
    flex: none;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 11px;
    color: var(--accent-soft);
    transition: color .25s var(--ease), border-color .25s var(--ease);
}
.project__mark svg { width: 24px; height: 24px; }

.project:hover .project__mark {
    color: #fff;
    border-color: var(--border-strong);
}

.ver {
    font-family: var(--mono);
    font-size: .78rem;
    font-weight: 600;
    padding: .18rem .55rem;
    border-radius: 6px;
    background: rgb(61 220 151 / .1);
    border: 1px solid rgb(61 220 151 / .22);
    color: var(--mint);
}

.project__tagline {
    margin-top: .5rem;
    color: var(--accent-soft);
    font-size: .95rem;
    font-weight: 500;
}

.project__desc {
    margin-top: 1.1rem;
    color: var(--text-dim);
}

.feats {
    display: grid;
    gap: .55rem;
    margin-top: 1.4rem;
}
.feats li {
    position: relative;
    padding-left: 1.6rem;
    font-size: .93rem;
    color: var(--text-dim);
}
.feats li::before {
    content: "";
    position: absolute;
    left: .3rem;
    top: .62em;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent);
}
.feats li b { color: var(--text); font-weight: 600; }

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    margin-top: 1.5rem;
}
.tags li {
    padding: .22rem .6rem;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-family: var(--mono);
    font-size: .74rem;
    color: var(--text-dim);
}

/* downloads ------------------------------------------------------------ */
.dl {
    margin-top: 1.9rem;
    padding-top: 1.6rem;
    border-top: 1px solid var(--border);
}

.dl__label {
    font-size: .74rem;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--text-faint);
    margin-bottom: .9rem;
}

.dl__row {
    display: flex;
    flex-wrap: wrap;
    gap: .6rem;
}

.dl__size {
    font-family: var(--mono);
    font-size: .74rem;
    font-weight: 400;
    opacity: .72;
}

.dl__note {
    margin-top: 1rem;
    font-size: .84rem;
    color: var(--text-faint);
}

/* install snippet */
.snippet {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .7rem .75rem .7rem 1rem;
    background: #06080d;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    overflow: hidden;
}
.snippet + .snippet { margin-top: .5rem; }
.snippet code {
    flex: 1;
    min-width: 0;
    font-size: .84rem;
    color: var(--text);
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
    /* fade the right edge so a long command reads as scrollable, not cut off */
    mask-image: linear-gradient(to right, #000 calc(100% - 24px), transparent 100%);
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 24px), transparent 100%);
}
.snippet code::-webkit-scrollbar { display: none; }
.snippet code .p { color: var(--mint); user-select: none; }

.copy {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .35rem .6rem;
    background: var(--surface-2);
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    color: var(--text-dim);
    font: inherit;
    font-size: .76rem;
    font-weight: 600;
    cursor: pointer;
    transition: color .18s, border-color .18s, background .18s;
}
.copy:hover { color: #fff; border-color: var(--accent); }
.copy.is-done { color: var(--mint); border-color: rgb(61 220 151 / .4); }
.copy svg { width: 13px; height: 13px; }

/* all-builds disclosure */
.more {
    margin-top: 1.4rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    overflow: hidden;
}
.more > summary {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .8rem 1rem;
    font-size: .88rem;
    font-weight: 600;
    color: var(--text-dim);
    cursor: pointer;
    list-style: none;
    transition: color .18s, background .18s;
}
.more > summary::-webkit-details-marker { display: none; }
.more > summary:hover { color: #fff; background: var(--surface-2); }
.more > summary .chev {
    width: 14px; height: 14px;
    margin-left: auto;
    transition: transform .22s var(--ease);
}
.more[open] > summary { color: #fff; border-bottom: 1px solid var(--border); }
.more[open] > summary .chev { transform: rotate(180deg); }

.builds { padding: 1.1rem 1rem 1.25rem; }
.builds h4 {
    font-family: var(--mono);
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--text-faint);
    margin: 1.3rem 0 .6rem;
}
.builds h4:first-child { margin-top: 0; }

.builds ul {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: .3rem;
}
.builds a {
    display: flex;
    align-items: baseline;
    gap: .6rem;
    padding: .42rem .6rem;
    border-radius: 6px;
    font-size: .86rem;
    color: var(--text-dim);
    transition: background .16s, color .16s;
}
.builds a:hover { background: var(--surface-3); color: #fff; }
.builds a .b-size {
    margin-left: auto;
    font-family: var(--mono);
    font-size: .72rem;
    color: var(--text-faint);
}

/* ---------------------------------------------------------------- about -- */
.about {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
    gap: clamp(2rem, 5vw, 4rem);
    align-items: start;
}
.about__text p + p { margin-top: 1.1rem; }
.about__text p { color: var(--text-dim); font-size: 1.03rem; }

.panel {
    padding: 1.6rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.panel h3 { font-size: 1.05rem; margin-bottom: 1.1rem; }

.stack { display: grid; gap: .85rem; }
.stack li {
    display: grid;
    grid-template-columns: 92px 1fr;
    gap: .9rem;
    align-items: baseline;
    font-size: .9rem;
    color: var(--text-dim);
}
.stack li span {
    font-family: var(--mono);
    font-size: .74rem;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--text-faint);
}

/* -------------------------------------------------------------- contact -- */
.contact {
    position: relative;
    text-align: center;
    padding: clamp(3rem, 7vw, 4.75rem) 1.75rem;
    background:
        radial-gradient(70% 130% at 50% 0%, rgb(91 157 255 / .12), transparent 68%),
        var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.contact h2 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
.contact p {
    max-width: 46ch;
    margin: 1.1rem auto 0;
    color: var(--text-dim);
}
.contact .hero__actions { justify-content: center; }

/* --------------------------------------------------------------- footer -- */
.site-footer {
    border-top: 1px solid var(--border);
    padding-block: 2.5rem;
    margin-top: clamp(4rem, 9vw, 7rem);
}
.site-footer .shell {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
}
.site-footer p { font-size: .87rem; color: var(--text-faint); }
.site-footer nav { display: flex; gap: 1.25rem; }
.site-footer nav a {
    font-size: .87rem;
    color: var(--text-dim);
    transition: color .18s;
}
.site-footer nav a:hover { color: #fff; }

/* ------------------------------------------------------------- lightbox -- */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
    padding: clamp(1rem, 4vw, 3rem);
    background: rgb(4 6 10 / .88);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    animation: fade .18s var(--ease);
}
.lightbox.is-open { display: flex; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.lightbox img {
    max-width: 100%;
    max-height: 88vh;
    width: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border-strong);
    box-shadow: var(--shadow-lg);
}
.lightbox__close {
    position: absolute;
    top: clamp(1rem, 3vw, 2rem);
    right: clamp(1rem, 3vw, 2rem);
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    background: var(--surface-2);
    border: 1px solid var(--border-strong);
    border-radius: 50%;
    color: var(--text);
    cursor: pointer;
}
.lightbox__close:hover { border-color: var(--accent); color: #fff; }
.lightbox__close svg { width: 18px; height: 18px; }

/* ---------------------------------------------------------- game modal -- */
.game-modal {
    position: fixed;
    inset: 0;
    z-index: 250;
    display: grid;
    place-items: center;
    padding: clamp(1rem, 3vw, 2rem);
    background: rgb(3 5 10 / .86);
    backdrop-filter: blur(8px) saturate(120%);
    -webkit-backdrop-filter: blur(8px) saturate(120%);
    animation: fade .18s var(--ease);
}
.game-modal[hidden] { display: none; }
.game-modal__backdrop { position: absolute; inset: 0; }
.game-modal__dialog {
    position: relative;
    z-index: 1;
    width: min(100%, 860px);
    max-height: calc(100vh - 2rem);
    overflow: auto;
    padding: clamp(1.1rem, 3vw, 1.75rem);
    background:
        radial-gradient(75% 40% at 50% 0%, rgb(91 157 255 / .08), transparent 75%),
        var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg);
    box-shadow: 0 25px 90px rgb(0 0 0 / .75), 0 0 45px rgb(91 157 255 / .08);
}
.game-modal__head {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 1rem;
}
.game-modal__eyebrow { margin-bottom: .35rem; color: var(--accent); }
.game-modal__head h2 { font-size: clamp(1.35rem, 3vw, 2rem); }
.game-modal__actions {
    display: flex;
    flex: none;
    align-items: center;
    gap: .45rem;
}
.game-modal__sound {
    display: inline-flex;
    align-items: center;
    gap: .42rem;
    min-height: 40px;
    padding: .45rem .7rem;
    background: var(--surface-2);
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    color: var(--text-dim);
    cursor: pointer;
    font: 600 .68rem var(--mono);
    transition: border-color .18s, color .18s, background .18s;
}
.game-modal__sound:hover,
.game-modal__sound:focus-visible { background: var(--surface-3); border-color: var(--accent); color: #fff; }
.game-modal__sound.is-muted { color: var(--text-faint); }
.game-modal__sound:disabled { cursor: not-allowed; opacity: .5; }
.game-modal__sound svg { width: 16px; height: 16px; }
.game-modal__close {
    display: grid;
    flex: none;
    width: 40px;
    height: 40px;
    place-items: center;
    background: var(--surface-2);
    border: 1px solid var(--border-strong);
    border-radius: 50%;
    color: var(--text-dim);
    cursor: pointer;
    transition: border-color .18s, color .18s, background .18s;
}
.game-modal__close:hover { background: var(--surface-3); border-color: var(--accent); color: #fff; }
.game-modal__close svg { width: 18px; height: 18px; }
.game-tv {
    position: relative;
    width: min(100%, 650px);
    margin: 1.35rem auto 1.5rem;
    padding: clamp(.55rem, 1.5vw, .8rem);
    background: linear-gradient(135deg, #3a4250, #11151d 24%, #252b36 75%, #0c1017);
    border: 1px solid #525d6d;
    border-radius: 17px;
    box-shadow: inset 0 0 0 2px #090b10, 0 16px 36px rgb(0 0 0 / .45), 0 0 34px rgb(91 157 255 / .08);
}
.game-screen {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    background: #05070c;
    border: 5px solid #080a0e;
    border-radius: 5% / 7%;
    box-shadow: inset 0 0 25px rgb(0 0 0 / .9), 0 0 12px rgb(143 252 255 / .18), 0 0 28px rgb(91 157 255 / .12);
}
.game-screen::before {
    position: absolute;
    inset: 0;
    z-index: 1;
    content: "";
    pointer-events: none;
    background: radial-gradient(ellipse at center, transparent 54%, rgb(0 0 0 / .45) 100%);
}
.game-screen canvas {
    display: block;
    width: 100%;
    height: 100%;
    image-rendering: pixelated;
    filter: saturate(1.28) contrast(1.08) brightness(1.04);
}
.game-screen::after {
    position: absolute;
    inset: -8%;
    z-index: 3;
    content: "";
    pointer-events: none;
    background:
        linear-gradient(112deg, transparent 28%, rgb(255 255 255 / .08) 44%, transparent 57%),
        radial-gradient(ellipse at center, transparent 55%, rgb(0 0 0 / .2) 100%);
    mix-blend-mode: screen;
    opacity: .32;
    animation: crt-flicker 4.8s steps(4, end) infinite;
}
.arcade-card__art::after,
.game-screen__scanlines {
    background:
        repeating-linear-gradient(to bottom, transparent 0, transparent 3px, rgb(255 255 255 / .055) 4px, transparent 5px),
        repeating-linear-gradient(to right, transparent 0, transparent 7px, rgb(143 252 255 / .018) 8px, transparent 9px);
    animation: crt-scan 11s linear infinite;
}
.game-screen__scanlines { z-index: 2; opacity: .3; }
/* WebGL CRT filter (games/crt.js) takes over when available; CSS overlay steps aside. */
.game-screen.is-gl .game-screen__scanlines { display: none; }
@keyframes crt-scan {
    from { background-position: 0 0, 0 0; }
    to { background-position: 0 12px, 7px 0; }
}
@keyframes crt-flicker {
    0%, 100% { opacity: .3; }
    46% { opacity: .3; }
    48% { opacity: .22; }
    51% { opacity: .34; }
    53% { opacity: .27; }
}
.game-modal__controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: .45rem 0;
    align-items: start;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
}
.game-modal__label { margin-bottom: .45rem; color: var(--text-faint); }
.game-modal__description { color: var(--text-dim); font-size: .9rem; }
.game-controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: start;
    gap: .55rem .8rem;
}
.game-control {
    display: inline-flex;
    align-items: center;
    gap: .38rem;
    color: var(--text-faint);
    font-size: .72rem;
    white-space: nowrap;
}
.game-control kbd {
    padding: .28rem .42rem;
    background: var(--surface-2);
    border: 1px solid var(--border-strong);
    border-bottom-color: #465064;
    border-radius: 4px;
    color: var(--text);
    font-size: .68rem;
    font-weight: 600;
}
.game-modal__note {
    margin-top: 1.25rem;
    color: var(--text-faint);
    font-family: var(--mono);
    font-size: .68rem;
}

/* --------------------------------------------------------------- reveal -- */
.reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity .6s var(--ease), transform .6s var(--ease);
}
.reveal.is-in { opacity: 1; transform: none; }

/* ----------------------------------------------------------- responsive -- */
@media (max-width: 940px) {
    .project,
    .about {
        grid-template-columns: minmax(0, 1fr);
    }
    .project:nth-child(even) .project__media { order: 0; }
    .project__media > .shots { position: static; }
    .hero__stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
    :root { --shell: min(1180px, 100% - 2.25rem); }
    .nav__links { display: none; }
    .nav__toggle { display: inline-flex; }
    .stack li { grid-template-columns: 1fr; gap: .1rem; }
    .hero__actions .btn { flex: 1 1 100%; }
    /* smaller mark keeps the longest name and its version badge on one line */
    .project__mark { width: 38px; height: 38px; border-radius: 10px; }
    .project__mark svg { width: 21px; height: 21px; }
    .arcade__top { align-items: start; flex-direction: column; gap: .65rem; }
    .arcade__rail {
        display: flex;
        overflow-x: auto;
        padding-bottom: .35rem;
        scroll-snap-type: x mandatory;
        scrollbar-width: thin;
    }
    .arcade-card {
        flex: 0 0 min(82vw, 340px);
        scroll-snap-align: start;
    }
}

@media (max-width: 420px) {
    .hero__stats { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
    }
    .reveal { opacity: 1; transform: none; }
}
