/* ==========================================================================
   elshod.me — styles
   Palette borrows from Uzbek ceramics: deep cobalt, turquoise, ochre, ivory.
   Fonts are self-hosted (SIL OFL, see fonts/): Instrument Serif for Latin
   display text, Prata for Cyrillic display text, Manrope for body and
   JetBrains Mono for code and tags.
   ========================================================================== */

/* ---------- fonts ---------- */
@font-face {
    font-family: 'Display';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url(fonts/instrument-serif-latin-400-normal.woff2) format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Display';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url(fonts/instrument-serif-latin-ext-400-normal.woff2) format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    /* Cyrillic headings: Instrument Serif has no Cyrillic, Prata fills in */
    font-family: 'Display';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url(fonts/prata-cyrillic-400-normal.woff2) format('woff2');
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
    font-family: 'Manrope';
    font-style: normal;
    font-weight: 200 800;
    font-display: swap;
    src: url(fonts/manrope-latin-wght-normal.woff2) format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Manrope';
    font-style: normal;
    font-weight: 200 800;
    font-display: swap;
    src: url(fonts/manrope-latin-ext-wght-normal.woff2) format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: 'Manrope';
    font-style: normal;
    font-weight: 200 800;
    font-display: swap;
    src: url(fonts/manrope-cyrillic-wght-normal.woff2) format('woff2');
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
    font-family: 'JetBrains Mono';
    font-style: normal;
    font-weight: 100 800;
    font-display: swap;
    src: url(fonts/jetbrains-mono-latin-wght-normal.woff2) format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'JetBrains Mono';
    font-style: normal;
    font-weight: 100 800;
    font-display: swap;
    src: url(fonts/jetbrains-mono-cyrillic-wght-normal.woff2) format('woff2');
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

:root {
    --font-body: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-display: 'Display', Georgia, 'Times New Roman', serif;
    --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

    --wrap: 1080px;
    --gutter: 20px;
    --r-xs: 4px;
    --r-sm: 8px;
    --r-md: 14px;
    --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

[data-theme="dark"] {
    --bg: #0f1a2a;
    --bg-2: #12203a;
    --surface: #152439;
    --surface-2: #1a2c45;
    --line: #243854;
    --line-strong: #345079;
    --ink: #eef2f6;
    --ink-2: #aab7c9;
    --ink-3: #7e8ea4;
    --accent: #55d6c8;
    --accent-ink: #0b1a24;
    --accent-soft: rgba(85, 214, 200, 0.14);
    --warm: #e6b455;
    --warm-soft: rgba(230, 180, 85, 0.14);
    --ok: #6fd18c;
    --err: #f08a8a;
    --code-kw: #8ab4ff;
    --code-ty: #d7b8ff;
    --code-str: #a6e3a1;
    --code-cmt: #7e8ea4;
    --grid: rgba(255, 255, 255, 0.045);
    color-scheme: dark;
}

[data-theme="light"] {
    --bg: #f7f7f4;
    --bg-2: #f1f2ee;
    --surface: #ffffff;
    --surface-2: #f4f6f8;
    --line: #dfe3e8;
    --line-strong: #bfc8d3;
    --ink: #14213a;
    --ink-2: #4c5a70;
    --ink-3: #7a879b;
    --accent: #0f8a84;
    --accent-ink: #ffffff;
    --accent-soft: rgba(15, 138, 132, 0.12);
    --warm: #a56f11;
    --warm-soft: rgba(165, 111, 17, 0.12);
    --ok: #1f8a4c;
    --err: #c23f3f;
    --code-kw: #2352c9;
    --code-ty: #7a3fb8;
    --code-str: #1a7a3a;
    --code-cmt: #7a879b;
    --grid: rgba(20, 33, 58, 0.06);
    color-scheme: light;
}

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    color: var(--ink);
    background-color: var(--bg);
    background-image:
        linear-gradient(var(--grid) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid) 1px, transparent 1px);
    background-size: 40px 40px;
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
}

/* fade the grid out below the hero so sections sit on a calmer field */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    background: linear-gradient(180deg, transparent 0, var(--bg) 640px);
    pointer-events: none;
}

h1, h2, h3, h4, p, ul, ol, dl, dd, figure, pre { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
svg { display: inline-block; vertical-align: middle; }

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

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

.skip-link {
    position: absolute;
    left: 12px;
    top: -60px;
    padding: 8px 12px;
    background: var(--accent);
    color: var(--accent-ink);
    border-radius: var(--r-sm);
    font-weight: 600;
    z-index: 100;
}
.skip-link:focus { top: 12px; }

/* external-link glyph */
.ext {
    margin-left: 4px;
    opacity: 0.7;
    transition: transform 0.2s var(--ease), opacity 0.2s var(--ease);
}
a:hover .ext { opacity: 1; transform: translate(1px, -1px); }

/* ---------- header ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 24px;
    height: 60px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 7px;
    background: var(--accent);
    color: var(--accent-ink);
    font-family: var(--font-display);
    font-size: 20px;
    line-height: 1;
}

.nav { margin-left: auto; }

.nav-toggle {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: var(--r-sm);
    color: var(--ink-2);
    font-weight: 600;
    font-size: 14px;
}

.nav-links {
    display: flex;
    gap: 4px;
}

.nav-links a {
    display: inline-block;
    padding: 8px 12px;
    border-radius: var(--r-sm);
    color: var(--ink-2);
    font-weight: 500;
    font-size: 15px;
    transition: color 0.2s var(--ease), background 0.2s var(--ease);
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--ink);
    background: var(--surface-2);
}

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

.lang-switch {
    display: inline-flex;
    padding: 3px;
    gap: 2px;
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    background: var(--surface);
}

.lang-btn {
    padding: 4px 9px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--ink-3);
    transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
.lang-btn:hover { color: var(--ink); }
.lang-btn[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }

.theme-toggle {
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    background: var(--surface);
    color: var(--ink-2);
    transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.theme-toggle:hover { color: var(--ink); border-color: var(--line-strong); }
[data-theme="dark"] .icon-moon { display: none; }
[data-theme="light"] .icon-sun { display: none; }

/* ---------- buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 11px 18px;
    border-radius: var(--r-sm);
    font-weight: 600;
    font-size: 15px;
    line-height: 1.2;
    border: 1px solid transparent;
    transition: background 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.btn:active { transform: translateY(1px); }

.btn-primary {
    background: var(--accent);
    color: var(--accent-ink);
}
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 88%, white); }

.btn-ghost {
    border-color: var(--line-strong);
    color: var(--ink);
    background: transparent;
}
.btn-ghost:hover { background: var(--surface-2); border-color: var(--ink-3); }

/* ---------- hero ---------- */
.hero {
    padding: 88px 0 72px;
}

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    gap: 56px;
    align-items: center;
}

.status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px 6px 10px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background: var(--surface);
    font-size: 13.5px;
    font-weight: 600;
    color: var(--ink-2);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--ok);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 25%, transparent);
}
.status-dot.warm {
    background: var(--warm);
    box-shadow: 0 0 0 3px var(--warm-soft);
}

.hero-name {
    margin-top: 22px;
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(44px, 6.4vw, 76px);
    line-height: 0.98;
    letter-spacing: -0.015em;
}

.hero-lede {
    margin-top: 20px;
    max-width: 46ch;
    font-size: clamp(17px, 1.6vw, 19px);
    line-height: 1.55;
    color: var(--ink-2);
}

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

.hero-links {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
    margin-top: 26px;
    font-size: 14.5px;
    color: var(--ink-2);
}
.hero-links a {
    display: inline-flex;
    align-items: center;
    padding: 2px 0;
    border-bottom: 1px solid transparent;
    transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.hero-links a:hover { color: var(--ink); border-color: var(--accent); }

/* code card — the one showy element on the page */
.code-card {
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    background: var(--surface);
    overflow: hidden;
    box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.45);
}

.code-card-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    border-bottom: 1px solid var(--line);
    background: var(--surface-2);
    font-family: var(--font-mono);
    font-size: 12.5px;
    color: var(--ink-3);
}
.code-file { color: var(--ink-2); }

.code {
    padding: 20px 18px 22px;
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 13.5px;
    line-height: 1.65;
    color: var(--ink);
    tab-size: 4;
}
.code .kw { color: var(--code-kw); }
.code .ty { color: var(--code-ty); }
.code .str { color: var(--code-str); }
.code .cmt { color: var(--code-cmt); font-style: italic; }
.code .num { color: var(--warm); }
.code .nl { display: none; }   /* phone-only line break */

/* hero load-in: the only non-interactive motion on the page */
[data-anim] {
    opacity: 0;
    transform: translateY(10px);
    animation: rise 0.6s var(--ease) forwards;
}
[data-anim="1"] { animation-delay: 0.05s; }
[data-anim="2"] { animation-delay: 0.12s; }
[data-anim="3"] { animation-delay: 0.2s; }
[data-anim="4"] { animation-delay: 0.28s; }
[data-anim="5"] { animation-delay: 0.36s; }

@keyframes rise {
    to { opacity: 1; transform: none; }
}

/* ---------- sections ---------- */
.section {
    padding: 72px 0;
    border-top: 1px solid var(--line);
    scroll-margin-top: 60px;
}

.section-grid {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 48px;
    align-items: start;
}

.section-head {
    position: sticky;
    top: 84px;
}

.section-head h2 {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 38px;
    line-height: 1;
    letter-spacing: -0.01em;
}

.section-head p {
    margin-top: 12px;
    font-size: 14.5px;
    line-height: 1.55;
    color: var(--ink-2);
}

.subhead {
    margin: 40px 0 16px;
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 26px;
    letter-spacing: -0.01em;
}

/* ---------- tags ---------- */
.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.tags li {
    padding: 4px 9px;
    border: 1px solid var(--line-strong);
    border-radius: var(--r-xs);
    font-family: var(--font-mono);
    font-size: 12.5px;
    line-height: 1.4;
    color: var(--ink-2);
    background: var(--surface);
}

/* ---------- featured project ---------- */
.featured {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 240px;
    border: 1px solid var(--line-strong);
    border-radius: var(--r-md);
    background: var(--surface);
    overflow: hidden;
}

.featured-main {
    padding: 30px 32px 32px;
}

.featured-label {
    display: inline-block;
    padding: 3px 9px;
    border-radius: var(--r-xs);
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 12.5px;
    font-weight: 700;
}

.featured-title {
    margin-top: 16px;
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 40px;
    line-height: 1;
    letter-spacing: -0.01em;
}

.featured-sub {
    margin-top: 6px;
    font-size: 17px;
    color: var(--ink-2);
}

.featured-desc {
    margin-top: 18px;
    max-width: 62ch;
    color: var(--ink-2);
    line-height: 1.65;
}

.highlights {
    margin-top: 18px;
    display: grid;
    gap: 8px;
}
.highlights li {
    position: relative;
    padding-left: 18px;
    font-size: 15px;
    line-height: 1.5;
}
.highlights li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.62em;
    width: 8px;
    height: 8px;
    border-radius: 2px;
    background: var(--accent);
}

.featured-main .tags { margin-top: 22px; }

.featured-side {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 24px;
    padding: 30px 24px 32px;
    border-left: 1px solid var(--line);
    background: var(--surface-2);
}

.featured-facts {
    display: grid;
    gap: 16px;
}
.featured-facts dt {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--ink-3);
}
.featured-facts dd {
    margin-top: 3px;
    font-size: 14.5px;
    line-height: 1.5;
    color: var(--ink-2);
}
.featured-facts dd .status-dot {
    display: inline-block;
    margin-right: 8px;
    vertical-align: 1px;
}

.featured-actions {
    display: grid;
    gap: 8px;
}
.featured-actions .btn { justify-content: center; }

/* ---------- project grid ---------- */
.projects {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.project {
    display: flex;
    flex-direction: column;
    padding: 22px 22px 20px;
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    background: var(--surface);
    transition: border-color 0.2s var(--ease);
}
.project:hover { border-color: var(--line-strong); }

.project-meta {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--ink-3);
}

.project-title {
    margin-top: 10px;
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 26px;
    line-height: 1.1;
    letter-spacing: -0.01em;
}

.project-desc {
    margin-top: 10px;
    flex: 1;
    font-size: 14.5px;
    line-height: 1.6;
    color: var(--ink-2);
}

.project .tags { margin-top: 16px; }

.project-link {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    margin-top: 16px;
    font-size: 14px;
    font-weight: 600;
    color: var(--accent);
}
.project-link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- skills ---------- */
.skills {
    display: grid;
    gap: 0;
}

.skill-row {
    display: grid;
    grid-template-columns: 160px minmax(0, 1fr);
    gap: 20px;
    padding: 16px 0;
    border-bottom: 1px solid var(--line);
}
.skill-row:first-child { padding-top: 0; }
.skill-row:last-child { border-bottom: 0; }

.skill-row dt {
    padding-top: 4px;
    font-weight: 600;
    font-size: 14.5px;
    color: var(--ink);
}

.skill-row.learning dt { color: var(--warm); }
.skill-row.learning .tags li {
    border-style: dashed;
    color: var(--warm);
    border-color: color-mix(in srgb, var(--warm) 55%, transparent);
    background: var(--warm-soft);
}

/* ---------- about ---------- */
.about-text {
    max-width: 66ch;
    font-size: 17px;
    line-height: 1.65;
    color: var(--ink-2);
}

.facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 32px;
}

.fact {
    padding: 20px 22px;
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    background: var(--surface);
}

.fact h3 {
    font-size: 13px;
    font-weight: 700;
    color: var(--ink-3);
}

.fact-main {
    margin-top: 10px;
    font-weight: 600;
    font-size: 16px;
}

.fact-sub {
    margin-top: 2px;
    font-size: 14.5px;
    color: var(--ink-2);
}

.fact-list {
    margin-top: 10px;
    display: grid;
    gap: 6px;
}
.fact-list li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 15px;
}
.fact-note { color: var(--ink-3); font-size: 14px; }

.timeline {
    margin-top: 32px;
    display: grid;
    gap: 0;
    border-left: 2px solid var(--line-strong);
}
.timeline li {
    position: relative;
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 12px;
    padding: 0 0 18px 20px;
}
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before {
    content: '';
    position: absolute;
    left: -6px;
    top: 7px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--bg);
    border: 2px solid var(--accent);
}
.timeline li:last-child::before { background: var(--accent); }

.tl-year {
    font-family: var(--font-mono);
    font-size: 13.5px;
    color: var(--ink-3);
    padding-top: 2px;
}
.tl-text { font-size: 15px; color: var(--ink-2); }

/* ---------- contact ---------- */
.contact-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 40px;
    align-items: start;
}

.form {
    display: grid;
    gap: 16px;
}

.field { display: grid; gap: 6px; }

.field label {
    font-size: 14px;
    font-weight: 600;
}

.field input,
.field textarea {
    width: 100%;
    padding: 11px 13px;
    border: 1px solid var(--line-strong);
    border-radius: var(--r-sm);
    background: var(--surface);
    color: var(--ink);
    font: inherit;
    font-size: 15px;
    transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.field input::placeholder,
.field textarea::placeholder { color: var(--ink-3); }
.field input:focus,
.field textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
.field input.invalid,
.field textarea.invalid { border-color: var(--err); }
.field textarea { resize: vertical; min-height: 120px; }

.form-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
}

.btn .btn-busy { display: none; }
.btn.is-busy .btn-label { display: none; }
.btn.is-busy .btn-busy { display: inline; }
.btn.is-busy { opacity: 0.8; pointer-events: none; }

.form-note { font-size: 14px; font-weight: 500; }
.form-note.ok { color: var(--ok); }
.form-note.err { color: var(--err); }

.direct {
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    background: var(--surface);
}

.direct h3 {
    font-size: 13px;
    font-weight: 700;
    color: var(--ink-3);
}

.direct-list {
    margin-top: 12px;
    display: grid;
    gap: 10px;
}
.direct-list li {
    display: grid;
    gap: 1px;
    font-size: 14.5px;
}
.direct-k { font-size: 12.5px; color: var(--ink-3); }
.direct-list a {
    color: var(--ink);
    word-break: break-all;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s var(--ease);
}
.direct-list a:hover { border-color: var(--accent); }

/* ---------- footer ---------- */
.site-footer {
    border-top: 1px solid var(--line);
    padding: 28px 0 40px;
    font-size: 14px;
    color: var(--ink-3);
}
.footer-inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px 24px;
}
.site-footer a { color: var(--ink-2); border-bottom: 1px solid var(--line-strong); }
.site-footer a:hover { color: var(--ink); border-color: var(--accent); }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
    .hero { padding: 64px 0 56px; }
    .hero-grid {
        grid-template-columns: 1fr;
        gap: 36px;
    }
    .code-card { max-width: 620px; }

    .section-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    .section-head { position: static; }
    .section-head p { margin-top: 8px; }

    .featured { grid-template-columns: 1fr; }
    .featured-side {
        border-left: 0;
        border-top: 1px solid var(--line);
        padding: 22px 24px 26px;
    }
    .featured-actions { grid-template-columns: 1fr 1fr; }

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

@media (max-width: 720px) {
    .header-inner { gap: 12px; }
    .brand-name { display: none; }

    .nav { position: static; }
    .nav-toggle { display: inline-flex; }
    .nav-links {
        display: none;
        position: absolute;
        left: var(--gutter);
        right: var(--gutter);
        top: 64px;
        flex-direction: column;
        gap: 2px;
        padding: 8px;
        border: 1px solid var(--line);
        border-radius: var(--r-md);
        background: var(--surface);
        box-shadow: 0 20px 40px -20px rgba(0, 0, 0, 0.5);
    }
    .nav-links.open { display: flex; }
    .nav-links a { padding: 10px 12px; font-size: 16px; }

    .section { padding: 52px 0; }
    .section-head h2 { font-size: 32px; }

    .featured-main { padding: 24px 20px 26px; }
    .featured-title { font-size: 34px; }
    .featured-actions { grid-template-columns: 1fr; }

    .projects { grid-template-columns: 1fr; }
    .facts { grid-template-columns: 1fr; }

    .skill-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .skill-row dt { padding-top: 0; }

    .code { font-size: 12px; padding: 16px 14px 18px; }
    .code .pad { display: none; }
    .code .nl { display: inline; }
    .hero-links { gap: 6px 14px; font-size: 14px; }
}

@media (max-width: 400px) {
    .lang-btn { padding: 4px 7px; }
    .code { font-size: 11.5px; }
}

/* ---------- motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    [data-anim] { animation: none; opacity: 1; transform: none; }
    *, *::before, *::after { transition-duration: 0.01ms !important; }
}

/* ---------- print: reads as a one-page CV ---------- */
@media print {
    body { background: #fff; color: #000; }
    body::before, .site-header, .hero-actions, .form, .site-footer a { display: none !important; }
    .section, .featured, .project, .fact, .direct, .code-card { border-color: #bbb; box-shadow: none; }
    .section-grid { grid-template-columns: 1fr; gap: 12px; }
    .section { padding: 24px 0; }
    a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 11px; color: #555; }
}
