@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("../fonts/InterVariable.woff2") format("woff2");
}

:root {
    --bg: #101517;                /* body */
    --bg-2: #14191c;              /* raised surfaces */
    --bg-3: #1a2024;              /* cards */
    --line: #232a2f;              /* dividers */
    --line-2: #2c343a;            /* card borders */
    --line-3: #3a444c;            /* hover borders */
    --ink: #ffffff;
    --ink-2: #d7dadf;
    --muted: #a4abb3;
    --muted-2: #787c82;
    --accent: #3858e9;            
    --accent-2: #4d6cf3;
    --accent-soft: rgba(56, 88, 233, 0.15);
    --green: #4fc38a;
    --amber: #f0a44a;

    /* Type */
    --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-mono: "JetBrains Mono", "SFMono-Regular", ui-monospace, Menlo, Consolas, monospace;

    /* Layout */
    --max: 1200px;
    --gutter: 24px;
    --section-y: clamp(22px, 3.25vw, 40px);
    --radius-sm: 4px;             
    --radius-md: 8px;
    --radius-lg: 12px;

    color-scheme: dark;
}

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

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}

html {
    background: var(--bg);
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-sans);
    /* Inter character-variant defaults the type designer recommends:
       cv02/03/04 make 1/l/i more distinct, cv11 gives a single-storey a. */
    font-feature-settings: "cv02", "cv03", "cv04", "cv11";
    font-size: 16px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

a {
    color: var(--ink);
    text-decoration: none;
}

a:hover {
    color: var(--accent-2);
}

p { margin: 0; }

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

.wrap {
    width: min(100% - 2 * var(--gutter), var(--max));
    margin-inline: auto;
}

/* ---------- Top bar ---------- */
.topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    background: rgba(16, 21, 23, 0.78);
    border-bottom: 1px solid var(--line);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    backdrop-filter: saturate(180%) blur(12px);
}

.nav {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 32px;
    min-height: 60px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--ink);
    font-weight: 500;
    font-size: 15px;
    letter-spacing: -0.005em;
}

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

.brand img {
    display: block;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--line-2);
}

.nav-links {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 28px;
    font-size: 14px;
    font-weight: 400;
}

.nav-links a {
    color: var(--ink-2);
    padding: 6px 2px;
}

.nav-links a:hover { color: var(--ink); }

.nav-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid var(--line-2);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--ink);
    cursor: pointer;
}

.nav-toggle svg { width: 18px; height: 18px; }
.nav-toggle .icon-close { display: none; }
.nav-toggle[aria-expanded="true"] .icon-menu { display: none; }
.nav-toggle[aria-expanded="true"] .icon-close { display: inline-block; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 16px;
    min-height: 38px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    background: transparent;
    color: var(--ink);
    font-family: inherit;
    font-size: 14.5px;
    font-weight: 500;
    letter-spacing: -0.003em;
    cursor: pointer;
    transition: background 140ms ease, color 140ms ease, border-color 140ms ease;
}

.btn svg {
    width: 15px;
    height: 15px;
    flex: 0 0 auto;
}

.btn.primary {
    background: var(--accent);
    color: var(--ink);
    border-color: var(--accent);
}

.btn.primary:hover {
    background: var(--accent-2);
    border-color: var(--accent-2);
}

.btn.secondary {
    background: transparent;
    color: var(--ink);
    border-color: var(--muted-2);
}

.btn.secondary:hover {
    border-color: var(--ink);
}

.btn.compact {
    min-height: 34px;
    padding: 7px 14px;
    font-size: 13.5px;
}

/* ---------- Hero ---------- */
.hero {
    position: relative;
    padding: clamp(34px, 5vw, 60px) 0 clamp(22px, 3.5vw, 40px);
    overflow: hidden;
    isolation: isolate;
}

/* Grid pattern overlay */
.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image:
        linear-gradient(to right,  rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
    background-size: 56px 56px;
    background-position: -1px -1px;
    -webkit-mask-image: radial-gradient(ellipse at 50% 30%, #000 60%, transparent 92%);
            mask-image: radial-gradient(ellipse at 50% 30%, #000 60%, transparent 92%);
}

/* Soft blue glow behind the headline. */
.hero::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(ellipse 50% 50% at 18% 28%, rgba(56, 88, 233, 0.16), transparent 65%);
    pointer-events: none;
}

.hero-inner {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    gap: clamp(32px, 5vw, 64px);
    align-items: center;
}

.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px 4px 8px;
    border: 1px solid var(--line-2);
    border-radius: 999px;
    background: var(--bg-2);
    color: var(--muted);
    font-size: 12.5px;
    font-weight: 500;
}

.hero-eyebrow .dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 0 3px rgba(79, 195, 138, 0.18);
}

.hero h1 {
    margin: 22px 0 0;
    color: var(--ink);
    font-size: clamp(40px, 5.6vw, 64px);
    line-height: 1.05;
    letter-spacing: -0.022em;
    font-weight: 500;
    max-width: 14ch;
}

.hero h1 .accent { color: var(--accent-2); }

.hero-lede {
    margin-top: 22px;
    max-width: 48ch;
    color: var(--muted);
    font-size: 17px;
    line-height: 1.5;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 28px;
}

/* ---------- Hero dashboard panel (right side) ---------- */
.hero-dashboard {
    position: relative;
    width: 100%;
    background: var(--bg-3);
    border: 1px solid var(--line-2);
    border-radius: 10px;
    overflow: hidden;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.03) inset,
        0 24px 60px -20px rgba(0, 0, 0, 0.55),
        0 0 0 1px rgba(56, 88, 233, 0.05);
    isolation: isolate;
}

/* Soft blue glow behind the panel. */
.hero-dashboard::before {
    content: "";
    position: absolute;
    inset: -40%;
    z-index: -1;
    background: radial-gradient(circle at 70% 20%, rgba(56, 88, 233, 0.18), transparent 60%);
    pointer-events: none;
}

.hd-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    border-bottom: 1px solid var(--line-2);
    background: rgba(255, 255, 255, 0.02);
}

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

.hd-dots span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--muted-2);
    display: inline-block;
}

.hd-dots span:nth-child(1) { background: #ff5f57; }
.hd-dots span:nth-child(2) { background: #febc2e; }
.hd-dots span:nth-child(3) { background: #28c840; }

.hd-title {
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 11.5px;
}

.hd-live {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 9px;
    border-radius: 999px;
    background: rgba(79, 195, 138, 0.1);
    border: 1px solid rgba(79, 195, 138, 0.25);
    color: var(--green);
    font-family: var(--font-mono);
    font-size: 10.5px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.hd-live i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 0 0 rgba(79, 195, 138, 0.4);
    animation: hd-pulse 2.4s ease-out infinite;
}

@keyframes hd-pulse {
    0%   { box-shadow: 0 0 0 0   rgba(79, 195, 138, 0.5); }
    70%  { box-shadow: 0 0 0 8px rgba(79, 195, 138, 0);   }
    100% { box-shadow: 0 0 0 0   rgba(79, 195, 138, 0);   }
}

.hd-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    background: var(--line-2);
}

.hd-tile {
    padding: 18px 18px 16px;
    background: var(--bg-3);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.hd-tile-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    color: var(--muted);
    font-size: 12px;
    font-family: var(--font-mono);
    letter-spacing: 0.02em;
}

.hd-tile-trend {
    color: var(--green);
    font-size: 11px;
    font-weight: 500;
}

.hd-tile-trend.flat {
    color: var(--muted-2);
}

.hd-value {
    color: var(--ink);
    font-size: clamp(24px, 2.4vw, 30px);
    line-height: 1;
    font-weight: 500;
    letter-spacing: -0.02em;
}

.hd-value sup {
    font-size: 0.55em;
    color: var(--muted-2);
    font-weight: 400;
    margin-left: 3px;
    top: -0.55em;
}

.hd-sub {
    color: var(--muted-2);
    font-size: 11.5px;
    font-family: var(--font-mono);
    letter-spacing: 0;
}

.hd-chart {
    width: 100%;
    height: 36px;
    margin-top: 10px;
    display: block;
    overflow: visible;
}

/* Sparkline (line + faint area fill). */
.hd-chart .area {
    fill: rgba(77, 108, 243, 0.13);
    opacity: 0;
    animation: hd-area-in 600ms ease-out forwards;
    animation-delay: 1.4s;
}

.hd-chart .line {
    fill: none;
    stroke: var(--accent-2);
    stroke-width: 1.5;
    stroke-linejoin: round;
    stroke-linecap: round;
    stroke-dasharray: 220;
    stroke-dashoffset: 220;
    animation: hd-line-in 1.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* Bar chart bars. */
.hd-chart .bar {
    fill: var(--accent-2);
    transform-origin: bottom;
    transform: scaleY(0);
    animation: hd-bar-in 700ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* Stagger each tile's draw-in. */
.hd-tile:nth-child(1) .line,
.hd-tile:nth-child(1) .bar { animation-delay: 0.25s; }
.hd-tile:nth-child(2) .line,
.hd-tile:nth-child(2) .bar { animation-delay: 0.45s; }
.hd-tile:nth-child(3) .line,
.hd-tile:nth-child(3) .bar { animation-delay: 0.65s; }
.hd-tile:nth-child(4) .line,
.hd-tile:nth-child(4) .bar { animation-delay: 0.85s; }

/* Per-bar additional stagger so they don't all pop at once. */
.hd-chart .bar:nth-child(1) { animation-delay: calc(var(--d, 0.25s) + 0.0s); }
.hd-chart .bar:nth-child(2) { animation-delay: calc(var(--d, 0.25s) + 0.06s); }
.hd-chart .bar:nth-child(3) { animation-delay: calc(var(--d, 0.25s) + 0.12s); }
.hd-chart .bar:nth-child(4) { animation-delay: calc(var(--d, 0.25s) + 0.18s); }
.hd-chart .bar:nth-child(5) { animation-delay: calc(var(--d, 0.25s) + 0.24s); }
.hd-chart .bar:nth-child(6) { animation-delay: calc(var(--d, 0.25s) + 0.30s); }

.hd-tile:nth-child(2) .hd-chart { --d: 0.45s; }
.hd-tile:nth-child(4) .hd-chart { --d: 0.85s; }

@keyframes hd-line-in {
    to { stroke-dashoffset: 0; }
}

@keyframes hd-area-in {
    to { opacity: 1; }
}

@keyframes hd-bar-in {
    to { transform: scaleY(1); }
}

@media (prefers-reduced-motion: reduce) {
    .hd-chart .line {
        animation: none;
        stroke-dashoffset: 0;
    }
    .hd-chart .area { animation: none; opacity: 1; }
    .hd-chart .bar { animation: none; transform: scaleY(1); }
    .hd-live i { animation: none; }
}

/* ---------- Section scaffolding ---------- */
.section {
    padding: var(--section-y) 0;
}

.section-head {
    max-width: 720px;
    margin-bottom: 28px;
}

.section-eyebrow {
    display: inline-block;
    margin-bottom: 14px;
    color: var(--accent-2);
    font-family: var(--font-mono);
    font-size: 12.5px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.section h2 {
    margin: 0;
    color: var(--ink);
    font-size: clamp(30px, 3.8vw, 44px);
    line-height: 1.1;
    letter-spacing: -0.02em;
    font-weight: 500;
}

.section-lede {
    margin-top: 16px;
    color: var(--muted);
    font-size: 17px;
    line-height: 1.5;
    max-width: 56ch;
}

/* ---------- Spotlight (big featured card) ---------- */
.spotlight {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    border: 1px solid var(--line-2);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--bg-2);
}

.spotlight-copy {
    padding: clamp(28px, 4vw, 48px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 18px;
}

.spotlight-copy .tag {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--accent-soft);
    border: 1px solid rgba(77, 108, 243, 0.3);
    color: var(--accent-2);
    font-family: var(--font-mono);
    font-size: 11.5px;
    font-weight: 500;
}

.spotlight-copy h3 {
    margin: 0;
    color: var(--ink);
    font-size: clamp(24px, 2.6vw, 32px);
    line-height: 1.15;
    letter-spacing: -0.015em;
    font-weight: 500;
}

.spotlight-copy p {
    color: var(--muted);
    font-size: 15.5px;
    line-height: 1.55;
}

.spotlight-copy .links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
}

.spotlight-visual {
    position: relative;
    background:
        radial-gradient(circle at 75% 25%, rgba(56, 88, 233, 0.28), transparent 55%),
        radial-gradient(circle at 20% 80%, rgba(79, 195, 138, 0.18), transparent 50%),
        #0a0d0f;
    padding: clamp(24px, 4vw, 36px);
    display: flex;
    align-items: stretch;
    min-height: 320px;
    border-left: 1px solid var(--line-2);
}

.terminal {
    position: relative;
    flex: 1;
    align-self: center;
    width: 100%;
    background: rgba(10, 13, 15, 0.85);
    border: 1px solid var(--line-2);
    border-radius: var(--radius-md);
    font-family: var(--font-mono);
    font-size: 12.5px;
    line-height: 1.65;
    overflow: hidden;
    box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.7);
}

.terminal-head {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--line-2);
    background: rgba(255, 255, 255, 0.02);
}

.terminal-head span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--muted-2);
}

.terminal-head span:nth-child(1) { background: #ff5f57; }
.terminal-head span:nth-child(2) { background: #febc2e; }
.terminal-head span:nth-child(3) { background: #28c840; }

.terminal-head .title {
    width: auto;
    margin-left: 10px;
    color: var(--muted-2);
    background: transparent;
    font-size: 11.5px;
}

.terminal-body {
    padding: 16px 18px;
    color: var(--ink-2);
    white-space: pre-wrap;
    word-break: break-word;
}

.terminal-body .prompt { color: var(--green); }
.terminal-body .flag { color: var(--accent-2); }
.terminal-body .comment { color: var(--muted-2); }
.terminal-body .ok { color: var(--green); }

/* ---------- Work grid ---------- */
.work-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.work-card {
    display: flex;
    flex-direction: column;
    padding: 24px;
    background: var(--bg-3);
    border: 1px solid var(--line-2);
    border-radius: var(--radius-md);
    transition: border-color 160ms ease, background 160ms ease;
}

.work-card:hover {
    border-color: var(--line-3);
    background: #1d2429;
}

.work-card .role-tag {
    display: inline-flex;
    align-self: flex-start;
    padding: 3px 9px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--line-2);
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 11.5px;
    font-weight: 500;
    margin-bottom: 14px;
}

.work-card h3 {
    margin: 0 0 10px;
    color: var(--ink);
    font-size: 18px;
    line-height: 1.25;
    letter-spacing: -0.012em;
    font-weight: 500;
}

.work-card p {
    flex: 1;
    color: var(--muted);
    font-size: 14.5px;
    line-height: 1.55;
}

.work-card .work-links {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.work-card .work-links a {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--accent-2);
    font-size: 13.5px;
    font-weight: 500;
}

.work-card .work-links a::after {
    content: "↗";
    font-size: 12px;
    transition: transform 160ms ease;
}

.work-card .work-links a:hover { color: var(--ink); }
.work-card .work-links a:hover::after { transform: translate(2px, -2px); }

.work-details {
    flex: 1 0 100%;
}

.work-details summary {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--accent-2);
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    list-style: none;
}

.work-details summary::-webkit-details-marker {
    display: none;
}

.work-details summary::after {
    content: "+";
    color: var(--muted-2);
    font-family: var(--font-mono);
    font-size: 12px;
}

.work-details[open] summary {
    color: var(--ink);
}

.work-details[open] summary::after {
    content: "-";
}

.work-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
}

.work-tech span {
    display: inline-flex;
    padding: 3px 8px;
    border: 1px solid var(--line-2);
    border-radius: 999px;
    color: var(--muted-2);
    font-family: var(--font-mono);
    font-size: 11px;
    line-height: 1.3;
}

/* ---------- Experience timeline ---------- */
.timeline {
    margin: 0;
    padding: 0;
    list-style: none;
    border-top: 1px solid var(--line);
}

.timeline-row {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr) 280px;
    gap: 28px;
    align-items: baseline;
    padding: 24px 0;
    border-bottom: 1px solid var(--line);
}

.timeline-year {
    color: var(--muted-2);
    font-family: var(--font-mono);
    font-size: 13px;
}

.timeline-role {
    color: var(--ink);
    font-size: 17px;
    line-height: 1.3;
    letter-spacing: -0.01em;
    font-weight: 500;
}

.timeline-role .org {
    color: var(--muted);
    font-weight: 400;
}

.timeline-tag {
    color: var(--muted);
    font-size: 14px;
    text-align: right;
}

/* ---------- Stack ---------- */
.stack-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.stack-card {
    padding: 22px;
    background: var(--bg-3);
    border: 1px solid var(--line-2);
    border-radius: var(--radius-md);
}

.stack-card dt {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    color: var(--ink);
    font-size: 15px;
    font-weight: 500;
}

.stack-card dt::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-2);
}

.stack-card dd { margin: 0; }

.stack-card .chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.stack-card .chips li {
    display: inline-flex;
    padding: 4px 9px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--line-2);
    color: var(--ink-2);
    font-family: var(--font-mono);
    font-size: 11.5px;
    line-height: 1.3;
}

/* ---------- CTA actions row ---------- */
.cta-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 0;
    justify-content: center;
}

/* ---------- Secondary pages ---------- */
.page-shell,
.error-page {
    position: relative;
    padding: clamp(34px, 5vw, 64px) 0;
    overflow: hidden;
    isolation: isolate;
}

.page-shell::before,
.error-page::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image:
        linear-gradient(to right,  rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 56px 56px;
    background-position: -1px -1px;
    -webkit-mask-image: radial-gradient(ellipse at 50% 20%, #000 55%, transparent 88%);
            mask-image: radial-gradient(ellipse at 50% 20%, #000 55%, transparent 88%);
}

.legal-page,
.error-panel {
    margin-inline: auto;
    padding: clamp(28px, 4vw, 48px);
    background: var(--bg-2);
    border: 1px solid var(--line-2);
    border-radius: var(--radius-md);
}

.legal-page {
    width: min(calc(100% - 2 * var(--gutter)), 820px);
}

.error-panel {
    width: min(100%, 820px);
}

.legal-page h1,
.error-panel h1 {
    margin: 0;
    color: var(--ink);
    font-size: clamp(38px, 6vw, 64px);
    line-height: 1.05;
    letter-spacing: -0.022em;
    font-weight: 500;
}

.legal-page .updated {
    display: block;
    margin-top: 16px;
    margin-bottom: 0;
}

.legal-page .lede,
.error-panel p {
    margin-top: 24px;
    color: var(--ink-2);
    font-size: 18px;
    line-height: 1.5;
}

.legal-page h2 {
    margin: 34px 0 0;
    color: var(--ink);
    font-size: clamp(24px, 3vw, 32px);
    line-height: 1.15;
    letter-spacing: -0.015em;
    font-weight: 500;
}

.legal-page p {
    margin-top: 14px;
    color: var(--muted);
    font-size: 16px;
    line-height: 1.6;
}

.legal-page a {
    color: var(--accent-2);
}

.legal-page a:hover {
    color: var(--ink);
}

.legal-page strong {
    color: var(--ink);
    font-weight: 600;
}

.legal-page ul {
    display: grid;
    gap: 8px;
    margin: 16px 0 0;
    padding: 0;
    list-style: none;
}

.legal-page li,
.callout {
    padding: 14px 16px;
    background: var(--bg-3);
    border: 1px solid var(--line-2);
    border-radius: var(--radius-md);
    color: var(--ink-2);
    font-size: 15px;
    line-height: 1.55;
}

.callout {
    margin-top: 28px;
}

.page-back {
    margin-top: 28px;
}

.error-page {
    display: flex;
    align-items: center;
    min-height: calc(100vh - 149px);
}

.error-panel {
    max-width: 680px;
}

.error-panel .section-eyebrow {
    margin-bottom: 16px;
}

.error-panel p {
    max-width: 40rem;
    color: var(--muted);
}

/* ---------- Footer ---------- */
.site-footer {
    padding: 28px 0 32px;
    color: var(--muted);
    font-size: 14px;
}

.footer-bottom {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 14px 24px;
    color: var(--muted-2);
    font-size: 13px;
}

.footer-bottom .footer-legal a {
    color: var(--muted-2);
    margin-left: 20px;
}

.footer-bottom .footer-legal a:first-child { margin-left: 0; }
.footer-bottom .footer-legal a:hover { color: var(--ink); }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
    .hero-inner { grid-template-columns: 1fr; }
    .work-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stack-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
    .nav {
        grid-template-columns: auto auto;
        justify-content: space-between;
    }

    .nav-toggle {
        display: inline-flex;
        justify-self: end;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 8px 24px 20px;
        background: var(--bg-2);
        border-bottom: 1px solid var(--line);
    }

    .nav-links a {
        padding: 14px 0;
        border-top: 1px solid var(--line);
    }

    /* JS toggles `is-open` on `.nav-links` directly — see js/site.js. */
    .nav-links.is-open { display: flex; }

    /* Hero dashboard is decorative and bulky on phones — hide it. */
    .hero-dashboard { display: none; }

    .spotlight { grid-template-columns: 1fr; }
    .spotlight-visual { display: none; }

    .timeline-row { grid-template-columns: 1fr; gap: 6px; }
    .timeline-tag { text-align: left; }
}

@media (max-width: 560px) {
    :root { --gutter: 18px; }

    .work-grid,
    .stack-grid { grid-template-columns: 1fr; }

    .hero-actions,
    .cta-actions { width: 100%; }
    .hero-actions .btn,
    .cta-actions .btn { flex: 1 1 auto; }
}
