/* ============================================================
   Rustin Soraki — academic homepage
   "Parchment & Avocado" — warm, earthy, editorial
   ============================================================ */

:root {
    /* Color tokens */
    --bg: #f0ebdf;            /* warm parchment background */
    --bg-warm: #e8e1d0;       /* deeper parchment — alternating bands / footer */
    --surface: #faf7ef;       /* lifted cream card */
    --primary-color: #29271f; /* warm near-black ink (body text) */
    --secondary-color: #5c5547;/* warm gray (secondary text) */
    --muted-color: #8b8270;   /* faint warm gray (captions, eyebrows) */
    --accent-color: #6b8e23;  /* avocado / olive-drab — primary accent */
    --accent-hover: #567219;  /* deep avocado (hover) */
    --accent-soft: #e8eecb;   /* light avocado tint (icon chips, tinted fills) */
    --caption-bg: #e9e1cf;    /* warm kraft */
    --border-color: #ddd5c2;  /* warm hairline border */
    --border-strong: #c9bda4;
    --ink-block: #242a1a;     /* dark-olive block bg */
    --venue-color: #8a6a3c;   /* muted ochre-brown */
    --accent-rgb: 107, 142, 35;

    /* Type */
    --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
    --font-body: 'Hanken Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'SFMono-Regular', Consolas, Menlo, monospace;

    /* Metrics */
    --radius: 16px;
    --radius-sm: 10px;
    --maxw: 1080px;
    --nav-h: 64px;

    --shadow-sm: 0 1px 2px rgba(41,39,31,0.05), 0 1px 3px rgba(41,39,31,0.06);
    --shadow-md: 0 2px 6px rgba(41,39,31,0.05), 0 10px 28px rgba(41,39,31,0.09);
    --shadow-lg: 0 4px 14px rgba(41,39,31,0.07), 0 22px 48px rgba(41,39,31,0.14);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
    font-size: 15px;
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--nav-h) + 14px);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    line-height: 1.6;
    color: var(--primary-color);
    background-color: var(--bg);
    font-weight: 400;
    letter-spacing: -0.005em;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

/* Subtle paper grain over the whole page */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    opacity: 0.5;
    mix-blend-mode: multiply;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.045'/%3E%3C/svg%3E");
}

.container {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 0 28px;
}

a { color: var(--accent-color); text-decoration-color: rgba(var(--accent-rgb), 0.35); text-underline-offset: 2px; }
a:hover { color: var(--accent-hover); }

::selection { background: rgba(var(--accent-rgb), 0.30); }

/* Crisp inline-SVG link icons (profile rail + footer) */
.ricon {
    width: 18px;
    height: 18px;
    fill: currentColor;
    display: block;
}
.footer-links .ricon {
    width: 16px;
    height: 16px;
}

.skip-link {
    position: absolute;
    left: -999px;
    top: 0;
    z-index: 100;
    background: var(--primary-color);
    color: #f4efe3;
    padding: 10px 16px;
    border-radius: 0 0 10px 0;
    text-decoration: none;
}
.skip-link:focus { left: 0; }

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

/* ============================================================
   Navigation
   ============================================================ */
.nav {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(240, 235, 223, 0.82);
    backdrop-filter: saturate(140%) blur(10px);
    -webkit-backdrop-filter: saturate(140%) blur(10px);
    border-bottom: 1px solid var(--border-color);
}

.nav-inner {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 0 28px;
    height: var(--nav-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.nav-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--primary-color);
    font-weight: 600;
}

.nav-name {
    font-family: var(--font-display);
    font-size: 1.06rem;
    letter-spacing: -0.01em;
}

.nav-links {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-links a {
    display: inline-block;
    padding: 8px 12px;
    color: var(--secondary-color);
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 500;
    border-radius: 8px;
    transition: color 0.15s ease, background-color 0.15s ease;
}

.nav-links a:hover { color: var(--primary-color); background: rgba(var(--accent-rgb), 0.10); }
.nav-links a.is-active { color: var(--accent-hover); }

.nav-cv {
    margin-left: 6px;
    color: #f4efe3 !important;
    background: var(--primary-color);
    box-shadow: var(--shadow-sm);
}
.nav-cv:hover { background: var(--accent-color) !important; color: #fff !important; }

.nav-toggle {
    display: none;
    background: transparent;
    border: 1px solid var(--border-strong);
    color: var(--primary-color);
    width: 40px;
    height: 40px;
    border-radius: 10px;
    font-size: 1rem;
    cursor: pointer;
}

/* ============================================================
   Hero
   ============================================================ */
.hero {
    position: relative;
    padding: clamp(22px, 3.5vw, 38px) 0 clamp(20px, 3vw, 32px);
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(180deg, #f4efe3 0%, var(--bg) 62%);
    overflow: hidden;
}

.hero-glow {
    position: absolute;
    top: -220px;
    left: 50%;
    transform: translateX(-50%);
    width: 900px;
    height: 520px;
    background: radial-gradient(50% 50% at 50% 50%, rgba(var(--accent-rgb), 0.16) 0%, rgba(var(--accent-rgb), 0) 70%);
    pointer-events: none;
}

.hero-inner {
    position: relative;
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: clamp(26px, 4vw, 46px);
    align-items: center;
}

.hero-aside {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.portrait {
    position: relative;
    width: 196px;
    height: 196px;
    border-radius: 18px;
    overflow: hidden;
    background: linear-gradient(150deg, #7d9f3a 0%, #51691d 100%);
    border: 1px solid var(--border-strong);
    box-shadow: var(--shadow-lg);
    display: grid;
    place-items: center;
}

.portrait::after {
    content: "";
    position: absolute;
    inset: 0;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
    border-radius: 18px;
    pointer-events: none;
}

.portrait img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 2;
}

.portrait-mono {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 3.5rem;
    color: rgba(244, 239, 227, 0.92);
    letter-spacing: 0.02em;
    user-select: none;
}

.contact-rail {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 18px;
}

.contact-rail a {
    display: inline-grid;
    place-items: center;
    width: 35px;
    height: 35px;
    border-radius: 11px;
    background: var(--surface);
    border: 1px solid var(--border-color);
    color: var(--secondary-color);
    box-shadow: var(--shadow-sm);
    transition: transform 0.18s ease, color 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
}

.contact-rail a:hover {
    transform: translateY(-2px);
    color: var(--accent-hover);
    border-color: var(--border-strong);
    background: var(--accent-soft);
}

.eyebrow {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--accent-color);
    margin-bottom: 9px;
}

.hero-name {
    font-family: var(--font-display);
    font-optical-sizing: auto;
    font-size: clamp(2.2rem, 4.6vw, 3.3rem);
    font-weight: 600;
    line-height: 1.02;
    letter-spacing: -0.025em;
    margin-bottom: 10px;
}

.hero-affil {
    font-family: var(--font-display);
    font-size: clamp(0.88rem, 1.4vw, 1rem);
    font-weight: 400;
    line-height: 1.45;
    color: #45402f;
    margin-bottom: 13px;
}

.affil-line { display: block; }
.affil-line + .affil-line { margin-top: 5px; }
.affil-role { color: var(--muted-color); }

.hero-lead {
    max-width: 66ch;
    font-size: 1.02rem;
    line-height: 1.6;
    color: var(--secondary-color);
    text-wrap: pretty;
    margin-bottom: 0;
}
.hero-lead strong { color: var(--primary-color); font-weight: 600; }

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

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 20px;
    background-color: var(--primary-color);
    color: #f4efe3;
    text-decoration: none;
    border-radius: 999px;
    font-size: 0.92rem;
    font-weight: 500;
    letter-spacing: -0.005em;
    box-shadow: 0 1px 2px rgba(41,39,31,0.22);
    transition: transform 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease, color 0.18s ease;
}
.btn:hover {
    background-color: var(--accent-color);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 7px 18px rgba(var(--accent-rgb), 0.34);
}

.btn-ghost {
    background-color: transparent;
    color: var(--primary-color);
    border: 1px solid var(--border-strong);
    box-shadow: none;
}
.btn-ghost:hover {
    background-color: var(--surface);
    color: var(--accent-hover);
    border-color: var(--border-strong);
    box-shadow: var(--shadow-sm);
}

/* ============================================================
   Sections
   ============================================================ */
.section {
    position: relative;
    z-index: 2;
    padding: clamp(20px, 3vw, 32px) 0;
}

.section--alt {
    background: var(--bg-warm);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.section-eyebrow {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-mono);
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent-color);
    margin-bottom: 13px;
}

.section-num {
    color: var(--muted-color);
    font-weight: 600;
}
.section-num::after {
    content: "";
    display: inline-block;
    width: 26px;
    height: 1px;
    background: var(--border-strong);
    vertical-align: middle;
    margin-left: 12px;
}

.section-title {
    font-family: var(--font-display);
    font-optical-sizing: auto;
    font-size: clamp(1.45rem, 3vw, 1.95rem);
    font-weight: 600;
    letter-spacing: -0.018em;
    line-height: 1.12;
    margin-bottom: 9px;
    text-wrap: balance;
}

.section-intro {
    max-width: 62ch;
    font-size: 1rem;
    color: var(--secondary-color);
    line-height: 1.6;
    margin-bottom: 14px;
    text-wrap: pretty;
}
.section-intro .me { color: var(--primary-color); font-weight: 700; }
.section-intro a { font-weight: 500; }

/* About — callout card with drop cap */
.about-card {
    max-width: 1000px;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-left: 3px solid var(--accent-color);
    border-radius: var(--radius);
    padding: 22px 26px;
    box-shadow: var(--shadow-sm);
}
.about-card p { font-size: 1rem; line-height: 1.66; color: #413c30; text-wrap: pretty; }
.about-card p + p { margin-top: 10px; }
.about-card a { font-weight: 600; }
.about-card p:first-of-type::first-letter {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 2.7rem;
    line-height: 0.8;
    float: left;
    margin: 0.06em 0.1em 0 0;
    color: var(--accent-color);
}

/* Research cards */
.cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 19px 21px 21px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }

.card-icon {
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--accent-soft);
    color: var(--accent-color);
    font-size: 1.12rem;
    margin-bottom: 12px;
}

.card h3 {
    font-family: var(--font-display);
    font-optical-sizing: auto;
    font-size: 1.12rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin-bottom: 5px;
}
.card p { font-size: 0.95rem; line-height: 1.55; color: var(--secondary-color); }

/* News — vertical timeline */
.news {
    list-style: none;
    max-width: 600px;
    margin-top: 2px;
}

.news-item {
    position: relative;
    padding: 0 0 19px 32px;
}
.news-item:last-child { padding-bottom: 0; }

/* node dot on the rail */
.news-item::before {
    content: "";
    position: absolute;
    left: 0;
    top: 5px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent-color);
    box-shadow: 0 0 0 4px var(--bg);
    z-index: 1;
}
/* highlight the most recent entry */
.news-item:first-child::before {
    box-shadow: 0 0 0 4px var(--bg), 0 0 0 6px var(--accent-soft);
}

/* connector running down to the next node */
.news-item::after {
    content: "";
    position: absolute;
    left: 5px;
    top: 20px;
    bottom: -10px;
    width: 2px;
    background: var(--border-strong);
}
.news-item:last-child::after { display: none; }

.news-date {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent-hover);
    margin-bottom: 4px;
}

.news-body {
    display: block;
    font-size: 0.98rem;
    line-height: 1.55;
    color: var(--secondary-color);
    text-wrap: pretty;
}
.news-body strong { color: var(--primary-color); font-weight: 600; }
.news-body a { font-weight: 500; white-space: nowrap; color: var(--accent-color); }
.news-body a:hover { color: var(--accent-hover); }

/* ============================================================
   Publications
   ============================================================ */
.pub-list {
    display: flex;
    flex-direction: column;
    border-top: 1px solid var(--border-color);
}

.pub {
    padding: 14px 4px 15px 16px;
    border-bottom: 1px solid var(--border-color);
    border-left: 3px solid transparent;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}
.pub:hover { background: rgba(var(--accent-rgb), 0.05); }

.pub--lead { border-left-color: var(--accent-color); }

.pub-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 4px;
}

.pub-title {
    flex: 1 1 auto;
    min-width: 0;
    font-family: var(--font-display);
    font-optical-sizing: auto;
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.27;
    letter-spacing: -0.012em;
    margin: 0;
}
.pub-title a { color: var(--primary-color); text-decoration: none; transition: color 0.15s ease; }
.pub-title a:hover { color: var(--accent-hover); }

.pub-row .venue-badge { flex: 0 0 auto; }

.pub-authors {
    font-size: 0.92rem;
    line-height: 1.45;
    color: var(--secondary-color);
    margin-bottom: 9px;
}
.pub-authors .me { color: var(--primary-color); font-weight: 700; }
.pub-eq { color: var(--muted-color); font-size: 0.82em; white-space: nowrap; }

.venue-badge {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.74rem;
    font-weight: 500;
    letter-spacing: 0.03em;
    color: var(--venue-color);
    background: var(--caption-bg);
    border: 1px solid var(--border-color);
    padding: 4px 10px;
    border-radius: 7px;
}
.venue-badge--accent {
    color: var(--accent-hover);
    background: var(--accent-soft);
    border-color: rgba(var(--accent-rgb), 0.25);
}

.lead-tag {
    font-family: var(--font-mono);
    font-size: 0.66rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent-color);
    white-space: nowrap;
    margin-left: 9px;
}
.lead-tag::before { content: "\2726"; margin-right: 5px; }

.pub-links { display: flex; flex-wrap: wrap; gap: 6px; }

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 11px;
    font-size: 0.77rem;
    font-weight: 500;
    color: var(--secondary-color);
    background: var(--bg);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    text-decoration: none;
    transition: transform 0.15s ease, color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}
.chip:hover {
    color: var(--accent-hover);
    border-color: var(--border-strong);
    background: var(--accent-soft);
    transform: translateY(-1px);
}
.chip i { font-size: 0.8rem; }

/* ============================================================
   Footer / Contact
   ============================================================ */
.footer {
    position: relative;
    z-index: 2;
    background: var(--ink-block);
    color: #d9dcc6;
    padding: clamp(28px, 4vw, 40px) 0 24px;
    text-align: center;
    border-top: 1px solid #323a27;
}

.footer-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    font-family: var(--font-mono);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #9fb56a;
    margin-bottom: 11px;
}
.footer-num {
    color: #6f7757;
    font-weight: 600;
}
.footer-num::after {
    content: "";
    display: inline-block;
    width: 24px;
    height: 1px;
    background: #444c34;
    vertical-align: middle;
    margin-left: 11px;
}

.footer-title {
    font-family: var(--font-display);
    font-size: clamp(1.55rem, 3.2vw, 2.05rem);
    font-weight: 600;
    color: #f2efe2;
    letter-spacing: -0.02em;
    margin-bottom: 9px;
}

.footer-lead {
    max-width: 60ch;
    margin: 0 auto 22px;
    font-size: 0.98rem;
    line-height: 1.6;
    color: #c2c5ad;
}

/* Email — the focal point of the contact block */
.footer-email {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin: 0 auto 20px;
}
.footer-email-link {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-mono);
    font-size: clamp(1.02rem, 2.3vw, 1.4rem);
    font-weight: 500;
    letter-spacing: -0.01em;
    color: #f2efe2;
    text-decoration: none;
    padding-bottom: 4px;
    background-image: linear-gradient(var(--accent-color), var(--accent-color));
    background-size: 0% 2px;
    background-position: 0 100%;
    background-repeat: no-repeat;
    transition: background-size 0.32s cubic-bezier(0.22, 0.61, 0.36, 1), color 0.2s ease;
}
.footer-email-link .ricon {
    width: 22px;
    height: 22px;
    color: #9fb56a;
    flex: none;
}
.footer-email-link:hover {
    color: #fff;
    background-size: 100% 2px;
}
.footer-email-link:hover .ricon { color: var(--accent-color); }

.footer-copy {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    flex: none;
    border-radius: 10px;
    border: 1px solid #3c4530;
    background: rgba(255, 255, 255, 0.04);
    color: #b9bd9c;
    font-size: 0.92rem;
    cursor: pointer;
    transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}
.footer-copy:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: #56603f;
    color: #eef0dd;
}
.footer-copy[data-copied="true"] {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: #fff;
}
.footer-copy::after {
    content: "Copied";
    position: absolute;
    bottom: calc(100% + 9px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    padding: 4px 9px;
    border-radius: 7px;
    background: var(--accent-color);
    color: #fff;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
}
.footer-copy[data-copied="true"]::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Profile links — quiet secondary line (the prominent rail lives in the hero) */
.footer-elsewhere {
    list-style: none;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 22px;
}
.footer-elsewhere li { display: inline-flex; align-items: center; }
.footer-elsewhere li + li::before {
    content: "\00B7";
    margin: 0 13px;
    color: #5b6248;
}
.footer-elsewhere a {
    font-size: 0.86rem;
    font-weight: 500;
    color: #aeb491;
    text-decoration: none;
    transition: color 0.16s ease;
}
.footer-elsewhere a:hover { color: #d6e89b; }

.footer-fine {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: #8e9472;
    letter-spacing: 0.02em;
}

/* ============================================================
   Hero load animation (pure CSS — no JS dependency)
   ============================================================ */
@media (prefers-reduced-motion: no-preference) {
    @keyframes rise {
        from { opacity: 0; transform: translateY(16px); }
        to   { opacity: 1; transform: none; }
    }
    .hero .reveal { animation: rise 0.7s cubic-bezier(0.22, 0.61, 0.36, 1) both; }
    .hero-aside.reveal       { animation-delay: 0.04s; }
    .hero-main .eyebrow      { animation-delay: 0.10s; }
    .hero-main .hero-name    { animation-delay: 0.16s; }
    .hero-main .hero-affil   { animation-delay: 0.22s; }
    .hero-main .contact-rail { animation-delay: 0.28s; }
    .hero-main .hero-lead    { animation-delay: 0.28s; }
    .hero-main .hero-actions { animation-delay: 0.34s; }
}

/* Below-the-fold scroll reveal — gated by html.js so content is NEVER
   permanently hidden if JS is disabled or the observer fails to fire. */
@media (prefers-reduced-motion: no-preference) {
    .js .reveal-up { opacity: 0; transform: translateY(18px); }
    .js .reveal-up.in {
        opacity: 1;
        transform: none;
        transition: opacity 0.7s cubic-bezier(0.22, 0.61, 0.36, 1), transform 0.7s cubic-bezier(0.22, 0.61, 0.36, 1);
    }
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 860px) {
    .nav-toggle { display: inline-grid; place-items: center; }

    .nav-links {
        position: absolute;
        top: var(--nav-h);
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 2px;
        padding: 12px 18px 18px;
        background: #f1ecdf;
        border-bottom: 1px solid var(--border-color);
        box-shadow: var(--shadow-lg);
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        pointer-events: none;
        transition: max-height 0.28s ease, opacity 0.2s ease;
        z-index: 60;
    }
    .nav-links.open { max-height: 420px; opacity: 1; pointer-events: auto; }
    .nav-links a { padding: 12px 12px; border-radius: 8px; }
    .nav-cv { margin-left: 0; margin-top: 6px; justify-content: center; text-align: center; }

    .hero-inner { grid-template-columns: 1fr; gap: 22px; }
    .hero-aside { flex-direction: row; align-items: center; gap: 22px; justify-content: flex-start; }
    .portrait { width: 140px; height: 140px; border-radius: 16px; }
    .portrait-mono { font-size: 2.6rem; }
    .hero-lead { max-width: none; }

    .cards { grid-template-columns: 1fr; gap: 14px; }
}

@media (max-width: 520px) {
    .container { padding: 0 20px; }
    .nav-inner { padding: 0 20px; }

    .hero-aside { flex-direction: column; align-items: flex-start; }
    .portrait { width: 124px; height: 124px; }

    .pub { padding: 13px 0 14px 14px; }
    .pub-row { flex-direction: column; align-items: flex-start; gap: 6px; }

    .news-item { padding-left: 28px; padding-bottom: 17px; }

    .about-card { padding: 24px 22px; }
    .hero-actions .btn { flex: 1 1 auto; justify-content: center; }
}

/* ============================================================
   Print
   ============================================================ */
@media print {
    .nav, .hero-glow, .nav-toggle { display: none; }
    body::before { display: none; }
    .section--alt, .footer { background: #fff; color: #000; }
    a { color: #000; }
}
