/* ============================================================
   DeanDark — deandark.me
   "Capture overlay" design system: the site borrows the visual
   language of Unisic itself — selection frames, corner handles,
   mono dimension readouts, terminal blocks.
   ============================================================ */

/* ------------------------------------------------------------
   Tokens
   ------------------------------------------------------------ */

:root {
    /* violet-biased dark ground */
    --bg: #0d0911;
    --surface: #140f1a;
    --surface-2: #1a1322;
    --text: #efeaf5;
    --muted: #a399b0;
    --brand: #ae31f6;
    --brand-hover: #bc4ff8;
    --brand-ink: #c89bf7;      /* accent at text sizes on this ground */
    --brand-dim: rgba(174, 49, 246, 0.38);
    --brand-faint: rgba(174, 49, 246, 0.12);
    --ok: #28c840;
    --line: rgba(239, 234, 245, 0.1);
    --line-strong: rgba(239, 234, 245, 0.18);
    --header-bg: rgba(13, 9, 17, 0.72);
    --hover: rgba(239, 234, 245, 0.05);
    --shadow: rgba(0, 0, 0, 0.5);
    --btn-primary-ink: #ffffff;

    --font-display: "Clash Display", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
    --font-mono: ui-monospace, "JetBrains Mono", "Cascadia Code", "SF Mono", Menlo, Consolas, monospace;

    --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
    --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);

    --radius: 8px;
    --radius-sm: 6px;
    --container: 1080px;
}

@media (prefers-color-scheme: light) {
    :root {
        --bg: #f7f4fb;
        --surface: #ffffff;
        --surface-2: #f1ebf8;
        --text: #201731;
        --muted: #695e77;
        --brand: #8b1fd9;
        --brand-hover: #7a1ac4;
        --brand-ink: #7a1ac4;
        --brand-dim: rgba(139, 31, 217, 0.4);
        --brand-faint: rgba(139, 31, 217, 0.08);
        --line: rgba(32, 23, 49, 0.12);
        --line-strong: rgba(32, 23, 49, 0.2);
        --header-bg: rgba(247, 244, 251, 0.8);
        --hover: rgba(32, 23, 49, 0.04);
        --shadow: rgba(74, 38, 112, 0.18);
    }
}

:root[data-theme="dark"] {
    --bg: #0d0911;
    --surface: #140f1a;
    --surface-2: #1a1322;
    --text: #efeaf5;
    --muted: #a399b0;
    --brand: #ae31f6;
    --brand-hover: #bc4ff8;
    --brand-ink: #c89bf7;
    --brand-dim: rgba(174, 49, 246, 0.38);
    --brand-faint: rgba(174, 49, 246, 0.12);
    --line: rgba(239, 234, 245, 0.1);
    --line-strong: rgba(239, 234, 245, 0.18);
    --header-bg: rgba(13, 9, 17, 0.72);
    --hover: rgba(239, 234, 245, 0.05);
    --shadow: rgba(0, 0, 0, 0.5);
}

:root[data-theme="light"] {
    --bg: #f7f4fb;
    --surface: #ffffff;
    --surface-2: #f1ebf8;
    --text: #201731;
    --muted: #695e77;
    --brand: #8b1fd9;
    --brand-hover: #7a1ac4;
    --brand-ink: #7a1ac4;
    --brand-dim: rgba(139, 31, 217, 0.4);
    --brand-faint: rgba(139, 31, 217, 0.08);
    --line: rgba(32, 23, 49, 0.12);
    --line-strong: rgba(32, 23, 49, 0.2);
    --header-bg: rgba(247, 244, 251, 0.8);
    --hover: rgba(32, 23, 49, 0.04);
    --shadow: rgba(74, 38, 112, 0.18);
}

/* ------------------------------------------------------------
   Base
   ------------------------------------------------------------ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

::selection {
    background: var(--brand);
    color: #fff;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 90px;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.65;
    min-height: 100svh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    transition: background-color 250ms ease, color 250ms ease;
}

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

a {
    color: var(--brand-ink);
    text-decoration: none;
    transition: color 150ms ease;
}

a:hover {
    color: var(--brand-hover);
}

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

h1, h2, h3 {
    font-family: var(--font-display);
    text-wrap: balance;
}

h2 {
    font-size: clamp(1.7rem, 4vw, 2.3rem);
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.12;
    margin-bottom: 18px;
}

/* ------------------------------------------------------------
   Capture vocabulary — labels, handles, corner marks
   ------------------------------------------------------------ */

/* Section eyebrow: a selection-handle square + mono label + hairline */
.sec-label {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-mono);
    font-size: 0.74rem;
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--brand-ink);
    margin-bottom: 14px;
}

.sec-label::before {
    content: "";
    width: 7px;
    height: 7px;
    border: 1.5px solid var(--brand);
    flex-shrink: 0;
}

.sec-label::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--line);
}

.section-lead {
    color: var(--muted);
    max-width: 62ch;
    margin-bottom: 36px;
}

/* Corner capture marks that appear on interactive cards */
.mark {
    position: relative;
}

.mark::before,
.mark::after {
    content: "";
    position: absolute;
    width: 10px;
    height: 10px;
    border: 0 solid var(--brand);
    opacity: 0;
    transition: opacity 150ms ease;
    pointer-events: none;
}

.mark::before {
    top: -1px;
    left: -1px;
    border-top-width: 2px;
    border-left-width: 2px;
}

.mark::after {
    bottom: -1px;
    right: -1px;
    border-bottom-width: 2px;
    border-right-width: 2px;
}

@media (hover: hover) and (pointer: fine) {
    .mark:hover::before,
    .mark:hover::after {
        opacity: 1;
    }
}

/* ------------------------------------------------------------
   Header
   ------------------------------------------------------------ */

header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--header-bg);
    backdrop-filter: blur(16px) saturate(160%);
    -webkit-backdrop-filter: blur(16px) saturate(160%);
    border-bottom: 1px solid transparent;
    transition: border-color 250ms ease, background-color 250ms ease;
}

header.scrolled {
    border-bottom-color: var(--line);
}

.header-inner {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--text);
}

.brand img {
    width: 30px;
    height: 30px;
}

.brand:hover {
    color: var(--brand-ink);
}

nav ul {
    display: flex;
    gap: 2px;
    list-style: none;
}

nav a {
    display: block;
    padding: 7px 13px;
    border-radius: var(--radius-sm);
    color: var(--muted);
    font-size: 0.92rem;
    font-weight: 500;
    transition: color 150ms ease, background-color 150ms ease;
}

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

.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-toggle,
.theme-toggle {
    display: flex;
    background: none;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    color: var(--text);
    width: 38px;
    height: 38px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color 150ms ease, background-color 150ms ease,
                color 150ms ease, transform 160ms var(--ease-out);
}

.nav-toggle {
    display: none;
}

.nav-toggle:hover,
.theme-toggle:hover {
    border-color: var(--brand-dim);
    background: var(--hover);
    color: var(--brand-ink);
}

.nav-toggle:active,
.theme-toggle:active {
    transform: scale(0.94);
}

.nav-toggle svg,
.theme-toggle svg {
    width: 18px;
    height: 18px;
}

.theme-toggle .icon-moon {
    display: none;
}

:root[data-theme="light"] .theme-toggle .icon-sun {
    display: none;
}

:root[data-theme="light"] .theme-toggle .icon-moon {
    display: block;
}

/* ------------------------------------------------------------
   Layout
   ------------------------------------------------------------ */

main {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 24px;
}

section {
    padding: 88px 0 24px;
}

/* ------------------------------------------------------------
   Buttons
   ------------------------------------------------------------ */

.buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 22px;
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background-color 150ms ease, border-color 150ms ease,
                color 150ms ease, transform 160ms var(--ease-out);
}

.btn:active {
    transform: scale(0.97);
}

.btn svg {
    width: 17px;
    height: 17px;
}

.btn-primary {
    background: var(--brand);
    color: var(--btn-primary-ink);
    border: 1px solid transparent;
}

.btn-primary:hover {
    background: var(--brand-hover);
    color: var(--btn-primary-ink);
}

.btn-ghost {
    border: 1px solid var(--line-strong);
    color: var(--text);
    background: none;
}

.btn-ghost:hover {
    color: var(--text);
    border-color: var(--brand-dim);
    background: var(--hover);
}

/* ------------------------------------------------------------
   Hero — the headline sits inside a live selection region
   ------------------------------------------------------------ */

#hero {
    min-height: min(92svh, 760px);
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    align-items: center;
    gap: 56px;
    padding-top: 130px;
}

.hero-eyebrow {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 26px;
}

.hero-eyebrow::before {
    content: "";
    width: 7px;
    height: 7px;
    border: 1.5px solid var(--brand);
}

/* Selection frame around the name */
.capture {
    position: relative;
    display: inline-block;
    padding: 18px 30px 22px;
    margin: 0 0 22px -30px;
}

.capture::before {
    content: "";
    position: absolute;
    inset: 0;
    border: 1px dashed var(--brand-dim);
    pointer-events: none;
}

.capture h1 {
    font-size: clamp(3rem, 9vw, 5rem);
    font-weight: 600;
    letter-spacing: -0.025em;
    line-height: 1.02;
}

.capture .corner {
    position: absolute;
    width: 14px;
    height: 14px;
    border: 0 solid var(--brand);
    pointer-events: none;
}

.capture .c-tl { top: -2px; left: -2px; border-top-width: 2px; border-left-width: 2px; }
.capture .c-tr { top: -2px; right: -2px; border-top-width: 2px; border-right-width: 2px; }
.capture .c-bl { bottom: -2px; left: -2px; border-bottom-width: 2px; border-left-width: 2px; }
.capture .c-br { bottom: -2px; right: -2px; border-bottom-width: 2px; border-right-width: 2px; }

/* Real dimensions of the region, measured by JS */
.capture-dim {
    position: absolute;
    bottom: -13px;
    right: 12px;
    padding: 2px 9px;
    background: var(--bg);
    border: 1px solid var(--line-strong);
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.06em;
    color: var(--brand-ink);
    font-variant-numeric: tabular-nums;
    transition: background-color 250ms ease;
}

#hero .tagline {
    font-size: clamp(1.02rem, 2.2vw, 1.2rem);
    color: var(--muted);
    max-width: 46ch;
    margin-bottom: 26px;
}

#hero .tagline strong {
    color: var(--text);
    font-weight: 600;
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 34px;
}

.chip {
    padding: 5px 12px;
    border: 1px solid var(--line-strong);
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.76rem;
    letter-spacing: 0.02em;
    color: var(--muted);
}

/* App-window mockup */
.hero-visual {
    position: relative;
}

.window {
    border-radius: 10px;
    border: 1px solid var(--line-strong);
    overflow: hidden;
    background: var(--surface);
    box-shadow: 0 30px 70px var(--shadow);
}

.window-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: var(--surface-2);
    border-bottom: 1px solid var(--line);
}

.window-bar em {
    font-style: normal;
    font-family: var(--font-mono);
    font-size: 0.74rem;
    letter-spacing: 0.04em;
    color: var(--muted);
}

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

.window-dots span {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    border: 1.5px solid var(--line-strong);
}

.window img {
    width: 100%;
    display: block;
}

.hero-badge {
    position: absolute;
    bottom: -16px;
    left: -14px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    font-family: var(--font-mono);
    font-size: 0.74rem;
    letter-spacing: 0.02em;
    box-shadow: 0 10px 28px var(--shadow);
}

.hero-badge .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--ok);
    box-shadow: 0 0 0 4px rgba(40, 200, 64, 0.16);
}

/* ------------------------------------------------------------
   About
   ------------------------------------------------------------ */

#about .about-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 44px;
    align-items: start;
}

#about p + p {
    margin-top: 16px;
}

#about .about-grid p {
    color: var(--muted);
    max-width: 62ch;
}

#about p strong {
    color: var(--text);
    font-weight: 600;
}

.fact-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.fact {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 16px 18px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    transition: border-color 150ms ease;
}

@media (hover: hover) and (pointer: fine) {
    .fact:hover {
        border-color: var(--brand-dim);
    }
}

.fact svg {
    width: 21px;
    height: 21px;
    flex-shrink: 0;
    margin-top: 3px;
    color: var(--brand-ink);
}

.fact span {
    font-size: 0.93rem;
    color: var(--muted);
}

.fact span b {
    color: var(--text);
    font-family: var(--font-display);
    font-weight: 600;
    display: block;
    margin-bottom: 2px;
}

/* Stat strip — one ruled row, not four floating cards */
.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    margin-top: 48px;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.stat {
    padding: 22px 20px 20px;
    border-left: 1px solid var(--line);
}

.stat:first-child {
    border-left: none;
    padding-left: 0;
}

.stat b {
    display: block;
    font-family: var(--font-display);
    font-size: clamp(1.6rem, 3.5vw, 2rem);
    font-weight: 600;
    color: var(--brand-ink);
    line-height: 1.1;
    margin-bottom: 4px;
    font-variant-numeric: tabular-nums;
}

.stat span {
    font-size: 0.85rem;
    color: var(--muted);
}

/* ------------------------------------------------------------
   Now
   ------------------------------------------------------------ */

.now-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.now-card {
    padding: 24px 22px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    transition: border-color 150ms ease;
}

@media (hover: hover) and (pointer: fine) {
    .now-card:hover {
        border-color: var(--brand-dim);
    }
}

.now-ico {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: var(--brand-faint);
    color: var(--brand-ink);
    margin-bottom: 16px;
}

.now-ico svg {
    width: 20px;
    height: 20px;
}

.now-card h3 {
    font-size: 1.08rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.now-card p {
    color: var(--muted);
    font-size: 0.93rem;
}

/* ------------------------------------------------------------
   Stack
   ------------------------------------------------------------ */

.stack-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 16px;
}

.stack-group {
    padding: 22px 20px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    transition: border-color 150ms ease;
}

@media (hover: hover) and (pointer: fine) {
    .stack-group:hover {
        border-color: var(--brand-dim);
    }
}

.stack-group h3 {
    display: flex;
    align-items: center;
    gap: 9px;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--brand-ink);
    margin-bottom: 16px;
}

.stack-group h3 svg {
    width: 16px;
    height: 16px;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.tag {
    padding: 5px 11px;
    border: 1px solid var(--line-strong);
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--text);
}

.tag.soft {
    color: var(--muted);
}

/* ------------------------------------------------------------
   Setup
   ------------------------------------------------------------ */

.setup-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 18px;
    align-items: start;
}

.spec-sheet {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}

.spec-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--line);
    font-size: 0.93rem;
}

.spec-row:last-child {
    border-bottom: none;
}

.spec-row .k {
    display: flex;
    align-items: center;
    gap: 11px;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
    flex-shrink: 0;
}

.spec-row .k svg {
    width: 17px;
    height: 17px;
    color: var(--brand-ink);
}

.spec-row .v {
    color: var(--text);
    font-weight: 500;
    text-align: right;
}

.play-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 24px 22px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.play-card h3 {
    font-size: 1.08rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.play-card > p {
    font-size: 0.92rem;
    color: var(--muted);
    margin-bottom: 18px;
}

.play-card .games {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-bottom: 22px;
}

.play-card .games span {
    padding: 5px 11px;
    border: 1px solid var(--line-strong);
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--muted);
}

.steam-link {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: auto;
    padding: 12px 16px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    color: var(--text);
    transition: border-color 150ms ease, background-color 150ms ease;
}

.steam-link:hover {
    color: var(--text);
    border-color: var(--brand-dim);
    background: var(--hover);
}

.steam-link svg {
    width: 24px;
    height: 24px;
    color: var(--brand-ink);
    flex-shrink: 0;
}

.steam-link .st-name {
    font-weight: 600;
    font-size: 0.93rem;
}

.steam-link .st-sub {
    font-size: 0.8rem;
    color: var(--muted);
}

.steam-link .st-level {
    margin-left: auto;
    padding: 3px 10px;
    border-radius: 4px;
    background: var(--brand-faint);
    color: var(--brand-ink);
    font-family: var(--font-mono);
    font-size: 0.76rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}

/* ------------------------------------------------------------
   Unisic spotlight
   ------------------------------------------------------------ */

#unisic .spotlight {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: clamp(28px, 5vw, 52px);
}

.unisic-head {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.unisic-head img {
    width: 52px;
    height: 52px;
}

.unisic-head h2 {
    margin: 0;
}

.badge-os {
    padding: 4px 11px;
    border: 1px solid var(--line-strong);
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    color: var(--muted);
}

#unisic .tagline {
    font-family: var(--font-display);
    font-size: clamp(1.1rem, 2.4vw, 1.4rem);
    font-weight: 500;
    line-height: 1.35;
    max-width: 56ch;
    margin-bottom: 14px;
}

#unisic .tagline em {
    font-style: normal;
    color: var(--brand-ink);
}

#unisic .describe {
    color: var(--muted);
    max-width: 68ch;
    margin-bottom: 32px;
}

.features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 32px;
}

.feature {
    padding: 15px 17px;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    transition: border-color 150ms ease, background-color 250ms ease;
}

@media (hover: hover) and (pointer: fine) {
    .feature:hover {
        border-color: var(--brand-dim);
    }
}

.feature b {
    display: block;
    font-family: var(--font-display);
    font-weight: 600;
    margin-bottom: 4px;
}

.feature span {
    font-size: 0.89rem;
    color: var(--muted);
}

/* Terminal-styled install block */
.install {
    margin: 8px 0 28px;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    max-width: 620px;
    transition: background-color 250ms ease;
}

.install-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 16px;
    border-bottom: 1px solid var(--line);
    font-family: var(--font-mono);
    font-size: 0.74rem;
    color: var(--muted);
}

.install-head b {
    color: var(--text);
    font-weight: 600;
}

.install pre {
    margin: 0;
    padding: 16px;
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 0.84rem;
    line-height: 1.7;
    color: var(--text);
}

.install pre .c {
    color: var(--muted);
}

.install pre .p {
    color: var(--brand-ink);
    user-select: none;
}

.tech-line {
    font-size: 0.9rem;
    color: var(--muted);
    margin-bottom: 24px;
}

.tech-line code {
    font-family: var(--font-mono);
    font-size: 0.84rem;
    color: var(--brand-ink);
}

/* Gallery */
.gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 40px;
}

.gallery figure {
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--line-strong);
    background: var(--bg);
    transition: border-color 150ms ease, background-color 250ms ease;
}

@media (hover: hover) and (pointer: fine) {
    .gallery figure:hover {
        border-color: var(--brand-dim);
    }
}

.gallery img {
    width: 100%;
    aspect-ratio: 106 / 70;
    object-fit: cover;
    display: block;
}

.gallery figcaption {
    padding: 10px 14px;
    font-family: var(--font-mono);
    font-size: 0.76rem;
    color: var(--muted);
    border-top: 1px solid var(--line);
}

.gallery figcaption b {
    color: var(--text);
    font-weight: 600;
}

/* ------------------------------------------------------------
   Projects
   ------------------------------------------------------------ */

.projects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.project-card {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: visible;
    color: var(--text);
    transition: border-color 150ms ease;
}

@media (hover: hover) and (pointer: fine) {
    .project-card:hover {
        color: var(--text);
        border-color: var(--brand-dim);
    }
}

.project-card img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: var(--radius) var(--radius) 0 0;
    border-bottom: 1px solid var(--line);
}

.project-card .card-body {
    padding: 18px 20px 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.project-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.project-card h3 svg {
    width: 14px;
    height: 14px;
    color: var(--muted);
    transition: color 150ms ease, transform 150ms var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
    .project-card:hover h3 svg {
        color: var(--brand-ink);
        transform: translate(2px, -2px);
    }
}

.project-card p {
    font-size: 0.91rem;
    color: var(--muted);
    margin-bottom: 14px;
}

.project-card .card-tags {
    margin-top: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.project-card .card-tags span {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--muted);
    padding: 3px 9px;
    border: 1px solid var(--line);
    border-radius: 4px;
}

/* ------------------------------------------------------------
   Journey — numbered, because it really is a sequence
   ------------------------------------------------------------ */

.timeline {
    position: relative;
    margin-top: 12px;
    padding-left: 44px;
}

.timeline::before {
    content: "";
    position: absolute;
    left: 13px;
    top: 8px;
    bottom: 8px;
    width: 1px;
    background: var(--line-strong);
}

.tl-item {
    position: relative;
    padding-bottom: 34px;
    counter-increment: tl;
}

.tl-item:last-child {
    padding-bottom: 0;
}

.tl-item::before {
    content: counter(tl, decimal-leading-zero);
    position: absolute;
    left: -44px;
    top: 0;
    width: 27px;
    height: 27px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    border: 1px solid var(--brand-dim);
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--brand-ink);
    transition: background-color 250ms ease;
}

.tl-when {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--brand-ink);
    margin-bottom: 5px;
}

.tl-item h3 {
    font-size: 1.08rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.tl-item p {
    color: var(--muted);
    font-size: 0.94rem;
    max-width: 62ch;
}

/* ------------------------------------------------------------
   CTA — a full capture frame, the one loud static moment
   ------------------------------------------------------------ */

.cta {
    position: relative;
    margin-top: 32px;
    padding: clamp(34px, 5vw, 56px);
    background: var(--surface-2);
    border: 1px dashed var(--brand-dim);
    border-radius: 2px;
}

.cta .corner {
    position: absolute;
    width: 16px;
    height: 16px;
    border: 0 solid var(--brand);
    pointer-events: none;
}

.cta .c-tl { top: -2px; left: -2px; border-top-width: 2px; border-left-width: 2px; }
.cta .c-tr { top: -2px; right: -2px; border-top-width: 2px; border-right-width: 2px; }
.cta .c-bl { bottom: -2px; left: -2px; border-bottom-width: 2px; border-left-width: 2px; }
.cta .c-br { bottom: -2px; right: -2px; border-bottom-width: 2px; border-right-width: 2px; }

.cta h2 {
    margin-bottom: 10px;
}

.cta p {
    color: var(--muted);
    max-width: 56ch;
    margin-bottom: 26px;
}

/* ------------------------------------------------------------
   Contact
   ------------------------------------------------------------ */

.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}

.contact-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 20px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--text);
    transition: border-color 150ms ease;
}

@media (hover: hover) and (pointer: fine) {
    .contact-card:hover {
        color: var(--text);
        border-color: var(--brand-dim);
    }
}

.contact-card svg {
    width: 26px;
    height: 26px;
    flex-shrink: 0;
    color: var(--brand-ink);
}

.contact-card b {
    display: block;
    font-weight: 600;
    font-size: 0.93rem;
}

.contact-card span {
    font-size: 0.83rem;
    color: var(--muted);
}

/* ------------------------------------------------------------
   Footer
   ------------------------------------------------------------ */

footer {
    margin-top: 72px;
    border-top: 1px solid var(--line);
    padding: 28px 24px;
    text-align: center;
    color: var(--muted);
    font-size: 0.9rem;
}

footer .foot-links {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

footer .foot-links a {
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    letter-spacing: 0.04em;
}

footer .foot-links a:hover {
    color: var(--brand-ink);
}

/* ------------------------------------------------------------
   Motion — page load, scroll reveal, stagger
   ------------------------------------------------------------ */

/* Hero intro: one orchestrated moment, plays once per visit */
@keyframes rise-in {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes frame-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.js #hero > div:first-child > * {
    animation: rise-in 550ms var(--ease-out) both;
}

.js #hero > div:first-child > :nth-child(2) { animation-delay: 60ms; }
.js #hero > div:first-child > :nth-child(3) { animation-delay: 120ms; }
.js #hero > div:first-child > :nth-child(4) { animation-delay: 180ms; }
.js #hero > div:first-child > :nth-child(5) { animation-delay: 240ms; }

.js .capture::before,
.js .capture .corner,
.js .capture .capture-dim {
    animation: frame-in 500ms ease 350ms both;
}

.js .hero-visual {
    animation: rise-in 600ms var(--ease-out) 150ms both;
}

/* Scroll reveal — hidden only when JS is running */
.js .reveal {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 500ms var(--ease-out), transform 500ms var(--ease-out);
}

.js .reveal.visible {
    opacity: 1;
    transform: none;
}

/* Staggered children inside revealed grids */
.js .reveal .stagger > * {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 450ms var(--ease-out), transform 450ms var(--ease-out);
}

.js .reveal.visible .stagger > * {
    opacity: 1;
    transform: none;
}

.js .reveal .stagger > :nth-child(2) { transition-delay: 50ms; }
.js .reveal .stagger > :nth-child(3) { transition-delay: 100ms; }
.js .reveal .stagger > :nth-child(4) { transition-delay: 150ms; }
.js .reveal .stagger > :nth-child(5) { transition-delay: 200ms; }
.js .reveal .stagger > :nth-child(6) { transition-delay: 250ms; }
.js .reveal .stagger > :nth-child(n+7) { transition-delay: 300ms; }

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .js #hero > div:first-child > *,
    .js .capture::before,
    .js .capture .corner,
    .js .capture .capture-dim,
    .js .hero-visual {
        animation: frame-in 250ms ease both;
    }

    .js .reveal,
    .js .reveal .stagger > * {
        transform: none;
        transition: opacity 250ms ease;
    }

    .btn,
    .btn:active,
    .nav-toggle:active,
    .theme-toggle:active {
        transform: none;
    }
}

/* ------------------------------------------------------------
   Responsive
   ------------------------------------------------------------ */

@media (max-width: 960px) {
    #hero {
        grid-template-columns: 1fr;
        min-height: unset;
        gap: 56px;
        padding-top: 124px;
    }

    .capture {
        margin-left: 0;
        padding: 14px 22px 18px;
    }

    .hero-visual {
        max-width: 520px;
    }
}

@media (max-width: 900px) {
    .features,
    .gallery {
        grid-template-columns: repeat(2, 1fr);
    }

    .projects-grid,
    .now-grid {
        grid-template-columns: 1fr;
    }

    #about .about-grid,
    .setup-grid {
        grid-template-columns: 1fr;
    }

    .stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .stat:nth-child(3) {
        border-left: none;
        padding-left: 0;
    }

    .stat:nth-child(-n+2) {
        border-bottom: 1px solid var(--line);
    }
}

@media (max-width: 720px) {
    .nav-toggle {
        display: flex;
    }

    nav {
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: var(--bg);
        border-bottom: 1px solid var(--line);
        padding: 12px 24px 20px;
        display: none;
        opacity: 1;
        transform: none;
    }

    nav.open {
        display: block;
    }

    /* Animated open where display transitions are supported */
    @supports (transition-behavior: allow-discrete) {
        nav {
            transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out),
                        display 200ms allow-discrete;
        }

        nav.open {
            @starting-style {
                opacity: 0;
                transform: translateY(-6px);
            }
        }
    }

    nav ul {
        flex-direction: column;
        gap: 4px;
    }

    nav a {
        padding: 12px 14px;
        font-size: 1.02rem;
    }

    section {
        padding: 64px 0 20px;
    }

    .features,
    .gallery {
        grid-template-columns: 1fr;
    }

    .capture-dim {
        display: none;
    }
}

@media (max-width: 420px) {
    .stats {
        grid-template-columns: 1fr;
    }

    .stat {
        border-left: none;
        padding-left: 0;
        border-bottom: 1px solid var(--line);
    }

    .stat:last-child {
        border-bottom: none;
    }
}
