/* ==========================================================================
   Portfolio · System Architecture Blueprint (v2)
   One stylesheet, no framework. Tokens, base, layout, components, pages.
   Fonts are self-hosted (CSP: font-src 'self').
   ========================================================================== */

/* ---------- Fonts -------------------------------------------------------- */
@font-face { font-family: "Plex Sans"; src: url("../fonts/plex-sans-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plex Sans"; src: url("../fonts/plex-sans-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Plex Sans"; src: url("../fonts/plex-sans-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Plex Sans"; src: url("../fonts/plex-sans-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("../fonts/jetbrains-mono-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("../fonts/jetbrains-mono-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("../fonts/jetbrains-mono-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }

/* ---------- Tokens ------------------------------------------------------- */
:root {
    --sans: "Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

    --radius: 4px;
    --radius-lg: 8px;
    --gap: 28px;
    --shell: 1160px;
    --speed: 150ms;
    --tabbar-h: 0px;

    /* Dark blueprint (default) */
    --bg: #0a1520;
    --grid-line: rgba(111, 164, 214, 0.06);
    --grid-major: rgba(111, 164, 214, 0.11);
    --surface: rgba(13, 28, 42, 0.94);
    --surface-2: #11263a;
    --inset: #081320;
    --border: #1d3852;
    --border-strong: #2b5275;
    --text: #dbe6f1;
    --muted: #8fa5bb;
    --faint: #5f7891;
    --accent: #4fd1c5;
    --accent-ink: #052623;
    --accent-soft: rgba(79, 209, 197, 0.1);
    --accent-line: rgba(79, 209, 197, 0.45);
    --version: #f6c177;
    --version-soft: rgba(246, 193, 119, 0.1);
    --ok: #7ee787;
    --err: #ff8177;
    --info: #79c0ff;
    color-scheme: dark;
}

:root[data-theme="light"] {
    /* Paper blueprint */
    --bg: #f2f5f9;
    --grid-line: rgba(33, 88, 150, 0.06);
    --grid-major: rgba(33, 88, 150, 0.11);
    --surface: rgba(255, 255, 255, 0.96);
    --surface-2: #eaf0f6;
    --inset: #f6f9fc;
    --border: #cad7e3;
    --border-strong: #9db3c8;
    --text: #0f2233;
    --muted: #48607a;
    --faint: #7890a6;
    --accent: #0f766e;
    --accent-ink: #ffffff;
    --accent-soft: rgba(15, 118, 110, 0.08);
    --accent-line: rgba(15, 118, 110, 0.4);
    --version: #955400;
    --version-soft: rgba(149, 84, 0, 0.08);
    --ok: #1a7f37;
    --err: #c62828;
    --info: #0b62c4;
    color-scheme: light;
}

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

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

body {
    margin: 0;
    min-height: 100vh;
    padding-bottom: var(--tabbar-h);
    font: 400 16px/1.6 var(--sans);
    color: var(--text);
    background-color: var(--bg);
    background-image:
        linear-gradient(var(--grid-major) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-major) 1px, transparent 1px),
        linear-gradient(var(--grid-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
    background-size: 120px 120px, 120px 120px, 24px 24px, 24px 24px;
    background-position: -1px -1px;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; font-weight: 600; }
h1 { font-size: clamp(2rem, 5vw, 2.75rem); letter-spacing: -0.02em; }
p { margin: 0 0 1em; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
img { max-width: 100%; height: auto; display: block; }
ul, ol { padding-left: 1.2em; }
code, kbd, pre, .mono { font-family: var(--mono); font-size: .88em; }
kbd { padding: 0 .35em; border: 1px solid var(--border-strong); border-radius: 3px; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; }
[hidden] { display: none !important; }

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

.visually-hidden, .hp {
    position: absolute !important; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.skip-link { position: absolute; left: 16px; top: -48px; z-index: 100; padding: 8px 12px; background: var(--accent); color: var(--accent-ink); border-radius: var(--radius); }
.skip-link:focus { top: 8px; }
.muted { color: var(--muted); }
.empty { color: var(--muted); margin: 0; padding: 14px 16px; border: 1px dashed var(--border-strong); border-radius: var(--radius); font-size: .93rem; }

/* ---------- Layout ------------------------------------------------------- */
.shell { width: 100%; max-width: var(--shell); margin: 0 auto; padding: 0 20px; }
main.shell { padding-top: 28px; padding-bottom: 72px; }

.grid { display: grid; gap: var(--gap); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) {
    .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .node--wide { grid-column: 1 / -1; }
}

/* ---------- Top bar ------------------------------------------------------ */
.topbar {
    position: sticky; top: 0; z-index: 20;
    background: color-mix(in srgb, var(--bg) 86%, transparent);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(8px);
}
.topbar__inner { display: flex; align-items: center; gap: 14px; min-height: 58px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 700; letter-spacing: -0.01em; }
.brand__mark {
    display: inline-grid; place-items: center; width: 28px; height: 28px;
    font: 600 .78rem var(--mono); color: var(--accent);
    border: 1px solid var(--accent-line); border-radius: var(--radius); background: var(--accent-soft);
}
.topnav { display: none; gap: 2px; margin-left: auto; }
.topnav a { color: var(--muted); text-decoration: none; font-size: .9rem; font-weight: 500; padding: 6px 10px; border-radius: var(--radius); white-space: nowrap; }
.topnav a:hover { color: var(--text); background: var(--surface-2); }
.topbar__actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
@media (min-width: 760px) {
    .topnav { display: flex; }
    .topbar__actions { margin-left: 8px; }
}

.status-badge {
    display: none; align-items: center; gap: 7px;
    font: 500 .74rem var(--mono); color: var(--muted);
    border: 1px solid var(--border); border-radius: 999px; padding: 3px 11px; white-space: nowrap;
}
.status-badge__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 22%, transparent); }
.status-badge__ver { color: var(--version); }
@media (min-width: 1000px) { .status-badge { display: inline-flex; } }

/* ---------- Mobile tab bar ----------------------------------------------- */
.tabbar { display: none; }
@media (max-width: 759px) {
    :root { --tabbar-h: calc(62px + env(safe-area-inset-bottom, 0px)); }
    .tabbar {
        position: fixed; inset: auto 0 0 0; z-index: 30;
        display: grid; grid-template-columns: repeat(5, 1fr);
        height: var(--tabbar-h); padding-bottom: env(safe-area-inset-bottom, 0px);
        background: color-mix(in srgb, var(--bg) 92%, transparent);
        border-top: 1px solid var(--border); backdrop-filter: blur(8px);
    }
    .tabbar a {
        display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
        color: var(--muted); text-decoration: none; font-size: .7rem; font-weight: 500;
    }
    .tabbar a:hover, .tabbar a:focus-visible { color: var(--accent); }
    .tabbar .icon { width: 20px; height: 20px; }
}

/* ---------- Buttons, chips, badges, links -------------------------------- */
.icon { width: 16px; height: 16px; flex: none; vertical-align: -3px; }
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    font: 600 .9rem var(--sans); color: var(--text); text-decoration: none;
    background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: var(--radius);
    padding: 10px 18px; min-height: 42px; cursor: pointer;
    transition: border-color var(--speed), background var(--speed), color var(--speed);
}
.btn:hover { border-color: var(--accent); }
.btn--primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn--primary:hover { background: color-mix(in srgb, var(--accent) 88%, white); }
.btn--ghost { background: transparent; color: var(--muted); }
.btn--ghost:hover { color: var(--text); }
.btn--sm { padding: 5px 11px; min-height: 32px; font-size: .82rem; }
.btn--danger { border-color: var(--err); color: var(--err); background: transparent; }
.btn:disabled { opacity: .6; cursor: progress; }

.icon-btn {
    display: inline-grid; place-items: center; width: 36px; height: 36px;
    background: transparent; color: var(--text); border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer;
}
.icon-btn:hover { border-color: var(--accent); }
:root[data-theme="dark"] .icon--sun, :root[data-theme="light"] .icon--moon { display: none; }

.chip {
    display: inline-flex; align-items: center; gap: 6px; position: relative;
    font: 500 .8rem var(--mono); color: var(--text); text-decoration: none;
    border: 1px solid var(--border-strong); border-radius: var(--radius); padding: 5px 12px; cursor: pointer;
    background: var(--surface-2); transition: border-color var(--speed), color var(--speed);
}
.chip:hover, .chip.is-active { border-color: var(--accent); color: var(--accent); }
.chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip:has(input:checked) { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.chip:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }

.badges { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 0 0 12px; }
.badge { font: .74rem var(--mono); color: var(--muted); border: 1px solid var(--border); border-radius: 3px; padding: 2px 8px; background: var(--inset); }
.badges--lg .badge { font-size: .8rem; padding: 4px 10px; }
.badge--accent { color: var(--text); border-color: var(--accent-line); background: var(--accent-soft); }

.tag { display: inline-block; font: 600 .7rem/1.5 var(--mono); border-radius: 3px; padding: 1px 7px; border: 1px solid currentColor; white-space: nowrap; }
.tag--version { color: var(--version); background: var(--version-soft); }
.tag--certification { color: var(--info); }
.tag--award { color: var(--version); }
.tag--hackathon { color: var(--accent); }
.tag--milestone { color: var(--ok); }
.tag--private { color: var(--faint); }

.links { display: flex; flex-wrap: wrap; gap: 6px 18px; list-style: none; padding: 0; margin: 0; }
.link { display: inline-flex; align-items: center; gap: 6px; font-size: .88rem; font-weight: 500; }
.link--private { color: var(--muted); }

/* ---------- Nodes (the blueprint boxes) ---------------------------------- */
.node {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    min-width: 0;
}
.node--narrow { max-width: 640px; margin: 0 auto; }
/* The wire into each node: a dashed line from the node above into its input port. */
.grid > .node:not(:first-child)::before {
    content: ""; position: absolute; left: 32px; top: calc(-1 * var(--gap) - 1px); height: var(--gap);
    border-left: 1px dashed var(--border-strong);
}
/* The hero sits outside the grid, so wire it to the first node explicitly. */
.node--hero + .grid > .node:first-child::before {
    content: ""; position: absolute; left: 32px; top: calc(-1 * var(--gap) - 1px); height: var(--gap);
    border-left: 1px dashed var(--border-strong);
}
@media (max-width: 419px) { .node__meta { display: none; } }
.node__head {
    display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px;
    padding: 12px 20px; border-bottom: 1px solid var(--border);
}
.node__head::before {
    content: ""; width: 9px; height: 9px; flex: none;
    border: 2px solid var(--accent); border-radius: 50%; background: var(--bg);
}
.node__id {
    font: 600 .72rem var(--mono); color: var(--accent);
    border: 1px solid var(--accent-line); border-radius: 3px; padding: 1px 6px;
}
.node__title { font-size: 1.02rem; font-weight: 600; margin: 0; }
.node__meta { margin-left: auto; font: .74rem var(--mono); color: var(--faint); }
.node__body { padding: 22px 20px; }
.node__intro { margin-bottom: 18px; }
.subhead { font-size: .8rem; font-weight: 600; letter-spacing: .02em; color: var(--muted); margin: 26px 0 10px; }

/* ---------- NODE 00 · Hero ----------------------------------------------- */
.node--hero { margin-bottom: var(--gap); }
/* Registration marks on the hero corners: the one place the blueprint is drawn literally. */
.node--hero::after {
    content: ""; position: absolute; inset: -7px; pointer-events: none;
    --m: var(--border-strong);
    background:
        linear-gradient(var(--m), var(--m)) top left / 14px 1px,
        linear-gradient(var(--m), var(--m)) top left / 1px 14px,
        linear-gradient(var(--m), var(--m)) top right / 14px 1px,
        linear-gradient(var(--m), var(--m)) top right / 1px 14px,
        linear-gradient(var(--m), var(--m)) bottom left / 14px 1px,
        linear-gradient(var(--m), var(--m)) bottom left / 1px 14px,
        linear-gradient(var(--m), var(--m)) bottom right / 14px 1px,
        linear-gradient(var(--m), var(--m)) bottom right / 1px 14px;
    background-repeat: no-repeat;
}
.hero { display: grid; gap: 28px; padding: 28px 20px 26px; }
@media (min-width: 900px) {
    .hero { grid-template-columns: minmax(0, 1.2fr) minmax(300px, 1fr); gap: 40px; padding: 36px 32px 32px; align-items: center; }
}
.hero__prompt { color: var(--muted); margin-bottom: 10px; font-size: .85rem; }
.prompt { color: var(--accent); font-family: var(--mono); }
.hero__title { font-size: clamp(2.6rem, 7vw, 4rem); font-weight: 700; letter-spacing: -0.035em; line-height: 1; margin-bottom: 12px; }
.hero__role {
    display: inline-block; margin-bottom: 16px;
    font: 500 .82rem var(--mono); color: var(--accent);
    border: 1px solid var(--accent-line); background: var(--accent-soft); border-radius: 3px; padding: 3px 9px;
}
.hero__tagline { font-size: clamp(1.05rem, 2.2vw, 1.2rem); line-height: 1.55; max-width: 34em; margin-bottom: 22px; }
.spec {
    display: grid; grid-template-columns: minmax(0, 1fr); margin: 0 0 24px;
    border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
}
.spec > div { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--border); }
.spec > div:last-child { border-bottom: 0; }
@media (min-width: 600px) {
    .spec { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24px; }
    .spec > div { grid-template-columns: 1fr; gap: 0; }
    .spec > div:nth-last-child(-n+2):nth-child(odd), .spec > div:last-child { border-bottom: 0; }
}
.spec dt { font: .74rem var(--mono); color: var(--faint); }
.spec dd { margin: 0; font-size: .93rem; font-weight: 500; }
.spec__ok { color: var(--ok); }
.spec__ok::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: currentColor; vertical-align: 1px; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 10px; }

/* Pipeline figure */
.pipeline { margin: 0; padding: 14px 16px 16px; background: var(--inset); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.pipeline__head { display: flex; justify-content: space-between; gap: 12px; font-size: .8rem; color: var(--muted); margin-bottom: 10px; }
.pipeline__head .mono { color: var(--faint); font-size: .74rem; }
.pipeline__svg { display: block; width: 100%; max-width: 380px; height: auto; margin: 0 auto; overflow: visible; }
.pipeline__wire { fill: none; stroke: var(--border-strong); stroke-width: 1.5; stroke-dasharray: 4 4; animation: flow 1.2s linear infinite; }
@keyframes flow { to { stroke-dashoffset: -16; } }
.pipeline__box rect { fill: var(--surface); stroke: var(--border-strong); stroke-width: 1; }
.pipeline__box text { fill: var(--text); font: 500 11px var(--mono); text-anchor: middle; dominant-baseline: middle; }
.pipeline__box--accent rect { fill: var(--accent-soft); stroke: var(--accent); }
.pipeline__box--accent text { fill: var(--accent); }
.pipeline__box--dashed rect { stroke-dasharray: 3 3; }
.pipeline__box--ledger rect { fill: var(--version-soft); stroke: var(--version); }
.pipeline__box--ledger text { fill: var(--version); font-weight: 600; }
.pipeline__note { margin: 12px 0 0; font-size: .8rem; color: var(--muted); text-align: center; }

/* ---------- NODE 01 · Core ----------------------------------------------- */
.core { display: grid; gap: 28px; }
@media (min-width: 900px) {
    .core { grid-template-columns: minmax(0, 1.65fr) minmax(240px, 1fr); gap: 36px; }
    .core__history { border-left: 1px solid var(--border); padding-left: 28px; }
}
.core__history .subhead:first-child { margin-top: 0; }

.config { background: var(--inset); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.config__file { margin: 0; padding: 7px 14px; font-size: .74rem; color: var(--faint); border-bottom: 1px solid var(--border); }
.config__block { display: grid; grid-template-columns: minmax(84px, max-content) 1fr; gap: 8px 18px; margin: 0; padding: 16px; }
.config__block dt { font: 500 .85rem var(--mono); color: var(--accent); }
.config__block dt::after { content: ":"; color: var(--faint); }
.config__block dd { margin: 0; font-size: .95rem; }
.config__block dd.mono { font-size: .88rem; color: var(--version); }
.config__list { margin: 0; padding: 0; list-style: none; counter-reset: p; display: grid; gap: 6px; }
.config__list li { counter-increment: p; display: grid; grid-template-columns: 2.2em 1fr; }
.config__list li::before { content: counter(p, decimal-leading-zero); font: .8rem/1.9 var(--mono); color: var(--faint); }
@media (max-width: 599px) {
    .config__block { grid-template-columns: 1fr; gap: 2px; }
    .config__block dd { margin-bottom: 10px; }
}

.skills { display: grid; gap: 1px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.skills__group { background: var(--surface); padding: 12px 14px; }
.skills__label { font: 600 .74rem var(--mono); color: var(--accent); margin: 0 0 4px; }
.skills__items { margin: 0; font-size: .9rem; color: var(--muted); }

.timeline { list-style: none; padding: 0; margin: 0; border-left: 1px dashed var(--border-strong); }
.timeline__item { position: relative; padding: 0 0 22px 20px; }
.timeline__item:last-child { padding-bottom: 0; }
.timeline__item::before { content: ""; position: absolute; left: -5px; top: 6px; width: 9px; height: 9px; border-radius: 50%; background: var(--surface); border: 2px solid var(--border-strong); }
.timeline__item.is-current::before { border-color: var(--accent); background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.timeline__when { display: block; color: var(--faint); font-size: .74rem; margin-bottom: 2px; }
.timeline__item.is-current .timeline__when { color: var(--accent); }
.timeline__role { display: block; font-weight: 600; }
.timeline__org { display: block; color: var(--muted); font-size: .9rem; }
.timeline__item p { margin: 6px 0 0; color: var(--muted); font-size: .9rem; }

/* ---------- NODE 02 · Changelog ------------------------------------------ */
.changelog { display: grid; gap: 0; }
.release { position: relative; padding: 18px 0 18px 28px; border-bottom: 1px dashed var(--border); }
.release:first-child { padding-top: 4px; }
.release:last-child { border-bottom: 0; padding-bottom: 4px; }
.release__rail { position: absolute; left: 5px; top: 0; bottom: 0; border-left: 1px solid var(--border-strong); }
.release:first-child .release__rail { top: 12px; }
.release:last-child .release__rail { bottom: auto; height: 30px; }
.release__rail::before { content: ""; position: absolute; left: -6px; top: 24px; width: 11px; height: 11px; border-radius: 50%; background: var(--bg); border: 2px solid var(--version); }
.release:first-child .release__rail::before { top: 10px; }
.release--work .release__rail::before { border-color: var(--faint); border-style: dashed; }
.release__head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-bottom: 6px; }
.release__title { font-size: 1.15rem; font-weight: 600; margin: 0; letter-spacing: -0.01em; }
.release__title a { color: var(--text); text-decoration: none; }
.release__title a:hover { color: var(--accent); }
.release__type { font: .74rem var(--mono); color: var(--muted); border: 1px solid var(--border); border-radius: 3px; padding: 1px 7px; }
.release__date { margin-left: auto; font: .74rem var(--mono); color: var(--faint); }
.release__summary { margin-bottom: 12px; max-width: 70ch; }
.release .badges { margin-bottom: 10px; }
.release--work .release__title { color: var(--muted); }
.release--work .release__summary { color: var(--muted); margin: 0; }
.node__foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin: 18px 0 0; padding-top: 14px; border-top: 1px solid var(--border); }

/* ---------- NODE 03 · Terminal ------------------------------------------- */
.terminal { border: 1px solid var(--border-strong); border-radius: var(--radius-lg); background: #050c14; color: #cfe3d6; font-family: var(--mono); font-size: .86rem; overflow: hidden; }
.terminal__bar { display: flex; align-items: center; gap: 6px; padding: 9px 12px; background: #0b1826; border-bottom: 1px solid #1a3149; }
.terminal__bar span { width: 10px; height: 10px; border-radius: 50%; background: #2c4660; }
.terminal__bar span:nth-child(1) { background: #ff8177; }
.terminal__bar span:nth-child(2) { background: #f6c177; }
.terminal__bar span:nth-child(3) { background: #7ee787; }
.terminal__bar em { margin-left: 8px; font-style: normal; color: #7f97ad; font-size: .76rem; }
.terminal__out { max-height: 340px; min-height: 180px; overflow-y: auto; padding: 14px 16px; }
.terminal__out p, .terminal__out pre { margin: 0 0 4px; white-space: pre-wrap; overflow-wrap: anywhere; }
.terminal__out .cmd { color: #9fb3c6; }
.terminal__out .cmd::before { content: "guest:~$ "; color: #4fd1c5; }
.terminal__out .ok { color: #7ee787; }
.terminal__out .err { color: #ff8177; }
.terminal__out .dim { color: #7f97ad; }
.terminal__out .hl { color: #f6c177; }
.terminal__out a { color: #4fd1c5; }
.terminal__out kbd { border-color: #2c4660; color: #f6c177; }
.terminal__in { display: flex; align-items: center; gap: 8px; padding: 10px 16px 12px; border-top: 1px solid #12253a; }
.terminal .terminal__in input { flex: 1; min-width: 0; width: auto; padding: 0; background: transparent; border: 0; border-radius: 0; color: #e8f2ec; font: inherit; caret-color: #4fd1c5; }
.terminal .terminal__in input:focus { outline: none; box-shadow: none; }
.terminal__in:focus-within { box-shadow: inset 0 -2px 0 #4fd1c5; }
.terminal__chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 16px; border-top: 1px solid #1a3149; background: #081421; }
.terminal__chips-label { color: #7f97ad; font-size: .76rem; margin-right: 2px; }
.terminal__chips .chip { background: transparent; color: #cfe3d6; border-color: #2c4660; font-size: .76rem; padding: 3px 10px; }
.terminal__chips .chip:hover { color: #4fd1c5; border-color: #4fd1c5; }
.terminal .cursor { display: inline-block; width: .6em; background: #4fd1c5; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- NODE 04 · Milestones ----------------------------------------- */
.log { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.log__line { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; align-items: center; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--inset); }
.log__line time { color: var(--accent); font-size: .78rem; }
.log__line .tag { justify-self: end; }
.log__text { grid-column: 1 / -1; }
.log__text strong { font-weight: 600; }

/* ---------- NODE 05 · Artifacts ------------------------------------------ */
.artifacts { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.artifact { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--inset); }
.artifact__name { font-weight: 600; font-family: var(--sans); font-size: .95rem; }
.artifact__name em { color: var(--accent); font-style: normal; font-weight: 500; font-size: .82rem; margin-left: 4px; }
.artifact__meta { grid-column: 1; font-size: .8rem; }
.artifact .btn, .artifact > .artifact__meta:last-child { grid-column: 2; grid-row: 1 / span 2; }
.artifact:has(.btn) .artifact__meta { grid-row: 2; }

/* ---------- NODE 06 · Tea ------------------------------------------------ */
.tea { display: grid; gap: 16px; }
.tea__amounts { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.tea__amounts legend { font: .78rem var(--mono); color: var(--muted); margin-bottom: 8px; padding: 0; }
.tea__amounts .chip { justify-content: center; padding: 9px 6px; font-size: .84rem; }
.tea__custom { grid-column: 1 / -1; }
.tea__custom:not(:focus-within) { display: none; }
.tea__amounts:has(.chip--custom input:checked) .tea__custom { display: block; }
.tea__status { min-height: 1.5em; margin: 0; font-family: var(--mono); font-size: .86rem; }
.tea__status:empty { min-height: 0; margin-top: -8px; }
.tea__status.is-ok { color: var(--ok); }
.tea__status.is-err { color: var(--err); }
.tea__status.is-info { color: var(--info); }
.tea .btn--primary { width: 100%; }

/* ---------- Forms (contact + admin) -------------------------------------- */
.form { display: grid; gap: 14px; margin-bottom: 22px; }
.field { display: grid; gap: 5px; }
.field__label { font-size: .85rem; font-weight: 500; color: var(--muted); }
.field__hint { font-size: .8rem; color: var(--muted); margin: 0; }
.field__error { font-size: .82rem; color: var(--err); }
input[type="text"], input[type="email"], input[type="tel"], input[type="number"], input[type="password"], input[type="url"], input[type="date"], input[type="file"], select, textarea {
    width: 100%; font: 1rem var(--sans); color: var(--text);
    background: var(--inset); border: 1px solid var(--border-strong); border-radius: var(--radius); padding: 10px 12px;
}
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
input[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--err); }
textarea { resize: vertical; min-height: 120px; }
.form .btn--primary { justify-self: start; }
.direct { list-style: none; padding: 16px 0 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; border-top: 1px solid var(--border); }
.direct .link { padding: 6px 10px; border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); text-decoration: none; font-size: .84rem; }
.direct .link:hover { border-color: var(--accent); color: var(--accent); }

.notice { padding: 10px 14px; border-radius: var(--radius); border: 1px solid; font-size: .9rem; }
.notice .mono { font-weight: 600; margin-right: 6px; }
.notice--ok { color: var(--ok); border-color: currentColor; background: color-mix(in srgb, var(--ok) 8%, transparent); }
.notice--err { color: var(--err); border-color: currentColor; background: color-mix(in srgb, var(--err) 8%, transparent); }
.notice--info { color: var(--info); border-color: currentColor; background: color-mix(in srgb, var(--info) 8%, transparent); }

/* ---------- Inner pages -------------------------------------------------- */
.page-head { padding: 8px 0 26px; max-width: 800px; }
.crumbs { color: var(--muted); margin-bottom: 10px; }
.crumbs a { color: var(--muted); }
.lead { font-size: 1.12rem; }
.page-head h1 { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.page-head h1 .tag { font-size: .85rem; }
.page-head .links { margin-top: 14px; }
.filter { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.prose { max-width: 72ch; }
.prose h2 { font-size: .95rem; font-family: var(--mono); font-weight: 600; color: var(--accent); margin-top: 1.6em; }
.prose h2:first-child { margin-top: 0; }
.checklist { list-style: none; padding: 0; }
.checklist li { position: relative; padding-left: 24px; margin-bottom: 6px; }
.checklist li::before { content: "+"; position: absolute; left: 4px; color: var(--ok); font-family: var(--mono); font-weight: 700; }
.shots { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.shots figure { margin: 0; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.project > p { margin-top: 24px; }
.error-page { margin-top: 32px; }

/* ---------- Footer ------------------------------------------------------- */
.footer { border-top: 1px solid var(--border); background: color-mix(in srgb, var(--bg) 92%, transparent); }
.footer__inner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px 24px; padding-top: 22px; padding-bottom: 22px; font-size: .85rem; color: var(--muted); }
.footer__inner p { margin: 0; }
.footer__links { display: flex; flex-wrap: wrap; gap: 18px; }
.footer__links a { color: var(--muted); text-decoration: none; }
.footer__links a:hover { color: var(--accent); }

/* ---------- Motion ------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { transition: none !important; animation: none !important; }
}
