/* =========================================================================
   Public site — editorial academic design system
   Neutral warm-white ground, one institutional blue accent, serif display
   type (Source Serif 4) over a clean sans (Inter). Hairline structure
   instead of heavy cards. Light / dark / system themes.
   ========================================================================= */

:root {
    --bg: #fbfbf9;
    --bg-alt: #f3f2ee;
    --surface: #ffffff;
    --text: #16181d;
    --text-2: #3b404b;
    --muted: #646a76;
    --line: #e4e2dc;
    --line-strong: #cdcac1;
    --accent: #1d4d80;
    --accent-ink: #ffffff;
    --accent-soft: #e8eef6;
    --accent-text: #1d4d80;
    --focus: #2f6fb3;
    --success: #2b6a3d;
    --danger: #a3312a;
    --t-journal: #1d4d80;      --t-journal-bg: #e8eef6;
    --t-conference: #7a4a0c;   --t-conference-bg: #f6eddd;
    --t-book: #5a3c86;         --t-book-bg: #eee8f5;
    --t-other: #555b66;        --t-other-bg: #edede9;
    --radius: 6px;
    --wrap: 1120px;
    --header-h: 68px;
    --serif: "Source Serif 4", "Source Serif Pro", Georgia, "Times New Roman", serif;
    --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #111318; --bg-alt: #161920; --surface: #171a21;
        --text: #eceae5; --text-2: #c9c7c1; --muted: #9a9fab;
        --line: #262a33; --line-strong: #363b46;
        --accent: #8ab6e8; --accent-ink: #0d1622; --accent-soft: #1b2738; --accent-text: #9cc3ee; --focus: #9cc3ee;
        --success: #7cc48f; --danger: #f08a80;
        --t-journal: #9cc3ee;    --t-journal-bg: #1b2738;
        --t-conference: #e2b776; --t-conference-bg: #2a2217;
        --t-book: #c5aee9;       --t-book-bg: #241d31;
        --t-other: #b4b8c1;      --t-other-bg: #22252c;
        color-scheme: dark;
    }
}
:root[data-theme="dark"] {
    --bg: #111318; --bg-alt: #161920; --surface: #171a21;
    --text: #eceae5; --text-2: #c9c7c1; --muted: #9a9fab;
    --line: #262a33; --line-strong: #363b46;
    --accent: #8ab6e8; --accent-ink: #0d1622; --accent-soft: #1b2738; --accent-text: #9cc3ee; --focus: #9cc3ee;
    --success: #7cc48f; --danger: #f08a80;
    --t-journal: #9cc3ee;    --t-journal-bg: #1b2738;
    --t-conference: #e2b776; --t-conference-bg: #2a2217;
    --t-book: #c5aee9;       --t-book-bg: #241d31;
    --t-other: #b4b8c1;      --t-other-bg: #22252c;
    color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
    margin: 0; background: var(--bg); color: var(--text);
    font: 400 16px/1.65 var(--sans);
    -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a {
    color: var(--accent-text); text-decoration: underline; text-decoration-thickness: 1px;
    text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent);
}
a:hover { text-decoration-color: currentColor; }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; color: var(--text); line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.005em; }
p { margin: 0 0 1em; }
em { font-style: italic; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 3px; }
.site-main:focus { outline: none; }
.visually-hidden {
    position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link {
    position: absolute; left: 12px; top: -48px; z-index: 100; padding: 10px 14px;
    background: var(--accent); color: var(--accent-ink); border-radius: var(--radius); font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 12px; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 28px; }
@media (max-width: 640px) { .wrap { padding: 0 18px; } }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.empty { color: var(--muted); font-style: italic; }
.fine-print { font-size: .8rem; color: var(--muted); margin-top: 8px; }

/* ---------- Header ---------- */
.site-header {
    position: sticky; top: 0; z-index: 40;
    background: color-mix(in srgb, var(--bg) 90%, transparent);
    -webkit-backdrop-filter: saturate(1.4) blur(10px); backdrop-filter: saturate(1.4) blur(10px);
    border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 20px; min-height: var(--header-h); }
.brand { display: flex; flex-direction: column; color: var(--text); text-decoration: none; line-height: 1.25; margin-right: auto; min-width: 0; }
.brand-name { font-family: var(--serif); font-weight: 600; font-size: 1.06rem; }
.brand-meta { font-size: .74rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.primary-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 1px; }
.nav-link {
    display: block; position: relative; padding: 8px 9px; border-radius: 4px;
    font-size: .84rem; font-weight: 500; color: var(--text-2); text-decoration: none;
}
.nav-link:hover { color: var(--text); background: var(--bg-alt); }
.nav-link.is-active { color: var(--accent-text); }
.nav-link.is-active::after {
    content: ""; position: absolute; left: 9px; right: 9px; bottom: calc((var(--header-h) - 38px) / -2);
    height: 2px; background: var(--accent);
}
.header-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
    width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; padding: 0;
    border: 1px solid var(--line); background: var(--surface); color: var(--text-2);
    border-radius: var(--radius); cursor: pointer; font-size: .95rem; line-height: 1;
}
.icon-btn:hover { border-color: var(--line-strong); color: var(--text); }
.menu-btn { display: none; }
@media (max-width: 1180px) { .primary-nav { display: none; } .menu-btn { display: inline-flex; } }
@media (max-width: 560px) { .cv-btn, .brand-meta { display: none; } }

/* ---------- Drawer ---------- */
.drawer[hidden] { display: none; }
.drawer { position: fixed; inset: 0; z-index: 60; }
.drawer-backdrop { position: absolute; inset: 0; background: rgba(10, 12, 16, .45); }
.drawer-panel {
    position: absolute; top: 0; right: 0; height: 100%; width: min(340px, 88vw);
    background: var(--surface); border-left: 1px solid var(--line);
    padding: 18px 22px 28px; overflow-y: auto; display: flex; flex-direction: column; gap: 18px;
    animation: drawer-in .2s ease-out;
}
@keyframes drawer-in { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer-head { display: flex; align-items: center; justify-content: space-between; }
.drawer-nav { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.drawer-nav a { display: block; padding: 12px 2px; border-bottom: 1px solid var(--line); color: var(--text); text-decoration: none; font-weight: 500; }
.drawer-nav a.is-active { color: var(--accent-text); }
.drawer-profiles { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: .88rem; }
body.drawer-open { overflow: hidden; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 10px 18px; border: 1px solid transparent; border-radius: var(--radius);
    font: 500 .9rem/1.2 var(--sans); text-decoration: none; cursor: pointer; white-space: nowrap;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.btn-sm { padding: 7px 12px; font-size: .82rem; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 85%, var(--text)); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--line-strong); }
.btn-secondary:hover { border-color: var(--text-2); }
.btn-ghost { background: transparent; color: var(--accent-text); }
.btn-ghost:hover { background: var(--accent-soft); }
.link-btn {
    background: none; border: 0; padding: 0; font: inherit; color: var(--accent-text); cursor: pointer;
    text-decoration: underline; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent);
}
.link-btn:hover { text-decoration-color: currentColor; }

/* ---------- Page structure ---------- */
.section { padding: 64px 0; border-top: 1px solid var(--line); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 26px; }
.section-head h2 { font-size: 1.55rem; margin: 0; }
.section-link { font-size: .9rem; font-weight: 500; }
.section-note { font-size: .82rem; color: var(--muted); margin: 12px 0 0; }
.section-intro { color: var(--muted); font-size: .92rem; margin: -8px 0 20px; }
.eyebrow { font: 600 .74rem/1.4 var(--sans); letter-spacing: .09em; text-transform: uppercase; color: var(--accent-text); margin: 0 0 10px; }
.page-head { padding: 56px 0 32px; border-bottom: 1px solid var(--line); margin-bottom: 40px; }
.page-head h1 { font-size: clamp(2rem, 4vw, 2.7rem); margin-bottom: .3em; }
.lead { font-size: 1.08rem; color: var(--text-2); max-width: 68ch; margin: 0; }
.page-section { margin-bottom: 56px; }
.page-section > h2 { font-size: 1.35rem; padding-bottom: 10px; border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.split { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 56px; align-items: start; margin-bottom: 40px; }
.split-aside { display: grid; gap: 16px; position: sticky; top: calc(var(--header-h) + 24px); }
@media (max-width: 920px) { .split { grid-template-columns: 1fr; gap: 12px; } .split-aside { position: static; } }
.aside-box { padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.aside-box p:last-child { margin-bottom: 0; }
.aside-title { font: 600 .74rem/1.4 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 12px; }
.link-list { list-style: none; margin: 0; padding: 0; }
.link-list li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: .92rem; }
.link-list li:last-child { border-bottom: 0; }
.plain-list { list-style: none; margin: 0; padding: 0; }
.plain-list li { padding: 12px 0; border-bottom: 1px solid var(--line); display: grid; gap: 2px; }
.prose p { font-family: var(--serif); font-size: 1.08rem; line-height: 1.75; color: var(--text-2); max-width: 70ch; }

/* ---------- Hero ---------- */
.hero { padding: 68px 0 60px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 64px; align-items: center; }
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; gap: 36px; } .portrait { max-width: 260px; order: -1; } .hero { padding-top: 40px; } }
.hero-name { font-size: clamp(2.3rem, 5vw, 3.35rem); line-height: 1.08; letter-spacing: -.015em; margin-bottom: .35em; }
.hero-role { font-size: 1.14rem; font-weight: 500; color: var(--text); margin: 0 0 4px; }
.hero-affil { display: flex; flex-wrap: wrap; gap: 2px 0; color: var(--muted); font-size: .95rem; margin: 0 0 24px; }
.hero-affil span + span::before { content: "·"; margin: 0 10px; color: var(--line-strong); }
.hero-lead { font-family: var(--serif); font-size: 1.22rem; line-height: 1.55; color: var(--text-2); max-width: 60ch; margin-bottom: 24px; }
.status {
    display: flex; gap: 12px; align-items: flex-start; max-width: 620px; margin-bottom: 26px;
    padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: var(--radius);
}
.status p { margin: 0; }
.status-dot { width: 8px; height: 8px; margin-top: 7px; flex-shrink: 0; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 3px color-mix(in srgb, var(--success) 20%, transparent); }
.status-label { display: block; font-size: .72rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.status-text { display: block; font-weight: 500; color: var(--text); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 22px; }
.profile-links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 20px; font-size: .9rem; }
.profile-links a { color: var(--text-2); text-decoration: none; border-bottom: 1px solid var(--line-strong); padding-bottom: 1px; }
.profile-links a:hover { color: var(--accent-text); border-color: currentColor; }
.portrait { margin: 0; position: relative; isolation: isolate; }
.portrait img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--line); background: var(--bg-alt); }
.portrait::after { content: ""; position: absolute; inset: 14px -14px -14px 14px; border: 1px solid var(--line-strong); border-radius: var(--radius); z-index: -1; }

/* ---------- Metrics & charts ---------- */
.impact-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; align-items: start; }
@media (max-width: 900px) { .impact-grid { grid-template-columns: 1fr; } }
.chart-stack { display: grid; gap: 16px; }
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); margin: 0; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.metric { display: flex; flex-direction: column-reverse; justify-content: flex-end; padding: 18px 20px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface); }
.metric dd { margin: 0; font-family: var(--serif); font-size: 2rem; font-weight: 600; line-height: 1.1; color: var(--text); font-variant-numeric: tabular-nums; }
.metric dt { margin-top: 6px; font-size: .8rem; color: var(--muted); }
.metrics-compact .metric { padding: 14px 16px; }
.metrics-compact .metric dd { font-size: 1.6rem; }
.pub-summary { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 24px; align-items: start; margin-bottom: 40px; }
@media (max-width: 900px) { .pub-summary { grid-template-columns: 1fr; } }
.year-chart { margin: 0; padding: 18px 20px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.year-chart figcaption { font-size: .8rem; font-weight: 600; color: var(--muted); margin-bottom: 12px; }
.yc-bars { list-style: none; margin: 0; padding: 0; display: flex; align-items: stretch; gap: 8px; height: 160px; overflow-x: auto; }
.yc-item { flex: 1 0 30px; min-width: 30px; display: flex; flex-direction: column; align-items: center; }
.yc-value { font-size: .72rem; color: var(--text-2); font-variant-numeric: tabular-nums; margin-bottom: 4px; }
.yc-track { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; border-bottom: 1px solid var(--line-strong); }
.yc-bar { display: block; width: 100%; max-width: 34px; background: var(--accent); border-radius: 2px 2px 0 0; opacity: .88; }
.yc-year { font-size: .7rem; color: var(--muted); margin-top: 6px; font-variant-numeric: tabular-nums; }

/* ---------- Themes / cards (hairline grids, not heavy cards) ---------- */
.theme-grid, .record-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    border-top: 1px solid var(--line); border-left: 1px solid var(--line);
}
.record-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.theme, .record-card { display: flex; flex-direction: column; gap: 8px; padding: 22px; background: var(--surface); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.theme h3, .record-card h3 { font-size: 1.08rem; margin: 0; }
.record-card h3 a { color: var(--text); text-decoration: none; }
.record-card h3 a:hover { color: var(--accent-text); text-decoration: underline; }
.theme p, .record-card p { margin: 0; color: var(--text-2); font-size: .92rem; }
.theme-pubs { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 6px; font-size: .84rem; }
.theme-pubs a { color: var(--text-2); }
.theme-meta { margin-top: auto; padding-top: 8px; font-size: .8rem; color: var(--muted); }
a.theme-meta { color: var(--accent-text); font-weight: 500; }
.card-kicker { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: .8rem; }
.card-link { margin-top: auto; font-size: .86rem; font-weight: 500; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; }
.chip { display: inline-block; padding: 3px 10px; font-size: .78rem; color: var(--text-2); background: var(--bg); border: 1px solid var(--line); border-radius: 999px; }
.chips-lg .chip { padding: 6px 14px; font-size: .9rem; }
a.chip-link { text-decoration: none; }
a.chip-link:hover { border-color: var(--accent); color: var(--accent-text); }
.status-badge { font-size: .68rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; padding: 2px 8px; border-radius: 3px; background: var(--bg-alt); color: var(--text-2); }
.status-ongoing { color: var(--success); }
.feature-block { padding: 22px 24px; background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: var(--radius); }
.feature-title { font-family: var(--serif); font-size: 1.3rem; line-height: 1.4; color: var(--text); margin-bottom: 6px; }
.feature-block p:last-child { margin-bottom: 0; }

/* ---------- Publications ---------- */
.type-badge { display: inline-block; padding: 2px 8px; font-size: .7rem; font-weight: 600; letter-spacing: .02em; border-radius: 3px; white-space: nowrap; }
.type-journal { color: var(--t-journal); background: var(--t-journal-bg); }
.type-conference { color: var(--t-conference); background: var(--t-conference-bg); }
.type-book_chapter { color: var(--t-book); background: var(--t-book-bg); }
.type-other { color: var(--t-other); background: var(--t-other-bg); }
.pub-year { font-weight: 500; color: var(--text-2); font-variant-numeric: tabular-nums; }
.pub-list { list-style: none; margin: 0; padding: 0; counter-reset: pub; border-top: 1px solid var(--line); }
.pub-item { display: grid; grid-template-columns: 116px minmax(0, 1fr); gap: 20px; padding: 20px 0; border-bottom: 1px solid var(--line); counter-increment: pub; }
.pub-item[hidden] { display: none; }
.pub-meta { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; font-size: .8rem; }
.pub-meta::before { content: counter(pub, decimal-leading-zero); font: 600 .78rem/1 var(--mono); color: var(--muted); }
.pub-title { font-family: var(--serif); font-size: 1.1rem; line-height: 1.38; margin: 0 0 6px; }
.pub-title a { color: var(--text); text-decoration: none; }
.pub-title a:hover { color: var(--accent-text); text-decoration: underline; }
.pub-authors { display: block; font-size: .9rem; color: var(--text-2); margin: 0 0 4px; }
.owner-name { color: var(--text); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, var(--accent) 50%, transparent); }
.pub-venue { font-size: .88rem; color: var(--muted); margin: 0 0 4px; }
.pub-venue em { color: var(--text-2); }
.pub-doi { font-size: .8rem; color: var(--muted); margin: 0 0 8px; }
.pub-doi a { font-family: var(--mono); font-size: .78rem; overflow-wrap: anywhere; }
.pub-actions { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: .82rem; }
@media (max-width: 640px) {
    .pub-item { grid-template-columns: 1fr; gap: 8px; }
    .pub-meta { flex-direction: row; align-items: center; gap: 10px; }
}
.pub-controls {
    display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; margin-bottom: 14px;
    padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; flex: 1 1 140px; }
.field-search { flex: 3 1 280px; }
.field-type { flex: 0 1 auto; }
.field label, .field-label { font-size: .74rem; font-weight: 600; color: var(--muted); }
input, select, textarea, button { font: inherit; }
.field input, .field select, .form input, .form textarea {
    width: 100%; padding: 9px 11px; font-size: .92rem; color: var(--text);
    background: var(--bg); border: 1px solid var(--line-strong); border-radius: var(--radius);
}
.field input:focus, .field select:focus, .form input:focus, .form textarea:focus { outline: 2px solid var(--focus); outline-offset: 0; border-color: var(--focus); }
.segmented { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--line-strong); border-radius: var(--radius); overflow: hidden; }
.seg { padding: 8px 12px; font-size: .82rem; font-weight: 500; color: var(--text-2); background: var(--bg); border: 0; border-right: 1px solid var(--line); cursor: pointer; }
.seg:last-child { border-right: 0; }
.seg:hover { color: var(--text); }
.seg.is-active { background: var(--accent); color: var(--accent-ink); }
.result-count { font-size: .85rem; color: var(--muted); margin: 0 0 8px; }
.under-review { margin-top: 56px; }

/* ---------- Publication record ---------- */
.breadcrumb { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 36px; margin-bottom: 22px; font-size: .84rem; color: var(--muted); }
.record-head { padding-bottom: 26px; border-bottom: 1px solid var(--line); }
.record-kicker { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; font-size: .84rem; }
.record-head h1 { font-size: clamp(1.7rem, 3.4vw, 2.35rem); line-height: 1.2; max-width: 32em; }
.record-authors { font-size: 1rem; color: var(--text-2); margin: 0 0 6px; }
.record-venue { color: var(--muted); margin: 0 0 20px; }
.record-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.meta-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin: 0 0 34px; border-bottom: 1px solid var(--line); }
.meta-strip > div { padding: 14px 16px 14px 0; min-width: 0; }
.meta-strip dt { font-size: .7rem; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); margin-bottom: 3px; }
.meta-strip dd { margin: 0; font-size: .92rem; color: var(--text); overflow-wrap: anywhere; }
.meta-doi { grid-column: span 2; }
@media (max-width: 520px) { .meta-doi { grid-column: auto; } }
.tab-list { display: flex; gap: 2px; margin-bottom: 26px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: thin; }
.tab {
    padding: 10px 14px; margin-bottom: -1px; background: none; border: 0; border-bottom: 2px solid transparent;
    font-size: .9rem; font-weight: 500; color: var(--muted); cursor: pointer; white-space: nowrap;
}
.tab:hover { color: var(--text); }
.tab.is-active { color: var(--text); border-bottom-color: var(--accent); }
.js .tab-panel:not(.is-active) { display: none; }
.tab-panel { max-width: 780px; padding-bottom: 56px; }
.tab-panel:focus-visible { outline-offset: 6px; }
.panel-title { font-size: 1.25rem; margin-bottom: 14px; }
.panel-subtitle { font-family: var(--sans); font-size: .76rem; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); margin: 24px 0 10px; }
.panel-meta { font-family: var(--sans); font-size: .86rem; font-weight: 400; color: var(--muted); }
.overview-line { font-size: 1rem; color: var(--text-2); }
.notice { padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--line-strong); border-radius: var(--radius); color: var(--text-2); font-size: .94rem; }
.notice-success { border-left-color: var(--success); }
.notice-error { border-left-color: var(--danger); }
.author-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.author-list li { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.author-pos { width: 24px; font: 600 .78rem var(--mono); color: var(--muted); }
.owner-tag { padding: 2px 8px; font-size: .7rem; font-weight: 600; color: var(--accent-text); background: var(--accent-soft); border-radius: 3px; }
.cite-block { margin-bottom: 26px; }
.cite-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; }
.cite-head h3 { font-family: var(--sans); font-size: .76rem; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); margin: 0; }
.cite-text { margin: 0; padding: 14px 16px; font-size: .94rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.bibtex { margin: 0; padding: 14px 16px; font: .8rem/1.6 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text); background: var(--bg-alt); border: 1px solid var(--line); border-radius: var(--radius); }
.related-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.related-list li { display: grid; gap: 4px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.related-title { font-family: var(--serif); font-size: 1.02rem; color: var(--text); text-decoration: none; }
.related-title:hover { color: var(--accent-text); text-decoration: underline; }
.related-meta { font-size: .8rem; color: var(--muted); }
.definition { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 14px 28px; margin: 30px 0 64px; }
.definition dt { font-size: .86rem; font-weight: 600; color: var(--muted); }
.definition dd { margin: 0; color: var(--text-2); }
@media (max-width: 640px) { .definition { grid-template-columns: 1fr; gap: 4px; } .definition dd { margin-bottom: 12px; } }

/* ---------- Timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0; }
.tl-item { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 28px; }
.tl-when { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding-top: 2px; font-size: .84rem; font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }
.tl-body { position: relative; padding: 0 0 30px 26px; border-left: 1px solid var(--line); }
.tl-body::before { content: ""; position: absolute; left: -5px; top: 8px; width: 9px; height: 9px; border-radius: 50%; background: var(--bg); border: 2px solid var(--accent); }
.tl-item:last-child .tl-body { padding-bottom: 4px; }
.tl-title { font-size: 1.06rem; margin: 0 0 2px; }
.tl-org { font-size: .94rem; color: var(--text-2); margin: 0 0 6px; }
.tl-desc { font-size: .92rem; color: var(--text-2); margin-bottom: 6px; }
.tl-meta { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 3px 14px; margin: 8px 0 0; font-size: .86rem; }
.tl-meta div { display: contents; }
.tl-meta dt { color: var(--muted); }
.tl-meta dd { margin: 0; color: var(--text-2); }
.tl-links { display: flex; flex-wrap: wrap; gap: 14px; margin: 8px 0 0; font-size: .86rem; }
.tag-current { padding: 1px 7px; font-size: .66rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--success); border: 1px solid color-mix(in srgb, var(--success) 40%, transparent); border-radius: 3px; }
@media (max-width: 700px) {
    .tl-item { grid-template-columns: 1fr; gap: 4px; }
    .tl-when { flex-direction: row; align-items: center; padding-left: 26px; border-left: 1px solid var(--line); padding-bottom: 4px; }
}

/* ---------- News ---------- */
.news-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.news-item { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 20px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.news-item p { margin: 4px 0; color: var(--text-2); font-size: .92rem; }
.news-date { font-size: .84rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.news-cat { margin-right: 8px; font-size: .7rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--accent-text); }
@media (max-width: 600px) { .news-item { grid-template-columns: 1fr; gap: 4px; } }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 56px; margin-bottom: 72px; }
@media (max-width: 860px) { .contact-grid { grid-template-columns: 1fr; gap: 36px; } }
.contact-grid h2 { font-size: 1.3rem; }
.contact-list { margin: 0 0 28px; }
.contact-list div { padding: 10px 0; border-bottom: 1px solid var(--line); }
.contact-list dt { font-size: .72rem; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.contact-list dd { margin: 2px 0 0; overflow-wrap: anywhere; }
.form { display: grid; gap: 16px; }
.form-two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 560px) { .form-two { grid-template-columns: 1fr; } }
.form-row { display: grid; gap: 6px; }
.form-row label { font-size: .86rem; font-weight: 600; }
.form [aria-invalid="true"] { border-color: var(--danger); }
.field-error { margin: 0; font-size: .8rem; color: var(--danger); }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Footer ---------- */
.site-footer { margin-top: 48px; padding: 52px 0 26px; font-size: .9rem; background: var(--bg-alt); border-top: 1px solid var(--line); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; }
@media (max-width: 820px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-id { grid-column: 1 / -1; } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-name { font-family: var(--serif); font-size: 1.12rem; font-weight: 600; margin: 0 0 4px; }
.footer-role { margin: 0 0 2px; color: var(--text-2); }
.footer-areas { margin: 12px 0 0; font-size: .84rem; color: var(--muted); max-width: 44ch; }
.footer-grid h2 { font: 600 .72rem/1.4 var(--sans); letter-spacing: .09em; text-transform: uppercase; color: var(--muted); margin: 0 0 12px; }
.footer-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.footer-list a { color: var(--text-2); text-decoration: none; overflow-wrap: anywhere; }
.footer-list a:hover { color: var(--accent-text); text-decoration: underline; }
.footer-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-top: 40px; padding-top: 18px; font-size: .8rem; color: var(--muted); border-top: 1px solid var(--line); }

/* ---------- Feedback & motion ---------- */
.toast {
    position: fixed; left: 50%; bottom: 22px; z-index: 80; transform: translate(-50%, 8px);
    padding: 9px 16px; font-size: .85rem; color: var(--bg); background: var(--text); border-radius: var(--radius);
    opacity: 0; pointer-events: none; transition: opacity .18s ease, transform .18s ease;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.fade-in { opacity: 0; transform: translateY(8px); transition: opacity .5s ease, transform .5s ease; }
.fade-in.is-visible { opacity: 1; transform: none; }
html:not(.js) .fade-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
    .fade-in { opacity: 1; transform: none; }
}
@media print {
    .site-header, .drawer, .site-footer, .record-actions, .pub-actions, .pub-controls, .tab-list { display: none !important; }
    .js .tab-panel:not(.is-active) { display: block; }
    body { background: #fff; color: #000; }
}
.definition-tight { margin: 0; gap: 10px 28px; }

/* =========================================================================
   Visual layer — colour, depth and motion.
   A six-hue palette (blue, teal, violet, amber, rose, green) on the neutral
   ground; soft aurora light in the hero; charts that spring into place;
   cursor spotlight on cards; page-to-page transitions. Everything is
   switched off under prefers-reduced-motion.
   ========================================================================= */
:root {
    --accent-2: #0e8a8c; --accent-3: #6a4fd6; --accent-4: #cf7a1c; --accent-5: #cf3f6b; --accent-6: #2c9457;
    --ease: cubic-bezier(.22, 1, .36, 1);
    --spring: cubic-bezier(.34, 1.56, .64, 1);
    --r-lg: 14px;
    --aurora-a: rgba(37, 99, 235, .17); --aurora-b: rgba(14, 138, 140, .14); --aurora-c: rgba(106, 79, 214, .16);
    --card-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 10px 26px -20px rgba(16, 24, 40, .22);
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --accent-2: #45cfc4; --accent-3: #a58cff; --accent-4: #f3ab5a; --accent-5: #f27ea4; --accent-6: #66cf8f;
        --aurora-a: rgba(96, 165, 250, .22); --aurora-b: rgba(45, 212, 191, .15); --aurora-c: rgba(165, 140, 255, .20);
        --card-shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 30px -20px rgba(0, 0, 0, .65);
    }
}
:root[data-theme="dark"] {
    --accent-2: #45cfc4; --accent-3: #a58cff; --accent-4: #f3ab5a; --accent-5: #f27ea4; --accent-6: #66cf8f;
    --aurora-a: rgba(96, 165, 250, .22); --aurora-b: rgba(45, 212, 191, .15); --aurora-c: rgba(165, 140, 255, .20);
    --card-shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 30px -20px rgba(0, 0, 0, .65);
}
@property --ring-angle { syntax: '<angle>'; inherits: false; initial-value: 0deg; }

@keyframes rise { from { opacity: 0; transform: translateY(16px); } }
@keyframes rise-blur { from { opacity: 0; transform: translateY(18px) scale(.985); filter: blur(6px); } }
@keyframes pub-rise { from { opacity: 0; transform: translateY(8px); } }
@keyframes fade { from { opacity: 0; } }
@keyframes grow-x { from { transform: scaleX(0); } }
@keyframes grow-w { from { width: 0; } }
@keyframes flow-x { from { background-position: 0% 50%; } to { background-position: 100% 50%; } }
@keyframes flow-y { from { background-position: 50% 0%; } to { background-position: 50% 100%; } }
@keyframes pulse { from { transform: scale(1); opacity: .55; } to { transform: scale(3.2); opacity: 0; } }
@keyframes aurora { 0% { transform: translate3d(-3%, 0, 0) scale(1); } 50% { transform: translate3d(3%, -4%, 0) scale(1.08); } 100% { transform: translate3d(-1%, 3%, 0) scale(1.03); } }
@keyframes ring-spin { to { --ring-angle: 360deg; } }
@keyframes theme-reveal {
    from { clip-path: circle(0 at var(--vt-x, 50%) var(--vt-y, 0)); }
    to { clip-path: circle(var(--vt-r, 150vmax) at var(--vt-x, 50%) var(--vt-y, 0)); }
}
@keyframes vt-out { to { opacity: 0; transform: translateY(-6px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(10px); } }

/* ---------- Page-to-page and theme transitions ---------- */
@media (prefers-reduced-motion: no-preference) { @view-transition { navigation: auto; } }
::view-transition-old(root) { animation: vt-out .2s ease both; }
::view-transition-new(root) { animation: vt-in .42s var(--ease) both; }
.site-header { view-transition-name: site-header; }
html.theme-vt .site-header { view-transition-name: none; }
html.theme-vt::view-transition-old(root) { animation: none; mix-blend-mode: normal; }
html.theme-vt::view-transition-new(root) { animation: theme-reveal .7s cubic-bezier(.4, 0, .2, 1); mix-blend-mode: normal; }
html.theme-anim, html.theme-anim *, html.theme-anim *::before, html.theme-anim *::after {
    transition: background-color .45s ease, color .45s ease, border-color .45s ease, fill .45s ease, stroke .45s ease !important;
}

/* ---------- Header, progress, nav ---------- */
.scroll-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 70; pointer-events: none; }
.scroll-progress span {
    display: block; height: 100%; transform: scaleX(0); transform-origin: 0 50%;
    background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--accent-3), var(--accent-5), var(--accent));
    background-size: 300% 100%; animation: flow-x 8s ease-in-out infinite alternate;
}
.site-header { transition: box-shadow .3s ease, background-color .3s ease; }
.site-header.is-scrolled { box-shadow: 0 12px 30px -24px rgba(10, 20, 40, .55); }
@media (max-width: 1260px) { .primary-nav { display: none; } .menu-btn { display: inline-flex; } }
.nav-link { transition: color .2s ease, background-color .2s ease; }
.nav-link::before {
    content: ""; position: absolute; left: 9px; right: 9px; bottom: 4px; height: 1.5px; border-radius: 2px;
    background: currentColor; opacity: .4; transform: scaleX(0); transform-origin: left; transition: transform .3s var(--ease);
}
.nav-link:hover::before, .nav-link:focus-visible::before { transform: scaleX(1); }
.nav-link.is-active::before { display: none; }
.nav-link.is-active::after { height: 2.5px; border-radius: 2px; background: linear-gradient(90deg, var(--accent), var(--accent-3), var(--accent-5)); transform-origin: left; animation: grow-x .6s var(--ease) .1s backwards; }
.drawer:not([hidden]) .drawer-backdrop { animation: fade .25s ease; }
.drawer:not([hidden]) .drawer-nav li { animation: rise .45s var(--ease) backwards; animation-delay: calc(var(--i, 0) * 35ms + 80ms); }

/* ---------- Hero ---------- */
.hero { position: relative; isolation: isolate; overflow: hidden; padding: 80px 0 76px; }
.hero::before {
    content: ""; position: absolute; inset: -30% -15% -10% -15%; z-index: -2; pointer-events: none;
    background:
        radial-gradient(38% 46% at 16% 32%, var(--aurora-a), transparent 70%),
        radial-gradient(32% 42% at 84% 18%, var(--aurora-c), transparent 70%),
        radial-gradient(42% 50% at 62% 88%, var(--aurora-b), transparent 70%);
    filter: blur(24px); animation: aurora 20s ease-in-out infinite alternate;
}
.hero::after {
    content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: .55;
    background-image: radial-gradient(color-mix(in srgb, var(--text) 16%, transparent) 1px, transparent 1.2px);
    background-size: 22px 22px;
    -webkit-mask-image: radial-gradient(ellipse 65% 70% at 30% 40%, #000 20%, transparent 75%);
    mask-image: radial-gradient(ellipse 65% 70% at 30% 40%, #000 20%, transparent 75%);
}
.hero-name {
    background: linear-gradient(100deg, var(--text) 0%, var(--text) 35%, var(--accent) 60%, var(--accent-3) 80%, var(--accent-5) 100%);
    background-size: 220% 100%; -webkit-background-clip: text; background-clip: text;
    color: transparent; -webkit-text-fill-color: transparent; animation: flow-x 12s ease-in-out infinite alternate;
}
.hero-name::after {
    content: ""; display: block; width: 84px; height: 4px; margin-top: 18px; border-radius: 4px;
    background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--accent-3), var(--accent-5));
    background-size: 200% 100%; animation: flow-x 5s ease-in-out infinite alternate, grow-w 1s var(--ease) .5s backwards;
}
@media (forced-colors: active) { .hero-name { color: CanvasText; -webkit-text-fill-color: CanvasText; background: none; } }
.hero-focus { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; margin: -6px 0 24px; color: var(--muted); }
.focus-label { font: 600 .72rem/1 var(--sans); letter-spacing: .1em; text-transform: uppercase; padding: 5px 9px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 10%, transparent); color: var(--accent-text); }
.rotator { display: inline-block; min-width: 14ch; }
.rotator-word {
    display: inline-block; font-family: var(--serif); font-size: 1.18rem; font-weight: 600; color: var(--hue, var(--accent-text));
    transition: opacity .35s ease, transform .5s var(--ease), filter .35s ease, color .5s ease;
}
.rotator-word.is-out { opacity: 0; transform: translateY(-10px); filter: blur(4px); }
.rotator-word.is-in { opacity: 0; transform: translateY(12px); filter: blur(4px); transition: none; }
.status { position: relative; overflow: hidden; border-left: 1px solid var(--line); padding-left: 19px; box-shadow: var(--card-shadow); }
.status::before {
    content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
    background: linear-gradient(180deg, var(--accent), var(--accent-2), var(--accent-3), var(--accent));
    background-size: 100% 300%; animation: flow-y 6s ease-in-out infinite alternate;
}
.status-dot { position: relative; }
.status-dot::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--success); animation: pulse 2.6s ease-out infinite; }
.portrait { padding: 5px; border-radius: 22px; }
.portrait::before {
    content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit;
    background: conic-gradient(from var(--ring-angle), var(--accent), var(--accent-2), var(--accent-3), var(--accent-5), var(--accent-4), var(--accent));
    animation: ring-spin 9s linear infinite;
}
.portrait::after {
    inset: 12% 8% -4% 8%; border: 0; border-radius: 30px; z-index: -2; opacity: .5; filter: blur(28px);
    background: conic-gradient(from var(--ring-angle), var(--accent), var(--accent-3), var(--accent-2), var(--accent));
    animation: ring-spin 9s linear infinite; transition: opacity .5s ease;
}
.portrait img { border: 0; border-radius: 17px; transition: transform .7s var(--ease); }
.portrait:hover img { transform: scale(1.015); }
.portrait:hover::after { opacity: .75; }
@media (prefers-reduced-motion: no-preference) {
    .js .hero-copy > *, .js .page-head > *, .js .record-head > *, .js .breadcrumb { animation: rise .75s var(--ease) backwards; }
    .js .hero-copy > .hero-name { animation: rise .75s var(--ease) backwards, flow-x 12s ease-in-out 1s infinite alternate; }
    .js .hero-copy > :nth-child(2), .js .page-head > :nth-child(2), .js .record-head > :nth-child(2) { animation-delay: .07s; }
    .js .hero-copy > :nth-child(3), .js .page-head > :nth-child(3), .js .record-head > :nth-child(3) { animation-delay: .14s; }
    .js .hero-copy > :nth-child(4), .js .record-head > :nth-child(4) { animation-delay: .21s; }
    .js .hero-copy > :nth-child(5), .js .record-head > :nth-child(5) { animation-delay: .28s; }
    .js .hero-copy > :nth-child(6) { animation-delay: .35s; }
    .js .hero-copy > :nth-child(7) { animation-delay: .42s; }
    .js .hero-copy > :nth-child(8) { animation-delay: .49s; }
    .js .portrait { animation: rise-blur 1s var(--ease) .2s backwards; }
}

/* ---------- Buttons, links, profile icons ---------- */
a { transition: color .2s ease, text-decoration-color .2s ease; }
.btn { transition: transform .2s var(--ease), box-shadow .25s ease, background-color .2s ease, background-position .5s ease, border-color .2s ease, color .2s ease; }
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); box-shadow: none; }
.btn-primary, .btn-primary:hover {
    background-image: linear-gradient(115deg, var(--accent) 0%, var(--accent) 35%, color-mix(in srgb, var(--accent) 50%, var(--accent-3)) 100%);
    background-size: 220% 100%;
}
.btn-primary { position: relative; overflow: hidden; isolation: isolate; background-position: 0% 50%; box-shadow: 0 8px 20px -14px color-mix(in srgb, var(--accent) 80%, transparent); }
.btn-primary::after {
    content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
    background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, .32) 50%, transparent 70%);
    transform: translateX(-130%); transition: transform .8s var(--ease);
}
.btn-primary:hover { background-position: 100% 50%; box-shadow: 0 14px 28px -14px color-mix(in srgb, var(--accent-3) 70%, transparent); }
.btn-primary:hover::after { transform: translateX(130%); }
.btn-secondary:hover { border-color: var(--accent); color: var(--accent-text); box-shadow: 0 12px 24px -18px rgba(0, 0, 0, .45); }
.btn .p-icon { width: 16px; height: 16px; transition: transform .25s var(--ease); }
.btn:hover .p-icon { transform: translateY(2px); }
.icon-btn { transition: border-color .2s ease, color .2s ease, background-color .2s ease, transform .2s var(--ease); }
.icon-btn:hover { transform: translateY(-1px); border-color: var(--accent); color: var(--accent-text); }
.theme-glyph { display: inline-block; transition: transform .6s var(--spring); }
[data-theme-toggle]:hover .theme-glyph { transform: rotate(60deg) scale(1.1); }
.pl { display: inline-flex; align-items: center; gap: 8px; color: var(--text-2); text-decoration: none; transition: color .2s ease, background-color .25s ease, border-color .25s ease, transform .25s var(--ease), box-shadow .25s ease; }
.pl .p-icon { flex-shrink: 0; color: var(--hue, var(--muted)); opacity: .75; transition: color .25s ease, transform .4s var(--spring), opacity .25s ease; }
.pl:hover { color: var(--text); text-decoration: none; }
.pl:hover .p-icon, .pl:focus-visible .p-icon { opacity: 1; transform: translateY(-1px) rotate(-8deg) scale(1.15); }
.pl-arrow { margin-left: auto; color: var(--muted); transition: transform .25s var(--ease), color .25s ease; }
.pl:hover .pl-arrow { transform: translate(2px, -2px); color: var(--hue, var(--accent)); }
.pl-scholar { --hue: #3a6fd8; } .pl-orcid { --hue: #4c8f2f; } .pl-rg { --hue: #168c8c; } .pl-scopus { --hue: #c2622a; }
.pl-github { --hue: #7a57c9; } .pl-linkedin { --hue: #2f6fb8; } .pl-mail { --hue: #c2415f; } .pl-web { --hue: #2f8a7a; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .pl-scholar { --hue: #7ea6f0; } :root:not([data-theme="light"]) .pl-orcid { --hue: #86c56a; }
    :root:not([data-theme="light"]) .pl-rg { --hue: #4cc2c2; } :root:not([data-theme="light"]) .pl-scopus { --hue: #eb9a62; }
    :root:not([data-theme="light"]) .pl-github { --hue: #a98ae8; } :root:not([data-theme="light"]) .pl-linkedin { --hue: #6fa6e6; }
    :root:not([data-theme="light"]) .pl-mail { --hue: #ec7f98; } :root:not([data-theme="light"]) .pl-web { --hue: #5fc0ad; }
}
:root[data-theme="dark"] .pl-scholar { --hue: #7ea6f0; } :root[data-theme="dark"] .pl-orcid { --hue: #86c56a; }
:root[data-theme="dark"] .pl-rg { --hue: #4cc2c2; } :root[data-theme="dark"] .pl-scopus { --hue: #eb9a62; }
:root[data-theme="dark"] .pl-github { --hue: #a98ae8; } :root[data-theme="dark"] .pl-linkedin { --hue: #6fa6e6; }
:root[data-theme="dark"] .pl-mail { --hue: #ec7f98; } :root[data-theme="dark"] .pl-web { --hue: #5fc0ad; }
.profile-links { gap: 8px; }
.profile-links .pl {
    padding: 7px 14px 7px 11px; font-size: .86rem; border-radius: 999px;
    background: color-mix(in srgb, var(--surface) 80%, transparent); border: 1px solid var(--line);
    -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.profile-links .pl:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--hue) 50%, var(--line)); background: color-mix(in srgb, var(--hue) 10%, var(--surface)); box-shadow: 0 10px 22px -16px var(--hue); }
.link-list .pl { width: 100%; }
.footer-list .pl:hover, .drawer-profiles .pl:hover { color: var(--text); text-decoration: none; }
.drawer-profiles .pl .p-icon, .footer-list .pl .p-icon { width: 16px; height: 16px; }

/* ---------- Section headings ---------- */
.section-head h2::after, .page-section > h2::after {
    content: ""; display: block; width: 46px; height: 3px; margin-top: 10px; border-radius: 3px;
    background: linear-gradient(90deg, var(--accent), var(--accent-3), var(--accent-5)); transform-origin: left;
}
.page-section > h2 { position: relative; border-bottom: 0; padding-bottom: 0; }
.motion .section-head.is-visible h2::after, .motion .page-section > h2.is-visible::after { animation: grow-x 1s var(--ease) .2s backwards; }
.site-footer { position: relative; }
.site-footer::before {
    content: ""; position: absolute; top: -1px; left: 0; right: 0; height: 2px; opacity: .8;
    background: linear-gradient(90deg, transparent, var(--accent), var(--accent-2), var(--accent-3), var(--accent-5), transparent);
}

/* ---------- Colour cycle for cards ---------- */
.metrics > :nth-child(6n + 1), .theme-grid > :nth-child(6n + 1), .sv-grid > :nth-child(6n + 1), .record-grid > :nth-child(6n + 1), .sv-summary > :nth-child(6n + 1) { --hue: var(--accent); }
.metrics > :nth-child(6n + 2), .theme-grid > :nth-child(6n + 2), .sv-grid > :nth-child(6n + 2), .record-grid > :nth-child(6n + 2), .sv-summary > :nth-child(6n + 2) { --hue: var(--accent-2); }
.metrics > :nth-child(6n + 3), .theme-grid > :nth-child(6n + 3), .sv-grid > :nth-child(6n + 3), .record-grid > :nth-child(6n + 3), .sv-summary > :nth-child(6n + 3) { --hue: var(--accent-3); }
.metrics > :nth-child(6n + 4), .theme-grid > :nth-child(6n + 4), .sv-grid > :nth-child(6n + 4), .record-grid > :nth-child(6n + 4) { --hue: var(--accent-4); }
.metrics > :nth-child(6n + 5), .theme-grid > :nth-child(6n + 5), .sv-grid > :nth-child(6n + 5), .record-grid > :nth-child(6n + 5) { --hue: var(--accent-5); }
.metrics > :nth-child(6n + 6), .theme-grid > :nth-child(6n + 6), .sv-grid > :nth-child(6n + 6), .record-grid > :nth-child(6n + 6) { --hue: var(--accent-6); }

/* Shared card surface with a cursor-following spotlight */
.metric, .theme, .record-card, .sv-card, .sv-stat, .chart-card {
    position: relative; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
    box-shadow: var(--card-shadow);
    transition: transform .4s var(--ease), box-shadow .4s var(--ease), border-color .3s ease, background-color .3s ease;
}
.metric::after, .theme::after, .record-card::after, .sv-card::after, .sv-stat::after, .chart-card::after {
    content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .35s ease;
    background: radial-gradient(280px circle at var(--mx, 50%) var(--my, 0%), color-mix(in srgb, var(--hue, var(--accent)) 14%, transparent), transparent 70%);
}
.metric:hover::after, .theme:hover::after, .record-card:hover::after, .sv-card:hover::after, .sv-stat:hover::after, .chart-card:hover::after { opacity: 1; }
.metric:hover, .theme:hover, .record-card:hover, .sv-card:hover, .sv-stat:hover {
    transform: translateY(-4px); border-color: color-mix(in srgb, var(--hue, var(--accent)) 45%, var(--line));
    box-shadow: 0 22px 40px -28px color-mix(in srgb, var(--hue, var(--accent)) 70%, transparent);
}

/* Metrics */
.metrics { gap: 14px; border: 0; margin-bottom: 18px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.metric { padding: 20px 20px 18px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.metric::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: linear-gradient(90deg, var(--hue), color-mix(in srgb, var(--hue) 40%, var(--accent-3))); }
.metric dd {
    font-size: 2.2rem; background: linear-gradient(120deg, var(--text) 10%, var(--hue) 100%);
    -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent;
}
.metric dt { position: relative; }
.metrics-compact .metric dd { font-size: 1.75rem; }

/* Theme and record cards */
.theme-grid, .record-grid { gap: 14px; border: 0; }
.theme, .record-card { padding: 22px 22px 20px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.theme::before, .record-card::before {
    content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px;
    background: linear-gradient(90deg, var(--hue, var(--accent)), color-mix(in srgb, var(--hue, var(--accent)) 30%, var(--accent-3)));
    transform: scaleX(.18); transform-origin: left; transition: transform .5s var(--ease);
}
.theme:hover::before, .record-card:hover::before { transform: scaleX(1); }
.theme h3 { display: flex; align-items: center; gap: 10px; transition: color .25s ease; }
.theme h3::before { content: ""; flex: 0 0 10px; height: 10px; border-radius: 50%; background: var(--hue, var(--accent)); box-shadow: 0 0 0 4px color-mix(in srgb, var(--hue, var(--accent)) 16%, transparent); }
.theme:hover h3 { color: color-mix(in srgb, var(--hue, var(--accent)) 70%, var(--text)); }
a.theme-meta { color: color-mix(in srgb, var(--hue, var(--accent)) 75%, var(--text)); }

/* ---------- Charts ---------- */
.chart-row { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); gap: 14px; margin-bottom: 14px; }
.chart-row-single { grid-template-columns: 1fr; }
@media (max-width: 860px) { .chart-row { grid-template-columns: 1fr; } }
.chart-card { margin: 0; padding: 18px 18px 12px; }
.chart-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 6px; font-size: .84rem; font-weight: 600; color: var(--text-2); }
.chart-sub { font-weight: 500; color: var(--muted); font-size: .76rem; font-variant-numeric: tabular-nums; }
.bar-chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.bc-grid line { stroke: var(--line); stroke-dasharray: 3 5; }
.bc-grid text, .bc-x { fill: var(--muted); font: 500 11px var(--sans); }
.bc-hit { fill: transparent; transition: fill .25s ease; }
.bc-bar:hover .bc-hit { fill: color-mix(in srgb, var(--accent) 8%, transparent); }
.bc-col { transform-box: fill-box; transform-origin: 50% 100%; transition: filter .25s ease, opacity .25s ease; }
.bc-bars:hover .bc-bar:not(:hover) .bc-col { opacity: .45; }
.bc-bar:hover .bc-col { filter: brightness(1.12) saturate(1.2) drop-shadow(0 6px 8px color-mix(in srgb, var(--accent) 35%, transparent)); }
.bc-val { fill: var(--text); font: 600 11.5px var(--sans); opacity: .8; transition: opacity .25s ease; }
.bc-bar:hover .bc-val { opacity: 1; }
.motion .bc-col { transform: scaleY(0); }
.motion .chart-card.is-visible .bc-col { transform: scaleY(1); transition: transform 1.1s var(--spring) calc(var(--i, 0) * 70ms + 150ms), filter .25s ease, opacity .25s ease; }
.motion .bc-val { opacity: 0; }
.motion .chart-card.is-visible .bc-val { opacity: .8; transition: opacity .5s ease calc(var(--i, 0) * 70ms + 700ms); }
.donut-wrap { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; padding: 6px 0 8px; }
.donut { width: 156px; height: 156px; flex: 0 0 auto; overflow: visible; }
.dn-track { fill: none; stroke: var(--bg-alt); stroke-width: 13; }
.dn-seg { fill: none; stroke: var(--c); stroke-width: 13; stroke-dasharray: var(--dash); transition: stroke-width .3s var(--ease), opacity .3s ease; cursor: default; }
.donut:hover .dn-seg:not(:hover) { opacity: .4; }
.dn-seg:hover { stroke-width: 17; }
.motion .dn-seg { stroke-dasharray: 0 100; }
.motion .chart-card.is-visible .dn-seg { stroke-dasharray: var(--dash); transition: stroke-dasharray 1.2s var(--ease) calc(var(--i, 0) * 150ms + 200ms), stroke-width .3s var(--ease), opacity .3s ease; }
.dn-total { font: 600 28px var(--serif); fill: var(--text); }
.dn-label { font: 600 7.5px var(--sans); fill: var(--muted); letter-spacing: .12em; }
.dn-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; font-size: .86rem; flex: 1 1 150px; }
.dn-legend li { display: flex; align-items: center; gap: 9px; color: var(--text-2); }
.dn-legend .sw { width: 10px; height: 10px; border-radius: 3px; background: var(--c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 18%, transparent); }
.dn-legend .n { margin-left: auto; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.dn-legend .pct { width: 3em; text-align: right; font-size: .76rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.pub-summary { display: block; }
.pub-summary .metrics { margin-bottom: 14px; }

/* ---------- Timeline, publications, tabs ---------- */
.tl-body::after {
    content: ""; position: absolute; left: -1px; top: 0; bottom: 0; width: 2px; pointer-events: none; opacity: .75;
    background: linear-gradient(180deg, var(--accent), var(--accent-3)); transform-origin: top; transform: scaleY(1);
}
.tl-body::before { z-index: 1; transition: transform .35s var(--spring), background-color .3s ease, box-shadow .3s ease; }
.motion .tl-item .tl-body::after { transform: scaleY(0); }
.motion .tl-item.is-visible .tl-body::after { transform: scaleY(1); transition: transform 1.1s var(--ease) .15s; }
.motion .tl-item .tl-body::before { transform: scale(0); }
.motion .tl-item.is-visible .tl-body::before { transform: scale(1); transition: transform .6s var(--spring) .25s, background-color .3s ease, box-shadow .3s ease; }
.tl-item:hover .tl-body::before, .motion .tl-item.is-visible:hover .tl-body::before { transform: scale(1.4); background: var(--accent); box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 18%, transparent); }
.tl-title { transition: color .2s ease; }
.tl-item:hover .tl-title { color: var(--accent-text); }
.pub-item { position: relative; transition: background-color .3s ease; border-radius: 10px; }
.pub-item::after {
    content: ""; position: absolute; left: -14px; top: 18px; bottom: 18px; width: 3px; border-radius: 3px;
    background: linear-gradient(180deg, var(--accent), var(--accent-3), var(--accent-5)); transform: scaleY(0); transition: transform .35s var(--ease);
}
.pub-item:hover { background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 5%, transparent), transparent 70%); }
.pub-item:hover::after, .pub-item:focus-within::after { transform: scaleY(1); }
.pub-title a { transition: color .2s ease; }
.type-badge { transition: transform .25s var(--spring); }
.pub-item:hover .type-badge { transform: scale(1.06); }
.pub-list .pub-item.pub-in, .motion .pub-list .pub-item.pub-in { opacity: 1; animation: pub-rise .45s var(--ease) calc(var(--pi, 0) * 22ms) backwards; }
.tab-list { position: relative; }
.tab { transition: color .2s ease, border-color .25s ease; }
.tab-list.has-ink .tab.is-active { border-bottom-color: transparent; }
.tab-ink { position: absolute; left: 0; bottom: 0; height: 2.5px; width: 0; border-radius: 3px; pointer-events: none; background: linear-gradient(90deg, var(--accent), var(--accent-3), var(--accent-5)); transition: transform .5s var(--ease), width .5s var(--ease); }
.tab-panel.is-active { animation: rise .45s var(--ease); }
.chip { transition: border-color .2s ease, color .2s ease, background-color .2s ease, transform .25s var(--spring); }
a.chip-link:hover, .chips-lg .chip:hover { transform: translateY(-2px); border-color: var(--accent); color: var(--accent-text); background: var(--accent-soft); }
.seg { transition: background-color .25s ease, color .25s ease; }
.seg.is-active { background: linear-gradient(120deg, var(--accent), color-mix(in srgb, var(--accent) 55%, var(--accent-3))); }
.field input, .field select, .form input, .form textarea { transition: border-color .2s ease, box-shadow .2s ease; }
.field input:focus, .field select:focus, .form input:focus, .form textarea:focus { box-shadow: 0 0 0 4px color-mix(in srgb, var(--focus) 18%, transparent); }

/* ---------- Supervision ---------- */
.sv-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 18px; }
.sv-stat { padding: 18px 20px; }
.sv-stat strong {
    display: block; font: 600 2rem/1.1 var(--serif);
    background: linear-gradient(120deg, var(--text) 10%, var(--hue, var(--accent))); -webkit-background-clip: text; background-clip: text;
    color: transparent; -webkit-text-fill-color: transparent;
}
.sv-stat > span { font-size: .82rem; color: var(--muted); }
.sv-flags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.flag { display: inline-block; width: 20px; height: 15px; border-radius: 3px; object-fit: cover; box-shadow: 0 0 0 1px color-mix(in srgb, var(--text) 14%, transparent); flex-shrink: 0; }
.sv-flags .flag { width: 24px; height: 18px; transition: transform .3s var(--spring); }
.sv-flags .flag:hover { transform: translateY(-2px) scale(1.12); }
.sv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.sv-card { display: flex; gap: 14px; padding: 18px; }
.sv-avatar {
    flex: 0 0 48px; height: 48px; border-radius: 50%; display: grid; place-items: center;
    font: 600 .95rem var(--sans); letter-spacing: .02em; color: #fff;
    background: linear-gradient(135deg, var(--hue, var(--accent)), color-mix(in srgb, var(--hue, var(--accent)) 45%, var(--accent-3)));
    box-shadow: 0 10px 20px -12px var(--hue, var(--accent)); transition: transform .4s var(--spring);
}
.sv-card:hover .sv-avatar { transform: scale(1.08) rotate(-4deg); }
.sv-body { min-width: 0; }
.sv-level { margin: 0 0 3px; font-size: .68rem; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: color-mix(in srgb, var(--hue, var(--accent)) 80%, var(--text)); }
.sv-name { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 9px; margin: 0 0 4px; font-size: 1.04rem; line-height: 1.3; }
.sv-name a { color: var(--text); text-decoration: none; }
.sv-name a:hover { color: var(--accent-text); text-decoration: underline; }
.sv-country { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px 2px 4px; font: 500 .72rem/1.5 var(--sans); color: var(--text-2); background: var(--bg-alt); border: 1px solid var(--line); border-radius: 999px; }
.sv-topic { margin: 0 0 4px; font-size: .88rem; color: var(--text-2); }
.sv-meta { margin: 0 0 6px; font-size: .8rem; color: var(--muted); }
.sv-now { display: inline-flex; align-items: center; gap: 6px; margin: 2px 0 0; padding: 4px 10px; font-size: .8rem; font-weight: 500; color: var(--text-2); background: var(--bg-alt); border-radius: 999px; }
.sv-now .p-icon { width: 15px; height: 15px; }
.sv-now.is-grad { color: var(--success); background: color-mix(in srgb, var(--success) 11%, transparent); }

/* ---------- Gallery & certificates ---------- */
.gallery-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.gf-btn {
    display: inline-flex; align-items: center; gap: 7px; padding: 7px 14px; cursor: pointer;
    font: 500 .84rem var(--sans); color: var(--text-2); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 999px;
    transition: color .2s ease, background-color .25s ease, border-color .25s ease, transform .25s var(--spring), box-shadow .25s ease;
}
.gf-btn:hover { transform: translateY(-1px); border-color: var(--accent); color: var(--accent-text); }
.gf-btn.is-active { color: #fff; border-color: transparent; background: linear-gradient(120deg, var(--accent), color-mix(in srgb, var(--accent) 50%, var(--accent-3))); box-shadow: 0 10px 20px -14px var(--accent); }
.gf-n { font-size: .72rem; padding: 1px 7px; border-radius: 999px; background: color-mix(in srgb, currentColor 14%, transparent); }
.gallery-grid { columns: 3 260px; column-gap: 16px; }
.gallery-item { break-inside: avoid; margin: 0 0 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--card-shadow); transition: transform .4s var(--ease), box-shadow .4s var(--ease); }
.gallery-item[hidden] { display: none; }
.gallery-item:hover { transform: translateY(-4px); box-shadow: 0 24px 44px -30px rgba(15, 30, 60, .6); }
.gallery-media { position: relative; display: block; overflow: hidden; background: var(--bg-alt); }
.gallery-media img { width: 100%; height: auto; transition: transform .8s var(--ease), filter .5s ease; }
.gallery-item:hover .gallery-media img { transform: scale(1.06); }
.gallery-zoom {
    position: absolute; right: 12px; top: 12px; width: 36px; height: 36px; display: grid; place-items: center; color: #fff;
    background: rgba(10, 14, 22, .45); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); border-radius: 50%;
    opacity: 0; transform: scale(.8); transition: opacity .3s ease, transform .35s var(--spring);
}
.gallery-item:hover .gallery-zoom, .gallery-media:focus-visible .gallery-zoom { opacity: 1; transform: scale(1); }
.gallery-item figcaption { display: grid; gap: 3px; padding: 12px 14px 14px; font-size: .86rem; }
.gallery-cat { justify-self: start; padding: 2px 8px; font-size: .66rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--cat, var(--accent-text)); background: color-mix(in srgb, var(--cat, var(--accent)) 12%, transparent); border-radius: 999px; }
.gallery-title { font-family: var(--serif); font-size: 1rem; color: var(--text); }
.gallery-meta, .gallery-caption { color: var(--muted); font-size: .8rem; }
.gallery-link { font-size: .82rem; font-weight: 500; }
.gallery-item[data-category="Conferences"] { --cat: var(--accent); }
.gallery-item[data-category="Presentations"] { --cat: var(--accent-3); }
.gallery-item[data-category="Research Events"] { --cat: var(--accent-2); }
.gallery-item[data-category="Awards"] { --cat: var(--accent-4); }
.gallery-item[data-category="Certificates"] { --cat: var(--accent-5); }
.gallery-item[data-category="Lab Activities"] { --cat: var(--accent-6); }
.gallery-grid .gallery-item.gi-in, .motion .gallery-grid .gallery-item.gi-in { opacity: 1; animation: rise-blur .5s var(--ease) calc(var(--gi, 0) * 40ms) backwards; }
.cert-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 12px; }
.cert-thumb {
    display: grid; gap: 8px; padding: 8px 8px 10px; font-size: .8rem; color: var(--text-2); text-decoration: none;
    background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--card-shadow);
    transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .3s ease;
}
.cert-thumb img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; background: var(--bg-alt); }
.cert-thumb:hover { transform: translateY(-3px) rotate(-.6deg); border-color: var(--accent-5); box-shadow: 0 18px 34px -24px var(--accent-5); color: var(--text); }

/* ---------- Lightbox ---------- */
.lightbox[hidden] { display: none; }
.lightbox { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; }
.lb-backdrop { position: absolute; inset: 0; background: rgba(6, 9, 15, .88); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); opacity: 0; transition: opacity .3s ease; }
.lightbox.is-open .lb-backdrop { opacity: 1; }
.lb-dialog { position: relative; width: min(1100px, 94vw); max-height: 92vh; display: grid; place-items: center; }
.lb-figure { margin: 0; display: grid; gap: 12px; justify-items: center; opacity: 0; transform: scale(.96); transition: opacity .35s ease, transform .45s var(--ease); }
.lightbox.is-open.is-loaded .lb-figure { opacity: 1; transform: none; }
.lb-img { max-width: 100%; max-height: 76vh; width: auto; height: auto; border-radius: 10px; box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .8); background: #111; }
.lb-cap { display: grid; gap: 3px; max-width: 70ch; text-align: center; color: #e9ecf2; font-size: .9rem; }
.lb-title { font-family: var(--serif); font-size: 1.1rem; color: #fff; }
.lb-meta, .lb-count { color: #aab3c2; font-size: .8rem; }
.lb-btn {
    position: absolute; width: 46px; height: 46px; display: grid; place-items: center; padding: 0; cursor: pointer; color: #fff;
    background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .18); border-radius: 50%;
    transition: background-color .2s ease, transform .25s var(--spring);
}
.lb-btn:hover { background: rgba(255, 255, 255, .22); transform: scale(1.08); }
.lb-prev { left: -8px; top: 40%; } .lb-next { right: -8px; top: 40%; } .lb-close { right: -8px; top: -8px; }
.lightbox.is-single .lb-prev, .lightbox.is-single .lb-next { display: none; }
@media (max-width: 700px) { .lb-prev { left: 4px; top: auto; bottom: -58px; } .lb-next { right: 4px; top: auto; bottom: -58px; } .lb-close { right: 4px; top: -56px; } }
body.lb-open { overflow: hidden; }

/* ---------- Portrait fallback, portrait of the drawer, back to top ---------- */
.to-top {
    position: fixed; right: 20px; bottom: 20px; z-index: 45; width: 46px; height: 46px; padding: 0;
    display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: #fff;
    background: linear-gradient(135deg, var(--accent), var(--accent-3)); border: 0; border-radius: 50%;
    box-shadow: 0 14px 28px -14px color-mix(in srgb, var(--accent-3) 70%, transparent);
    opacity: 0; visibility: hidden; transform: translateY(14px) scale(.9);
    transition: opacity .3s ease, transform .4s var(--spring), visibility .3s;
}
.to-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { transform: translateY(-3px); }
.to-top .p-icon { transition: transform .3s var(--spring); }
.to-top:hover .p-icon { transform: translateY(-2px); }

/* ---------- Scroll reveal (only with html.motion, set before first paint) ---------- */
.motion :is(.metric, .chart-card, .theme, .record-card, .sv-card, .sv-stat, .gallery-item, .aside-box, .feature-block, .contact-info, .contact-form-wrap, .cert-thumb, .section-head, .tl-item, .pub-item, .news-item, .page-section > h2, .meta-strip, .tabs, .definition, .pub-controls, .gallery-filters) { opacity: 0; }
.motion :is(.section-head, .tl-item, .pub-item, .news-item, .page-section > h2, .meta-strip, .tabs, .definition, .pub-controls, .gallery-filters).is-visible { opacity: 1; animation: rise .75s var(--ease) var(--rd, 0ms) backwards; }
.motion :is(.metric, .chart-card, .theme, .record-card, .sv-card, .sv-stat, .gallery-item, .aside-box, .feature-block, .contact-info, .contact-form-wrap, .cert-thumb).is-visible { opacity: 1; animation: rise-blur .9s var(--ease) var(--rd, 0ms) backwards; }

@media print {
    .scroll-progress, .to-top, .lightbox, .hero::before, .hero::after { display: none !important; }
    .motion :is(.metric, .chart-card, .theme, .record-card, .sv-card, .sv-stat, .gallery-item, .aside-box, .feature-block, .contact-info, .contact-form-wrap, .cert-thumb, .section-head, .tl-item, .pub-item, .news-item, .page-section > h2, .meta-strip, .tabs, .definition, .pub-controls, .gallery-filters) { opacity: 1 !important; animation: none !important; }
    .motion .bc-col { transform: none !important; }
    .hero-name, .metric dd, .sv-stat strong { color: #000 !important; -webkit-text-fill-color: #000 !important; background: none !important; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important;
        transition-duration: .01ms !important; transition-delay: 0s !important;
    }
    ::view-transition-old(root), ::view-transition-new(root) { animation: none !important; }
}

/* ---------- Refinements after visual review ---------- */
.hero-name { background-position: 72% 50%; }
.donut { width: 138px; height: 138px; }
.dn-legend { flex: 1 1 170px; }
.dn-legend li { white-space: nowrap; }
.gf-btn.is-active, .to-top, .sv-avatar { color: var(--accent-ink); }
@media (max-width: 560px) {
    .hero-affil { flex-direction: column; gap: 2px; }
    .hero-affil span + span::before { display: none; }
}

/* ---------- Adaptive primary navigation (fits any number of links) ---------- */
.brand, .header-actions { flex: 0 0 auto; }
.brand { margin-right: 0; }
.primary-nav { flex: 1 1 auto; min-width: 0; display: flex; }
.primary-nav .nav-list { margin-left: auto; flex-wrap: nowrap; }
.js .primary-nav:not(.is-ready), html:not(.js) .primary-nav { overflow: hidden; }
.nav-link { padding: 8px 8px; white-space: nowrap; }
.nav-more { position: relative; }
.nav-more[hidden] { display: none; }
.nav-more-btn { display: inline-flex; align-items: center; gap: 3px; background: none; border: 0; cursor: pointer; font: 500 .84rem/1.2 var(--sans); }
.nav-more-btn .p-icon { width: 14px; height: 14px; transition: transform .25s var(--ease); }
.nav-more-btn[aria-expanded="true"] { color: var(--text); background: var(--bg-alt); }
.nav-more-btn[aria-expanded="true"] .p-icon { transform: rotate(180deg); }
.primary-nav .nav-more-menu {
    position: absolute; right: 0; top: calc(100% + 12px); z-index: 65; display: block; min-width: 200px; margin: 0; padding: 6px;
    list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
    box-shadow: 0 22px 46px -24px rgba(10, 20, 40, .5); animation: rise .25s var(--ease);
}
.primary-nav .nav-more-menu[hidden] { display: none; }
.nav-more-menu .nav-link { display: block; padding: 9px 12px; border-radius: 8px; font-size: .88rem; }
.nav-more-menu .nav-link::before, .nav-more-menu .nav-link::after { display: none; }
.nav-more-menu .nav-link:hover { background: var(--bg-alt); }
.nav-more-menu .nav-link.is-active { color: var(--accent-text); background: var(--accent-soft); }
@media (min-width: 901px) { .primary-nav { display: flex; } .menu-btn { display: none; } }
@media (max-width: 900px) { .primary-nav { display: none; } .menu-btn { display: inline-flex; } }
.primary-nav .nav-list { align-items: center; }
.nav-more-btn { font-family: var(--sans); font-size: .84rem; font-weight: 500; line-height: inherit; color: var(--text-2); }
