/* ==========================================================================
   Rugved Koshiya — portfolio
   Tokens → base → primitives → header → sections → responsive
   ========================================================================== */

/* ---------- Tokens (light is the base palette; dark is the default theme) ---------- */
:root {
    --bg: #f3f1ec;
    --bg-sunken: #e9e7e1;
    --bg-raised: #faf9f6;
    --ink: #121214;
    --ink-strong: #000;
    --muted: rgba(18, 18, 20, .72);
    --faint: rgba(18, 18, 20, .6);
    --line: #d4d2ce;
    --line-strong: #9e9c9a;
    --dot: #bdbab3;
    --accent: #9a5b00;
    --accent-soft: rgba(154, 91, 0, .1);
    --spot: rgba(154, 91, 0, .07);
    --ok: #0f8a58;
    --invert-bg: #121214;
    --invert-fg: #f3f1ec;
    --header-bg: rgba(243, 241, 236, .9);
    --logo-filter: grayscale(1) contrast(0) brightness(.5);

    --font-sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
    --font-serif: "Instrument Serif", Georgia, "Times New Roman", serif;
    --font-display: "Archivo", var(--font-sans);

    --frame: 1280px;
    --pad: clamp(16px, 4vw, 40px);
    --cell-pad: clamp(18px, 2.2vw, 28px);
    --header-h: 48px;
    --ease: cubic-bezier(.2, .7, .2, 1);

    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #0b0c0e;
        --bg-sunken: #060708;
        --bg-raised: #111215;
        --ink: #eeeae2;
        --ink-strong: #fff;
        --muted: rgba(238, 234, 226, .68);
        --faint: rgba(238, 234, 226, .5);
        --line: #29292a;
        --line-strong: #4f4f4e;
        --dot: #464645;
        --accent: #ffb224;
        --accent-soft: rgba(255, 178, 36, .12);
        --spot: rgba(255, 178, 36, .09);
        --ok: #3ddc97;
        --invert-bg: #eeeae2;
        --invert-fg: #0b0c0e;
        --header-bg: rgba(11, 12, 14, .86);
        --logo-filter: grayscale(1) contrast(0) brightness(1.6);
        color-scheme: dark;
    }
}

:root[data-theme="dark"] {
    --bg: #0b0c0e;
    --bg-sunken: #060708;
    --bg-raised: #111215;
    --ink: #eeeae2;
    --ink-strong: #fff;
    --muted: rgba(238, 234, 226, .68);
    --faint: rgba(238, 234, 226, .5);
    --line: #29292a;
    --line-strong: #4f4f4e;
    --dot: #464645;
    --accent: #ffb224;
    --accent-soft: rgba(255, 178, 36, .12);
    --spot: rgba(255, 178, 36, .09);
    --ok: #3ddc97;
    --invert-bg: #eeeae2;
    --invert-fg: #0b0c0e;
    --header-bg: rgba(11, 12, 14, .86);
    --logo-filter: grayscale(1) contrast(0) brightness(1.6);
    color-scheme: dark;
}

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

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) + 44px);
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: clip;
}

[hidden] { display: none !important; }
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4, p, figure { margin: 0; }
h1, h2, h3, h4 { font-weight: 600; letter-spacing: -.02em; line-height: 1.15; }
button { font: inherit; color: inherit; letter-spacing: inherit; text-transform: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
strong { font-weight: 600; color: var(--ink-strong); }

em {
    font-family: var(--font-serif);
    font-style: italic;
    font-weight: 400;
    letter-spacing: -.01em;
    color: var(--accent);
    padding-right: .04em;
}

::selection { background: var(--accent); color: #0b0c0e; }

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

.skip-link {
    position: fixed;
    left: 12px;
    top: -100px;
    z-index: 200;
    padding: 10px 16px;
    background: var(--invert-bg);
    color: var(--invert-fg);
}
.skip-link:focus { top: 8px; }

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

.i {
    width: 16px;
    height: 16px;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ---------- Primitives ---------- */

/* Mono uppercase HUD label */
.hud {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: .15em;
    text-transform: uppercase;
    line-height: 1.4;
}
.faint { color: var(--faint); }
.muted { color: var(--muted); }

/* Hairline-framed column */
.frame {
    position: relative;
    max-width: var(--frame);
    margin-inline: auto;
    border-inline: 1px solid var(--line);
}

/* Clip so the corner ticks can't cause sideways scroll once the frame meets the viewport edge */
.sec { position: relative; border-top: 1px solid var(--line); overflow-x: clip; }

/* Registration crosshair where a section rule meets the frame */
.tick {
    position: absolute;
    z-index: 31;
    width: 11px;
    height: 11px;
    pointer-events: none;
}
.tick::before,
.tick::after { content: ""; position: absolute; background: var(--line-strong); }
.tick::before { left: 5px; top: 0; bottom: 0; width: 1px; }
.tick::after { top: 5px; left: 0; right: 0; height: 1px; }
.tick-tl { top: -6px; left: -6px; }
.tick-tr { top: -6px; right: -6px; }

/* Sticky section bar: "01 / Work ............ meta" */
.bar {
    position: sticky;
    top: var(--header-h);
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px var(--pad);
    border-bottom: 1px solid var(--line);
    background: var(--header-bg);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    color: var(--muted);
}
.bar .n,
.bar .slash { color: var(--faint); }
.bar .slash { margin: 0 .6em; }
.bar-meta { color: var(--faint); text-align: right; }

.sec-head { padding: clamp(56px, 8vw, 96px) var(--pad) clamp(40px, 6vw, 64px); }
.sec-head h2 {
    max-width: 18ch;
    font-size: clamp(2.2rem, 5.2vw, 3.9rem);
    font-weight: 500;
    line-height: 1.02;
    letter-spacing: -.035em;
    color: var(--ink-strong);
    text-wrap: balance;
}
.lede {
    margin-top: 20px;
    max-width: 56ch;
    font-size: clamp(1rem, 1.3vw, 1.125rem);
    color: var(--muted);
}

/* Cell grid: every cell draws its right and bottom rule; the grid overlaps the
   frame's right border and the next section's top border so lines never double */
.cells {
    display: grid;
    margin-right: -1px;
    margin-bottom: -1px;
    border-top: 1px solid var(--line);
}
.cells.flush { border-top: 0; }
.cells > * {
    min-width: 0;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.cell-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px var(--cell-pad);
    border-bottom: 1px solid var(--line);
    color: var(--muted);
}
.cell-head .n { color: var(--faint); }

/* Buttons: square, mono, invert on hover */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 48px;
    padding: 0 24px;
    border: 1px solid transparent;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    white-space: nowrap;
    transition: background-color .12s linear, color .12s linear, border-color .12s linear, opacity .15s ease;
}
.btn-solid { background: var(--invert-bg); color: var(--invert-fg); }
.btn-solid:hover { opacity: .82; }
.btn-line { border-color: var(--line-strong); background: var(--bg); color: var(--ink); }
.btn-line:hover { border-color: transparent; background: var(--invert-bg); color: var(--invert-fg); }
.btn-sm { height: 36px; padding: 0 14px; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags li {
    padding: 5px 8px;
    border: 1px solid var(--line);
    font-family: var(--font-mono);
    font-size: 11px;
    line-height: 1;
    color: var(--muted);
}

.status-dot {
    position: relative;
    display: inline-block;
    flex: none;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--ok);
}
.status-dot::after {
    content: "";
    position: absolute;
    inset: -4px;
    border: 2px solid var(--ok);
    border-radius: 50%;
    opacity: 0;
    animation: pulse 2.4s ease-out infinite;
}
@keyframes pulse {
    0% { transform: scale(.5); opacity: .7; }
    100% { transform: scale(1.6); opacity: 0; }
}

/* Pointer-following spotlight */
.spotlight { position: relative; isolation: isolate; }
.spotlight::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: radial-gradient(380px circle at var(--mx, 50%) var(--my, 0%), var(--spot), transparent 60%);
    opacity: 0;
    transition: opacity .3s ease;
    pointer-events: none;
}
.spotlight:hover::before { opacity: 1; }

/* Reveal on scroll (only when JS is running) */
html.js .reveal {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity .7s var(--ease), transform .7s var(--ease);
    transition-delay: var(--d, 0ms);
}
html.js .reveal.is-in { opacity: 1; transform: none; }

.scroll-progress {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 120;
    height: 2px;
    pointer-events: none;
}
.scroll-progress span {
    display: block;
    height: 100%;
    background: var(--accent);
    transform: scaleX(var(--progress, 0));
    transform-origin: 0 50%;
}

/* Floating back-to-top; always visible without JS, revealed past the hero with it */
.to-top {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 90;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 1px solid var(--line-strong);
    background: var(--header-bg);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    color: var(--ink);
    transition: opacity .25s ease, visibility .25s, transform .25s var(--ease), background-color .12s linear, color .12s linear, border-color .12s linear;
}
.to-top:hover { border-color: transparent; background: var(--invert-bg); color: var(--invert-fg); }
.to-top:hover .i { transform: translateY(-2px); }
.to-top .i { transition: transform .2s var(--ease); }
html.js .to-top:not(.is-shown) { visibility: hidden; opacity: 0; transform: translateY(8px); pointer-events: none; }

/* ---------- Header ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--header-h);
    border-bottom: 1px solid var(--line);
    background: var(--header-bg);
    -webkit-backdrop-filter: saturate(160%) blur(10px);
    backdrop-filter: saturate(160%) blur(10px);
}
.header-in { display: flex; align-items: stretch; justify-content: space-between; height: 100%; }
.header-left,
.header-right { display: flex; align-items: stretch; min-width: 0; }

.brand {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 0 20px;
    border-right: 1px solid var(--line);
    font-family: var(--font-mono);
    font-size: 15px;
    font-weight: 700;
    color: var(--ink-strong);
}
.caret {
    display: inline-block;
    width: .55em;
    height: 1.05em;
    background: var(--accent);
    animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.nav ul { display: flex; height: 100%; padding-left: 6px; }
.nav li { display: flex; }
.nav a { display: flex; align-items: center; padding: 0 6px; color: var(--muted); }
.nav a span { padding: 3px 7px; transition: background-color .12s linear, color .12s linear; }
.nav a:hover { color: var(--ink); }
.nav a:hover span,
.nav a.is-active span { background: var(--invert-bg); color: var(--invert-fg); }

.hcell {
    display: grid;
    place-items: center;
    width: 48px;
    border-left: 1px solid var(--line);
    color: var(--muted);
    transition: background-color .12s linear, color .12s linear;
}
.hcell:hover { background: var(--invert-bg); color: var(--invert-fg); }
.hcta {
    display: flex;
    align-items: center;
    padding: 0 20px;
    border-left: 1px solid var(--line);
    background: var(--invert-bg);
    color: var(--invert-fg);
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    white-space: nowrap;
    transition: opacity .15s ease;
}
.hcta:hover { opacity: .82; }

.theme-toggle .i-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .i-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .i-moon { display: none; }
.menu-toggle { display: none; }
.menu-toggle .i-x { display: none; }
.nav-open .menu-toggle .i-x { display: block; }
.nav-open .menu-toggle .i-menu { display: none; }

/* ---------- Hero ---------- */
.hero {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: calc(100svh - var(--header-h));
    overflow: hidden;
}
.hero-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    image-rendering: pixelated;
    pointer-events: none;
    -webkit-mask-image: linear-gradient(#000 55%, transparent 98%);
    mask-image: linear-gradient(#000 55%, transparent 98%);
}

.hero-in {
    position: relative;
    z-index: 2;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 920px;
    margin-inline: auto;
    padding: 56px var(--pad) 88px;
    text-align: center;
}
.hero-halo {
    position: absolute;
    inset: 0 -12%;
    z-index: -1;
    background: radial-gradient(closest-side, var(--header-bg), transparent);
    pointer-events: none;
}

.wordmark-wrap { width: 100%; max-width: 780px; container-type: inline-size; }
.wordmark {
    display: block;
    font-family: var(--font-display);
    font-size: min(16vw, 140px);
    font-size: 18cqw;
    font-weight: 750;
    font-stretch: 125%;
    line-height: .95;
    letter-spacing: -.01em;
    color: var(--ink-strong);
    white-space: nowrap;
}
/* Each letter keeps its real glyph for layout; the scramble glyph is drawn on top */
.wm-l { position: relative; display: inline-block; }
html.js .wm-l { color: transparent; }
html.js .wm-l::after {
    content: attr(data-g);
    position: absolute;
    inset: 0;
    text-align: center;
    color: var(--ink-strong);
}
html.js .wm-l.is-hot::after { color: var(--accent); }

.hero-title {
    max-width: 27ch;
    margin-top: 30px;
    font-size: clamp(1.45rem, 3vw, 2.3rem);
    font-weight: 500;
    line-height: 1.14;
    letter-spacing: -.03em;
    text-wrap: balance;
}
.hero-lede {
    max-width: 54ch;
    margin-top: 16px;
    font-size: clamp(1rem, 1.3vw, 1.1rem);
    color: var(--muted);
}
.hero-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 30px; }
.hero-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px 22px;
    margin-top: 30px;
    color: var(--faint);
}
.hero-meta a,
.hero-meta span { display: inline-flex; align-items: center; gap: 7px; }
.hero-meta a:hover { color: var(--ink); }
.hero-meta .i { width: 13px; height: 13px; }

.hero-corner { position: absolute; z-index: 2; bottom: 18px; color: var(--faint); }
.hc-l { left: var(--pad); }
.hc-r { right: var(--pad); }

/* ---------- Marquee ---------- */
.marquee { display: flex; overflow: hidden; border-top: 1px solid var(--line); }
.marquee-track {
    display: flex;
    flex-shrink: 0;
    min-width: 100%;
    animation: marquee 70s linear infinite;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 22px 14px 0;
    color: var(--muted);
    white-space: nowrap;
}
.marquee li::before { content: "▪"; margin-right: 12px; color: var(--accent); }
.marquee img { width: 18px; height: 18px; object-fit: contain; filter: var(--logo-filter); }
@keyframes marquee { to { transform: translateX(-100%); } }

/* ---------- 00 Profile ---------- */
.profile { grid-template-columns: minmax(0, .9fr) minmax(0, 1.25fr) minmax(0, .85fr); }
.profile > * { display: flex; flex-direction: column; }

.portrait {
    position: relative;
    flex: 1;
    min-height: 320px;
    overflow: hidden;
    background: var(--bg-sunken);
    cursor: crosshair;
}
.portrait img,
.portrait canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 20%;
}
.portrait canvas { opacity: 0; transition: opacity .5s var(--ease); }
.portrait.is-dithered canvas { opacity: 1; }
.portrait.is-dithered:hover canvas,
.portrait.is-open canvas { opacity: 0; }
.portrait figcaption {
    position: absolute;
    left: 12px;
    bottom: 12px;
    z-index: 2;
    padding: 4px 8px;
    background: var(--invert-bg);
    color: var(--invert-fg);
    opacity: 0;
    transition: opacity .3s ease;
}
.portrait.is-dithered figcaption { opacity: 1; }
.portrait.is-dithered:hover figcaption,
.portrait.is-open figcaption { opacity: 0; }

.shell-cell .shell-in {
    flex: 1;
    display: flex;
    align-items: center;
    padding: var(--cell-pad);
    background: radial-gradient(var(--line) 1px, transparent 1.2px) 0 0 / 14px 14px;
}

/* The terminal stays dark in both themes */
.term {
    width: 100%;
    overflow: hidden;
    border: 1px solid #2c2d31;
    border-radius: 10px;
    background: #0e0f12;
    color: #d8d4cb;
    box-shadow: 0 30px 70px -30px rgba(0, 0, 0, .7);
}
.term-bar {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 11px 14px;
    border-bottom: 1px solid #23242a;
}
.term-bar span { width: 10px; height: 10px; border-radius: 50%; background: #3a3c43; }
.term-bar span:nth-child(1) { background: #ff5f57; }
.term-bar span:nth-child(2) { background: #febc2e; }
.term-bar span:nth-child(3) { background: #28c840; }
.term-bar code { margin-left: 8px; font-family: var(--font-mono); font-size: 11px; color: #7d7b75; }
.term-body {
    padding: 16px 18px 18px;
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 12.5px;
    line-height: 1.8;
}
.term .ln { display: block; white-space: pre; }
.t-p { color: #ffb224; }
.t-k { color: #8a8780; }
.t-ok { color: #3ddc97; }
.t-caret {
    display: inline-block;
    width: .6em;
    height: 1.1em;
    vertical-align: -.2em;
    background: #ffb224;
    animation: blink 1.1s steps(1) infinite;
}
html.js .term .ln { opacity: 0; transform: translateY(4px); transition: opacity .35s ease, transform .35s ease; transition-delay: var(--d, 0ms); }
html.js .term.is-in .ln { opacity: 1; transform: none; }

.stats { flex: 1; display: grid; grid-template-rows: repeat(4, 1fr); }
.stat {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 18px var(--cell-pad);
    border-bottom: 1px solid var(--line);
}
.stat:last-child { border-bottom: 0; }
.stat-v {
    font-family: var(--font-display);
    font-size: clamp(2rem, 3.2vw, 2.7rem);
    font-weight: 700;
    font-stretch: 125%;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    color: var(--ink-strong);
}
.stat-l { margin-top: 8px; font-size: 14.5px; color: var(--muted); }
.stat-l .hud { display: block; margin-top: 3px; font-size: 10px; color: var(--faint); }

/* ---------- 01 Capabilities ---------- */
.bento { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cap {
    display: flex;
    flex-direction: column;
    gap: 22px;
    padding: var(--cell-pad);
}
.cap-wide {
    grid-column: span 2;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
    align-items: center;
    gap: 28px;
}
.cap-tall { grid-row: span 2; }
.cap-tall .mock { flex: 1; }
.cap-n { color: var(--faint); }
.cap h3 { margin-top: 14px; font-size: 1.3rem; color: var(--ink-strong); }
.cap p:not(.hud) { margin-top: 8px; font-size: 15px; color: var(--muted); }
.cap .tags { margin-top: 18px; }

.mock {
    overflow-x: auto;
    padding: 16px 18px;
    border: 1px solid var(--line);
    background: var(--bg-sunken);
    font-family: var(--font-mono);
    font-size: 12px;
    line-height: 1.75;
    color: var(--muted);
}
.mock .ln { display: block; white-space: pre; }
.m-add { color: var(--ok); }
.m-chg { color: var(--accent); }
.m-dim { color: var(--faint); }
.m-ink { color: var(--ink); }
.mock .status-dot { width: 6px; height: 6px; margin-right: 6px; vertical-align: 1px; }
.mock .status-dot.is-warn { background: var(--accent); }
.mock .status-dot.is-warn::after { border-color: var(--accent); }

.scan-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 5px 0;
    border-bottom: 1px dashed var(--line);
}
.scan-row:last-child { border-bottom: 0; }
.scan-row b { font-weight: 500; color: var(--ok); }

.ci-bar { height: 2px; margin: 4px 0 10px; background: var(--line); }
.ci-bar span {
    display: block;
    height: 100%;
    background: var(--ok);
    transform: scaleX(0);
    transform-origin: 0 50%;
    transition: transform 2.2s var(--ease) .2s;
}
.is-in .ci-bar span { transform: none; }
.ci .chk { display: inline-block; width: 1.4em; color: var(--faint); transition: color .3s ease; transition-delay: var(--d, 0ms); }
.is-in .ci .chk { color: var(--ok); }
.ci .ln:last-child .chk { color: var(--accent); }

.arch { width: 100%; height: auto; }
.a-box { fill: var(--bg); stroke: var(--line-strong); stroke-width: 1; }
.a-box.is-acc { stroke: var(--accent); }
.a-t { font-family: var(--font-mono); font-size: 9.5px; fill: var(--muted); letter-spacing: .04em; }
.a-t.is-acc { fill: var(--accent); }
.a-ln { fill: none; stroke: var(--line-strong); stroke-width: 1; stroke-dasharray: 3 3; animation: flow 1.6s linear infinite; }
@keyframes flow { to { stroke-dashoffset: -12; } }

.board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.board-col { display: flex; flex-direction: column; gap: 8px; }
.board-col p { margin-bottom: 2px; font-size: 10px; color: var(--faint); }
.board-col span {
    padding: 7px 9px;
    overflow: hidden;
    border: 1px solid var(--line);
    background: var(--bg);
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--muted);
    white-space: nowrap;
    text-overflow: ellipsis;
}
.board-col span.is-acc { border-left: 2px solid var(--accent); color: var(--ink); }
.board-col span.is-done { color: var(--faint); text-decoration: line-through; text-decoration-color: var(--line-strong); }

/* ---------- 02 Work ---------- */
.filters { display: flex; flex-wrap: wrap; margin-right: -1px; border-top: 1px solid var(--line); }
.filter {
    padding: 13px 20px;
    border-right: 1px solid var(--line);
    color: var(--muted);
    transition: background-color .12s linear, color .12s linear;
}
.filter:hover { color: var(--ink); }
.filter[aria-pressed="true"] { background: var(--invert-bg); color: var(--invert-fg); }
.filter .c { margin-left: 8px; opacity: .6; }

.work-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.job { display: flex; flex-direction: column; }
.job-media {
    position: relative;
    display: grid;
    place-items: center;
    height: 150px;
    padding: 0 16px;
    border-bottom: 1px solid var(--line);
    background: radial-gradient(var(--line) 1px, transparent 1.2px) 0 0 / 10px 10px, var(--bg-sunken);
    text-align: center;
}
.job-mark {
    font-family: var(--font-display);
    font-size: clamp(1.35rem, 2.1vw, 1.8rem);
    font-weight: 700;
    font-stretch: 125%;
    letter-spacing: -.02em;
    line-height: 1.05;
    color: var(--ink-strong);
}
.job-chips { position: absolute; left: 12px; bottom: 12px; display: flex; gap: 6px; }
.job-chips span { padding: 3px 7px; border: 1px solid var(--line-strong); background: var(--bg); font-size: 10px; color: var(--muted); }
.job-flag {
    position: absolute;
    top: 12px;
    right: 12px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 10px;
    color: var(--muted);
}
.job-flag .i { width: 12px; height: 12px; }
a.job-flag:hover { color: var(--ink); }

.job-body { flex: 1; display: flex; flex-direction: column; padding: var(--cell-pad); }
.job h3 { font-size: 1.25rem; color: var(--ink-strong); }
.job h3 a { display: inline-flex; align-items: center; gap: 6px; transition: color .15s ease; }
.job h3 a .i { width: 15px; height: 15px; color: var(--faint); transition: transform .2s var(--ease), color .15s ease; }
.job h3 a:hover { color: var(--accent); }
.job h3 a:hover .i { color: var(--accent); transform: translate(2px, -2px); }
.job-role { margin-top: 6px; font-family: var(--font-mono); font-size: 12px; font-weight: 500; line-height: 1.5; color: var(--accent); }
.job-sum { margin-top: 12px; font-size: 15px; color: var(--muted); }
/* Verifiable figures on the strongest entries; dt (label) renders under dd (value) */
.job-facts {
    display: grid;
    grid-auto-columns: minmax(0, 1fr);
    grid-auto-flow: column;
    margin-top: 16px;
    border-block: 1px solid var(--line);
}
.job-facts div { display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: 4px; padding: 12px 12px 12px 0; }
.job-facts div + div { padding-left: 12px; border-left: 1px solid var(--line); }
.job-facts dd { margin: 0; font-family: var(--font-display); font-size: 1.35rem; font-weight: 700; line-height: 1; color: var(--ink-strong); }
.job-facts dt { font-family: var(--font-mono); font-size: 10px; line-height: 1.4; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.job-src { margin-top: 6px; font-size: 9.5px; color: var(--faint); }
.job ul:not(.tags) { display: grid; gap: 6px; margin-top: 14px; }
.job ul:not(.tags) li { position: relative; padding-left: 18px; font-size: 14px; color: var(--muted); }
.job ul:not(.tags) li::before { content: "›"; position: absolute; left: 2px; font-family: var(--font-mono); color: var(--accent); }
.job .tags { margin-top: auto; padding-top: 20px; }

/* NDA redaction bar on unlinked, private entries */
.redact { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 10px; color: var(--faint); }
.redact b { display: inline-block; width: 64px; height: 9px; background: var(--ink); opacity: .85; }

/* Full-width strip closing the work grid */
.job-more {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas: "tag tag tag" "title text btn";
    align-items: center;
    gap: 10px 36px;
    padding: var(--cell-pad);
    background: var(--bg-raised);
}
.job-more .hud { grid-area: tag; }
.job-more h3 { grid-area: title; font-size: 1.6rem; font-weight: 500; letter-spacing: -.03em; line-height: 1.1; }
.job-more p:not(.hud) { grid-area: text; max-width: 52ch; font-size: 15px; color: var(--muted); }
.job-more .btn { grid-area: btn; }

/* ---------- 03 Lab ---------- */
.lab { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); }
.proj { display: flex; flex-direction: column; }
.proj-body { flex: 1; display: flex; flex-direction: column; gap: 18px; padding: var(--cell-pad); }
.proj h3 { font-size: 1.5rem; color: var(--ink-strong); }
.proj h3 a { display: inline-flex; align-items: center; gap: 8px; transition: color .15s ease; }
.proj h3 a .i { width: 16px; height: 16px; color: var(--faint); transition: transform .2s var(--ease), color .15s ease; }
.proj h3 a:hover,
.proj h3 a:hover .i { color: var(--accent); }
.proj h3 a:hover .i { transform: translate(2px, -2px); }
.proj p:not(.hud) { font-size: 15px; color: var(--muted); }
.proj .tags { margin-top: auto; }
.proj-status { display: flex; align-items: center; gap: 8px; color: var(--accent); }

.px-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 3px; width: min(100%, 200px); }
.px-grid i { aspect-ratio: 1; background: var(--c, var(--line)); }
.px-grid i.is-payload { outline: 1px solid var(--accent); outline-offset: 1px; }

.lab > .proj:nth-child(3) .proj-body { gap: 12px; }
.ls-prompt { font-family: var(--font-mono); font-size: 12.5px; color: var(--muted); }
.ls-prompt span { color: var(--accent); }
.ls { border-top: 1px solid var(--line); }
.ls a {
    display: grid;
    grid-template-columns: minmax(0, 13.5em) minmax(0, 5em) minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
    padding: 9px 4px;
    border-bottom: 1px dashed var(--line);
    font-family: var(--font-mono);
    font-size: 12.5px;
    color: var(--muted);
    transition: color .15s ease, background-color .15s ease;
}
.ls-name { color: var(--ink); }
.ls-lang { color: var(--faint); }
.ls-desc { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ls a .i { width: 13px; height: 13px; color: var(--faint); transition: transform .2s var(--ease), color .15s ease; }
.ls a:hover { background: var(--spot); }
.ls a:hover .ls-name,
.ls a:hover .i { color: var(--accent); }
.ls a:hover .i { transform: translate(2px, -2px); }

.pkg-v {
    font-family: var(--font-display);
    font-size: clamp(3rem, 6vw, 4.5rem);
    font-weight: 700;
    font-stretch: 125%;
    line-height: .9;
    color: var(--ink-strong);
}
.pkg-v span { color: var(--accent); }
.pkg h3 { font-size: 1.3rem; }

/* ---------- 04 Stack ---------- */
.stack { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stack-body { padding: var(--cell-pad); }
.tags-lg li { padding: 8px 11px; font-size: 12.5px; color: var(--ink); background: var(--bg-raised); }
.stack-note { margin-top: 14px; color: var(--accent); }
.stack-sec { grid-column: 1 / -1; padding: 16px var(--cell-pad); background: var(--accent-soft); }
.stack-sec p { color: var(--muted); }
.stack-sec-k { margin-right: 14px; color: var(--accent); }

/* ---------- 05 Method ---------- */
.steps { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.step { padding: var(--cell-pad) var(--cell-pad) 36px; }
.step-n { color: var(--faint); }
.step h3 { margin-top: 34px; font-size: 1.5rem; font-weight: 500; letter-spacing: -.03em; color: var(--ink-strong); }
.step h3 span { color: var(--accent); }
.step p:not(.hud) { margin-top: 10px; font-size: 15px; color: var(--muted); }

/* ---------- CTA ---------- */
.cta {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: clamp(80px, 12vw, 140px) var(--pad);
    text-align: center;
}
.cta h2 {
    max-width: 14ch;
    margin-top: 22px;
    font-size: clamp(2.6rem, 7vw, 5rem);
    font-weight: 500;
    line-height: .98;
    letter-spacing: -.04em;
    color: var(--ink-strong);
    text-wrap: balance;
}
.cta .lede { margin-inline: auto; }
.cta-book {
    max-width: 100%;
    height: auto;
    min-height: 48px;
    margin-top: 36px;
    padding-block: 12px;
    white-space: normal;
}
.cta-book + .mail { margin-top: 12px; }
.mail {
    display: inline-flex;
    align-items: stretch;
    max-width: 100%;
    margin-top: 36px;
    border: 1px solid var(--line-strong);
}
.mail a {
    min-width: 0;
    padding: 14px 22px;
    overflow: hidden;
    font-family: var(--font-mono);
    font-size: clamp(12.5px, 1.6vw, 16px);
    text-overflow: ellipsis;
    transition: color .15s ease;
}
.mail a:hover { color: var(--accent); }
.copy-btn {
    display: grid;
    flex: none;
    place-items: center;
    width: 52px;
    border-left: 1px solid var(--line-strong);
    color: var(--muted);
    transition: background-color .12s linear, color .12s linear;
}
.copy-btn:hover { background: var(--invert-bg); color: var(--invert-fg); }
.copy-btn .i-check { display: none; }
.copy-btn.is-copied .i-copy { display: none; }
.copy-btn.is-copied .i-check { display: block; color: var(--ok); }
.cta-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 16px; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); overflow-x: clip; }
.foot-grid { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); }
.foot-col { padding: 32px var(--pad); }
.foot-col .brand { padding: 0; border: 0; font-size: 18px; }
.foot-col p { max-width: 38ch; margin-top: 14px; font-size: 15px; color: var(--muted); }
.foot-col h2 { font-size: 11px; font-weight: 500; letter-spacing: .15em; color: var(--faint); }
.foot-col ul { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.foot-col li a { color: var(--muted); transition: color .15s ease; }
.foot-col li a:hover { color: var(--ink); }
.foot-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px 24px;
    padding: 16px var(--pad);
    color: var(--faint);
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
    .profile { grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); }
    .profile > .stats-cell { grid-column: span 2; }
    .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); grid-template-rows: none; }
    .stat { border-bottom: 0; border-right: 1px solid var(--line); }
    .stat:last-child { border-right: 0; }

    .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cap-tall { grid-row: auto; }
    .work-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .lab { grid-template-columns: minmax(0, 1fr); }
    .stack { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
    .menu-toggle { display: grid; }
    .nav {
        position: absolute;
        top: var(--header-h);
        left: 0;
        right: 0;
        display: none;
        border-bottom: 1px solid var(--line);
        background: var(--bg);
    }
    .nav-open .nav { display: block; }
    .nav ul { flex-direction: column; padding: 8px 0; }
    .nav a { padding: 12px var(--pad); }
    .nav a span { padding: 3px 0; }
    .nav a:hover span,
    .nav a.is-active span { background: none; color: var(--accent); }
}

@media (max-width: 680px) {
    .bar-meta { display: none; }
    .hero-corner { display: none; }
    .profile { grid-template-columns: minmax(0, 1fr); }
    .profile > .stats-cell { grid-column: auto; }
    .portrait { min-height: 0; aspect-ratio: 4 / 4.2; flex: none; }
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stat:nth-child(2) { border-right: 0; }
    .stat:nth-child(-n+2) { border-bottom: 1px solid var(--line); }

    .bento,
    .work-grid,
    .stack,
    .steps,
    .foot-grid { grid-template-columns: minmax(0, 1fr); }
    .cap-wide { grid-column: auto; grid-template-columns: minmax(0, 1fr); }
    .job-more { grid-template-columns: minmax(0, 1fr); grid-template-areas: "tag" "title" "text" "btn"; }
    .job-more .btn { justify-self: start; }

    .term-body,
    .mock { font-size: 10.5px; }
    .ls a { grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px; }
    .ls-desc { display: none; }
    .term-body { padding: 14px; }
    .filters { flex-wrap: nowrap; overflow-x: auto; }
    .filter { flex: none; }
    .hcta { padding: 0 14px; }
    .to-top { right: 16px; bottom: 16px; }
}

@media (max-width: 400px) {
    .brand { padding: 0 14px; }
    .hcta { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
    .marquee { overflow-x: auto; }
    .marquee-track { animation: none; }
}
