/* ==========================================================================
   Dr. Ronobir Chandra Sarker — site styles
   ========================================================================== */

:root {
    --primary: #2563eb;
    --primary-strong: #1d4ed8;
    --primary-soft: rgba(37, 99, 235, 0.10);
    --accent: #0d9488;
    --accent-soft: rgba(13, 148, 136, 0.12);
    --violet: #7c3aed;

    --text: #0f172a;
    --text-muted: #475569;
    --text-faint: #94a3b8;

    --bg: #ffffff;
    --bg-alt: #f6f8fc;
    --card: #ffffff;
    --math-bg: #f1f5f9;
    --border: #e2e8f0;
    --border-strong: #cbd5e1;

    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
    --shadow: 0 8px 24px -8px rgba(15, 23, 42, 0.12), 0 2px 6px rgba(15, 23, 42, 0.05);
    --shadow-lg: 0 24px 48px -16px rgba(15, 23, 42, 0.22);
    --ring: 0 0 0 4px rgba(37, 99, 235, 0.18);

    --radius: 18px;
    --radius-sm: 10px;
    --header-h: 72px;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
    --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
    --font-mono: 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;
}

[data-theme="dark"] {
    --primary: #60a5fa;
    --primary-strong: #93c5fd;
    --primary-soft: rgba(96, 165, 250, 0.14);
    --accent: #2dd4bf;
    --accent-soft: rgba(45, 212, 191, 0.14);
    --violet: #a78bfa;

    --text: #e5edf7;
    --text-muted: #a3b1c6;
    --text-faint: #64748b;

    --bg: #0b1220;
    --bg-alt: #0f172a;
    --card: #111a2c;
    --math-bg: #16213a;
    --border: #1f2a44;
    --border-strong: #2c3a5a;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow: 0 8px 24px -8px rgba(0, 0, 0, 0.6), 0 2px 6px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 24px 48px -16px rgba(0, 0, 0, 0.7);
    --ring: 0 0 0 4px rgba(96, 165, 250, 0.25);
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }

body {
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.65;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul, ol { list-style: none; }

.container { width: min(1180px, 100% - 2.5rem); margin-inline: auto; }

h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.15; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.4rem, 5.2vw, 4rem); }
h2 { font-size: clamp(1.9rem, 3.6vw, 2.6rem); }
h3 { font-size: 1.2rem; }

.skip-link {
    position: absolute; left: 1rem; top: -4rem; z-index: 2000;
    padding: 0.6rem 1rem; background: var(--primary); color: #fff; border-radius: var(--radius-sm);
    transition: top 0.2s;
}
.skip-link:focus { top: 1rem; }

:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; border-radius: 6px; }

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.header {
    position: sticky; top: 0; z-index: 1000;
    height: var(--header-h);
    background: color-mix(in srgb, var(--bg) 78%, transparent);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s, box-shadow 0.3s, background-color 0.3s;
}
.header.scrolled { border-bottom-color: var(--border); box-shadow: var(--shadow-sm); }

.header-content { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; }

.brand { display: flex; align-items: center; gap: 0.8rem; min-width: 0; }
.brand-mark {
    flex: 0 0 auto; width: 42px; height: 42px; border-radius: 12px;
    display: grid; place-items: center;
    font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--violet));
    box-shadow: 0 6px 14px -6px rgba(37, 99, 235, 0.6);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-name { font-weight: 700; font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-sub { font-size: 0.75rem; color: var(--text-muted); white-space: nowrap; }

.main-nav ul { display: flex; gap: 0.25rem; }
.nav-link {
    display: inline-block; padding: 0.5rem 0.9rem; border-radius: 999px;
    font-weight: 500; font-size: 0.95rem; color: var(--text-muted);
    transition: color 0.2s, background-color 0.2s;
}
.nav-link:hover { color: var(--text); background: var(--primary-soft); }
.nav-link.active { color: var(--primary); background: var(--primary-soft); }

.header-actions { display: flex; align-items: center; gap: 0.5rem; }
.icon-btn {
    width: 42px; height: 42px; border-radius: 12px;
    display: grid; place-items: center; font-size: 1rem;
    color: var(--text-muted); border: 1px solid var(--border); background: var(--card);
    transition: color 0.2s, border-color 0.2s, transform 0.2s, background-color 0.2s;
}
.icon-btn:hover { color: var(--primary); border-color: var(--primary); transform: translateY(-1px); }
.menu-btn { display: none; }

/* --------------------------------------------------------------------------
   Buttons, chips, badges
   -------------------------------------------------------------------------- */
.btn {
    display: inline-flex; align-items: center; gap: 0.55rem;
    padding: 0.8rem 1.4rem; border-radius: 999px;
    font-weight: 600; font-size: 0.95rem; line-height: 1;
    transition: transform 0.25s var(--ease), box-shadow 0.25s, background-color 0.2s, color 0.2s, border-color 0.2s;
}
.btn i { font-size: 0.85em; transition: transform 0.25s var(--ease); }
.btn:hover i.fa-arrow-right { transform: translateX(3px); }

.btn-primary {
    color: #fff;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-strong) 100%);
    box-shadow: 0 10px 22px -10px rgba(37, 99, 235, 0.7);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 28px -12px rgba(37, 99, 235, 0.75); }
[data-theme="dark"] .btn-primary { color: #0b1220; background: linear-gradient(135deg, #93c5fd, #60a5fa); }

.btn-ghost { color: var(--text); border: 1px solid var(--border-strong); background: var(--card); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-2px); }

.chip {
    padding: 0.45rem 1rem; border-radius: 999px; font-size: 0.875rem; font-weight: 500;
    color: var(--text-muted); border: 1px solid var(--border); background: var(--card);
    transition: all 0.2s;
}
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip.active { background: var(--text); color: var(--bg); border-color: var(--text); }

.badge {
    display: inline-block; padding: 0.15rem 0.55rem; border-radius: 999px;
    font-size: 0.7rem; font-weight: 600; letter-spacing: 0.02em; text-transform: uppercase;
    background: var(--math-bg); color: var(--text-muted); vertical-align: middle; margin-left: 0.35rem;
}
.badge.q1 { background: var(--primary-soft); color: var(--primary); }
.badge.status { background: rgba(245, 158, 11, 0.14); color: #b45309; }
.badge.status.ok { background: var(--accent-soft); color: var(--accent); }
[data-theme="dark"] .badge.status { color: #fbbf24; }

/* --------------------------------------------------------------------------
   Reveal on scroll
   -------------------------------------------------------------------------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.reveal.delay-1 { transition-delay: 0.12s; }
.reveal.delay-2 { transition-delay: 0.24s; }
@media (prefers-reduced-motion: reduce) {
    .reveal { opacity: 1; transform: none; transition: none; }
    html { scroll-behavior: auto; }
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */
.hero { position: relative; overflow: hidden; padding: clamp(3rem, 7vw, 6rem) 0 0; }

.hero-bg { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.blob { position: absolute; border-radius: 50%; filter: blur(70px); opacity: 0.55; }
.blob-1 { width: 520px; height: 520px; top: -160px; right: -120px; background: radial-gradient(circle, rgba(37, 99, 235, 0.45), transparent 65%); }
.blob-2 { width: 420px; height: 420px; bottom: -120px; left: -140px; background: radial-gradient(circle, rgba(13, 148, 136, 0.35), transparent 65%); }
.grid-lines {
    position: absolute; inset: 0;
    background-image: linear-gradient(var(--border) 1px, transparent 1px), linear-gradient(90deg, var(--border) 1px, transparent 1px);
    background-size: 48px 48px; opacity: 0.35;
    -webkit-mask-image: radial-gradient(ellipse at 50% 30%, #000 20%, transparent 70%);
    mask-image: radial-gradient(ellipse at 50% 30%, #000 20%, transparent 70%);
}
[data-theme="dark"] .blob { opacity: 0.4; }

.hero-content {
    position: relative; z-index: 1;
    display: grid; grid-template-columns: 1.15fr 0.85fr; gap: clamp(2rem, 5vw, 4.5rem);
    align-items: center; padding-bottom: clamp(3rem, 6vw, 5rem);
}

.eyebrow {
    display: inline-flex; align-items: center; gap: 0.5rem;
    font-size: 0.8rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
    color: var(--primary); margin-bottom: 1.1rem;
}
.eyebrow .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }

.hero-text, .hero-visual, .pub-body, .section-head { min-width: 0; }
.hero-text h1 { margin-bottom: 1.25rem; }
.grad-text {
    background: linear-gradient(120deg, var(--primary), var(--violet) 60%, var(--accent));
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lead { font-size: clamp(1.05rem, 1.4vw, 1.2rem); color: var(--text-muted); max-width: 58ch; margin-bottom: 2rem; }

.cta-buttons { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-bottom: 2.5rem; }

.stats { display: grid; grid-template-columns: repeat(3, auto); gap: 2.2rem; justify-content: start; }
.stat { display: flex; flex-direction: column; }
.stat dt { order: 2; font-size: 0.85rem; font-weight: 600; color: var(--text); }
.stat dd { order: 1; font-family: var(--font-display); font-size: 2.2rem; font-weight: 700; line-height: 1; color: var(--primary); }
.stat-note { order: 3; font-size: 0.75rem; color: var(--text-faint); }

/* Portrait */
.hero-visual { display: flex; justify-content: center; }
.portrait-wrap { position: relative; width: min(100%, 380px); aspect-ratio: 1; }
.portrait-ring {
    position: absolute; inset: -14px; border-radius: 34px;
    background: conic-gradient(from 200deg, var(--primary), var(--violet), var(--accent), var(--primary));
    opacity: 0.85; filter: blur(0.5px);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor; mask-composite: exclude; padding: 3px;
    transform: rotate(-4deg);
}

.portrait {
    position: relative; z-index: 1; width: 100%; aspect-ratio: 1; object-fit: cover;
    border-radius: 28px; box-shadow: var(--shadow-lg); background: var(--math-bg);
}

.float-card {
    position: absolute; z-index: 2;
    background: color-mix(in srgb, var(--card) 88%, transparent);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow);
    animation: floatY 6s ease-in-out infinite;
}
@keyframes floatY { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@media (prefers-reduced-motion: reduce) { .float-card { animation: none; } }

.float-eq { left: -48px; bottom: 28px; padding: 0.8rem 1.1rem 0.6rem; min-width: 210px; text-align: center; }
.float-eq .math-text { font-size: 0.95rem; margin: 0; }
.float-eq mjx-container { margin: 0 !important; }
.float-caption { font-size: 0.7rem; color: var(--text-faint); font-style: italic; margin-top: 0.15rem; }

.float-tag { right: -30px; top: 26px; display: flex; align-items: center; gap: 0.7rem; padding: 0.7rem 1rem; animation-delay: 1.5s; }
.float-tag i { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.float-tag strong { display: block; font-size: 0.85rem; }
.float-tag span { font-size: 0.72rem; color: var(--text-muted); white-space: nowrap; }

/* Journal strip */
.journal-strip { position: relative; z-index: 1; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--bg-alt) 70%, transparent); padding: 1rem 0; }
.journal-strip .container { display: flex; align-items: center; gap: 1.5rem; overflow: hidden; }
.strip-label { flex: 0 0 auto; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-faint); }
.journal-strip ul { display: flex; gap: 2.5rem; white-space: nowrap; overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none; }
.journal-strip ul::-webkit-scrollbar { display: none; }
.journal-strip li { font-family: var(--font-display); font-size: 0.98rem; font-weight: 500; color: var(--text-muted); }

/* --------------------------------------------------------------------------
   Sections
   -------------------------------------------------------------------------- */
.section { padding: clamp(4rem, 8vw, 6.5rem) 0; }
.section.alt { background: var(--bg-alt); }

.section-head { max-width: 680px; margin-bottom: clamp(2.2rem, 4vw, 3.2rem); }
.section-head .eyebrow { margin-bottom: 0.6rem; }
.section-head h2 { margin-bottom: 0.8rem; }
.section-lead { color: var(--text-muted); font-size: 1.05rem; }

/* Cards */
.card {
    position: relative; min-width: 0; background: var(--card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 1.6rem; box-shadow: var(--shadow-sm);
    transition: transform 0.35s var(--ease), box-shadow 0.35s, border-color 0.3s;
}
.card:hover { transform: translateY(-5px); box-shadow: var(--shadow); border-color: var(--border-strong); }
.card-icon {
    width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center;
    background: var(--primary-soft); color: var(--primary); font-size: 1.2rem; margin-bottom: 1.1rem;
}
.card h3 { margin-bottom: 0.5rem; }
.card p { color: var(--text-muted); font-size: 0.95rem; }

.math-preview, .math-text {
    background: var(--math-bg); border-radius: var(--radius-sm); padding: 0.75rem 1rem;
    margin-top: 1.1rem; overflow-x: auto; overflow-y: hidden; text-align: center; font-size: 0.95rem;
}
mjx-container[display="true"] { margin: 0.3em 0 !important; min-width: 0 !important; }
.math-preview mjx-container, .math-text mjx-container { max-width: 100%; }

/* Research */
.research-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.4rem; }
.research-card { display: flex; flex-direction: column; }
.research-card .math-preview { margin-top: auto; padding-top: 0.75rem; }
.research-card p + .math-preview { margin-top: 1.1rem; }
.research-image { margin-top: 1.1rem; border-radius: var(--radius-sm); border: 1px solid var(--border); background: #f8fafc; }

/* Publications */
.pub-filters { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.6rem; }
.pub-list { display: flex; flex-direction: column; border-top: 1px solid var(--border); }
.pub {
    display: grid; grid-template-columns: 72px 1fr; gap: 1.2rem; padding: 1.4rem 0.5rem;
    border-bottom: 1px solid var(--border); transition: background-color 0.2s;
}
.pub:hover { background: color-mix(in srgb, var(--card) 60%, transparent); }
.pub[hidden] { display: none; }
.pub-year { font-family: var(--font-mono); font-size: 0.85rem; color: var(--text-faint); padding-top: 0.25rem; }
.pub-body h3 { font-family: var(--font-sans); font-size: 1.05rem; font-weight: 600; line-height: 1.4; margin-bottom: 0.35rem; }
.pub-authors { font-size: 0.9rem; color: var(--text-muted); }
.pub-authors strong { color: var(--text); font-weight: 600; }
.pub-venue { font-size: 0.9rem; color: var(--text-muted); margin-top: 0.2rem; }
.pub-empty, .notes-empty { text-align: center; color: var(--text-faint); padding: 2rem 0; }

/* Teaching */
.search-container { position: relative; max-width: 560px; margin-bottom: 2rem; }
.search-icon { position: absolute; left: 1.1rem; top: 50%; transform: translateY(-50%); color: var(--text-faint); pointer-events: none; }
.search-input {
    width: 100%; padding: 0.9rem 1.1rem 0.9rem 2.9rem; border-radius: 999px;
    border: 1px solid var(--border); background: var(--card); color: var(--text); font: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.search-input:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); }
.search-input::-webkit-search-cancel-button { cursor: pointer; }

.notes-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.4rem; }
.note-card { display: flex; flex-direction: column; }
.note-card[hidden] { display: none; }
.note-tag { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); margin-bottom: 0.4rem; }
.note-card .math-preview { margin-top: auto; }
.note-card p + .math-preview { margin-top: 1rem; }
.card-link { display: inline-flex; align-items: center; gap: 0.4rem; margin-top: 1rem; font-size: 0.9rem; font-weight: 600; color: var(--primary); }
.card-link i { font-size: 0.75em; transition: transform 0.25s var(--ease); }
.note-card:hover .card-link i { transform: translate(2px, -2px); }

/* Contact */
.contact-grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: clamp(2rem, 4vw, 4rem); align-items: start; }
.contact-info { display: flex; flex-direction: column; gap: 1.1rem; }
.contact-item {
    display: flex; align-items: center; gap: 1rem; padding: 1rem 1.1rem;
    background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm);
    transition: border-color 0.2s, transform 0.25s var(--ease);
}
a.contact-item:hover { border-color: var(--primary); transform: translateX(4px); }
.contact-icon { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.contact-item strong { display: block; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-faint); }
.contact-item span span { color: var(--text); word-break: break-word; }

.social-links { display: flex; gap: 0.7rem; margin-top: 0.5rem; }
.social-links a {
    width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
    background: var(--card); border: 1px solid var(--border); color: var(--text-muted); font-size: 1.1rem;
    transition: all 0.2s;
}
.social-links a:hover { color: var(--primary); border-color: var(--primary); transform: translateY(-3px); }

.contact-form { padding: 1.8rem; }
.contact-form:hover { transform: none; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-group { display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: 1rem; }
.form-group label { font-size: 0.85rem; font-weight: 600; }
.form-group input, .form-group textarea {
    padding: 0.8rem 0.95rem; border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: var(--bg); color: var(--text); font: inherit; transition: border-color 0.2s, box-shadow 0.2s;
}
.form-group input:focus, .form-group textarea:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); }
.form-group textarea { min-height: 140px; resize: vertical; }
.form-hint { margin-top: 0.8rem; font-size: 0.8rem; color: var(--text-faint); }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.footer { border-top: 1px solid var(--border); padding: 1.8rem 0; }
.footer-content { display: flex; align-items: center; justify-content: space-between; gap: 1rem; font-size: 0.9rem; color: var(--text-muted); }
.footer-links { display: flex; gap: 1.4rem; }
.footer-links a:hover { color: var(--primary); }
.back-top { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; border: 1px solid var(--border); color: var(--text-muted); transition: all 0.2s; }
.back-top:hover { color: var(--primary); border-color: var(--primary); transform: translateY(-2px); }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
    .hero-content { grid-template-columns: 1fr; }
    .hero-visual { order: -1; }
    .portrait-wrap { width: min(100%, 300px); }
    .float-eq { left: -20px; }
    .float-tag { right: -16px; }
    .stats { gap: 1.6rem; }
}

@media (max-width: 860px) {
    .brand-sub { display: none; }
    .menu-btn { display: grid; }
    .main-nav {
        position: fixed; top: var(--header-h); left: 0; right: 0;
        background: var(--bg); border-bottom: 1px solid var(--border); box-shadow: var(--shadow);
        padding: 0.8rem 1.25rem 1.2rem;
        transform: translateY(-8px); opacity: 0; visibility: hidden;
        transition: transform 0.25s var(--ease), opacity 0.25s, visibility 0.25s;
    }
    .main-nav.open { transform: none; opacity: 1; visibility: visible; }
    .main-nav ul { flex-direction: column; gap: 0.2rem; }
    .nav-link { display: block; padding: 0.8rem 1rem; font-size: 1.05rem; }
    .contact-grid { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .footer-content { flex-direction: column; text-align: center; }
}

@media (max-width: 560px) {
    .container { width: min(1180px, 100% - 2rem); }
    .brand-name { font-size: 0.9rem; max-width: 46vw; }
    .portrait-wrap { width: min(100% - 40px, 260px); margin: 0 auto 1rem; }
    .float-eq { left: -28px; bottom: -14px; min-width: 180px; }
    .float-eq .math-text { font-size: 0.8rem; }
    .float-tag { right: -20px; top: -14px; padding: 0.55rem 0.8rem; }
    .stats { grid-template-columns: repeat(3, 1fr); gap: 0.8rem; }
    .stat dd { font-size: 1.7rem; }
    .stat-note { display: none; }
    .pub { grid-template-columns: 1fr; gap: 0.3rem; }
    .pub-year { padding-top: 0; }
    .card { padding: 1.3rem; }
    .contact-form { padding: 1.3rem; }
}

/* Theme-toggle icon swap */
[data-theme="dark"] #theme-toggle .fa-moon::before { content: "\f185"; }

/* --------------------------------------------------------------------------
   About / timeline
   -------------------------------------------------------------------------- */
.about-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: start; }
.about-text h2 { margin-bottom: 1rem; }
.about-text p { color: var(--text-muted); margin-bottom: 1rem; }
.about-text p a { color: var(--primary); font-weight: 500; }
.about-text p a:hover { text-decoration: underline; }
.tag-list { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1.2rem 0; }
.tag-list li { padding: 0.35rem 0.8rem; border-radius: 999px; font-size: 0.82rem; font-weight: 500; background: var(--primary-soft); color: var(--primary); }
.id-links { display: flex; flex-wrap: wrap; gap: 1.2rem; font-size: 0.9rem; }
.id-links a { display: inline-flex; align-items: center; gap: 0.45rem; color: var(--text-muted); font-family: var(--font-mono); font-size: 0.82rem; }
.id-links a:hover { color: var(--primary); }
.id-links i { color: var(--accent); }

.timeline { position: relative; padding-left: 1.6rem; border-left: 2px solid var(--border); display: flex; flex-direction: column; gap: 1.6rem; }
.tl-item { position: relative; }
.tl-item::before { content: ''; position: absolute; left: calc(-1.6rem - 7px); top: 0.45rem; width: 12px; height: 12px; border-radius: 50%; background: var(--bg); border: 3px solid var(--primary); }
.tl-item:first-child::before { background: var(--primary); box-shadow: 0 0 0 5px var(--primary-soft); }
.tl-date { display: block; font-family: var(--font-mono); font-size: 0.78rem; color: var(--text-faint); margin-bottom: 0.2rem; }
.tl-item h3 { font-family: var(--font-sans); font-size: 1rem; font-weight: 600; }
.tl-item p { color: var(--text-muted); font-size: 0.9rem; }

/* Publications feed */
.pub-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.6rem; }
.pub-filters { margin-bottom: 0; }
.pub-external { display: flex; gap: 1.2rem; font-size: 0.9rem; }
.pub-external a { display: inline-flex; align-items: center; gap: 0.4rem; color: var(--text-muted); font-weight: 500; }
.pub-external a:hover { color: var(--primary); }
.pub-body h3 a { color: inherit; }
.pub-body h3 a:hover { color: var(--primary); }
.pub-cite { display: inline-flex; align-items: center; gap: 0.3rem; margin-left: 0.6rem; font-size: 0.8rem; color: var(--text-faint); }
.pub-doi { display: inline-block; margin-left: 0.6rem; font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-faint); }
.pub-doi:hover { color: var(--primary); }
.pub-status { margin-top: 1.2rem; font-size: 0.85rem; color: var(--text-faint); display: flex; align-items: center; gap: 0.5rem; }
.pub-status a { color: var(--text-muted); text-decoration: underline; text-underline-offset: 3px; }
.pub-status a:hover { color: var(--primary); }
.skeleton .sk-line { height: 0.9rem; border-radius: 6px; background: linear-gradient(90deg, var(--math-bg) 25%, var(--border) 50%, var(--math-bg) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; margin-bottom: 0.55rem; }
.skeleton .w90 { width: 90%; } .skeleton .w80 { width: 80%; } .skeleton .w70 { width: 70%; } .skeleton .w50 { width: 50%; } .skeleton .w40 { width: 40%; } .skeleton .w30 { width: 30%; }
@keyframes shimmer { to { background-position: -200% 0; } }

@media (max-width: 860px) {
    .about-grid { grid-template-columns: 1fr; }
}
