/* ============================================
   Beckwith Lab — Genome Architecture & Precision Medicine
   Modern, responsive, accessible
   ============================================ */

/* Variables */
:root {
    --color-bg: #ffffff;
    --color-surface: #f7f8fa;
    --color-dark: #0f172a;
    --color-dark-surface: #1e293b;
    --color-text: #1e293b;
    --color-text-secondary: #64748b;
    --color-text-muted: #94a3b8;
    --color-accent: #2563eb;
    --color-accent-light: #3b82f6;
    --color-accent-dark: #1d4ed8;
    --color-border: #e2e8f0;
    --color-border-light: #f1f5f9;
    --radius: 12px;
    --radius-sm: 6px;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --transition: 0.2s ease;
    --max-width: 1200px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

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

body {
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.6;
    color: var(--color-text);
    background: var(--color-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img, picture, video, canvas, svg {
    display: block;
    max-width: 100%;
}

/* Skip link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--color-accent);
    color: white;
    padding: 8px 16px;
    z-index: 10000;
    text-decoration: none;
    border-radius: 0 0 var(--radius-sm) 0;
    font-weight: 500;
    font-size: 14px;
}
.skip-link:focus {
    top: 0;
}

/* Container */
.container {
    width: 100%;
    max-width: var(--max-width);
    margin-inline: auto;
    padding-inline: 1.5rem;
}
.container.narrow {
    max-width: 800px;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--color-border-light);
    transition: var(--transition);
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.logo {
    font-size: 1.25rem;
    font-weight: 300;
    color: var(--color-text);
    text-decoration: none;
    letter-spacing: -0.02em;
}
.logo strong {
    font-weight: 700;
    color: var(--color-accent);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-link {
    color: var(--color-text-secondary);
    text-decoration: none;
    font-size: 0.9375rem;
    font-weight: 500;
    padding: 0.25rem 0;
    position: relative;
    transition: var(--transition);
}
.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--color-accent);
    transition: width 0.3s ease;
    border-radius: 1px;
}
.nav-link:hover,
.nav-link:focus {
    color: var(--color-accent);
    outline: none;
}
.nav-link:hover::after,
.nav-link:focus::after {
    width: 100%;
}

/* Mobile nav toggle */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    width: 40px;
    height: 40px;
    position: relative;
    z-index: 1001;
}

.hamburger,
.hamburger::before,
.hamburger::after {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--color-text);
    border-radius: 1px;
    transition: var(--transition);
}

.hamburger {
    position: relative;
}

.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    left: 0;
}

.hamburger::before { top: -7px; }
.hamburger::after { top: 7px; }

.nav-toggle[aria-expanded="true"] .hamburger {
    background: transparent;
}
.nav-toggle[aria-expanded="true"] .hamburger::before {
    top: 0;
    transform: rotate(45deg);
}
.nav-toggle[aria-expanded="true"] .hamburger::after {
    top: 0;
    transform: rotate(-45deg);
}

/* Hero */
.hero {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    overflow: hidden;
    padding: 5.5rem 0 4rem;
}

.hero-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(37, 99, 235, 0.12), transparent),
        radial-gradient(ellipse 60% 40% at 80% 100%, rgba(37, 99, 235, 0.06), transparent);
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 720px;
}

.hero-eyebrow {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-accent);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 1rem;
}

.hero-title {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 300;
    line-height: 1.1;
    letter-spacing: -0.03em;
    color: var(--color-text);
    margin-bottom: 0.5rem;
}

.hero-title .accent {
    font-weight: 700;
    color: var(--color-accent);
}

.hero-subtitle {
    font-size: clamp(1.125rem, 2.5vw, 1.5rem);
    font-weight: 400;
    color: var(--color-text-secondary);
    margin-bottom: 1.5rem;
}

.hero-subtitle .divider {
    opacity: 0.4;
    margin: 0 0.3em;
}

.hero-lead {
    font-size: 1.125rem;
    color: var(--color-text-secondary);
    line-height: 1.7;
    max-width: 560px;
    margin-inline: auto;
    margin-bottom: 2rem;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Banner image strip below the hero text */
.hero-banner {
    position: relative;
    z-index: 1;
    width: 100%;
    margin-bottom: 2.5rem;
}
.hero-banner img {
    width: 100%;
    height: auto;
    border-radius: var(--radius);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-lg);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.75rem;
    font-size: 0.9375rem;
    font-weight: 600;
    font-family: inherit;
    text-decoration: none;
    border-radius: var(--radius-sm);
    border: 2px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    line-height: 1.5;
}

.btn-primary {
    background: var(--color-accent);
    color: white;
    border-color: var(--color-accent);
}
.btn-primary:hover,
.btn-primary:focus {
    background: var(--color-accent-dark);
    border-color: var(--color-accent-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.btn-secondary {
    background: transparent;
    color: var(--color-text);
    border-color: var(--color-border);
}
.btn-secondary:hover,
.btn-secondary:focus {
    border-color: var(--color-text);
    background: var(--color-surface);
}

.btn-outline {
    background: transparent;
    color: var(--color-accent);
    border-color: var(--color-accent);
}
.btn-outline:hover,
.btn-outline:focus {
    background: var(--color-accent);
    color: white;
}

/* Sections */
.section {
    padding: 5rem 0;
}

.section-light {
    background: var(--color-bg);
}

.section-surface {
    background: var(--color-surface);
}

.section-dark {
    background: var(--color-dark);
    color: #e2e8f0;
}
.section-dark .section-title {
    color: white;
}
.section-dark a {
    color: #93c5fd;
}
.section-dark a:hover {
    color: #bfdbfe;
}

.section-title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
    text-align: center;
}

.section-lead {
    text-align: center;
    color: var(--color-text-secondary);
    font-size: 1.0625rem;
    margin-bottom: 3rem;
    max-width: 600px;
    margin-inline: auto;
}

/* Prose */
.prose {
    font-size: 1.0625rem;
    line-height: 1.75;
    color: var(--color-text-secondary);
}

.prose .lead {
    font-size: 1.25rem;
    color: var(--color-text);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.prose p {
    margin-bottom: 1.25rem;
}

.prose strong {
    color: var(--color-text);
    font-weight: 600;
}

/* Pillars / Cards */
.pillars {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.pillar-card {
    background: white;
    border-radius: var(--radius);
    padding: 2.5rem;
    border: 1px solid var(--color-border);
    transition: var(--transition);
}
/* specificity beats `.pillar-card p` below */
.pillar-card p.pillar-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-accent);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.5rem;
}

.project-list {
    list-style: none;
    margin-bottom: 1.25rem;
    display: grid;
    gap: 0.75rem;
}
.project-list > li {
    color: var(--color-text-secondary);
    line-height: 1.7;
    padding-left: 1rem;
    border-left: 2px solid var(--color-border);
}
.project-list strong {
    color: var(--color-text);
}

/* People on a research project */
.project-people {
    margin-top: 0.75rem;
}
.person-chips {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.person-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.35rem 0.85rem 0.35rem 0.35rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
}
.person-photo {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(37, 99, 235, 0.1);
    color: var(--color-accent);
    font-size: 0.75rem;
    font-weight: 600;
}
.person-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.person-text {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}
.person-name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--color-text);
}
.person-name a {
    color: inherit;
    text-decoration: none;
}
.person-name a:hover {
    color: var(--color-accent);
}
.person-role {
    font-size: 0.6875rem;
    color: var(--color-text-muted);
}

.pillar-card h3 {
    font-size: 1.375rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--color-text);
}

.pillar-card p {
    color: var(--color-text-secondary);
    line-height: 1.7;
    margin-bottom: 1.25rem;
}

/* Tag list */
.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    list-style: none;
}

.tag-list li {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--color-accent-dark);
    background: rgba(37, 99, 235, 0.08);
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
}

/* Grants */
.grants-block {
    background: white;
    border-radius: var(--radius);
    border: 1px solid var(--color-border);
    padding: 2rem 2.5rem;
}

.grants-block .h4 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    color: var(--color-text);
}

.grants-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.grant-item {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--color-border-light);
}
.grant-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.grant-funder {
    flex-shrink: 0;
    width: 170px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
    padding-top: 0.15rem;
}
.grant-funder img {
    /* tall cap only matters for squarer logos (Humboldt); wide ones hit max-width */
    height: 44px;
    width: auto;
    max-width: 150px;
    object-fit: contain;
    object-position: left center;
}
.grant-programme {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
    line-height: 1.3;
}

.grant-body {
    font-size: 0.9375rem;
    color: var(--color-text);
    line-height: 1.5;
}

.grant-meta {
    display: block;
    font-size: 0.8125rem;
    color: var(--color-text-muted);
    margin-top: 0.25rem;
}

/* Publications */
.publication-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.pub-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: white;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.5rem;
    transition: var(--transition);
}
.pub-card:hover {
    box-shadow: var(--shadow);
    border-color: var(--color-border-light);
}

.pub-figure {
    width: 100%;
    aspect-ratio: 16 / 9;
    max-height: 220px;
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-muted);
    font-size: 0.75rem;
    text-align: center;
    overflow: hidden;
    flex-shrink: 0;
    order: 1;
    margin-top: auto;
}
.pub-content {
    order: 0;
}
.pub-figure img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pub-content {
    min-width: 0;
}

.pub-title {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 0.4rem;
    color: var(--color-text);
}
.pub-title a {
    color: inherit;
    text-decoration: none;
}
.pub-title a:hover {
    color: var(--color-accent);
}

.pub-authors {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    margin-bottom: 0.35rem;
}

.pub-meta {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: center;
}

.pub-badge {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
}
.pub-badge--highlight {
    background: rgba(37, 99, 235, 0.1);
    color: var(--color-accent-dark);
}
.pub-badge--preprint {
    background: rgba(100, 116, 139, 0.1);
    color: var(--color-text-secondary);
}

.pub-note {
    font-size: 0.8125rem;
    color: var(--color-text-secondary);
    margin-top: 0.5rem;
    font-style: italic;
}

/* Team */
.team-grid {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}
.team-subgrid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1.25rem;
}
.team-alumni {
    text-align: center;
}
.team-alumni-list {
    list-style: none;
    margin-top: 0.75rem;
    font-size: 0.9375rem;
    color: var(--color-text-secondary);
    line-height: 1.9;
}
.team-alumni-name {
    color: var(--color-text);
    font-weight: 500;
}
.team-alumni-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0.5rem 0 0;
    text-align: center;
}

.team-card {
    background: white;
    border-radius: var(--radius);
    border: 1px solid var(--color-border);
    padding: 1.5rem;
    text-align: center;
    transition: var(--transition);
}

.team-photo {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: var(--color-surface);
    border: 2px solid var(--color-border);
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    overflow: hidden;
}
.team-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.team-name {
    font-size: 1.0625rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--color-text);
}

.team-name a {
    color: inherit;
    text-decoration: none;
}
.team-name a:hover {
    color: var(--color-accent);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.team-role {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    margin-bottom: 0.5rem;
}

.team-bio {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
    line-height: 1.5;
}

/* Open positions */
.positions-empty {
    text-align: center;
    color: var(--color-text-secondary);
}
.positions {
    list-style: none;
    display: grid;
    gap: 0.75rem;
}
.position {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    background: white;
    border: 1px solid var(--color-border);
    border-left: 4px solid var(--color-accent);
    border-radius: var(--radius-sm);
    padding: 1rem 1.25rem;
}
.position-title {
    font-weight: 600;
    color: var(--color-text);
    text-decoration: none;
}
.position-title:hover {
    color: var(--color-accent);
    text-decoration: underline;
    text-underline-offset: 3px;
}
.position-meta {
    font-size: 0.875rem;
    color: var(--color-text-muted);
}
.positions-note {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.9375rem;
    color: var(--color-text-secondary);
}
.positions-note a {
    color: var(--color-accent);
}

/* Code section */
.code-card {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    background: white;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 2rem;
}


.code-card p {
    color: var(--color-text-secondary);
    margin-bottom: 1rem;
    line-height: 1.6;
}

/* Contact */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: start;
}

.contact-info h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.contact-info p {
    margin-bottom: 1rem;
    line-height: 1.7;
}

.contact-info a {
    text-decoration: none;
}
.contact-info a:hover {
    text-decoration: underline;
}

.contact-address {
    font-size: 0.9375rem;
    opacity: 0.8;
}

/* Footer */
.site-footer {
    background: var(--color-dark);
    color: var(--color-text-muted);
    padding: 2rem 0;
    font-size: 0.875rem;
}

.footer-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.site-footer a {
    color: var(--color-text-secondary);
    text-decoration: none;
}
.site-footer a:hover {
    color: white;
}

/* Utilities */
.text-center { text-align: center; }

.link-arrow {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--color-accent);
    font-weight: 600;
    text-decoration: none;
    font-size: 0.9375rem;
}
.link-arrow::after {
    content: '→';
    transition: transform 0.2s;
}
.link-arrow:hover::after {
    transform: translateX(3px);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Responsive */
@media (max-width: 768px) {
    /* Too thin at full width on phones: show the middle panels larger */
    .hero-banner img {
        height: 160px;
        object-fit: cover;
    }
    .nav-toggle {
        display: block;
    }
    .nav-menu {
        position: fixed;
        inset: 64px 0 0 0;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        gap: 0;
        padding-top: 2rem;
        background: rgba(255, 255, 255, 0.97);
        backdrop-filter: blur(12px);
        transform: translateY(-100%);
        opacity: 0;
        pointer-events: none;
        transition: transform 0.3s ease, opacity 0.3s ease;
    }
    .nav-menu.open {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }
    .nav-link {
        display: block;
        padding: 1rem;
        font-size: 1.125rem;
    }
    .nav-link::after {
        display: none;
    }
    .hero-actions {
        flex-direction: column;
        align-items: center;
    }
    .btn {
        width: 100%;
        max-width: 280px;
    }
    .pub-figure {
        max-height: 200px;
    }
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    .pillars {
        grid-template-columns: 1fr;
    }
    .code-card {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .grant-item {
        flex-direction: column;
        gap: 0.5rem;
    }
    .grant-funder {
        align-self: flex-start;
        width: auto;
    }
    .team-subgrid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    .team-card {
        padding: 1rem 0.75rem;
    }
    .team-photo {
        width: 88px;
        height: 88px;
    }
    .footer-container {
        flex-direction: column;
        text-align: center;
    }
}

/* ============================================
   Publications — live list (OpenAlex)
   ============================================ */

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

/* Stats row */
.pub-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    max-width: 640px;
    margin: 0 auto 0.75rem;
}
.pub-stat {
    background: white;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.1rem 1rem;
    text-align: center;
}
.pub-stat-num {
    display: block;
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--color-accent-dark);
    font-variant-numeric: tabular-nums;
}
.pub-stat-label {
    display: block;
    font-size: 0.8125rem;
    color: var(--color-text-muted);
    margin-top: 0.15rem;
}
.pub-stats.is-loading .pub-stat-num {
    color: var(--color-text-muted);
}

/* Source line (live / cached / snapshot) */
.pub-source {
    text-align: center;
    font-size: 0.8125rem;
    color: var(--color-text-muted);
    margin-bottom: 3rem;
}
.pub-source a { color: var(--color-accent); }
.pub-live-dot {
    display: inline-block;
    width: 8px; height: 8px;
    border-radius: 50%;
    margin-right: 0.4rem;
    background: var(--color-text-muted);
    vertical-align: 1px;
}
.pub-live-dot.is-live {
    background: #16a34a;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.15);
}
.pub-live-dot.is-cache { background: #d97706; }
.pub-live-dot.is-snapshot { background: var(--color-text-muted); }

/* Highlights strip */
.pub-highlights-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 1rem;
    text-align: center;
}
.pub-list-title {
    margin-top: 3.5rem;
}
.pub-more-wrap {
    text-align: center;
    margin-top: 1.5rem;
}
.pub-more[hidden] {
    display: none;
}
.pub-highlights {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
    gap: 1.25rem;
    margin-bottom: 3rem;
}

/* Toolbar */
.pub-toolbar {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}
.pub-toolbar-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}
.pub-search {
    flex: 1 1 260px;
    max-width: 420px;
    padding: 0.6rem 0.9rem;
    font-size: 0.9375rem;
    font-family: inherit;
    color: var(--color-text);
    background: white;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    transition: var(--transition);
}
.pub-search:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.pub-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    cursor: pointer;
    user-select: none;
}
.pub-toggle input { accent-color: var(--color-accent); }

.pub-chips {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.pub-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.9rem;
    font-size: 0.875rem;
    font-weight: 500;
    font-family: inherit;
    color: var(--color-text-secondary);
    background: white;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    cursor: pointer;
    transition: var(--transition);
}
.pub-chip:hover { border-color: var(--color-accent); color: var(--color-accent); }
.pub-chip.is-active {
    background: var(--color-accent);
    border-color: var(--color-accent);
    color: white;
}
.pub-chip-count {
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(100, 116, 139, 0.12);
    border-radius: 999px;
    padding: 0.05rem 0.45rem;
    font-variant-numeric: tabular-nums;
}
.pub-chip.is-active .pub-chip-count {
    background: rgba(255, 255, 255, 0.25);
}

.pub-results {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
    margin-left: auto;
    font-variant-numeric: tabular-nums;
}

/* List: year groups + compact rows */
.publication-list { display: block; }
.pub-year-group { margin-bottom: 2rem; }
.pub-year-group:last-child { margin-bottom: 0; }
.pub-year-heading {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--color-text);
    padding-bottom: 0.5rem;
    margin-bottom: 0.75rem;
    border-bottom: 2px solid var(--color-border-light);
}

.pub-row {
    display: grid;
    grid-template-columns: 96px 1fr;
    gap: 1rem;
    padding: 1rem 0.25rem;
    border-bottom: 1px solid var(--color-border-light);
    transition: background 0.15s ease;
    border-radius: var(--radius-sm);
}
.pub-row:hover { background: rgba(37, 99, 235, 0.03); }
.pub-row:last-child { border-bottom: none; }

.pub-type {
    align-self: start;
    justify-self: start;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    margin-top: 0.15rem;
    white-space: nowrap;
}
.pub-type--article {
    background: rgba(37, 99, 235, 0.09);
    color: var(--color-accent-dark);
}
.pub-type--preprint {
    background: rgba(100, 116, 139, 0.12);
    color: var(--color-text-secondary);
}
.pub-type--other {
    background: rgba(124, 58, 237, 0.09);
    color: #6d28d9;
}

.pub-row-body { min-width: 0; }
.pub-title {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 0.3rem;
    color: var(--color-text);
}
.pub-title a {
    color: inherit;
    text-decoration: none;
}
.pub-title a:hover { color: var(--color-accent); }

.pub-authors {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    margin-bottom: 0.3rem;
    line-height: 1.55;
}
.pub-me { color: var(--color-text); font-weight: 600; }
.pub-authors-more {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    font-size: 0.8125rem;
    color: var(--color-accent);
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.pub-authors-more:hover { color: var(--color-accent-dark); }

.pub-venue-line {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}
.pub-dot-sep { opacity: 0.5; }
.pub-cites {
    font-weight: 600;
    color: var(--color-text-secondary);
    background: rgba(100, 116, 139, 0.08);
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
    font-variant-numeric: tabular-nums;
}
.pub-retracted {
    font-weight: 600;
    color: #b91c1c;
    background: rgba(185, 28, 28, 0.08);
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
}

.pub-links {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 0.35rem;
    font-size: 0.8125rem;
}
.pub-links a {
    color: var(--color-accent);
    text-decoration: none;
    padding: 0.1rem 0.45rem;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    transition: var(--transition);
}
.pub-links a:hover {
    background: rgba(37, 99, 235, 0.06);
    border-color: rgba(37, 99, 235, 0.25);
}
.pub-links-sep { color: var(--color-border); }

.pub-note {
    font-size: 0.8125rem;
    color: var(--color-text-secondary);
    margin-top: 0.4rem;
    font-style: italic;
}
.pub-note--auto {
    color: var(--color-text-muted);
    font-style: normal;
}

.pub-empty {
    text-align: center;
    color: var(--color-text-muted);
    padding: 2rem 0;
}

/* Skeleton while loading */
.pub-skeleton-row {
    height: 72px;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    background: linear-gradient(90deg, var(--color-surface) 25%, #eef2f7 50%, var(--color-surface) 75%);
    background-size: 200% 100%;
    animation: pubShimmer 1.4s infinite;
}
@keyframes pubShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.pub-noscript {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    font-size: 0.9375rem;
}
.pub-noscript a { color: #92400e; font-weight: 600; }

/* Team links (chips instead of emoji) */
.team-links {
    display: flex;
    gap: 0.4rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 0.75rem;
}
.team-link {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-accent-dark);
    background: rgba(37, 99, 235, 0.07);
    border: 1px solid rgba(37, 99, 235, 0.15);
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    text-decoration: none;
    transition: var(--transition);
}
.team-link:hover {
    background: rgba(37, 99, 235, 0.14);
}

@media (max-width: 640px) {
    .pub-row { grid-template-columns: 1fr; gap: 0.35rem; }
    .pub-type { justify-self: start; margin-bottom: 0.2rem; }
    .pub-stats { grid-template-columns: repeat(3, 1fr); gap: 0.5rem; }
    .pub-stat { padding: 0.8rem 0.5rem; }
    .pub-stat-num { font-size: 1.4rem; }
    .pub-results { margin-left: 0; }
}

