/* ============================================================
   Alexander Kimaru — portfolio v2
   Terminal-precise, dense info, big sans headlines + mono accents
   ============================================================ */

:root {
    --bg: #0a1020;
    --bg-2: #0e1530;
    --bg-3: #161e3a;
    --fg: #e8eef8;
    --fg-dim: #93a0bd;
    --fg-mute: #5a6788;
    --rule: rgba(232, 238, 248, 0.10);
    --rule-strong: rgba(232, 238, 248, 0.22);
    --accent: #1ce783;
    --accent-ink: #031a0e;
    --warn: #f7c948;
    --grid: 8px;
    --max: 1280px;
    --pad-x: 40px;

    /* Type scale */
    --text-xs: 11px;
    --text-sm: 12px;
    --text-md: 13px;
    --text-base: 15px;
    --text-data: 16px;
    --text-lg: 17px;
    --text-body: 18px;
    --text-xl: 22px;
    --text-2xl: 26px;
    --text-3xl: 36px;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
}

html {
    background: var(--bg);
    color: var(--fg);
    font-family: "DM Sans", "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    font-feature-settings: "ss01", "cv11";
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    background: radial-gradient(1200px 700px at 80% -10%, color-mix(in oklab, var(--accent) 10%, transparent), transparent 60%),
    var(--bg);
    transition: background-color .4s ease, color .4s ease;
    position: relative;
}

/* Dot grid + horizontal rule texture fixed behind all content */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background-image: radial-gradient(circle at 1px 1px, color-mix(in oklab, var(--fg) 9%, transparent) 1px, transparent 0),
    repeating-linear-gradient(0deg, transparent 0 79px, color-mix(in oklab, var(--fg) 3%, transparent) 79px 80px);
    background-size: 24px 24px, 100% 80px;
    mix-blend-mode: normal;
    opacity: .85;
}

/* Keep all content above the texture layer */
.topbar, .hero, .section, .foot, .contact-pad {
    position: relative;
    z-index: 1;
}

::selection {
    background: var(--accent);
    color: var(--accent-ink);
}

/* utility */
.mono {
    font-family: "DM Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

.dim {
    color: var(--fg-dim);
}

.mute {
    color: var(--fg-mute);
}

.wrap {
    max-width: var(--max);
    margin: 0 auto;
    padding: 0 var(--pad-x);
}

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

/* ── Admin bar ───────────────────────────────────────────── */
.admin-bar {
    position: sticky;
    top: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--pad-x);
    height: 32px;
    background: color-mix(in oklab, var(--accent) 10%, #0a1020);
    border-bottom: 1px solid color-mix(in oklab, var(--accent) 30%, transparent);
    font-family: "DM Mono", ui-monospace, monospace;
    font-size: var(--text-xs);
    letter-spacing: .04em;
    color: var(--fg-mute);
}

.admin-bar__left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-bar__dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 6px var(--accent);
}

.admin-bar strong {
    color: var(--fg-dim);
    font-weight: 500;
}

.admin-bar__right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.admin-bar a {
    color: var(--accent);
    text-decoration: none;
    opacity: .8;
    transition: opacity .15s;
}

.admin-bar a:hover {
    opacity: 1;
}

.admin-bar__signout {
    color: #f08080 !important;
    opacity: .7 !important;
    padding: 2px 8px;
    border: 1px solid color-mix(in oklab, #c0392b 35%, transparent);
    border-radius: 4px;
    background: color-mix(in oklab, #c0392b 10%, transparent);
}

.admin-bar__signout:hover {
    opacity: 1 !important;
    background: color-mix(in oklab, #c0392b 20%, transparent) !important;
}

/* ── Top bar ─────────────────────────────────────────────── */
.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    background: color-mix(in oklab, var(--bg) 78%, transparent);
    border-bottom: 1px solid var(--rule);
}

body.is-admin .topbar {
    top: 32px;
}

.topbar .row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
    gap: 24px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: "DM Mono", ui-monospace, monospace;
    font-size: var(--text-md);
    letter-spacing: .02em;
}

.brand .sig {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border: 1px solid var(--rule-strong);
    border-radius: 4px;
    font-weight: 700;
    color: var(--accent);
}

.brand .meta {
    color: var(--fg-mute);
}

.topnav {
    display: flex;
    align-items: center;
    gap: 22px;
    font-family: "DM Mono", ui-monospace, monospace;
    font-size: var(--text-sm);
    color: var(--fg-dim);
}

.topnav a {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    padding: 6px 0;
    border-bottom: 1px solid transparent;
    transition: color .15s, border-color .15s;
}

.topnav a .n {
    color: var(--fg-mute);
    font-size: var(--text-xs);
}

.topnav a:hover {
    color: var(--fg);
    border-color: var(--rule-strong);
}

.topnav .clock {
    color: var(--fg-mute);
    font-variant-numeric: tabular-nums;
}

.topnav .cta {
    color: var(--accent);
}

/* ── Mobile nav toggle ───────────────────────────────────── */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 36px;
    height: 36px;
    background: transparent;
    border: 1px solid var(--rule-strong);
    border-radius: 6px;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
}

.nav-toggle span {
    display: block;
    width: 16px;
    height: 1.5px;
    background: var(--fg);
    border-radius: 2px;
    transition: transform 0.2s, opacity 0.2s;
    transform-origin: center;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(6.5px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-6.5px) rotate(-45deg);
}

.dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 0 currentColor;
    animation: pulse 2.2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 color-mix(in oklab, var(--accent) 70%, transparent);
    }
    70% {
        box-shadow: 0 0 0 8px transparent;
    }
    100% {
        box-shadow: 0 0 0 0 transparent;
    }
}

/* ── Section header ──────────────────────────────────────── */
.section {
    padding-top: 96px;
    padding-bottom: 32px;
    position: relative;
}

.section + .section {
    border-top: 1px solid var(--rule);
}

.sec-head {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 32px;
    margin-bottom: 40px;
}

.sec-no {
    font-family: "DM Mono", ui-monospace, monospace;
    font-size: var(--text-sm);
    color: var(--fg-mute);
    letter-spacing: .02em;
    padding-top: 6px;
}

.sec-no .lbl {
    color: var(--fg-dim);
    padding-left: 10px;
}

.sec-title {
    font-size: var(--text-base);
    font-weight: 500;
    letter-spacing: -.005em;
    font-family: "DM Mono", ui-monospace, monospace;
    color: var(--fg-dim);
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 14px;
}

.sec-title::before {
    content: "";
    width: 24px;
    height: 1px;
    background: var(--accent);
}

/* ── Hero ────────────────────────────────────────────────── */
.hero {
    padding-top: 88px;
    padding-bottom: 64px;
    position: relative;
    font-family: "Geist", ui-sans-serif, system-ui, sans-serif;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 40px;
    align-items: end;
}

.hero h1 {
    font-size: clamp(48px, 9vw, 138px);
    line-height: 0.92;
    letter-spacing: -0.045em;
    font-weight: 600;
    margin: 0;
    text-wrap: balance;
    font-feature-settings: "ss01", "cv11", "tnum";
}

.hero h1 .cursor {
    display: inline-block;
    width: .55ch;
    height: .82em;
    vertical-align: -.04em;
    background: var(--accent);
    margin-left: .08em;
    animation: blink 1.05s steps(1) infinite;
}

@keyframes blink {
    50% {
        opacity: 0;
    }
}

.hero h1 em {
    font-style: normal;
    color: var(--accent);
    font-family: "DM Mono", ui-monospace, monospace;
    font-weight: 500;
    font-size: 0.84em;
    letter-spacing: -0.02em;
}

.hero-sub {
    margin-top: 28px;
    max-width: 56ch;
    font-size: var(--text-lg);
    color: var(--fg-dim);
    line-height: 1.55;
}

.hero-strip {
    margin-top: 36px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-family: "DM Mono", ui-monospace, monospace;
    font-size: var(--text-sm);
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 11px;
    border: 1px solid var(--rule-strong);
    border-radius: 999px;
    color: var(--fg-dim);
    background: color-mix(in oklab, var(--bg) 60%, transparent);
}

.chip .k {
    color: var(--fg-mute);
}

.chip.live {
    color: var(--fg);
    border-color: color-mix(in oklab, var(--accent) 55%, var(--rule-strong));
}

.chip.live .dot {
    width: 6px;
    height: 6px;
}

.hero-side {
    border: 1px solid var(--rule);
    border-radius: 10px;
    padding: 18px;
    background: color-mix(in oklab, var(--bg-2) 65%, transparent);
    font-family: "DM Mono", ui-monospace, monospace;
    font-size: var(--text-md);
}

.hero-side .kv {
    display: grid;
    grid-template-columns: 76px 1fr;
    row-gap: 10px;
    column-gap: 14px;
    color: var(--fg-dim);
}

.hero-side .kv dt {
    color: var(--fg-mute);
}

.hero-side .kv dd {
    margin: 0;
    color: var(--fg);
}

.hero-side .hr {
    height: 1px;
    background: var(--rule);
    margin: 14px 0;
}

.hero-side .footnote {
    color: var(--fg-mute);
    line-height: 1.5;
}

/* ── About ───────────────────────────────────────────────── */
.about-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 56px;
}

.about p {
    font-size: var(--text-body);
    line-height: 1.6;
    max-width: 64ch;
    color: var(--fg);
}

.about p + p {
    margin-top: 18px;
}

.about .lede {
    font-size: var(--text-xl);
    line-height: 1.4;
    color: var(--fg);
    margin-bottom: 24px;
    letter-spacing: -.005em;
    text-wrap: pretty;
}

.about .footnote {
    margin-top: 28px;
    font-family: "DM Mono", ui-monospace, monospace;
    font-size: var(--text-md);
    color: var(--fg-mute);
    border-left: 1px solid var(--rule-strong);
    padding: 6px 0 6px 14px;
}

.fact-stack {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.fact {
    display: grid;
    grid-template-columns: 96px 1fr;
    gap: 18px;
    padding: 14px 16px;
    border: 1px solid var(--rule);
    border-radius: 10px;
    background: color-mix(in oklab, var(--bg-2) 50%, transparent);
}

.fact .k {
    font-family: "DM Mono", ui-monospace, monospace;
    font-size: var(--text-xs);
    color: var(--fg-mute);
    letter-spacing: .03em;
    text-transform: uppercase;
    padding-top: 4px;
}

.fact .v {
    font-size: var(--text-data);
    color: var(--fg);
    line-height: 1.45;
}

.fact .v strong {
    color: var(--accent);
    font-weight: 500;
}

.fact .v .mono {
    font-size: var(--text-md);
    color: var(--fg-dim);
}

.fact-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.fact-pills .pill {
    font-family: "DM Mono", ui-monospace, monospace;
    font-size: var(--text-xs);
    letter-spacing: .03em;
    padding: 3px 9px;
    border-radius: 999px;
    background: color-mix(in oklab, var(--pill-hue) 10%, var(--bg-2));
    border: 1px solid color-mix(in oklab, var(--pill-hue) 28%, transparent);
    color: color-mix(in oklab, var(--pill-hue) 65%, var(--fg-dim));
}

/* Material hues — same understated recipe, 8-cycle */
.fact-pills .pill:nth-child(8n+1) {
    --pill-hue: #64b5f6;
}

/* blue        */
.fact-pills .pill:nth-child(8n+2) {
    --pill-hue: #b39ddb;
}

/* deep-purple */
.fact-pills .pill:nth-child(8n+3) {
    --pill-hue: #80cbc4;
}

/* teal        */
.fact-pills .pill:nth-child(8n+4) {
    --pill-hue: #ffb74d;
}

/* amber       */
.fact-pills .pill:nth-child(8n+5) {
    --pill-hue: #f48fb1;
}

/* pink        */
.fact-pills .pill:nth-child(8n+6) {
    --pill-hue: #a5d6a7;
}

/* green       */
.fact-pills .pill:nth-child(8n+7) {
    --pill-hue: #81d4fa;
}

/* light-blue  */
.fact-pills .pill:nth-child(8n+8) {
    --pill-hue: #ffcc80;
}

/* orange      */

/* ── Stack table ─────────────────────────────────────────── */
.stack {
    border: 1px solid var(--rule);
    border-radius: 12px;
    overflow: hidden;
    background: color-mix(in oklab, var(--bg-2) 45%, transparent);
}

.stack-row {
    display: grid;
    grid-template-columns: 180px 1fr 120px;
    gap: 24px;
    padding: 18px 22px;
    align-items: center;
    border-bottom: 1px solid var(--rule);
    transition: background .2s;
}

.stack-row:last-child {
    border-bottom: 0;
}

.stack-row:hover {
    background: color-mix(in oklab, var(--accent) 6%, transparent);
}

.stack-row .cat {
    font-family: "DM Mono", ui-monospace, monospace;
    font-size: var(--text-sm);
    color: var(--fg-dim);
    letter-spacing: .04em;
    text-transform: uppercase;
}

.stack-row .items {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    font-size: var(--text-data);
    color: var(--fg);
}

.stack-row .items span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.stack-row .items span::before {
    content: "";
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--fg-mute);
}

.stack-row .yrs {
    font-family: "DM Mono", ui-monospace, monospace;
    font-size: var(--text-sm);
    color: var(--fg-mute);
    text-align: right;
}

.stack-row .yrs b {
    color: var(--accent);
    font-weight: 500;
}

/* ── Work cards ──────────────────────────────────────────── */
.work-list {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.work-filter {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 36px;
    font-family: "DM Mono", ui-monospace, monospace;
    font-size: var(--text-sm);
}

.filter-btn {
    appearance: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    background: transparent;
    border: 1px solid var(--rule-strong);
    border-radius: 6px;
    color: var(--fg-dim);
    font-family: "DM Mono", ui-monospace, monospace;
    font-size: var(--text-sm);
    cursor: pointer;
    transition: all .15s;
}

.filter-btn:hover {
    color: var(--fg);
    border-color: var(--fg-dim);
}

.filter-btn[data-active] {
    background: var(--accent);
    color: var(--accent-ink);
    border-color: var(--accent);
}

.filter-btn .ct {
    font-size: var(--text-xs);
    color: var(--fg-mute);
}

.filter-btn[data-active] .ct {
    color: var(--accent-ink);
    opacity: .7;
}

.filter-meta {
    color: var(--fg-mute);
    margin-left: 6px;
    font-family: "DM Mono", ui-monospace, monospace;
    font-size: var(--text-sm);
}

.filter-meta b {
    color: var(--fg);
}

.case {
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 28px;
    padding: 28px 0;
    border-top: 1px solid var(--rule-strong);
}

.case .idx {
    font-family: "DM Mono", ui-monospace, monospace;
    color: var(--fg-mute);
    font-size: var(--text-sm);
    padding-top: 4px;
}

.case .body {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 36px;
}

.case h3 {
    margin: 0 0 6px;
    font-size: var(--text-3xl);
    letter-spacing: -.022em;
    font-weight: 600;
    line-height: 1.05;
}

.case .tagline {
    font-size: var(--text-lg);
    color: var(--fg-dim);
    margin-bottom: 22px;
    max-width: 56ch;
}

.case .meta-grid,
.post-page .meta-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin: 14px 0 22px;
    padding: 14px 0;
    border-top: 1px solid var(--rule);
    border-bottom: 1px solid var(--rule);
}

.case .meta-grid .k,
.post-page .meta-grid .k {
    font-family: "DM Mono", ui-monospace, monospace;
    font-size: var(--text-xs);
    color: var(--fg-mute);
    letter-spacing: .06em;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.case .meta-grid .v,
.post-page .meta-grid .v {
    font-family: "DM Mono", ui-monospace, monospace;
    font-size: var(--text-sm);
    color: var(--fg);
    line-height: 1.35;
}

.case .ps,
.post-page .ps {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.case .ps .block .lbl,
.post-page .ps .block .lbl {
    font-family: "DM Mono", ui-monospace, monospace;
    font-size: var(--text-xs);
    color: var(--fg-mute);
    letter-spacing: .08em;
    text-transform: uppercase;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.case .ps .block .lbl::before,
.post-page .ps .block .lbl::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--fg-mute);
}

.case .ps .block.solution .lbl::before,
.post-page .ps .block.solution .lbl::before {
    background: var(--accent);
}

.case .ps p,
.post-page .ps p,
.case .ps .ps-body p,
.post-page .ps .ps-body p {
    font-size: var(--text-base);
    line-height: 1.55;
    color: var(--fg-dim);
    margin: 0 0 8px;
}

.case .ps .ps-body p:last-child,
.post-page .ps .ps-body p:last-child {
    margin-bottom: 0;
}

.case .ps p strong,
.post-page .ps p strong,
.case .ps .ps-body p strong,
.post-page .ps .ps-body p strong {
    color: var(--fg);
    font-weight: 500;
}

.work-foot {
    display: flex;
    justify-content: flex-end;
    margin-top: 36px;
}

.all-projects-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    background: var(--accent);
    color: var(--accent-ink);
    border: 1px solid var(--accent);
    border-radius: 8px;
    font-family: "DM Mono", ui-monospace, monospace;
    font-size: var(--text-sm);
    font-weight: 500;
    letter-spacing: .02em;
    transition: transform .15s, box-shadow .15s;
}

.all-projects-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px color-mix(in oklab, var(--accent) 30%, transparent);
}

.case-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 20px;
    padding: 7px 14px;
    border: 1px solid color-mix(in oklab, var(--accent) 35%, transparent);
    border-radius: 6px;
    font-family: "DM Mono", ui-monospace, monospace;
    font-size: var(--text-sm);
    color: var(--accent);
    letter-spacing: .02em;
    transition: border-color .15s, background .15s;
}

.case-link:hover {
    border-color: var(--accent);
    background: color-mix(in oklab, var(--accent) 8%, transparent);
}

.post-page .actions {
    display: flex;
    gap: 12px;
    margin-top: 22px;
    font-family: "DM Mono", ui-monospace, monospace;
    font-size: var(--text-sm);
    flex-wrap: wrap;
}

.post-page .actions a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 10px 18px;
    border-radius: 6px;
    font-weight: 500;
    letter-spacing: 0.02em;
    transition: all .15s;
    background: var(--accent);
    color: var(--accent-ink);
    border: 1px solid var(--accent);
}

.post-page .actions a:hover {
    background: color-mix(in oklab, var(--accent) 85%, white);
    border-color: color-mix(in oklab, var(--accent) 85%, white);
}

.post-page .actions a.ghost {
    background: transparent;
    color: var(--fg);
    border: 1px solid var(--rule-strong);
}

.post-page .actions a.ghost:hover {
    border-color: var(--fg);
    background: transparent;
}


/* Visual slot (placeholder for project shot) */
.shot {
    border: 1px solid var(--rule-strong);
    border-radius: 10px;
    background: repeating-linear-gradient(
        135deg,
        color-mix(in oklab, var(--fg) 4%, transparent) 0 1px,
        transparent 1px 9px
    ),
    color-mix(in oklab, var(--bg-2) 65%, transparent);
    aspect-ratio: 4 / 3;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 14px;
    font-family: "DM Mono", ui-monospace, monospace;
    font-size: var(--text-xs);
    color: var(--fg-mute);
    transition: transform .35s cubic-bezier(.2, .7, .2, 1), border-color .2s;
}

.shot:hover {
    transform: translateY(-2px);
    border-color: var(--rule-strong);
}

.shot-inline {
    display: none;
}

.shot .tl, .shot .br {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.shot .center {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--fg-dim);
    font-size: var(--text-md);
    letter-spacing: .04em;
}

.shot .center b {
    color: var(--fg);
    font-weight: 500;
}

.shot .corner {
    width: 10px;
    height: 10px;
    border-top: 1px solid var(--fg-mute);
    border-left: 1px solid var(--fg-mute);
    opacity: .6;
}

.shot .corner.tr {
    border-top: 1px solid var(--fg-mute);
    border-right: 1px solid var(--fg-mute);
    border-left: 0;
}

.shot .corner.bl {
    border-bottom: 1px solid var(--fg-mute);
    border-left: 1px solid var(--fg-mute);
    border-top: 0;
}

.shot .corner.br {
    border-bottom: 1px solid var(--fg-mute);
    border-right: 1px solid var(--fg-mute);
    border-top: 0;
    border-left: 0;
}

/* ── Process ─────────────────────────────────────────────── */
.process-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    border-top: 1px solid var(--rule-strong);
    border-bottom: 1px solid var(--rule-strong);
}

.step {
    padding: 28px 26px 32px;
    border-right: 1px solid var(--rule);
    position: relative;
    transition: background .25s;
}

.step:last-child {
    border-right: 0;
}

.step:hover {
    background: color-mix(in oklab, var(--accent) 4%, transparent);
}

.step .n {
    font-family: "DM Mono", ui-monospace, monospace;
    font-size: var(--text-xs);
    color: var(--fg-mute);
    letter-spacing: .06em;
    margin-bottom: 22px;
}

.step h4 {
    margin: 0 0 12px;
    font-size: var(--text-xl);
    letter-spacing: -.018em;
    font-weight: 600;
    line-height: 1.15;
}

.step p {
    margin: 0;
    font-size: var(--text-base);
    color: var(--fg-dim);
    line-height: 1.55;
}

.step .deliver {
    margin-top: 18px;
    font-family: "DM Mono", ui-monospace, monospace;
    font-size: var(--text-xs);
    color: var(--fg-mute);
    letter-spacing: .04em;
    text-transform: uppercase;
}

.step .deliver b {
    color: var(--accent);
    font-weight: 500;
}

/* ── Blog cards ──────────────────────────────────────────── */
.blog-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    border-top: 1px solid var(--rule-strong);
    border-bottom: 1px solid var(--rule-strong);
}

.blog-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 28px 26px 32px;
    border-right: 1px solid var(--rule);
    background: transparent;
    transition: background .25s;
    position: relative;
    text-decoration: none;
    color: inherit;
}

.blog-card:last-child {
    border-right: 0;
}

.blog-card:hover {
    background: color-mix(in oklab, var(--accent) 5%, transparent);
}

.blog-card .meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: "DM Mono", ui-monospace, monospace;
    font-size: var(--text-xs);
    color: var(--fg-mute);
    letter-spacing: .04em;
    text-transform: uppercase;
}

.cat-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 9px;
    border: 1px solid var(--rule-strong);
    border-radius: 999px;
    font-size: var(--text-xs);
    letter-spacing: .06em;
}

.cat-pill[data-cat="tech"] {
    color: var(--accent);
    border-color: color-mix(in oklab, var(--accent) 55%, var(--rule-strong));
}

.cat-pill[data-cat="personal"] {
    color: var(--fg);
}

.cat-pill[data-cat="life"] {
    color: var(--fg-dim);
}

.cat-pill::before {
    content: "";
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
}

.blog-card h4 {
    margin: 4px 0 0;
    font-size: var(--text-xl);
    line-height: 1.18;
    letter-spacing: -.018em;
    font-weight: 600;
}

.blog-card .excerpt {
    font-size: var(--text-base);
    line-height: 1.55;
    color: var(--fg-dim);
    margin: 0;
    flex: 1;
}

.blog-card .more {
    font-family: "DM Mono", ui-monospace, monospace;
    font-size: var(--text-sm);
    color: var(--fg-dim);
    margin-top: 4px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.blog-card:hover .more {
    color: var(--accent);
}

.blog-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 24px;
    font-family: "DM Mono", ui-monospace, monospace;
    font-size: var(--text-sm);
    color: var(--fg-dim);
}

.blog-foot a.viewall {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border: 1px solid var(--rule-strong);
    border-radius: 6px;
    color: var(--fg);
    transition: all .15s;
}

.blog-foot a.viewall:hover {
    color: var(--accent-ink);
    background: var(--accent);
    border-color: var(--accent);
}

/* ── Blog master page ────────────────────────────────────── */
.blog-page {
    padding-top: 56px;
    padding-bottom: 96px;
}

.blog-head {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 32px;
    align-items: end;
    padding-bottom: 28px;
    margin-bottom: 28px;
    border-bottom: 1px solid var(--rule-strong);
}

.blog-head h1 {
    margin: 0;
    font-size: clamp(40px, 6vw, 88px);
    letter-spacing: -.035em;
    line-height: .98;
    font-weight: 600;
}

.blog-head .sub {
    font-family: "DM Mono", ui-monospace, monospace;
    font-size: var(--text-md);
    color: var(--fg-dim);
    margin-top: 14px;
    max-width: 56ch;
    line-height: 1.55;
}

.blog-filter {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    font-family: "DM Mono", ui-monospace, monospace;
    font-size: var(--text-sm);
}

.blog-index {
    display: flex;
    flex-direction: column;
}

.blog-row {
    display: grid;
    grid-template-columns: 64px 1fr 110px 60px;
    gap: 24px;
    align-items: center;
    padding: 22px 8px;
    border-bottom: 1px solid var(--rule);
    text-decoration: none;
    color: inherit;
    transition: background .2s;
}

.blog-row:hover {
    background: color-mix(in oklab, var(--accent) 6%, transparent);
}

.blog-row .idx {
    font-family: "DM Mono", ui-monospace, monospace;
    font-size: var(--text-sm);
    color: var(--fg-mute);
}

.blog-row .row-title-wrap {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.blog-row h3 {
    margin: 0;
    font-size: var(--text-xl);
    line-height: 1.2;
    letter-spacing: -.015em;
    font-weight: 600;
}

.blog-row .row-kicker {
    font-size: var(--text-base);
    color: var(--fg-dim);
    line-height: 1.45;
}

.blog-row .row-date {
    font-family: "DM Mono", ui-monospace, monospace;
    font-size: var(--text-sm);
    color: var(--fg-mute);
}

.blog-row .row-arrow {
    font-family: "DM Mono", ui-monospace, monospace;
    font-size: var(--text-base);
    color: var(--fg-dim);
    text-align: right;
}

.blog-row:hover .row-arrow {
    color: var(--accent);
}

/* ── Single post page ────────────────────────────────────── */
.post-page {
    padding-top: 56px;
    padding-bottom: 96px;
}

.post-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 260px;
    gap: 0 56px;
    align-items: start;
}

/* ── Sidebar ─────────────────────────────────────────────────────── */
.post-sidebar {
    position: sticky;
    top: 80px;
    display: flex;
    flex-direction: column;
    gap: 0;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    scrollbar-width: none;
    border: 1px solid var(--rule);
    border-radius: 10px;
    padding: 18px;
    background: color-mix(in oklab, var(--bg-2) 65%, transparent);
}

.post-sidebar::-webkit-scrollbar {
    display: none;
}

.sidebar-section {
    padding: 16px 0;
}

.sidebar-section + .sidebar-section {
    border-top: 1px solid var(--rule);
}

.sidebar-section .lbl {
    font-weight: 500;
    margin-bottom: 12px;
}

.sidebar-cats {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-cat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 7px 0;
    font-size: var(--text-md);
    color: var(--fg-dim);
    text-decoration: none;
    transition: color .15s;
    gap: 8px;
}

.sidebar-cat:hover {
    color: var(--fg);
}

.sidebar-cat.active {
    color: var(--accent);
}

.sidebar-cat .ct {
    color: var(--fg-mute);
}

.sidebar-posts {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sidebar-post {
    display: flex;
    flex-direction: column;
    gap: 3px;
    text-decoration: none;
    color: inherit;
    transition: color .15s;
}

.sidebar-post:hover {
    color: var(--accent);
}

.sidebar-post-title {
    font-size: var(--text-md);
    font-weight: 500;
    line-height: 1.35;
    font-family: inherit;
}

.sidebar-post-date {
    font-size: var(--text-xs);
    color: var(--fg-mute);
}

/* ── Table of contents ───────────────────────────────────────────── */
.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.toc-list a {
    display: block;
    padding: 5px 0;
    font-size: var(--text-md);
    color: var(--fg-dim);
    text-decoration: none;
    line-height: 1.4;
    transition: color .15s;
}

.toc-list a:hover {
    color: var(--fg);
}

.toc-list a.active {
    color: var(--accent);
}

.toc-h3 a {
    padding-left: 12px;
    font-size: var(--text-sm);
}

/* ── CTA ─────────────────────────────────────────────────────────── */
.post-cta {
    margin-top: 56px;
    padding: 32px 36px;
    border: 1px solid var(--rule);
    border-radius: 12px;
    max-width: 68ch;
}

.post-cta-headline {
    font-size: var(--text-xl);
    font-weight: 600;
    margin: 0 0 8px;
    letter-spacing: -.02em;
}

.post-cta-sub {
    font-size: var(--text-base);
    color: var(--fg-dim);
    margin: 0 0 20px;
    line-height: 1.6;
}

.post-cta-link {
    font-family: "DM Mono", monospace;
    font-size: var(--text-md);
    color: var(--accent);
    text-decoration: none;
    transition: opacity .15s;
}

.post-cta-link:hover {
    opacity: .75;
}

.post-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: "DM Mono", ui-monospace, monospace;
    font-size: var(--text-sm);
    color: var(--fg-dim);
    margin-bottom: 36px;
    transition: color .15s;
}

.post-back:hover {
    color: var(--accent);
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    font-family: "DM Mono", ui-monospace, monospace;
    font-size: var(--text-sm);
    color: var(--fg-mute);
    letter-spacing: .04em;
    text-transform: uppercase;
    margin-bottom: 22px;
}

.post-title {
    margin: 0 0 18px;
    font-size: clamp(40px, 5.5vw, 72px);
    letter-spacing: -.03em;
    line-height: 1.02;
    font-weight: 600;
    text-wrap: balance;
    max-width: 22ch;
}

.post-kicker {
    font-size: var(--text-xl);
    color: var(--fg-dim);
    line-height: 1.4;
    margin: 0 0 56px;
    font-weight: 400;
}

.post-body {
    max-width: 68ch;
    font-size: var(--text-body);
    line-height: 1.7;
    color: var(--fg);
}

.post-body img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
    border: 1px solid var(--rule);
    margin: 8px 0 24px;
}

.post-body p {
    margin: 0 0 24px;
}

.post-body p strong {
    color: var(--fg);
    font-weight: 600;
}

.post-body h2 {
    margin: 48px 0 18px;
    font-size: var(--text-2xl);
    letter-spacing: -.018em;
    line-height: 1.2;
    font-weight: 600;
}

.post-body h2::before {
    content: "// ";
    color: var(--accent);
    font-family: "DM Mono", ui-monospace, monospace;
    font-size: var(--text-xl);
}

.post-body ul, .post-body ol {
    margin: 0 0 28px;
    padding-left: 0;
}

.post-body li {
    margin: 10px 0;
    padding-left: 28px;
    list-style: none;
    position: relative;
}

.post-body ul li::before {
    content: "›";
    position: absolute;
    left: 10px;
    top: 0;
    color: var(--accent);
    font-family: "DM Mono", ui-monospace, monospace;
    font-weight: 600;
}

.post-body ol {
    counter-reset: post-ol;
}

.post-body ol li::before {
    counter-increment: post-ol;
    content: counter(post-ol, decimal-leading-zero);
    position: absolute;
    left: 0;
    top: 4px;
    font-family: "DM Mono", ui-monospace, monospace;
    font-size: var(--text-md);
    color: var(--accent);
}

.post-body code {
    font-family: "DM Mono", ui-monospace, monospace;
    font-size: .9em;
    padding: 1px 6px;
    background: color-mix(in oklab, var(--accent) 10%, transparent);
    border-radius: 4px;
    color: var(--fg);
}

.post-related {
    margin-top: 96px;
    padding-top: 32px;
    border-top: 1px solid var(--rule-strong);
}

.post-related .lbl {
    font-family: "DM Mono", ui-monospace, monospace;
    font-size: var(--text-md);
    color: var(--fg-mute);
    letter-spacing: .06em;
    text-transform: uppercase;
    margin-bottom: 20px;
}

.post-related .grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0;
    border-top: 1px solid var(--rule);
    border-bottom: 1px solid var(--rule);
}

/* ── Contact ─────────────────────────────────────────────── */
.contact-pad {
    padding-top: 120px;
    padding-bottom: 96px;
}

.contact-row {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 64px;
    align-items: start;
}

.contact h2 {
    margin: 0 0 24px;
    font-size: clamp(40px, 6vw, 80px);
    letter-spacing: -.035em;
    line-height: .98;
    font-weight: 600;
    text-wrap: balance;
}

.contact h2 em {
    font-style: normal;
    color: var(--accent);
    font-family: "DM Mono", ui-monospace, monospace;
    font-weight: 500;
    font-size: .82em;
    letter-spacing: -.015em;
}

.contact .lede {
    font-size: var(--text-lg);
    color: var(--fg-dim);
    max-width: 52ch;
    line-height: 1.55;
    margin: 0 0 32px;
}

.contact-cta {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 14px 22px;
    background: var(--accent);
    color: var(--accent-ink);
    border-radius: 8px;
    font-family: "DM Mono", ui-monospace, monospace;
    font-size: var(--text-base);
    font-weight: 500;
    letter-spacing: .01em;
    border: 1px solid var(--accent);
    transition: transform .15s, box-shadow .15s;
}

.contact-cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 30px color-mix(in oklab, var(--accent) 30%, transparent);
}

.contact-side {
    border: 1px solid var(--rule);
    border-radius: 12px;
    padding: 22px;
    background: color-mix(in oklab, var(--bg-2) 55%, transparent);
    font-family: "DM Mono", ui-monospace, monospace;
    font-size: var(--text-md);
}

.contact-side .ln {
    display: grid;
    grid-template-columns: 70px 1fr;
    padding: 8px 0;
    border-bottom: 1px dashed var(--rule);
}

.contact-side .ln:last-child {
    border-bottom: 0;
}

.contact-side .ln .k {
    color: var(--fg-mute);
}

.contact-side .ln .v {
    color: var(--fg);
}

.contact-side .ln .v a:hover {
    color: var(--accent);
}

/* ── Footer ──────────────────────────────────────────────── */
.foot {
    border-top: 1px solid var(--rule);
    padding-top: 22px;
    padding-bottom: 32px;
    font-family: "DM Mono", ui-monospace, monospace;
    font-size: var(--text-sm);
    color: var(--fg-mute);
}

.foot .row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

.foot .bar {
    height: 1px;
    background: repeating-linear-gradient(90deg, var(--fg-mute) 0 4px, transparent 4px 10px);
    opacity: .35;
    margin: 0 0 22px;
}

/* ── Scroll reveal ───────────────────────────────────────── */
/* Visible by default; JS arms elements below the fold then reveals on scroll. Page works without JS. */
.reveal {
    transition: opacity .7s ease, transform .7s cubic-bezier(.2, .7, .2, 1);
}

.reveal.reveal-armed {
    opacity: 0;
    transform: translateY(14px);
}

.reveal.in {
    opacity: 1;
    transform: none;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 1020px) {
    .nav-toggle {
        display: flex;
    }

    .brand .meta {
        display: none;
    }

    .topnav {
        position: fixed;
        top: 56px;
        left: 0;
        right: 0;
        height: calc(100vh - 56px);
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
        padding: 24px var(--pad-x) 32px;
        background: var(--bg);
        border-top: 1px solid var(--rule);
        overflow-y: auto;
        transform: translateY(-8px);
        opacity: 0;
        pointer-events: none;
        transition: transform 0.22s ease, opacity 0.22s ease;
        z-index: 49;
    }

    .topnav.nav-open {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }

    .topnav a {
        width: 100%;
        padding: 14px 0;
        border-bottom: 1px solid var(--rule);
        font-size: var(--text-data);
        gap: 10px;
    }

    .topnav a:last-of-type {
        border-bottom: none;
    }

    .topnav a .n {
        font-size: var(--text-sm);
        color: var(--fg-mute);
    }

    .topnav .clock {
        display: block;
        margin-top: 24px;
        font-size: var(--text-md);
        color: var(--fg-mute);
    }
}

@media (max-width: 900px) {
    :root {
        --pad-x: 24px;
    }

    .hero {
        padding-top: 60px;
        padding-bottom: 40px;
    }

    .section {
        padding-top: 64px;
        padding-bottom: 24px;
    }

    .hero-grid {
        grid-template-columns: 1fr;
    }

    .hero-side {
        margin-top: 16px;
    }

    .sec-head {
        grid-template-columns: 1fr;
        gap: 14px;
        margin-bottom: 28px;
    }

    .about-grid {
        grid-template-columns: 1fr;
        gap: 36px;
    }

    .stack-row {
        grid-template-columns: 120px 1fr;
        grid-template-rows: auto auto;
        gap: 4px 16px;
    }

    .stack-row .yrs {
        grid-column: 2;
        text-align: left;
        padding-bottom: 4px;
    }

    .case {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .case .body {
        grid-template-columns: 1fr 200px;
        gap: 22px;
    }

    .case .meta-grid,
    .post-page .meta-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .case .ps {
        display: none;
    }

    .shot-inline {
        display: flex;
        margin-bottom: 16px;
    }

    .case .body > .shot:not(.shot-inline) {
        display: none;
    }

    .case .body {
        grid-template-columns: 1fr;
    }

    .process-grid {
        grid-template-columns: 1fr 1fr;
    }

    .step {
        border-right: 0;
        border-bottom: 1px solid var(--rule);
    }

    .step:nth-child(odd) {
        border-right: 1px solid var(--rule);
    }

    .contact-row {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .blog-list {
        grid-template-columns: 1fr;
    }

    .blog-card {
        border-right: 0;
        border-bottom: 1px solid var(--rule);
    }

    .blog-card:last-child {
        border-bottom: 0;
    }

    .blog-head {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .blog-row {
        grid-template-columns: 50px 1fr 80px;
    }

    .blog-row .row-arrow {
        display: none;
    }

    .post-related .grid {
        grid-template-columns: 1fr;
    }

    .post-layout {
        grid-template-columns: 1fr;
    }

    .post-sidebar {
        position: static;
        max-height: none;
        overflow-y: visible;
        margin-top: 40px;
    }

    .post-cta {
        max-width: 100%;
    }

    .case h3 {
        font-size: var(--text-2xl);
    }

    .about .lede {
        font-size: 19px;
    }

    .filter-meta {
        display: none;
    }
}

@media (max-width: 600px) {
    :root {
        --pad-x: 16px;
    }

    .hero {
        padding-top: 48px;
        padding-bottom: 32px;
    }

    .section {
        padding-top: 48px;
        padding-bottom: 20px;
    }

    .process-grid {
        grid-template-columns: 1fr;
    }

    .step {
        border-right: 0 !important;
    }

    .about .lede {
        font-size: var(--text-body);
    }

    .hero-sub {
        font-size: 16px;
    }

    .blog-foot {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
    }

    .case .meta-grid,
    .post-page .meta-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .contact h2 {
        font-size: clamp(32px, 8vw, 56px);
    }
}


/* ── 2-col work cards: 601px–900px ──────────────────────────────── */
@media (min-width: 601px) and (max-width: 900px) {
    .work-list {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 16px;
    }
}

@media (max-width: 640px) {
    .case-mobile .ps {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 430px) {
    .stack-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .stack-row .yrs {
        grid-column: 1;
    }
}

/* ── More work pagination ────────────────────────────────────────── */
.card-img {
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--rule);
    margin-bottom: 4px;
    aspect-ratio: 4/3;
    max-height: 260px;
}

.card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.more-work-head {
    margin-bottom: 16px;
}

.more-work-head .lbl {
    margin-bottom: 8px;
}

.mw-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.mw-filter {
    margin-bottom: 0;
}

.pagination {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pag-btn {
    padding: 5px 14px;
    border: 1px solid var(--rule-strong);
    border-radius: 6px;
    font-size: var(--text-sm);
    color: var(--fg);
    background: transparent;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    font-family: inherit;
}

.pag-btn:hover:not(:disabled) {
    background: var(--surface);
    border-color: var(--fg-mute);
}

.pag-btn:disabled {
    color: var(--fg-mute);
    cursor: default;
}

.pag-count {
    font-size: var(--text-sm);
    color: var(--fg-dim);
    white-space: nowrap;
}

.mw-card[hidden] {
    display: none;
}

/* ── Project gallery ─────────────────────────────────────────────── */
.project-gallery {
    margin: 40px 0 0;
}

.project-gallery .lbl {
    font-family: "DM Mono", ui-monospace, monospace;
    font-size: var(--text-xs);
    color: var(--fg-mute);
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-bottom: 16px;
}

.gallery-strip {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 12px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--rule-strong) transparent;
}

.gallery-strip::-webkit-scrollbar {
    height: 4px;
}

.gallery-strip::-webkit-scrollbar-track {
    background: transparent;
}

.gallery-strip::-webkit-scrollbar-thumb {
    background: var(--rule-strong);
    border-radius: 2px;
}

.gallery-thumb {
    flex: 0 0 auto;
    scroll-snap-align: start;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--rule);
    cursor: zoom-in;
    transition: border-color .15s;
    background: var(--surface);
    max-height: 320px;
}

.gallery-thumb:hover {
    border-color: var(--accent);
}

.gallery-thumb img {
    height: 300px;
    width: auto;
    max-width: 560px;
    object-fit: contain;
    display: block;
}

/* ── Lightbox ────────────────────────────────────────────────────── */
.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, .92);
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
}

.lightbox.open {
    display: flex;
}

.lightbox img {
    max-width: 92vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 32px 80px rgba(0, 0, 0, .6);
    cursor: default;
}

.lightbox-close {
    position: fixed;
    top: 20px;
    right: 24px;
    font-size: 28px;
    color: var(--fg-dim);
    cursor: pointer;
    line-height: 1;
    background: none;
    border: none;
    padding: 4px 8px;
    transition: color .15s;
}

.lightbox-close:hover {
    color: var(--fg);
}

.lightbox-prev,
.lightbox-next {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    font-size: 24px;
    color: var(--fg-dim);
    cursor: pointer;
    background: none;
    border: none;
    padding: 12px 16px;
    transition: color .15s;
    font-family: "DM Mono", ui-monospace, monospace;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    color: var(--fg);
}

.lightbox-prev {
    left: 16px;
}

.lightbox-next {
    right: 16px;
}

.lightbox-counter {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    font-family: "DM Mono", ui-monospace, monospace;
    font-size: var(--text-xs);
    color: var(--fg-mute);
}

@media (max-width: 768px) {
    .gallery-thumb img {
        height: 200px;
        max-width: 340px;
    }
}
