/* ==========================================================================
   Juan Camilo García Cano — personal site
   Research-first, clean layout with light & dark themes.
   ========================================================================== */

:root {
    --bg: #fbfbf9;
    --bg-alt: #f3f3ef;
    --surface: #ffffff;
    --text: #1b1d22;
    --text-muted: #5b606b;
    --text-faint: #8a8f99;
    --border: #e4e4de;
    --accent: #3f4fc8;
    --accent-strong: #2f3cab;
    --accent-soft: #eceefc;
    --accent-contrast: #ffffff;
    --success: #0f7a55;
    --danger: #b42318;
    --shadow-sm: 0 1px 2px rgba(20, 22, 30, 0.05);
    --shadow-md: 0 6px 24px -8px rgba(20, 22, 30, 0.14);

    --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-serif: "Newsreader", "Iowan Old Style", Georgia, serif;

    --radius-sm: 8px;
    --radius: 14px;
    --max: 1080px;
    --gutter: clamp(16px, 4vw, 32px);
    --header-h: 64px;
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #111317;
        --bg-alt: #16191e;
        --surface: #1a1d23;
        --text: #eceef2;
        --text-muted: #a3a8b3;
        --text-faint: #767c88;
        --border: #2a2e36;
        --accent: #9aa6ff;
        --accent-strong: #b8c0ff;
        --accent-soft: #232845;
        --accent-contrast: #111317;
        --success: #4ccf9a;
        --danger: #ff8a80;
        --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
        --shadow-md: 0 8px 28px -10px rgba(0, 0, 0, 0.6);
        color-scheme: dark;
    }
}

:root[data-theme="dark"] {
    --bg: #111317;
    --bg-alt: #16191e;
    --surface: #1a1d23;
    --text: #eceef2;
    --text-muted: #a3a8b3;
    --text-faint: #767c88;
    --border: #2a2e36;
    --accent: #9aa6ff;
    --accent-strong: #b8c0ff;
    --accent-soft: #232845;
    --accent-contrast: #111317;
    --success: #4ccf9a;
    --danger: #ff8a80;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 28px -10px rgba(0, 0, 0, 0.6);
    color-scheme: dark;
}

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

* { margin: 0; }

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

body {
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.65;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-strong); }

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

h1, h2, h3 { line-height: 1.2; font-weight: 600; }

.container {
    width: 100%;
    max-width: var(--max);
    margin: 0 auto;
    padding: 0 var(--gutter);
}

.skip-link {
    position: absolute;
    left: 12px;
    top: -60px;
    padding: 8px 14px;
    background: var(--accent);
    color: var(--accent-contrast);
    border-radius: var(--radius-sm);
    z-index: 2000;
}
.skip-link:focus { top: 12px; color: var(--accent-contrast); }

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

/* ---------- Header ---------- */
.header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: color-mix(in srgb, var(--bg) 85%, transparent);
    backdrop-filter: saturate(160%) blur(12px);
    -webkit-backdrop-filter: saturate(160%) blur(12px);
    border-bottom: 1px solid transparent;
    transition: border-color .2s ease;
}
.header.scrolled { border-bottom-color: var(--border); }
.header:has(.nav-links.open) { background: var(--bg); }

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    height: var(--header-h);
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: var(--text);
    letter-spacing: -0.01em;
    white-space: nowrap;
}
.logo:hover { color: var(--text); }
.logo-mark {
    display: grid;
    place-items: center;
    width: 32px; height: 32px;
    border-radius: 9px;
    background: var(--accent);
    color: var(--accent-contrast);
    font-family: var(--font-serif);
    font-size: 1rem;
    font-weight: 600;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
    list-style: none;
    padding: 0;
}
.nav-links a {
    display: block;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    transition: color .15s ease, background .15s ease;
}
.nav-links a:hover { color: var(--text); background: var(--bg-alt); }
.nav-links a.active,
.nav-links a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }

.nav-actions { display: flex; align-items: center; gap: 6px; }

.icon-btn {
    display: inline-grid;
    place-items: center;
    width: 38px; height: 38px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    cursor: pointer;
    transition: color .15s ease, border-color .15s ease;
}
.icon-btn:hover { color: var(--text); border-color: var(--text-faint); }
.icon-btn svg { width: 18px; height: 18px; }

.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: block; }
    :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
}

.menu-btn { display: none; }

/* ---------- Buttons & chips ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 999px;
    font-size: 0.95rem;
    font-weight: 500;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background .15s ease, color .15s ease, border-color .15s ease, transform .15s ease;
    font-family: inherit;
}
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--accent); color: var(--accent-contrast); }
.btn-primary:hover { background: var(--accent-strong); color: var(--accent-contrast); }
.btn-ghost { border-color: var(--border); color: var(--text); background: var(--surface); }
.btn-ghost:hover { border-color: var(--text-faint); color: var(--text); }

.chip-row { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; }
.chip {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 500;
    background: var(--bg-alt);
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.text-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.9rem;
    font-weight: 500;
}
.text-link svg { width: 14px; height: 14px; transition: transform .15s ease; }
.text-link:hover svg { transform: translate(2px, -2px); }

/* ---------- Hero ---------- */
.hero { padding: clamp(48px, 9vw, 104px) 0 clamp(40px, 7vw, 80px); }

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

.eyebrow {
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 14px;
}

.hero h1 {
    font-family: var(--font-serif);
    font-weight: 500;
    font-size: clamp(2.4rem, 6vw, 3.9rem);
    letter-spacing: -0.02em;
    line-height: 1.05;
    margin-bottom: 20px;
}

.hero-lead {
    font-size: clamp(1.05rem, 2vw, 1.2rem);
    color: var(--text-muted);
    max-width: 38em;
    margin-bottom: 24px;
}
.hero-lead strong { color: var(--text); font-weight: 600; }

.status {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 6px 14px 6px 10px;
    border-radius: 999px;
    background: var(--surface);
    border: 1px solid var(--border);
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 28px;
}
.status-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--success) 20%, transparent);
}

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

.social-row { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; }
.social-row a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.875rem;
    color: var(--text-muted);
    border: 1px solid var(--border);
    background: var(--surface);
}
.social-row a:hover { color: var(--text); border-color: var(--text-faint); }
.social-row svg { width: 16px; height: 16px; }

.glance {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}
.glance h2 {
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-faint);
    margin-bottom: 8px;
}
.glance dl { display: grid; gap: 0; }
.glance-row {
    padding: 14px 0;
    border-top: 1px solid var(--border);
}
.glance-row:first-child { border-top: 0; }
.glance dt {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-faint);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 2px;
}
.glance dd { font-size: 0.95rem; color: var(--text); }
.glance dd span { display: block; color: var(--text-muted); font-size: 0.875rem; }

/* ---------- Sections ---------- */
.section { padding: clamp(56px, 8vw, 96px) 0; }
.section-alt { background: var(--bg-alt); border-block: 1px solid var(--border); }

.section-head { margin-bottom: clamp(28px, 4vw, 44px); max-width: 44em; }
.section-kicker {
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 8px;
}
.section-title {
    font-family: var(--font-serif);
    font-weight: 500;
    font-size: clamp(1.8rem, 3.6vw, 2.4rem);
    letter-spacing: -0.015em;
}
.section-intro { margin-top: 12px; color: var(--text-muted); font-size: 1.05rem; }

/* ---------- Research interests ---------- */
.interest-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}
.interest-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
}
.interest-icon {
    display: grid;
    place-items: center;
    width: 40px; height: 40px;
    border-radius: 10px;
    background: var(--accent-soft);
    color: var(--accent);
    margin-bottom: 16px;
}
.interest-icon svg { width: 20px; height: 20px; }
.interest-card h3 { font-size: 1rem; margin-bottom: 6px; }
.interest-card p { font-size: 0.9rem; color: var(--text-muted); line-height: 1.55; }

/* ---------- Selected work ---------- */
.work-list { display: grid; gap: 20px; }

.work-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: box-shadow .2s ease, border-color .2s ease;
}
.work-card:hover { box-shadow: var(--shadow-md); }

.work-media {
    position: relative;
    background: var(--bg-alt);
    min-height: 240px;
}
.work-media img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.work-media.illustration {
    display: grid;
    place-items: center;
    background:
        radial-gradient(120% 80% at 20% 10%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 60%),
        radial-gradient(90% 70% at 90% 90%, color-mix(in srgb, var(--success) 16%, transparent), transparent 60%),
        var(--accent-soft);
}
.chat-illustration { width: min(78%, 320px); display: grid; gap: 10px; padding: 24px 0; }
.bubble {
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 0.85rem;
    line-height: 1.4;
    max-width: 85%;
    box-shadow: var(--shadow-sm);
}
.bubble.user { justify-self: end; background: var(--accent); color: var(--accent-contrast); border-bottom-right-radius: 4px; }
.bubble.bot { background: var(--surface); color: var(--text); border: 1px solid var(--border); border-bottom-left-radius: 4px; }

.work-body { padding: clamp(22px, 3vw, 32px); display: flex; flex-direction: column; gap: 12px; }
.work-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 2px 12px;
    font-size: 0.8rem;
    line-height: 1.5;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-faint);
}
.work-meta .tag-accent { color: var(--accent); }
.work-body h3 { font-family: var(--font-serif); font-weight: 500; font-size: 1.45rem; letter-spacing: -0.01em; }
.work-body p { color: var(--text-muted); font-size: 0.95rem; }
.work-links { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: auto; padding-top: 4px; }

.work-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}
.work-grid-2 .work-card { grid-template-columns: 1fr; }
.work-grid-2 .work-media { min-height: 0; aspect-ratio: 16 / 9; }

/* ---------- Publications ---------- */
.pub-list { list-style: none; padding: 0; display: grid; gap: 16px; }
.pub {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    gap: 24px;
    padding: 22px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.pub-thumb {
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--bg-alt);
    aspect-ratio: 4 / 3;
}
.pub-thumb img { width: 100%; height: 100%; object-fit: cover; }
.pub-venue {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 6px;
}
.pub-venue .year { color: var(--text-faint); }
.pub h3 { font-size: 1.1rem; margin-bottom: 6px; }
.pub-authors { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 8px; }
.pub-authors .me { color: var(--text); font-weight: 600; }
.pub-abstract { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 12px; }
.pub-links { display: flex; flex-wrap: wrap; gap: 8px 18px; }

/* ---------- Timeline (experience / education) ---------- */
.timeline { list-style: none; padding: 0; display: grid; }
.timeline-item {
    display: grid;
    grid-template-columns: 170px minmax(0, 1fr);
    gap: 28px;
    padding: 26px 0;
    border-top: 1px solid var(--border);
}
.timeline-item:first-child { border-top: 0; padding-top: 0; }
.timeline-date {
    font-size: 0.875rem;
    font-variant-numeric: tabular-nums;
    color: var(--text-faint);
    padding-top: 3px;
}
.timeline-date .now {
    display: inline-block;
    margin-top: 6px;
    padding: 1px 8px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--success);
    background: color-mix(in srgb, var(--success) 12%, transparent);
}
.timeline-item h3 { font-size: 1.08rem; margin-bottom: 2px; }
.timeline-org { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 10px; }
.timeline-org .loc { color: var(--text-faint); }
.timeline-item ul { padding-left: 1.1em; color: var(--text-muted); font-size: 0.95rem; display: grid; gap: 4px; }
.timeline-item ul li::marker { color: var(--text-faint); }
.timeline-item .chip-row { margin-top: 12px; }
.highlight {
    display: inline-block;
    margin-bottom: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--success);
}

.two-col {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: clamp(32px, 6vw, 72px);
}

/* ---------- Skills ---------- */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}
.skill-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
}
.skill-card h3 {
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-faint);
    margin-bottom: 12px;
}

.extras {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 16px;
    margin-top: 16px;
}
.lang-list { list-style: none; padding: 0; display: grid; gap: 12px; }
.lang {
    display: grid;
    grid-template-columns: 90px minmax(0, 1fr) 64px;
    align-items: center;
    gap: 12px;
    font-size: 0.92rem;
}
.lang-bar { height: 6px; border-radius: 999px; background: var(--bg-alt); border: 1px solid var(--border); overflow: hidden; }
.lang-bar span { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.lang-level { font-size: 0.82rem; color: var(--text-faint); text-align: right; }

/* ---------- Contact ---------- */
.contact-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
    gap: clamp(32px, 6vw, 72px);
    align-items: start;
}
.contact-list { list-style: none; padding: 0; display: grid; gap: 4px; margin-top: 24px; }
.contact-list li a,
.contact-list li > span {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    margin: 0 -12px;
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.95rem;
}
.contact-list li a:hover { background: var(--surface); color: var(--text); }
.contact-list svg { width: 18px; height: 18px; color: var(--text-faint); flex: none; }
.contact-list .label { color: var(--text-faint); font-size: 0.85rem; margin-left: auto; }

.contact-form {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: clamp(20px, 3vw, 28px);
    display: grid;
    gap: 16px;
    box-shadow: var(--shadow-sm);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-group { display: grid; gap: 6px; }
.form-group label { font-size: 0.85rem; font-weight: 500; color: var(--text-muted); }
.form-group input,
.form-group textarea {
    width: 100%;
    font: inherit;
    font-size: 0.95rem;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.form-group textarea { resize: vertical; min-height: 130px; }
.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}
.form-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.form-status { font-size: 0.9rem; min-height: 1.4em; }
.form-status.success { color: var(--success); }
.form-status.error { color: var(--danger); }
.btn[disabled] { opacity: .6; cursor: progress; }

/* ---------- Footer ---------- */
.footer { padding: 32px 0 40px; border-top: 1px solid var(--border); }
.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 0.875rem;
    color: var(--text-faint);
}
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-links a { color: var(--text-muted); }
.footer-links a:hover { color: var(--text); }

/* ---------- Projects page ---------- */
.page-hero { padding: clamp(48px, 8vw, 88px) 0 clamp(24px, 4vw, 40px); }
.page-hero h1 {
    font-family: var(--font-serif);
    font-weight: 500;
    font-size: clamp(2.2rem, 5vw, 3.2rem);
    letter-spacing: -0.02em;
    margin-bottom: 12px;
}
.page-hero p:not(.eyebrow) { color: var(--text-muted); font-size: 1.1rem; max-width: 40em; }

.project-group { padding: 24px 0 32px; }
.project-group h2 {
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-faint);
    margin-bottom: 16px;
}
.project-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}
.project-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 22px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    transition: border-color .15s ease, box-shadow .2s ease, transform .2s ease;
}
.project-card:hover { color: var(--text); border-color: var(--text-faint); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.project-card h3 { font-size: 1.05rem; display: flex; justify-content: space-between; gap: 8px; }
.project-card h3 svg { width: 16px; height: 16px; color: var(--text-faint); flex: none; margin-top: 3px; }
.project-card p { color: var(--text-muted); font-size: 0.92rem; flex: 1; }
.lang-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 0.82rem; color: var(--text-muted); }
.lang-tag::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--dot, var(--text-faint)); }
.lang-tag.csharp { --dot: #178600; }
.lang-tag.typescript { --dot: #3178c6; }
.lang-tag.javascript { --dot: #d9b800; }
.lang-tag.html { --dot: #e34c26; }
.lang-tag.css { --dot: #663399; }

.cta-band {
    margin: 32px 0 72px;
    padding: clamp(24px, 4vw, 40px);
    border-radius: var(--radius);
    background: var(--accent-soft);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}
.cta-band h2 { font-family: var(--font-serif); font-weight: 500; font-size: 1.6rem; margin-bottom: 4px; }
.cta-band p { color: var(--text-muted); }
.cta-band .hero-actions { margin: 0; }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(12px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .reveal { opacity: 1; transform: none; transition: none; }
    * { transition: none !important; }
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
    .interest-grid,
    .skills-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
    .menu-btn { display: inline-grid; }
    .nav-links {
        position: absolute;
        top: var(--header-h);
        left: 0; right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 2px;
        padding: 12px var(--gutter) 20px;
        background: var(--bg);
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow-md);
        display: none;
    }
    .nav-links.open { display: flex; }
    .nav-links a { padding: 10px 12px; border-radius: var(--radius-sm); font-size: 1rem; }

    .hero-grid,
    .contact-grid,
    .two-col { grid-template-columns: 1fr; }

    .work-card { grid-template-columns: 1fr; }
    .work-media { min-height: 0; aspect-ratio: 16 / 9; }
    .work-media.illustration { aspect-ratio: auto; }
    .work-grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .interest-grid,
    .skills-grid,
    .project-grid,
    .extras { grid-template-columns: 1fr; }
    .pub { grid-template-columns: 1fr; gap: 16px; }
    .pub-thumb { aspect-ratio: 16 / 9; }
    .timeline-item { grid-template-columns: 1fr; gap: 6px; }
    .form-row { grid-template-columns: 1fr; }
    .logo-text { display: none; }
    .lang { grid-template-columns: 80px minmax(0, 1fr) 56px; }
}
