@import url('https://fonts.googleapis.com/css2?family=Crimson+Text:ital@0;1&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --bg-base: #101114;
    --text-main: #f3f4f6;
    --text-muted: #a1a1aa;
    --accent: #60a5fa;
    --accent-light: #93c5fd;
    --accent-dark: #3b82f6;
    --accent-rgb: 96, 165, 250;
    --bg-base-rgb: 16, 17, 20;
    --panel-bg: #181b22;
    --panel-border: #2a3140;
    --panel-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    --blur: none;
}

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

html, body {
    min-height: 100%;
    background: var(--bg-base);
    color: var(--text-main);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    scroll-behavior: smooth;
}

a {
    color: var(--accent);
    text-decoration-color: rgba(var(--accent-rgb), 0.5);
    text-underline-offset: 0.18em;
    transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

a:hover {
    color: var(--accent-light);
    text-decoration-color: rgba(var(--accent-rgb), 0.8);
}

a:focus-visible {
    outline: 2px solid rgba(var(--accent-rgb), 0.45);
    outline-offset: 3px;
}

#fluid-canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    z-index: 0;
    pointer-events: none;
}

.background-overlay {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: linear-gradient(135deg, rgba(var(--bg-base-rgb), 0.72) 0%, rgba(var(--bg-base-rgb), 0.88) 100%);
}

.site-wrapper {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem 1.5rem;
    min-height: 100vh;
}

/* Header / Navbar */
header {
    width: 100%;
    max-width: 1200px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    margin-bottom: 5rem;
    animation: fadeInDown 0.8s ease backwards;
}

header .logo {
    font-weight: 700;
    font-size: 1.3rem;
    letter-spacing: -0.01em;
    color: var(--text-main);
    text-decoration: none;
    font-family: 'Crimson Text', serif;
}

header .logo span {
    color: var(--accent);
}

header nav a {
    color: var(--text-muted);
    text-decoration: none;
    margin-left: 2rem;
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

header nav a:hover {
    color: var(--text-main);
}

.hamburger-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.hamburger-btn span {
    width: 24px;
    height: 2px;
    background: var(--text-main);
    transition: all 0.3s ease;
}

.hamburger-btn.open span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.hamburger-btn.open span:nth-child(2) {
    opacity: 0;
}

.hamburger-btn.open span:nth-child(3) {
    transform: rotate(-45deg) translate(8px, -8px);
}

header nav {
    display: flex;
    gap: 0;
}

header nav > a,
header nav > .nav-dropdown {
    margin-left: 2rem;
    display: flex;
    align-items: center;
}

.nav-dropdown {
    position: relative;
}

.nav-dropdown-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s ease;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-dropdown-btn::after {
    content: '▼';
    font-size: 0.65rem;
    transition: transform 0.2s ease;
}

.nav-dropdown-menu.show .nav-dropdown-btn::after {
    transform: rotate(180deg);
}

.nav-dropdown-btn:hover {
    color: var(--text-main);
}

.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    margin-top: 0.5rem;
    z-index: 100;
    min-width: 200px;
}

.nav-dropdown-menu.show {
    display: block;
}

.nav-dropdown-menu a {
    display: block;
    padding: 0.75rem 1.25rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s ease;
    border: none;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.nav-dropdown-menu a:hover {
    color: var(--text-main);
    background: rgba(var(--accent-rgb), 0.1);
}

.nav-dropdown-menu a::before {
    font-size: 1.1rem;
}

.nav-dropdown-menu a[href*="bibtex"]::before {
    content: '📚';
}

.nav-dropdown-menu a[href*="markdown"]::before {
    content: '📄';
}

/* Main Content Area */
main {
    width: 100%;
    max-width: 1200px;
    display: flex;
    flex-direction: column;
    gap: 4rem;
}

/* Hero Section */
.hero {
    padding: 2rem 1rem 0;
    animation: fadeInUp 1s ease backwards 0.2s;
}

.hero h1 {
    font-size: clamp(3.5rem, 9vw, 5.5rem);
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.03em;
    margin-bottom: 1.5rem;
    font-family: 'Crimson Text', serif;
}

.hero h1 span.highlight {
    color: var(--accent);
}

.hero p.subtitle {
    font-size: clamp(1.15rem, 2.5vw, 1.4rem);
    color: var(--text-muted);
    max-width: 650px;
    line-height: 1.6;
    margin-bottom: 2.5rem;
    font-weight: 400;
}

.hero-actions {
    display: flex;
    gap: 1.25rem;
}

/* Enhanced Hero for Homepage */
.hero.hero-featured {
    padding: 5rem 1rem 4rem;
    text-align: center;
    width: 100%;
}

.hero.hero-featured h1 {
    font-size: clamp(5rem, 14vw, 9rem);
    line-height: 0.95;
    letter-spacing: -0.05em;
    margin-bottom: 2rem;
}

.hero.hero-featured h1 span.highlight {
    color: var(--accent);
    transition: all 0.3s ease;
}

.hero.hero-featured h1 span.highlight:hover {
    text-shadow: 0 0 20px rgba(var(--accent-rgb), 0.4), 0 0 30px rgba(var(--accent-rgb), 0.2);
    transform: translateY(-2px);
}

.hero.hero-featured p.subtitle {
    font-size: clamp(1.5rem, 3.5vw, 1.9rem);
    margin: 0 auto 3.5rem;
    line-height: 1.7;
    max-width: 800px;
}

.hero.hero-featured .hero-actions {
    gap: 1.5rem;
    justify-content: center;
}

/* Simpler Hero for Projects Page */
.hero:not(.hero-featured) h1 {
    font-size: clamp(3rem, 8vw, 5rem);
    line-height: 1;
}

.hero:not(.hero-featured) h1 span.highlight {
    color: var(--accent);
}

.hero:not(.hero-featured) p.subtitle {
    font-size: clamp(1.15rem, 2.5vw, 1.4rem);
    margin-bottom: 2rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.9rem 2rem;
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    cursor: pointer;
}

.btn-primary {
    background: var(--accent);
    color: var(--bg-base);
}

.btn-primary:hover {
    background: var(--accent-light);
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(var(--accent-rgb), 0.2);
}

.btn-secondary {
    background: transparent;
    color: var(--text-main);
    border: 1px solid var(--panel-border);
}

.btn-secondary:hover {
    background: var(--panel-bg);
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-2px);
}

/* Glass Panel */
.panel {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    padding: clamp(2.5rem, 6vw, 4rem);
    box-shadow: var(--panel-shadow);
    animation: fadeInUp 1s ease backwards 0.4s;
}

/* About Section */
.about-grid {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) 2fr;
    gap: 4rem;
    align-items: center;
}

.about-image {
    width: 100%;
    border-radius: 0;
    object-fit: cover;
    border: 1px solid var(--panel-border);
    background: rgba(0, 0, 0, 0.3);
    box-shadow: var(--panel-shadow);
    transition: transform 0.3s ease;
}

.about-image:hover {
    transform: scale(1.02);
}

.about-copy h2 {
    font-size: clamp(2rem, 4vw, 2.75rem);
    font-weight: 700;
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
    color: var(--text-main);
    font-family: 'Crimson Text', serif;
}

.about-copy p {
    color: var(--text-muted);
    line-height: 1.8;
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

.about-copy p:last-child {
    margin-bottom: 0;
}

/* Career Timeline */
.timeline-section {
    animation: fadeInUp 1s ease backwards 0.48s;
}

.timeline-header {
    margin-bottom: 2rem;
}

.timeline-header h2 {
    font-size: clamp(2rem, 4vw, 2.75rem);
    color: var(--text-main);
    margin-bottom: 0.75rem;
    font-family: 'Crimson Text', serif;
    letter-spacing: -0.02em;
}

.timeline-header p {
    color: var(--text-muted);
    max-width: 720px;
    margin: 0;
    line-height: 1.7;
}

.career-timeline {
    list-style: none;
    margin: 0;
    padding: 0;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.career-timeline::before {
    content: '';
    position: absolute;
    top: 0.55rem;
    bottom: 0.55rem;
    left: 7.3rem;
    width: 1px;
    background: linear-gradient(180deg, rgba(var(--accent-rgb), 0.95), rgba(42, 49, 64, 0.65));
}

.timeline-item {
    position: relative;
    display: grid;
    grid-template-columns: 6.5rem 1fr;
    gap: 1.4rem;
    align-items: start;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: calc(7.3rem - 6px);
    top: 0.7rem;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid var(--bg-base);
    box-shadow: 0 0 0 1px rgba(var(--accent-rgb), 0.45);
}

.timeline-date {
    color: var(--accent);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
    padding-top: 0.45rem;
}

.timeline-content {
    border: 1px solid var(--panel-border);
    background: rgba(var(--accent-rgb), 0.06);
    padding: 1rem 1.25rem;
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.timeline-content:hover {
    transform: translateX(4px);
    border-color: rgba(var(--accent-rgb), 0.55);
    background: rgba(var(--accent-rgb), 0.1);
}

.timeline-content h3 {
    margin-bottom: 0.5rem;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    letter-spacing: -0.01em;
}

.timeline-content p {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.65;
    color: var(--text-muted);
}

/* Footer */
footer {
    width: 100%;
    max-width: 1200px;
    margin-top: 5rem;
    padding: 1.75rem;
    border: 1px solid var(--panel-border);
    background: var(--panel-bg);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    animation: fadeInUp 1s ease backwards 0.6s;
}

.social-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.social-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0.95rem;
    border: 1px solid var(--panel-border);
    background: rgba(var(--accent-rgb), 0.05);
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

.social-link svg {
    width: 1rem;
    height: 1rem;
    fill: currentColor;
    flex-shrink: 0;
}

.social-link:hover {
    color: var(--accent);
    border-color: rgba(var(--accent-rgb), 0.6);
    background: rgba(var(--accent-rgb), 0.12);
    transform: translateY(-2px);
}

footer p {
    margin: 0;
    font-size: 0.86rem;
    letter-spacing: 0.02em;
}

/* Animations */
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 768px) {
    .site-wrapper {
        padding: 1.5rem 1rem;
    }

    header {
        position: relative;
        flex-direction: row;
        gap: 1.25rem;
        padding: 1rem 1.25rem;
        margin-bottom: 2.5rem;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        max-width: 100%;
    }

    .hamburger-btn {
        display: flex;
        position: relative;
        z-index: 101;
    }

    header .logo {
        flex: 1;
    }

    header nav {
        display: none;
        position: absolute;
        top: 100%;
        left: -1.25rem;
        right: -1.25rem;
        flex-direction: column;
        gap: 0;
        background: var(--panel-bg);
        border: 1px solid var(--panel-border);
        border-top: none;
        margin-top: 0;
        z-index: 100;
        pointer-events: auto;
    }

    header nav.open {
        display: flex;
    }

    header nav > a,
    header nav > .nav-dropdown {
        margin-left: 0;
        padding: 0.75rem 1.25rem;
        border-bottom: 1px solid var(--panel-border);
    }

    header nav > a:last-child,
    header nav > .nav-dropdown:last-child {
        border-bottom: none;
    }

    .nav-dropdown-menu {
        position: static;
        background: #141821;
        border: none;
        border-top: 1px solid var(--panel-border);
        margin-top: 0;
        min-width: auto;
        display: none;
    }

    .nav-dropdown-menu.show {
        display: block;
    }

    .nav-dropdown-menu a {
        padding: 0.5rem 2rem;
        border-bottom: 1px solid rgba(42, 49, 64, 0.5);
    }

    .nav-dropdown-menu a:last-child {
        border-bottom: none;
    }

    .about-grid {
        grid-template-columns: 1fr;
        gap: 2.5rem;
        text-align: center;
    }

    .about-image {
        max-width: 300px;
        margin: 0 auto;
    }

    .timeline-header {
        text-align: center;
    }

    .career-timeline::before {
        left: 0.5rem;
    }

    .timeline-item {
        grid-template-columns: 1fr;
        gap: 0.55rem;
        padding-left: 1.8rem;
    }

    .timeline-item::before {
        left: 0;
        top: 0.72rem;
    }

    .timeline-date {
        padding-top: 0;
        font-size: 0.75rem;
    }

    .timeline-content:hover {
        transform: none;
    }

    .hero {
        text-align: center;
    }

    .hero p.subtitle {
        margin: 0 auto 2rem;
    }

    .hero-actions {
        justify-content: center;
    }

    .hero.hero-featured h1 {
        font-size: clamp(3.5rem, 11vw, 6rem);
        margin-bottom: 1.5rem;
    }

    .hero.hero-featured p.subtitle {
        font-size: clamp(1.2rem, 3vw, 1.5rem);
        margin: 0 auto 2.5rem;
    }

    .hero.hero-featured h1 span.highlight {
        padding-bottom: 0;
    }

    main {
        gap: 2.5rem;
    }

    footer {
        padding: 1.25rem;
    }

    .social-links {
        gap: 0.5rem;
    }

    .social-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }
}

/* Publications Section & Carousel */
.publications {
    animation: fadeInUp 1s ease backwards 0.5s;
}

.section-header {
    margin-bottom: 2rem;
    text-align: center;
}

.section-header h2 {
    font-size: clamp(2rem, 4vw, 2.5rem);
    color: var(--text-main);
    margin-bottom: 0.5rem;
    font-family: 'Crimson Text', serif;
}

.section-header p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.carousel-container {
    display: flex;
    align-items: center;
    position: relative;
    gap: 1rem;
    width: 100%;
}

.carousel-track {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    padding-bottom: 1rem;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none;  /* IE and Edge */
    flex: 1;
}

.carousel-track::-webkit-scrollbar {
    display: none;
}

.paper-card {
    min-width: 100%;
    flex: 0 0 100%;
    scroll-snap-align: start;
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

@media (min-width: 768px) {
    .paper-card {
        min-width: calc(50% - 0.75rem);
        flex: 0 0 calc(50% - 0.75rem);
    }
}

.paper-meta {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent);
    font-weight: 600;
}

.paper-title {
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.4;
    color: #fff;
}

.paper-authors {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 1rem;
    flex-grow: 1;
}

.paper-links {
    display: flex;
    gap: 0.75rem;
    margin-top: auto;
}

.card-btn {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

.carousel-btn {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    color: var(--text-main);
    width: 40px;
    height: 40px;
    border-radius: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transition: all 0.2s ease;
    z-index: 10;
}

.carousel-btn:hover {
    background: var(--accent);
    color: var(--bg-base);
    transform: scale(1.1);
}

.paper-card:hover {
    transform: translateY(-4px);
    border-color: rgba(var(--accent-rgb), 0.45);
}

.highlight-author {
    color: var(--accent);
    font-weight: 700;
}

.carousel-empty {
    color: var(--text-muted);
    text-align: center;
    padding: 1.75rem;
    width: 100%;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(var(--bg-base-rgb), 0.9);
}

.modal-backdrop.show {
    display: flex;
}

.modal-panel {
    width: min(760px, 100%);
    max-height: min(86vh, 760px);
    overflow: auto;
    position: relative;
    border-radius: 0;
    padding: 2rem;
    border: 1px solid var(--panel-border);
}

.modal-close {
    border: 1px solid var(--panel-border);
    background: rgba(148, 163, 184, 0.08);
    color: var(--text-main);
    border-radius: 0;
    width: 36px;
    height: 36px;
    cursor: pointer;
    font-size: 1.25rem;
    line-height: 1;
    position: absolute;
    top: 1rem;
    right: 1rem;
}

.modal-meta {
    color: var(--accent);
    font-size: 0.9rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 0.8rem;
}

.modal-title {
    font-size: clamp(1.3rem, 2.4vw, 1.95rem);
    line-height: 1.3;
    margin-bottom: 0.8rem;
}

.modal-authors {
    color: var(--text-muted);
    margin-bottom: 1.25rem;
    line-height: 1.5;
}

.modal-abstract {
    color: var(--text-main);
    line-height: 1.7;
    margin-bottom: 1.5rem;
    white-space: pre-wrap;
}

.modal-links {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Substack Section */
.substack {
    animation: fadeInUp 1s ease backwards 0.55s;
}

.post-card {
    min-width: 100%;
    flex: 0 0 100%;
    scroll-snap-align: start;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.post-thumb-wrap {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 0;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(24, 27, 34, 0.7);
    margin-bottom: 0.45rem;
}

.post-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

@media (min-width: 768px) {
    .post-card {
        min-width: calc(50% - 0.75rem);
        flex: 0 0 calc(50% - 0.75rem);
    }
}

.post-date {
    font-size: 0.85rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.post-title {
    font-size: 1.2rem;
    line-height: 1.35;
    color: #fff;
}

.post-excerpt {
    color: var(--text-muted);
    line-height: 1.6;
    font-size: 0.97rem;
    flex-grow: 1;
}

.post-links {
    margin-top: auto;
    display: flex;
    gap: 0.75rem;
}

@media (max-width: 768px) {
    .carousel-btn {
        display: none;
    }

    .modal-panel {
        padding: 1.25rem;
    }
}

/* Projects Page Styles */
.projects-section {
    animation: fadeInUp 1s ease backwards 0.4s;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    width: 100%;
    margin-bottom: 3rem;
}

.project-card {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    transition: all 0.2s ease;
    cursor: pointer;
}

.project-card:hover {
    transform: translateY(-4px);
    border-color: rgba(var(--accent-rgb), 0.55);
    box-shadow: 0 8px 16px rgba(var(--accent-rgb), 0.1);
}

.project-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.project-year,
.project-date,
.project-type {
    color: var(--accent);
    font-weight: 600;
}

.project-type {
    background: rgba(var(--accent-rgb), 0.15);
    padding: 0.25rem 0.5rem;
    border-radius: 2px;
}

.badge-featured {
    background: rgba(var(--accent-rgb), 0.25);
    color: var(--accent);
    padding: 0.3rem 0.7rem;
    border-radius: 2px;
    font-size: 0.75rem;
    font-weight: 700;
}

.project-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-main);
    line-height: 1.4;
    margin: 0.25rem 0 0;
}

.project-role,
.project-venue {
    font-size: 0.9rem;
    color: var(--accent);
    font-weight: 500;
    margin: 0;
}

.project-description {
    color: var(--text-muted);
    line-height: 1.6;
    font-size: 0.95rem;
    flex-grow: 1;
    margin: 0.5rem 0 0;
}

.project-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin: 0.5rem 0;
}

.tag-badge {
    background: rgba(var(--accent-rgb), 0.1);
    color: var(--text-muted);
    padding: 0.35rem 0.7rem;
    border-radius: 2px;
    font-size: 0.8rem;
    font-weight: 500;
    display: inline-block;
    transition: all 0.2s ease;
}

.project-card:hover .tag-badge {
    background: rgba(var(--accent-rgb), 0.2);
    color: var(--accent);
}

.project-card .btn {
    margin-top: 0.75rem;
    align-self: flex-start;
}

.github-card.featured {
    border-color: rgba(var(--accent-rgb), 0.45);
    background: rgba(var(--accent-rgb), 0.05);
}

.sci-comm-card {
    position: relative;
}

.loading-message,
.error-message {
    color: var(--text-muted);
    text-align: center;
    padding: 2rem;
    font-size: 1rem;
}

.error-message {
    padding: 1.5rem;
    background: rgba(var(--accent-rgb), 0.1);
    border-left: 3px solid var(--accent);
}

@media (max-width: 768px) {
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .project-card {
        padding: 1.5rem;
    }

    .project-title {
        font-size: 1.1rem;
    }

    .projects-section {
        margin-bottom: 2.5rem;
    }
}

/* ═══════════════════════════════════════════════
   Field Notes Section
═══════════════════════════════════════════════ */

.field-notes-section {
    --fn-accent: #a78bfa;
    --fn-accent-rgb: 167, 139, 250;
    --fn-glow: rgba(167, 139, 250, 0.12);
    --fn-border: rgba(167, 139, 250, 0.22);
    --fn-bg: rgba(167, 139, 250, 0.04);
}

/* Section header overrides */
.field-notes-header {
    text-align: left;
}

.field-notes-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.13em;
    font-weight: 600;
    color: var(--fn-accent);
    margin-bottom: 0.75rem;
}

.field-notes-icon {
    font-size: 0.75rem;
    animation: fn-pulse 3s ease-in-out infinite;
}

@keyframes fn-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(0.85); }
}

.field-notes-header h2 {
    font-family: 'Crimson Text', serif;
    font-size: clamp(2rem, 4vw, 2.5rem);
    color: var(--text-main);
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.field-notes-header p {
    color: var(--text-muted);
    font-size: 1.05rem;
    max-width: 620px;
    line-height: 1.65;
}

/* Grid */
.field-notes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.75rem;
    width: 100%;
}

/* Card */
.fn-card {
    position: relative;
    display: block;
    background: var(--fn-bg);
    border: 1px solid var(--fn-border);
    padding: 0;
    text-decoration: none;
    color: inherit;
    overflow: hidden;
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
    cursor: pointer;
}

.fn-card:hover {
    transform: translateY(-5px);
    border-color: rgba(var(--fn-accent-rgb), 0.55);
    box-shadow: 0 12px 32px rgba(var(--fn-accent-rgb), 0.12);
}

.fn-card--draft {
    opacity: 0.8;
}

/* Glow layer */
.fn-card-glow {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(
        ellipse at top left,
        rgba(var(--fn-accent-rgb), 0.08) 0%,
        transparent 65%
    );
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 0;
}

.fn-card:hover .fn-card-glow {
    opacity: 1;
}

/* Inner layout */
.fn-card-inner {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.75rem 2rem;
    height: 100%;
}

.fn-card-top {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

/* Subject + status row */
.fn-subject-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.fn-subject {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 700;
    color: var(--fn-accent);
}

.fn-status {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.2rem 0.55rem;
    border-radius: 2px;
}

.fn-status--draft {
    background: rgba(251, 191, 36, 0.12);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.3);
}

.fn-status--published {
    background: rgba(52, 211, 153, 0.12);
    color: #34d399;
    border: 1px solid rgba(52, 211, 153, 0.3);
}

/* Title */
.fn-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.35;
    margin: 0.15rem 0 0;
    font-family: 'Crimson Text', serif;
    letter-spacing: -0.01em;
    transition: color 0.2s ease;
}

.fn-card:hover .fn-title {
    color: var(--fn-accent);
}

/* Subtitle */
.fn-subtitle {
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.5;
    font-style: italic;
    margin: 0;
}

/* Teaser */
.fn-teaser {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.7;
    margin: 0;
    flex-grow: 1;
}

/* Footer */
.fn-card-footer {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--fn-border);
}

.fn-tags {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.fn-tag {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.25rem 0.55rem;
    background: rgba(var(--fn-accent-rgb), 0.1);
    color: rgba(var(--fn-accent-rgb), 0.8);
    border-radius: 2px;
    transition: background 0.2s ease;
}

.fn-card:hover .fn-tag {
    background: rgba(var(--fn-accent-rgb), 0.2);
    color: var(--fn-accent);
}

.fn-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.fn-date {
    font-size: 0.8rem;
    color: var(--text-muted);
    letter-spacing: 0.02em;
}

.fn-read-cta {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--fn-accent);
    letter-spacing: 0.01em;
    opacity: 0.7;
    transition: opacity 0.2s ease, letter-spacing 0.2s ease;
}

.fn-card:hover .fn-read-cta {
    opacity: 1;
    letter-spacing: 0.04em;
}

/* Responsive */
@media (max-width: 768px) {
    .field-notes-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .fn-card-inner {
        padding: 1.4rem 1.5rem;
    }

    .field-notes-header {
        text-align: center;
    }

    .field-notes-header p {
        margin: 0 auto;
    }
}
