/* ── Variables ────────────────────────────────────────────────────────────── */
:root {
    --bg:          #0a0e1a;
    --bg2:         #0d1221;
    --bg-card:     #111827;
    --bg-card-h:   #151f30;
    --border:      #1e2d4a;
    --border2:     #253350;

    --accent:      #00d4ff;
    --accent-dim:  rgba(0,212,255,0.08);
    --accent-glow: rgba(0,212,255,0.35);
    --purple:      #7c3aed;
    --purple-dim:  rgba(124,58,237,0.08);

    --text:        #e2e8f0;
    --text2:       #94a3b8;
    --text3:       #4b5563;

    --ec2:  #f47219;
    --rds:  #4b89dc;
    --s3:   #4a9b3e;
    --alb:  #7c3aed;
    --igw:  #0891b2;
    --lambda:     #f47219;
    --apigw:      #e83a8f;
    --cloudfront: #8c4bdf;
    --waf:        #dd3522;
    --redis:      #2e73b8;
    --cloudflare: #f38020;
    --github:     #e2e8f0;
    --account:    #d62059;

    --nav-h:     64px;
    --sidebar-w: 400px;
    --max-w:     1100px;
    --r:         8px;
    --r-lg:      16px;
    --ease:      cubic-bezier(0.4,0,0.2,1);
}

/* ── Reset ────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    background: var(--bg);
    color: var(--text);
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    font-size: 1rem;
    line-height: 1.7;
    overflow-x: hidden;
}
body.sidebar-open { overflow: hidden; }
img, svg { display: block; max-width: 100%; }
a { color: var(--accent); text-decoration: none; transition: opacity .15s; }
a:hover { opacity: .8; }
ul { list-style: none; }
code {
    font-family: 'Cascadia Code','Fira Code','JetBrains Mono',Menlo,Consolas,monospace;
    font-size: .88em;
    background: rgba(255,255,255,.06);
    padding: .1em .35em;
    border-radius: 4px;
}

/* ── Scroll progress bar (CSS-only via scroll-driven animation) ───────────── */
.scroll-progress {
    position: fixed;
    top: 0; left: 0;
    height: 3px;
    width: 100%;
    background: linear-gradient(90deg, var(--accent), var(--purple));
    transform-origin: left;
    transform: scaleX(0);
    z-index: 9999;
    pointer-events: none;
}
@supports (animation-timeline: scroll()) {
    .scroll-progress {
        animation: sp-grow linear;
        animation-timeline: scroll(root);
    }
    @keyframes sp-grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
}

/* ── Navbar ───────────────────────────────────────────────────────────────── */
#navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--nav-h);
    z-index: 100;
    transition: background .25s var(--ease), border-color .25s;
    border-bottom: 1px solid transparent;
}
#navbar.scrolled {
    background: rgba(10,14,26,.92);
    backdrop-filter: blur(12px);
    border-color: var(--border);
}
.nav-inner {
    max-width: var(--max-w);
    margin: 0 auto;
    height: 100%;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    gap: 2rem;
}
.nav-logo {
    font-weight: 800;
    font-size: 1.25rem;
    letter-spacing: .04em;
    color: var(--accent);
    margin-right: auto;
}
.nav-links {
    display: flex;
    gap: .25rem;
}
.nav-link {
    color: var(--text2);
    font-size: .9rem;
    padding: .4rem .75rem;
    border-radius: var(--r);
    transition: color .15s, background .15s;
}
.nav-link:hover, .nav-link.active {
    color: var(--text);
    background: rgba(255,255,255,.05);
    opacity: 1;
}
.nav-link.active { color: var(--accent); }
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 36px;
    height: 36px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}
.bar {
    display: block;
    height: 2px;
    background: var(--text2);
    border-radius: 2px;
    transition: transform .25s, opacity .2s;
}
.nav-toggle.active .bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.active .bar:nth-child(2) { opacity: 0; }
.nav-toggle.active .bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Sections shared ──────────────────────────────────────────────────────── */
section {
    padding: 6rem 1.5rem;
}
#home { padding-top: calc(var(--nav-h) + 4rem); }
.section-wrap {
    max-width: var(--max-w);
    margin: 0 auto;
}
.section-head {
    margin-bottom: 3rem;
}
.section-label {
    display: inline-block;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: .75rem;
}
.section-head h2 {
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 1rem;
}
.section-head h2::after {
    content: '';
    display: block;
    width: 48px;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--purple));
    margin-top: .6rem;
    border-radius: 2px;
}
.section-intro {
    color: var(--text2);
    max-width: 620px;
    font-size: 1.05rem;
}

/* ── Home / Hero ──────────────────────────────────────────────────────────── */
#home {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background-image:
        linear-gradient(to bottom, transparent 85%, var(--bg2) 100%),
        linear-gradient(rgba(0,212,255,.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0,212,255,.025) 1px, transparent 1px);
    background-size: 100% 100%, 48px 48px, 48px 48px;
}
.hero-wrap {
    max-width: var(--max-w);
    margin: 0 auto;
    width: 100%;
    padding: 0 1.5rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}
.pill {
    display: inline-block;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--accent);
    background: var(--accent-dim);
    border: 1px solid rgba(0,212,255,.2);
    padding: .3rem .9rem;
    border-radius: 50px;
    margin-bottom: 1.25rem;
}
.hero-copy h1 {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 900;
    line-height: 1.05;
    letter-spacing: -.02em;
    margin-bottom: 1.25rem;
}
.accent { color: var(--accent); }
.hero-sub {
    color: var(--text2);
    font-size: 1.1rem;
    max-width: 480px;
    margin-bottom: 2rem;
    line-height: 1.65;
}
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }
.btn {
    display: inline-flex;
    align-items: center;
    padding: .65rem 1.5rem;
    border-radius: var(--r);
    font-weight: 600;
    font-size: .95rem;
    transition: all .2s var(--ease);
    text-decoration: none;
}
.btn-primary {
    background: var(--accent);
    color: #000;
}
.btn-primary:hover { background: #33dcff; opacity: 1; transform: translateY(-1px); }
.btn-ghost {
    border: 1px solid var(--border2);
    color: var(--text);
    background: transparent;
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); opacity: 1; }

/* Terminal widget */
.terminal {
    background: #070d1a;
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    overflow: hidden;
    box-shadow: 0 24px 64px rgba(0,0,0,.5);
}
.term-bar {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .75rem 1rem;
    background: #0b1220;
    border-bottom: 1px solid var(--border);
}
.dot { width: 12px; height: 12px; border-radius: 50%; }
.dot-r { background: #ff5f57; }
.dot-y { background: #ffbd2e; }
.dot-g { background: #28ca41; }
.term-title { font-size: .8rem; color: var(--text3); margin-left: auto; margin-right: auto; font-family: monospace; }
.term-body {
    padding: 1.25rem 1.5rem;
    font-family: 'Cascadia Code','Fira Code',Menlo,Consolas,monospace;
    font-size: .85rem;
    line-height: 1.9;
}
.term-line { display: flex; align-items: center; gap: .5rem; }
.prompt { color: var(--accent); font-weight: 700; }
.term-out { color: #7dd3fc; padding-left: 1.25rem; }
.cursor {
    display: inline-block;
    width: 8px; height: 1em;
    background: var(--accent);
    animation: blink 1s step-end infinite;
    vertical-align: middle;
    margin-left: 2px;
}
@keyframes blink { 0%,100% { opacity:1; } 50% { opacity:0; } }

/* Hero stats */
.stats-row {
    max-width: var(--max-w);
    margin: 3rem auto 0;
    padding: 0 1.5rem;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: var(--r);
    overflow: hidden;
}
.stat {
    background: var(--bg2);
    padding: 1.25rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: .25rem;
}
.stat-val { font-size: 1.4rem; font-weight: 800; color: var(--accent); }
.stat-lbl { font-size: .78rem; color: var(--text2); }

/* ── About ────────────────────────────────────────────────────────────────── */
#about { background: var(--bg2); }
.about-grid {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 3rem;
    align-items: start;
}
.bio-col p { color: var(--text2); margin-bottom: 1rem; }
.lead { font-size: 1.1rem; color: var(--text) !important; font-weight: 500; }
.lead em { color: var(--accent); font-style: normal; }
.skills-heading {
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--accent);
    margin: 2rem 0 1rem;
}
.skills-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}
.skill-group h4 {
    font-size: .78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--text3);
    margin-bottom: .5rem;
}
.tags { display: flex; flex-wrap: wrap; gap: .4rem; }
.tag {
    font-size: .75rem;
    padding: .25rem .6rem;
    border: 1px solid var(--border2);
    border-radius: 4px;
    color: var(--text2);
    background: rgba(255,255,255,.025);
}
.tag-highlight {
    border-color: rgba(0,212,255,.4);
    color: var(--accent);
    background: var(--accent-dim);
}
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 1.5rem;
    margin-bottom: 1.25rem;
}
.card h3 {
    font-size: .8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--text3);
    margin-bottom: 1.1rem;
}
.contact-list li {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .5rem 0;
    border-bottom: 1px solid var(--border);
    font-size: .9rem;
    color: var(--text2);
}
.contact-list li:last-child { border-bottom: none; }
.contact-icon { width: 18px; height: 18px; flex-shrink: 0; color: var(--accent); }
.cert-list li {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .4rem 0;
    font-size: .88rem;
    color: var(--text2);
    border-bottom: 1px solid var(--border);
}
.cert-list li:last-child { border-bottom: none; }
.cert-badge {
    font-size: .65rem;
    font-weight: 800;
    padding: .2rem .45rem;
    border-radius: 4px;
    flex-shrink: 0;
    letter-spacing: .05em;
}
.cert-badge.aws  { background: rgba(244,114,25,.15); color: var(--ec2); border: 1px solid rgba(244,114,25,.3); }
.cert-badge.hc   { background: rgba(124,58,237,.15); color: #a78bfa;   border: 1px solid rgba(124,58,237,.3); }
.cert-badge.cncf { background: rgba(0,212,255,.1);   color: var(--accent); border: 1px solid rgba(0,212,255,.3); }

/* ── Experience / Project card ────────────────────────────────────────────── */
.project-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    overflow: hidden;
}
.project-head {
    padding: 2rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1.5rem;
    flex-wrap: wrap;
}
.project-head h3 { font-size: 1.25rem; margin-bottom: .5rem; }
.project-desc { color: var(--text2); font-size: .95rem; max-width: 640px; }
.project-tags { flex-shrink: 0; display: flex; flex-wrap: wrap; gap: .4rem; align-items: flex-start; padding-top: .25rem; }

/* ── Diagram ──────────────────────────────────────────────────────────────── */
.diagram-wrap { padding: 1.5rem; }
.diagram-scroll {
    background: #060c18;
    border: 1px solid var(--border);
    border-radius: var(--r);
    overflow-x: auto;
    padding: 1rem;
}
.diagram-svg {
    width: 100%;
    height: auto;
    min-width: 640px;
    display: block;
    font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
}
.diagram-hint {
    margin-top: .75rem;
    font-size: .8rem;
    color: var(--text3);
    text-align: center;
}

/* SVG topology shapes */
.vpc-border  { stroke: #1a4a8c; stroke-width: 1.5; stroke-dasharray: 8 4; fill: none; }
.az-box      { fill: #0b1828; stroke: #1a3560; stroke-width: 1; stroke-dasharray: 4 3; }
.subnet-pub  { fill: #0a1f38; stroke: none; }
.subnet-priv { fill: #071529; stroke: none; }

/* SVG typography */
.lbl-vpc      { font-size: 10px; fill: #2a62c0; font-weight: 700; letter-spacing: .05em; }
.lbl-az       { font-size: 9px;  fill: #3d6aa0; font-weight: 600; letter-spacing: .05em; }
.lbl-subnet   { font-size: 8.5px; fill: #2a4e78; }
.lbl-conn     { font-size: 8px;  fill: #3a4a68; text-anchor: middle; }
.lbl-endpoint { font-size: 8px;  fill: #3a6a38; text-anchor: middle; }

/* Resource boxes */
.res-bg { transition: filter .15s ease; }
.res-ec2      { fill: #160c03; stroke: var(--ec2); stroke-width: 1.5; }
.res-rds      { fill: #030c1a; stroke: var(--rds); stroke-width: 1.5; }
.res-s3       { fill: #041304; stroke: var(--s3);  stroke-width: 1.5; }
.res-alb      { fill: #0b0415; stroke: var(--alb); stroke-width: 1.5; }
.res-igw      { fill: #020f14; stroke: var(--igw); stroke-width: 1.5; }
.res-internet { fill: #08101e; stroke: var(--accent); stroke-width: 1.5; }
.res-lambda     { fill: #160c03; stroke: var(--lambda); stroke-width: 1.5; }
.res-apigw      { fill: #16030d; stroke: var(--apigw); stroke-width: 1.5; }
.res-cloudfront { fill: #0c0415; stroke: var(--cloudfront); stroke-width: 1.5; }
.res-waf        { fill: #160303; stroke: var(--waf); stroke-width: 1.5; }
.res-redis      { fill: #030a16; stroke: var(--redis); stroke-width: 1.5; }
.res-cloudflare { fill: #160703; stroke: var(--cloudflare); stroke-width: 1.5; }
.res-github     { fill: #111827; stroke: var(--github); stroke-width: 1.5; }

/* SVG topology shapes */
.account-box { fill: none; stroke: var(--account); stroke-width: 1.5; }
.region-box  { fill: none; stroke: #5a6a88; stroke-width: 1; stroke-dasharray: 4 3; }
.lbl-account { font-size: 10px; fill: var(--account); font-weight: 700; letter-spacing: .05em; }
.lbl-region  { font-size: 9px;  fill: #5a6a88; font-weight: 600; letter-spacing: .05em; }

/* Resource text */
.res-lbl   { font-size: 12px; font-weight: 600; fill: #d1d9e6; }
.res-lbl-c { font-size: 11px; font-weight: 600; fill: #d1d9e6; text-anchor: middle; }
.res-sub   { font-size: 9.5px; fill: #5a6a88; }
.res-sub-c { font-size: 9.5px; fill: #5a6a88; text-anchor: middle; }
.res-badge { font-size: 8px; font-weight: 700; fill: rgba(200,220,255,.3); text-anchor: end; letter-spacing: .1em; }

/* Icon colors via CSS currentColor */
.ico-internet { color: var(--accent); }
.ico-igw      { color: var(--igw); }
.ico-alb      { color: var(--alb); }
.ico-ec2      { color: var(--ec2); }
.ico-rds      { color: var(--rds); }
.ico-s3       { color: var(--s3); }
.ico-lambda     { color: var(--lambda); }
.ico-apigw      { color: var(--apigw); }
.ico-cloudfront { color: var(--cloudfront); }
.ico-waf        { color: var(--waf); }
.ico-redis      { color: var(--redis); }
.ico-cloudflare { color: var(--cloudflare); }
.ico-github     { color: var(--github); }

/* Interaction */
.resource { cursor: pointer; }
.resource:focus { outline: none; }
.resource:hover .res-bg,
.resource:focus .res-bg { filter: brightness(1.45); }
.resource:focus-visible { filter: drop-shadow(0 0 6px var(--accent-glow)); }
.resource:hover { filter: drop-shadow(0 0 5px rgba(0,212,255,.2)); }

/* Connections */
.conn     { stroke: #2a3a58; stroke-width: 1.5; fill: none; }
.conn-rep { stroke: #2e3a8a; stroke-width: 1.5; fill: none; stroke-dasharray: 5 3; }
.arr-fill     { fill: #2a3a58; }
.arr-fill-rep { fill: #2e3a8a; }

/* ── Sidebar ──────────────────────────────────────────────────────────────── */
.sidebar {
    position: fixed;
    top: 0; right: 0;
    width: var(--sidebar-w);
    max-width: 100vw;
    height: 100%;
    background: var(--bg-card);
    border-left: 1px solid var(--border);
    z-index: 500;
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform .3s var(--ease);
    padding: calc(var(--nav-h) + 1rem) 1.75rem 2rem;
}
.sidebar.open { transform: translateX(0); }
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    z-index: 499;
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s;
    backdrop-filter: blur(3px);
}
.sidebar-overlay.visible { opacity: 1; pointer-events: auto; }
.sidebar-close {
    position: absolute;
    top: calc(var(--nav-h) + .75rem);
    right: 1.25rem;
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,.05);
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    color: var(--text2);
    transition: background .15s, color .15s;
}
.sidebar-close:hover { background: rgba(255,255,255,.1); color: var(--text); }
.sidebar-close svg { width: 16px; height: 16px; }
.sidebar-body { padding-top: 2rem; }

/* Sidebar content styles (built by JS) */
.s-type {
    display: inline-block;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--accent);
    background: var(--accent-dim);
    border: 1px solid rgba(0,212,255,.2);
    padding: .2rem .6rem;
    border-radius: 50px;
    margin-bottom: .75rem;
}
.s-title {
    font-size: 1.3rem;
    font-weight: 800;
    margin-bottom: 1rem;
    line-height: 1.3;
}
.s-desc { color: var(--text2); font-size: .92rem; line-height: 1.7; margin-bottom: 1.5rem; }
.s-section { margin-bottom: 1.5rem; }
.s-section-title {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--text3);
    margin-bottom: .75rem;
    padding-bottom: .5rem;
    border-bottom: 1px solid var(--border);
}
.s-dl { display: grid; grid-template-columns: auto 1fr; gap: .35rem .75rem; font-size: .88rem; }
.s-dl dt { color: var(--text3); white-space: nowrap; }
.s-dl dd { color: var(--text); font-weight: 500; }
.s-security {
    background: rgba(244,114,25,.05);
    border: 1px solid rgba(244,114,25,.2);
    border-radius: var(--r);
    padding: 1rem;
}
.s-security-title {
    color: #f47219;
    border-bottom-color: rgba(244,114,25,.2);
    display: flex;
    align-items: center;
    gap: .5rem;
}
.s-security-title svg { width: 14px; height: 14px; flex-shrink: 0; }
.s-security p { font-size: .87rem; color: #c4a070; line-height: 1.65; margin-top: .5rem; }

/* ── Blog ─────────────────────────────────────────────────────────────────── */
#blog { background: var(--bg2); }
.blog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}
.blog-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    gap: .9rem;
    transition: border-color .2s, transform .2s var(--ease);
    border-top: 3px solid var(--border);
}
.blog-card:hover {
    border-top-color: var(--accent);
    transform: translateY(-3px);
}
.blog-meta {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
}
.blog-meta time { font-size: .78rem; color: var(--text3); }
.blog-card h2,
.blog-card h3 { font-size: 1rem; font-weight: 700; line-height: 1.4; }
.blog-card p  { font-size: .88rem; color: var(--text2); line-height: 1.7; flex: 1; }
.coming-soon {
    display: inline-block;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--text3);
    border: 1px solid var(--border);
    padding: .25rem .6rem;
    border-radius: 4px;
    margin-top: auto;
    width: fit-content;
}

/* ── Footer ───────────────────────────────────────────────────────────────── */
footer {
    background: #070b15;
    border-top: 1px solid var(--border);
    padding: 3rem 1.5rem;
}
.footer-inner {
    max-width: var(--max-w);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 2rem;
}
.footer-left { display: flex; align-items: center; gap: 1rem; }
.footer-left p { font-size: .8rem; color: var(--text3); line-height: 1.6; max-width: 280px; }
footer nav { display: flex; gap: 1.5rem; }
footer nav a { font-size: .85rem; color: var(--text2); }
footer nav a:hover { color: var(--accent); opacity: 1; }
.footer-copy { font-size: .8rem; color: var(--text3); }

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
    .blog-grid { grid-template-columns: 1fr 1fr; }
    .about-grid { grid-template-columns: 1fr; }
    .contact-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
    .contact-col .card { margin-bottom: 0; }
}

@media (max-width: 768px) {
    section { padding: 4rem 1.25rem; }
    #home { padding-top: calc(var(--nav-h) + 2rem); }

    .nav-links {
        display: none;
        position: absolute;
        top: var(--nav-h);
        left: 0; right: 0;
        background: rgba(10,14,26,.97);
        border-bottom: 1px solid var(--border);
        flex-direction: column;
        padding: .75rem 1.25rem 1.25rem;
        gap: .25rem;
    }
    .nav-links.open { display: flex; }
    .nav-toggle { display: flex; }

    .hero-wrap { grid-template-columns: 1fr; gap: 2.5rem; }
    .terminal { display: none; }
    .stats-row { grid-template-columns: 1fr 1fr; }

    .skills-grid { grid-template-columns: 1fr; }
    .contact-col { display: block; }

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

    .project-head { flex-direction: column; }
    .project-tags { flex-direction: row; }

    .sidebar { width: 100%; max-width: 100vw; }

    .footer-inner { flex-direction: column; align-items: flex-start; gap: 1.5rem; }
}

@media (max-width: 480px) {
    .stats-row { grid-template-columns: 1fr 1fr; }
    .hero-copy h1 { font-size: 2.5rem; }
    .hero-actions { flex-direction: column; }
    .btn { width: 100%; justify-content: center; }
}

/* ── Pagination ───────────────────────────────────────────────────────────── */
.pg-hidden { display: none !important; }
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    margin-top: 3rem;
    flex-wrap: wrap;
}
.pg-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 .6rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text2);
    font-size: .85rem;
    font-family: inherit;
    cursor: pointer;
    transition: border-color .15s, color .15s, background .15s;
}
.pg-btn:hover:not([disabled]) { border-color: var(--accent); color: var(--accent); }
.pg-btn.pg-active { background: var(--accent); border-color: var(--accent); color: #000; font-weight: 700; }
.pg-btn[disabled]  { opacity: .3; cursor: not-allowed; }

/* ── Section "see all" footer ─────────────────────────────────────────────── */
.section-footer {
    margin-top: 2.5rem;
    display: flex;
    justify-content: flex-end;
}
.see-all {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    font-size: .9rem;
    font-weight: 600;
    color: var(--accent);
    border: 1px solid rgba(0,212,255,.25);
    padding: .5rem 1.1rem;
    border-radius: var(--r);
    transition: background .15s, border-color .15s;
}
.see-all:hover { background: var(--accent-dim); border-color: rgba(0,212,255,.5); opacity: 1; }

/* ── Sub-page layout ──────────────────────────────────────────────────────── */
main#main-content {
    padding: 4rem 1.5rem 6rem;
}
.page-hero {
    padding: calc(var(--nav-h) + 3.5rem) 1.5rem 3rem;
    background: var(--bg2);
    border-bottom: 1px solid var(--border);
}
.page-hero-inner { max-width: var(--max-w); margin: 0 auto; }
.breadcrumb {
    display: flex;
    align-items: center;
    gap: .4rem;
    font-size: .8rem;
    color: var(--text3);
    margin-bottom: 1.25rem;
}
.breadcrumb a { color: var(--text3); transition: color .15s; }
.breadcrumb a:hover { color: var(--accent); opacity: 1; }
.breadcrumb-sep { opacity: .35; }
.page-title {
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    font-weight: 900;
    line-height: 1.15;
    margin-bottom: .75rem;
}
.page-lead { font-size: 1.05rem; color: var(--text2); max-width: 640px; line-height: 1.7; }

/* ── Post header ──────────────────────────────────────────────────────────── */
.post-meta {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
    font-size: .83rem;
    color: var(--text3);
}
.post-meta .sep { opacity: .3; }
.reading-time { color: var(--text3); }
.page-wrap {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 4rem 1.5rem;
}
.post-wrap {
    max-width: 760px;
    margin: 0 auto;
    padding: 4rem 1.5rem;
}

/* ── Prose typography ─────────────────────────────────────────────────────── */
.prose { color: var(--text2); font-size: 1rem; line-height: 1.85; }
.prose > * + * { margin-top: 1.4rem; }
.prose h2 {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text);
    margin-top: 3rem;
    padding-top: 2.5rem;
    border-top: 1px solid var(--border);
}
.prose h3 { font-size: 1.1rem; font-weight: 700; color: var(--text); margin-top: 2rem; }
.prose p { margin-top: 1.2rem; }
.prose strong { color: var(--text); font-weight: 600; }
.prose em { color: var(--accent); font-style: normal; }
.prose a { text-decoration: underline; text-underline-offset: 3px; }
.prose ul { list-style: none; padding: 0; margin-top: 1rem; }
.prose ul li {
    position: relative;
    padding-left: 1.25rem;
    margin-bottom: .5rem;
}
.prose ul li::before { content: '—'; position: absolute; left: 0; color: var(--accent); }
.prose ol { padding-left: 1.5rem; margin-top: 1rem; }
.prose ol li { margin-bottom: .5rem; }
.prose pre {
    background: #060c18;
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 1.25rem 1.5rem;
    overflow-x: auto;
    font-family: 'Cascadia Code','Fira Code',Menlo,Consolas,monospace;
    font-size: .84rem;
    line-height: 1.75;
    color: #7dd3fc;
    margin: 1.75rem 0;
}
.prose code { color: #7dd3fc; }
.prose pre code { background: none; padding: 0; font-size: inherit; }
.prose blockquote {
    border-left: 3px solid var(--accent);
    padding: .8rem 1.25rem;
    background: var(--accent-dim);
    border-radius: 0 var(--r) var(--r) 0;
    color: var(--text2);
    font-style: italic;
}
.prose table { width: 100%; border-collapse: collapse; font-size: .9rem; margin: 1.5rem 0; }
.prose th {
    text-align: left;
    padding: .6rem .75rem;
    border-bottom: 2px solid var(--border);
    color: var(--text3);
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .08em;
}
.prose td { padding: .6rem .75rem; border-bottom: 1px solid var(--border); color: var(--text2); }
.prose tr:last-child td { border-bottom: none; }

/* ── Post link (replaces coming-soon on published posts) ──────────────────── */
.post-link {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    font-size: .82rem;
    font-weight: 600;
    color: var(--accent);
    margin-top: auto;
}
.post-link:hover { opacity: .75; }

/* ── Projects grid (listing page) ────────────────────────────────────────── */
.projects-listing { padding: 3rem 1.5rem 5rem; }
.projects-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}
.proj-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    gap: .9rem;
    transition: border-color .2s, transform .2s var(--ease);
    border-top: 3px solid var(--border);
}
.proj-card:hover { border-top-color: var(--accent); transform: translateY(-2px); }
.proj-card h2,
.proj-card h3 { font-size: 1rem; font-weight: 700; }
.proj-card p  { font-size: .88rem; color: var(--text2); line-height: 1.65; flex: 1; }
.proj-link {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    font-size: .82rem;
    font-weight: 600;
    color: var(--accent);
    margin-top: auto;
}
.proj-link:hover { opacity: .75; }

/* ── Individual project page ──────────────────────────────────────────────── */
.project-page-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin: 2.5rem 0;
}
.project-spec-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 1.5rem;
}
.project-spec-card h2,
.project-spec-card h3 {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--text3);
    margin-bottom: 1rem;
    padding-bottom: .75rem;
    border-bottom: 1px solid var(--border);
}
.project-spec-card table { width: 100%; border-collapse: collapse; font-size: .83rem; }
.project-spec-card th {
    text-align: left;
    padding: .45rem .5rem;
    color: var(--text3);
    font-weight: 500;
    width: 40%;
    vertical-align: top;
    border-bottom: 1px solid var(--border);
}
.project-spec-card td {
    padding: .45rem .5rem;
    color: var(--text2);
    border-bottom: 1px solid var(--border);
}
.project-spec-card tr:last-child th,
.project-spec-card tr:last-child td { border-bottom: none; }

/* ── Post / project navigation ────────────────────────────────────────────── */
.post-nav { margin: 3rem 0 1rem; }
.spec-list { list-style: none; padding: 0; }
.spec-list li {
    display: flex;
    flex-direction: column;
    padding: .55rem 0;
    border-bottom: 1px solid var(--border);
    font-size: .85rem;
}
.spec-list li:last-child { border-bottom: none; }
.spec-key { font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; color: var(--text3); margin-bottom: .2rem; }
.spec-val { color: var(--text); font-weight: 500; }

/* ── Responsive additions ─────────────────────────────────────────────────── */
@media (max-width: 1024px) {
    .projects-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    .project-page-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    .page-hero { padding-top: calc(var(--nav-h) + 2rem); }
    .post-wrap, .page-wrap { padding: 2.5rem 1.25rem; }
    .projects-listing { padding: 2rem 1.25rem 4rem; }
    .blog-grid { grid-template-columns: 1fr; }
}
