/* ========================================
   Clean K10K-Inspired Dark Theme
   Readable pixel aesthetic, no CRT effects
   ======================================== */

:root {
    --bg-primary: #fafafa;
    --bg-secondary: #f5f5f5;
    --bg-card: #ffffff;
    
    --text-primary: #1a1a1a;
    --text-secondary: #4a4a4a;
    --text-muted: #6a6a6a;
    
    --accent: #0066cc;
    --accent-hover: #0052a3;
    --accent-secondary: #00a86b;
    --green: #4A9B67;
    --green-light: #67B084;
    --green-subtle: rgba(74, 155, 103, 0.1);
    --warning: #f59e0b;
    --warning-light: #fbbf24;
    --warning-subtle: rgba(245, 158, 11, 0.1);
    
    --border: #e0e0e0;
    --shadow: rgba(0, 0, 0, 0.08);
    
    --font-mono: 'IBM Plex Mono', 'SF Mono', monospace;
    --font-sans: 'Space Grotesk', system-ui, sans-serif;
    
    --nav-height: 56px;
    --max-width: 960px;
    
    --transition-fast: 0.15s ease;
    --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.75;
    color: var(--text-primary);
    background: var(--bg-primary);
    position: relative;
    overflow-x: hidden;
}

/* Subtle graph paper background with animated gradient */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(0, 102, 204, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 102, 204, 0.02) 1px, transparent 1px),
        linear-gradient(rgba(0, 102, 204, 0.01) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 102, 204, 0.01) 1px, transparent 1px);
    background-size: 
        100px 100px,
        100px 100px,
        20px 20px,
        20px 20px;
    background-position: 
        -1px -1px,
        -1px -1px,
        -1px -1px,
        -1px -1px;
    pointer-events: none;
    z-index: 0;
}

/* Animated gradient overlay */
body::after {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(
        circle at 20% 50%,
        rgba(0, 102, 204, 0.03) 0%,
        transparent 50%
    ),
    radial-gradient(
        circle at 80% 80%,
        rgba(0, 168, 107, 0.03) 0%,
        transparent 50%
    );
    animation: gradientShift 20s ease infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes gradientShift {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-20px, -20px); }
}

body > * {
    position: relative;
    z-index: 1;
}

a {
    color: var(--accent-hover);
    text-decoration: none;
    transition: all var(--transition-fast);
    position: relative;
}

a:hover {
    color: var(--green);
    text-decoration: none;
    transform: translateY(-1px);
}

a:active {
    transform: translateY(0);
}

a:focus {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

a:focus:not(:focus-visible) {
    outline: none;
}

/* Ensure italic text inside links inherits link color */
a em,
a i {
    color: inherit;
}

/* ========================================
   Navigation
   ======================================== */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 3px var(--shadow);
    z-index: 1000;
    animation: slideDown 0.5s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.nav-inner {
    max-width: var(--max-width);
    height: 100%;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    font-family: var(--font-mono);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--accent);
    text-decoration: none;
    transition: all var(--transition-fast);
}

.nav-logo:hover {
    transform: scale(1.1) rotate(-5deg);
}

.nav-links {
    display: flex;
    gap: 0.6rem;
    align-items: center;
}

.nav-link {
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all var(--transition-fast);
    position: relative;
}

.nav-link {
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    transition: all var(--transition-smooth);
    transform: translateY(0);
}

.nav-link:hover {
    background: var(--green);
    color: white !important;
    transform: translateY(0);
}

.nav-link.active {
    background: var(--green);
    color: white !important;
}

.nav-link-sub {
    font-size: 0.75rem;
    padding-left: 1.5rem;
    opacity: 0.85;
}

.nav-cta {
    background: var(--accent);
    color: var(--bg-primary) !important;
    padding: 0.375rem 0.75rem;
    font-weight: 600;
    transition: all var(--transition-fast);
    box-shadow: 0 0 0 rgba(0, 102, 204, 0);
}

.nav-cta::after {
    display: none;
}

.nav-cta:hover {
    background: var(--green);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(45, 90, 61, 0.2);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    padding: 8px;
    background: none;
    border: none;
    cursor: pointer;
}

.nav-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--accent);
    transition: 0.2s;
}

@media (max-width: 768px) {
    .nav-links { display: none; }
    .nav-toggle { display: flex; }
    
    .nav-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(4px, 4px);
    }
    .nav-toggle.active span:nth-child(2) { opacity: 0; }
    .nav-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(4px, -4px);
    }
}

/* Mobile Menu */
.mobile-menu {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-primary);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: 0.2s;
}

.mobile-menu.active {
    opacity: 1;
    visibility: visible;
}

.mobile-menu-inner {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.mobile-link {
    font-family: var(--font-mono);
    font-size: 1.125rem;
    color: var(--text-secondary);
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}

.mobile-link-sub {
    font-size: 1rem;
    padding-left: 1.5rem;
    opacity: 0.85;
}

.mobile-link:hover {
    color: var(--accent);
}

/* ========================================
   Layout
   ======================================== */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.page {
    padding-top: calc(var(--nav-height) + 3rem);
    padding-bottom: 5rem;
    min-height: 100vh;
}

/* ========================================
   Typography
   ======================================== */
.page-title {
    font-family: var(--font-sans);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2.5rem;
    padding-bottom: 1rem;
    border-bottom: 3px solid var(--border);
    animation: fadeInUp 0.6s ease;
    position: relative;
}

.page-title::before {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 80px;
    height: 3px;
    background: var(--accent);
    animation: expandWidth 1s ease 0.3s;
}

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

@keyframes expandWidth {
    from { width: 0; }
    to { width: 60px; }
}

h2 {
    font-family: var(--font-sans);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 2.5rem 0 1.25rem;
    position: relative;
    padding-bottom: 0.75rem;
}

h2::before {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 60px;
    height: 2px;
    background: var(--accent);
}
    background: var(--accent);
}

h3 {
    font-family: var(--font-sans);
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 1.75rem 0 1rem;
    position: relative;
    padding-left: 0;
}

h3::before {
    content: '';
}

p {
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
    font-size: 1rem;
    line-height: 1.75;
}

.lead {
    font-size: 1.125rem;
    color: var(--text-primary);
    line-height: 1.8;
}

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

em {
    color: var(--text-primary);
}

/* ========================================
   Hero (Welcome page)
   ======================================== */
.hero {
    padding-top: calc(var(--nav-height) + 4rem);
    padding-bottom: 4rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 4rem;
    align-items: start;
}

.hero-badge {
    font-family: var(--font-mono);
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--green);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 1rem;
    animation: fadeIn 0.8s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.hero-name {
    font-family: var(--font-sans);
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    animation: fadeInUp 0.8s ease 0.2s both;
}

.hero-name .accent {
    color: var(--text-primary);
    display: inline-block;
}

.hero-tagline {
    font-size: 1.125rem;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 2rem;
    animation: fadeInUp 0.8s ease 0.4s both;
}

.hero-visual {
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.hero-image {
    width: 100%;
    aspect-ratio: 1;
    background: var(--bg-card);
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 4rem;
    color: var(--accent);
    opacity: 0.3;
    transition: all var(--transition-smooth);
    animation: float 6s ease-in-out infinite;
}

.hero-image:hover {
    opacity: 0.6;
    transform: scale(1.05) rotate(5deg);
    border-color: var(--accent);
}

.hero-image-photo {
    width: 100%;
    max-width: 250px;
    height: auto;
    border: 2px solid rgba(224, 224, 224, 0.6);
    transition: all var(--transition-smooth);
    animation: float 6s ease-in-out infinite;
    display: block;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 0 rgba(255, 255, 255, 0.5);
}

.hero-image-photo:hover {
    transform: scale(1.02);
    border-color: var(--accent);
    box-shadow: 
        0 16px 48px rgba(0, 0, 0, 0.12),
        0 4px 12px rgba(0, 102, 204, 0.1),
        inset 0 1px 0 0 rgba(255, 255, 255, 0.8);
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

@media (max-width: 768px) {
    .hero-content {
        grid-template-columns: 1fr;
    }
    .hero-visual {
        display: none;
    }
    .hero-positions {
        grid-template-columns: 1fr;
        margin-top: 1.5rem;
    }
}

/* ========================================
   Cards & Panels
   ======================================== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: all var(--transition-smooth);
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border-radius: 8px;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(0, 102, 204, 0.05),
        transparent
    );
    transition: left 0.5s;
}

.card:hover {
    border-color: var(--accent);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px var(--shadow);
}

.card:hover::before {
    left: 100%;
}

.hero-positions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-top: 2rem;
    margin-bottom: 0rem;
}

.position-card {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(224, 224, 224, 0.3);
}

.position-org {
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--text-primary);
}

.position-role {
    color: var(--accent);
    font-size: 0.9375rem;
}

.position-dept {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.erdos-card {
    background: linear-gradient(135deg, rgba(45, 90, 61, 0.08) 0%, rgba(45, 90, 61, 0.03) 100%);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(45, 90, 61, 0.2);
    padding: 1.5rem;
    margin-bottom: 0;
}

.erdos-card:hover {
    border-color: var(--green);
    background: linear-gradient(135deg, rgba(45, 90, 61, 0.12) 0%, rgba(45, 90, 61, 0.05) 100%);
}

.erdos-title {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0 0 0.75rem 0;
    padding: 0;
    font-weight: 600;
    text-align: center;
    border: none;
}

.erdos-title::before {
    display: none;
}

.erdos-chain {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    line-height: 1.6;
}

.erdos-link {
    color: var(--text-secondary);
    transition: color var(--transition-fast);
}

.erdos-link:hover {
    color: var(--green);
}

.erdos-arrow {
    color: var(--green-light);
    font-weight: 600;
}

.erdos-me {
    font-weight: 700;
    color: var(--green);
}

/* Quick Actions */
.quick-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2.5rem;
    flex-wrap: wrap;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    font-family: var(--font-sans);
    font-size: 0.9375rem;
    font-weight: 500;
    border-radius: 8px;
    transition: all var(--transition-smooth);
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.action-btn svg {
    transition: transform var(--transition-smooth);
}

.action-btn:hover svg {
    transform: translateX(2px);
}

.action-primary {
    background: var(--green);
    color: white;
    border: 2px solid var(--green);
    box-shadow: 0 4px 12px rgba(45, 90, 61, 0.2);
}

.action-primary:hover {
    background: var(--green-light);
    border-color: var(--green-light);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(45, 90, 61, 0.3);
    color: white;
}

.action-secondary {
    background: white;
    color: var(--green);
    border: 2px solid var(--green);
}

.action-secondary:hover {
    background: var(--green-subtle);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(45, 90, 61, 0.15);
    color: var(--green);
}

/* Stats Bar */
.stats-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    margin: 3rem 0;
    padding: 2.5rem;
    background: linear-gradient(135deg, rgba(45, 90, 61, 0.05) 0%, rgba(0, 102, 204, 0.05) 100%);
    border-radius: 8px;
    border: 1px solid rgba(45, 90, 61, 0.1);
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-family: var(--font-mono);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--green);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.stat-number::after {
    content: '+';
    font-size: 1.5rem;
    opacity: 0.7;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

@media (max-width: 768px) {
    .quick-actions {
        flex-direction: column;
    }
    
    .action-btn {
        justify-content: center;
    }
    
    .stats-bar {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
        padding: 1.5rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
}

/* ========================================
   Content Sections
   ======================================== */
.section {
    margin-bottom: 3.5rem;
    animation: fadeInUp 0.6s ease;
}

.section-about {
    padding-top: 0rem;
    padding-bottom: 4rem;
}

.section-about-title {
    margin-top: 0;
}

.section img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 2.5rem auto;
    border: 1px solid rgba(224, 224, 224, 0.3);
    border-radius: 4px;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 0 rgba(255, 255, 255, 0.5);
    transition: all var(--transition-smooth);
}

.section img:hover {
    transform: scale(1.02);
    box-shadow: 
        0 16px 48px rgba(0, 0, 0, 0.12),
        0 4px 12px rgba(0, 102, 204, 0.1),
        inset 0 1px 0 0 rgba(255, 255, 255, 0.8);
}

/* Floating side images with captions */
.img-float-right,
.img-float-left {
    position: relative;
    margin-bottom: 1rem;
}

.img-float-right {
    float: right;
    max-width: 400px;
    width: 45%;
    margin-left: 2rem;
    margin-right: 0;
    margin-top: 0.5rem;
    margin-bottom: 1.5rem;
}

.img-float-left {
    float: left;
    max-width: 400px;
    width: 45%;
    margin-right: 2rem;
    margin-left: 0;
    margin-top: 0.5rem;
    margin-bottom: 1.5rem;
}

.img-float-right img,
.img-float-left img {
    width: 100%;
    display: block;
    border: 2px solid rgba(224, 224, 224, 0.6);
    transition: all var(--transition-smooth);
    animation: float 6s ease-in-out infinite;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 0 rgba(255, 255, 255, 0.5);
}

.img-float-right:hover img,
.img-float-left:hover img {
    transform: scale(1.02);
    border-color: var(--accent);
    box-shadow: 
        0 16px 48px rgba(0, 0, 0, 0.12),
        0 4px 12px rgba(0, 102, 204, 0.1),
        inset 0 1px 0 0 rgba(255, 255, 255, 0.8);
}

/* Small inline images */
.img-small {
    max-width: 300px;
    width: 35%;
}

/* Medium inline images */
.img-medium {
    max-width: 500px;
    width: 60%;
}

/* Map/chart images */
.img-map {
    max-width: 700px;
    width: 80%;
    margin: 2rem auto;
}

/* Caption styling for floating images */
.img-caption {
    display: block;
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.75rem;
    font-style: italic;
    line-height: 1.4;
    padding: 0 0.5rem;
    transition: color 0.3s ease;
}

.img-float-right:hover .img-caption,
.img-float-left:hover .img-caption {
    color: var(--accent);
}

/* Image Card - standalone centered image */
.image-card {
    max-width: 700px;
    margin: 2.5rem auto;
    text-align: center;
}

.image-card img {
    width: 100%;
    height: auto;
    display: block;
    border: 2px solid rgba(224, 224, 224, 0.6);
    border-radius: 8px;
    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 0 rgba(255, 255, 255, 0.5);
    transition: all var(--transition-smooth);
    margin: 0 auto;
}

.image-card img:hover {
    transform: translateY(-4px);
    box-shadow: 
        0 20px 56px rgba(0, 0, 0, 0.15),
        0 4px 12px rgba(74, 155, 103, 0.1),
        inset 0 1px 0 0 rgba(255, 255, 255, 0.8);
}

.image-card .img-caption {
    margin-top: 1rem;
}

/* Image Gallery */
.image-gallery {
    max-width: 700px;
    margin: 3rem auto;
    padding: 2rem;
    background: linear-gradient(135deg, rgba(74, 155, 103, 0.03) 0%, rgba(74, 155, 103, 0.01) 100%);
    border-radius: 12px;
    border: 1px solid rgba(224, 224, 224, 0.3);
}

.gallery-main {
    position: relative;
    width: 100%;
    margin-bottom: 1.5rem;
    overflow: hidden;
    border-radius: 8px;
}

.gallery-main img {
    width: 100%;
    height: auto;
    display: block;
    border: 2px solid rgba(224, 224, 224, 0.6);
    border-radius: 8px;
    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 0 rgba(255, 255, 255, 0.5);
    transition: all var(--transition-smooth);
    margin: 0;
}

.gallery-caption {
    display: block;
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 1rem;
    font-style: italic;
    line-height: 1.4;
    font-weight: 500;
}

.gallery-thumbnails {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-top: 1.5rem;
}

.gallery-thumb {
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    object-fit: cover;
    cursor: pointer;
    border: 2px solid rgba(224, 224, 224, 0.4);
    border-radius: 6px;
    transition: all var(--transition-smooth);
    opacity: 0.6;
    margin: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.gallery-thumb:hover {
    opacity: 1;
    border-color: var(--green);
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 16px rgba(74, 155, 103, 0.25);
}

.gallery-thumb.active {
    opacity: 1;
    border-color: var(--green);
    border-width: 3px;
    box-shadow: 
        0 4px 12px rgba(74, 155, 103, 0.3),
        0 0 0 3px rgba(74, 155, 103, 0.1);
}

@media (max-width: 768px) {
    .image-gallery {
        padding: 1.5rem;
        margin: 2rem auto;
    }
    
    .gallery-thumbnails {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .gallery-caption {
        font-size: 0.8rem;
    }
    
    .image-card {
        margin: 2rem auto;
    }
}

/* Clear floats */
.clear {
    clear: both;
}

@media (max-width: 768px) {
    .img-float-right,
    .img-float-left {
        float: none;
        width: 100%;
        max-width: 100%;
        margin: 1.5rem 0;
    }
    
    .img-small,
    .img-medium,
    .img-map {
        width: 100%;
        max-width: 100%;
    }
}

.section:last-of-type {
    margin-bottom: 2rem;
}

.section-intro {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(74, 155, 103, 0.12) 0%, rgba(74, 155, 103, 0.06) 100%);
    border: 1px solid rgba(74, 155, 103, 0.25);
    border-left: 4px solid var(--green);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(74, 155, 103, 0.08);
    animation: fadeInLeft 0.6s ease;
    position: relative;
    overflow: hidden;
}

.section-intro::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 0;
    background: var(--green-light);
    animation: expandHeight 1s ease 0.3s forwards;
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes expandHeight {
    to { height: 100%; }
}

blockquote {
    padding: 1.5rem;
    padding-left: 2.5rem;
    background: linear-gradient(135deg, rgba(74, 155, 103, 0.12) 0%, rgba(74, 155, 103, 0.06) 100%);
    border: 1px solid rgba(74, 155, 103, 0.25);
    border-left: 4px solid var(--green);
    margin: 2rem 0;
    position: relative;
    font-style: italic;
    color: var(--text-primary);
    line-height: 1.8;
    animation: fadeInLeft 0.6s ease;
    transition: all var(--transition-smooth);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(74, 155, 103, 0.08);
}

blockquote:hover {
    border-left-color: var(--green-light);
    background: linear-gradient(135deg, rgba(74, 155, 103, 0.18) 0%, rgba(74, 155, 103, 0.09) 100%);
    border-color: rgba(74, 155, 103, 0.35);
    box-shadow: 0 4px 16px rgba(74, 155, 103, 0.12);
}

blockquote::before {
    content: '"';
    position: absolute;
    top: -0.25rem;
    left: 0.75rem;
    font-size: 3rem;
    font-family: Georgia, serif;
    color: var(--green);
    opacity: 0.15;
    line-height: 1;
    pointer-events: none;
}

.blockquote p {
    margin: 0;
}

/* ========================================
   Alert System
   ======================================== */
/* Base Alert */
.alert {
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid;
    border: 1px solid;
    margin: 2rem 0;
    transition: all var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

/* Info Box (Green - Default) */
.alert-info {
    background: linear-gradient(135deg, rgba(74, 155, 103, 0.12) 0%, rgba(74, 155, 103, 0.06) 100%);
    border-color: rgba(74, 155, 103, 0.25);
    border-left-color: var(--green);
    box-shadow: 0 2px 8px rgba(74, 155, 103, 0.08);
    color: var(--text-primary);
}

.alert-info:hover {
    background: linear-gradient(135deg, rgba(74, 155, 103, 0.18) 0%, rgba(74, 155, 103, 0.09) 100%);
    border-color: rgba(74, 155, 103, 0.35);
    box-shadow: 0 4px 16px rgba(74, 155, 103, 0.12);
}

/* Note Box (Blue) */
.alert-note {
    background: linear-gradient(135deg, rgba(0, 102, 204, 0.12) 0%, rgba(0, 102, 204, 0.06) 100%);
    border-color: rgba(0, 102, 204, 0.25);
    border-left-color: var(--accent);
    box-shadow: 0 2px 8px rgba(0, 102, 204, 0.08);
    color: var(--text-primary);
}

.alert-note:hover {
    background: linear-gradient(135deg, rgba(0, 102, 204, 0.18) 0%, rgba(0, 102, 204, 0.09) 100%);
    border-color: rgba(0, 102, 204, 0.35);
    box-shadow: 0 4px 16px rgba(0, 102, 204, 0.12);
}

/* Warning Box (Amber) */
.alert-warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.12) 0%, rgba(245, 158, 11, 0.06) 100%);
    border-color: rgba(245, 158, 11, 0.25);
    border-left-color: var(--warning);
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.08);
    color: var(--text-primary);
}

.alert-warning:hover {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.18) 0%, rgba(245, 158, 11, 0.09) 100%);
    border-color: rgba(245, 158, 11, 0.35);
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.12);
}

/* Success Box (Vibrant Green) */
.alert-success {
    background: linear-gradient(135deg, rgba(103, 176, 132, 0.12) 0%, rgba(103, 176, 132, 0.06) 100%);
    border-color: rgba(103, 176, 132, 0.25);
    border-left-color: var(--green-light);
    box-shadow: 0 2px 8px rgba(103, 176, 132, 0.08);
    color: var(--text-primary);
}

.alert-success:hover {
    background: linear-gradient(135deg, rgba(103, 176, 132, 0.18) 0%, rgba(103, 176, 132, 0.09) 100%);
    border-color: rgba(103, 176, 132, 0.35);
    box-shadow: 0 4px 16px rgba(103, 176, 132, 0.12);
}

/* Alert paragraphs */
.alert p {
    margin: 0;
    line-height: 1.7;
}

.alert p:not(:last-child) {
    margin-bottom: 0.75rem;
}

/* Apple Glass-inspired depth effects */
.glass-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 
        0 8px 32px 0 rgba(0, 0, 0, 0.08),
        inset 0 1px 0 0 rgba(255, 255, 255, 0.5);
}

.depth-layer-1 {
    transform: translateZ(0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.depth-layer-2 {
    transform: translateZ(10px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.depth-layer-3 {
    transform: translateZ(20px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

/* Masonry-style feedback layout */
.feedback-masonry {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
    align-items: start;
}

.feedback-masonry blockquote {
    margin: 0;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(224, 224, 224, 0.3);
    border-radius: 8px;
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.06),
        inset 0 1px 0 0 rgba(255, 255, 255, 0.8);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.feedback-masonry blockquote::before {
    opacity: 0.08;
}

.feedback-masonry blockquote:hover {
    transform: translateY(-4px) scale(1.01);
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(0, 102, 204, 0.3);
    box-shadow: 
        0 12px 32px rgba(0, 0, 0, 0.1),
        0 2px 8px rgba(0, 102, 204, 0.1),
        inset 0 1px 0 0 rgba(255, 255, 255, 1);
}

/* Short feedback (1-2 sentences) */
.feedback-masonry blockquote.short {
    grid-column: span 1;
}

/* Medium feedback (3-4 sentences) */
.feedback-masonry blockquote.medium {
    grid-column: span 1;
}

/* Long feedback (5+ sentences) */
.feedback-masonry blockquote.long {
    grid-column: span 2;
}

@media (max-width: 768px) {
    .feedback-masonry {
        grid-template-columns: 1fr;
    }
    
    .feedback-masonry blockquote.short,
    .feedback-masonry blockquote.medium,
    .feedback-masonry blockquote.long {
        grid-column: span 1;
    }
}

.blockquote {
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(74, 155, 103, 0.12) 0%, rgba(74, 155, 103, 0.06) 100%);
    border: 1px solid rgba(74, 155, 103, 0.25);
    border-left: 4px solid var(--green);
    margin: 2rem 0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(74, 155, 103, 0.08);
}

.blockquote p {
    font-style: italic;
    color: var(--text-primary);
    margin: 0;
}

/* ========================================
   Publications Grid
   ======================================== */
.journal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
    margin: 1.5rem 0;
}

.journal-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 1rem;
    border-radius: 6px;
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    color: var(--text-secondary);
    transition: all var(--transition-smooth);
}

.journal-item:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow);
}

/* Publication List */
.pub-list {
    margin: 1.5rem 0;
    padding-left: 0;
    list-style: none;
}

.pub-list li {
    padding: 1rem 0;
    padding-left: 1.25rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.7;
    position: relative;
    transition: all var(--transition-fast);
    opacity: 0;
    animation: fadeInUp 0.4s ease forwards;
}

.pub-list li:nth-child(1) { animation-delay: 0.05s; }
.pub-list li:nth-child(2) { animation-delay: 0.1s; }
.pub-list li:nth-child(3) { animation-delay: 0.15s; }
.pub-list li:nth-child(4) { animation-delay: 0.2s; }
.pub-list li:nth-child(5) { animation-delay: 0.25s; }

.pub-list li:hover {
    padding-left: 1.5rem;
    color: var(--text-primary);
}

.pub-list li::before {
    content: '»';
    position: absolute;
    left: 0;
    color: var(--accent);
    font-family: var(--font-mono);
    transition: all var(--transition-fast);
}

.pub-list li:hover::before {
    transform: translateX(4px);
    color: var(--accent-hover);
}

.pub-list li:last-child {
    border-bottom: none;
}

.pub-list li strong {
    color: var(--text-primary);
    font-weight: 600;
}

.pub-list li em {
    color: var(--text-primary);
    font-style: italic;
}

.pub-list li a {
    color: var(--accent);
}

.pub-list li a:hover {
    color: var(--accent-hover);
}

/* Two-column collaborator list */
.collaborator-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 2rem;
}

.collaborator-two-col li {
    break-inside: avoid;
    page-break-inside: avoid;
}

@media (max-width: 768px) {
    .collaborator-two-col {
        grid-template-columns: 1fr;
    }
}

/* Award Badge */
.award {
    display: inline-block;
    background: rgba(45, 90, 61, 0.1);
    color: var(--green);
    font-size: 0.75rem;
    font-family: var(--font-mono);
    padding: 0.25rem 0.5rem;
    margin-left: 0.5rem;
    border: 1px solid var(--green);
    border-radius: 3px;
}

/* Course List */
.course-list {
    margin: 0.75rem 0;
    padding-left: 1.5rem;
    list-style: none;
}

.course-list li {
    padding: 0.375rem 0;
    color: var(--text-secondary);
    font-size: 0.9375rem;
    position: relative;
}

.course-list li::before {
    content: '—';
    position: absolute;
    left: -1.25rem;
    color: var(--green);
}

/* Course Terms */
.course-terms {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
    margin-bottom: 0;
}

/* Coauthor Grid */
.coauthor-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1rem 0;
}

.coauthor-grid span {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    transition: all 0.15s;
}

.coauthor-grid span:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.pub-item {
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
}

.pub-item:last-child {
    border-bottom: none;
}

.pub-year {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--accent);
    margin-bottom: 0.25rem;
}

.pub-title {
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.pub-venue {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-style: italic;
}

/* ========================================
   Contact Links
   ======================================== */
.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

.contact-link {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(224, 224, 224, 0.3);
    padding: 1.25rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    transition: all var(--transition-smooth);
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.06),
        inset 0 1px 0 0 rgba(255, 255, 255, 0.8);
}

.contact-link::after {
    content: '→';
    position: absolute;
    right: 1rem;
    bottom: 1rem;
    font-family: var(--font-mono);
    color: var(--accent);
    opacity: 0;
    transform: translateX(-10px);
    transition: all var(--transition-smooth);
}

.contact-link:hover {
    border-color: rgba(0, 102, 204, 0.3);
    transform: translateY(-4px);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 
        0 12px 32px rgba(0, 0, 0, 0.1),
        0 2px 8px rgba(0, 102, 204, 0.1),
        inset 0 1px 0 0 rgba(255, 255, 255, 1);
}

.contact-link:hover::after {
    opacity: 1;
    transform: translateX(0);
}

.contact-link:hover .contact-value {
    color: var(--accent);
}

.contact-label {
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.contact-value {
    color: var(--text-primary);
    font-size: 0.9375rem;
}

/* ========================================
   Two Column Layout
   ======================================== */
.two-col {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 3rem;
}

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

@media (max-width: 768px) {
    .two-col {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   Footer
   ======================================== */
.footer {
    padding: 3rem 0 2rem;
    border-top: 1px solid var(--border);
    margin-top: 5rem;
    background: rgba(250, 250, 250, 0.6);
    backdrop-filter: blur(10px);
}

.footer-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.footer-nav-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

.footer-section h4 {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1rem;
    padding: 0;
    border: none;
}

.footer-section h4::before {
    display: none;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.footer-links a {
    font-size: 0.875rem;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.footer-links a:hover {
    color: var(--accent);
    padding-left: 0.25rem;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    margin-top: 0.5rem;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.footer-logo {
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--accent);
}

.footer-name {
    color: var(--text-secondary);
}

.footer-copyright {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

@media (max-width: 768px) {
    .footer-nav-grid {
        grid-template-columns: 1fr;
    }
    .footer-bottom {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}

/* ========================================
   Utilities
   ======================================== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

/* Selection */
::selection {
    background: var(--accent);
    color: white;
}

/* ========================================
   Expandable Sections
   ======================================== */
.year-section {
    margin-bottom: 1.25rem;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 12px var(--shadow);
    transition: all var(--transition-smooth);
}

.year-section:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.year-header {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    padding: 1.125rem 1.5rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all var(--transition-smooth);
    user-select: none;
}

.year-header:hover {
    border-color: var(--green-light);
    background: rgba(45, 90, 61, 0.05);
}

.year-title {
    font-family: var(--font-mono);
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    padding-left: 0;
}

.year-title::before {
    display: none;
}

.year-count {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-left: 1rem;
}

.year-toggle {
    font-family: var(--font-mono);
    font-size: 1.25rem;
    color: var(--accent);
    transition: transform var(--transition-smooth);
}

.year-section.expanded .year-toggle {
    transform: rotate(180deg);
}

.year-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-smooth);
}

.year-section.expanded .year-content {
    max-height: 10000px;
}

.year-content-inner {
    padding: 1.75rem;
    border: 1px solid var(--border);
    border-top: none;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(8px);
}

.year-content-inner p {
    transition: all var(--transition-fast);
    margin-bottom: 0.875rem;
}

.year-content-inner p:last-child {
    margin-bottom: 0;
}

.year-content-inner p:hover {
    background: var(--green-subtle);
    padding-left: 0.5rem;
    border-left: 3px solid var(--green);
    margin-left: -0.5rem;
    border-radius: 3px;
}

/* Spotify Embed */
.spotify-embed {
    margin: 2rem 0;
    border: 1px solid var(--border);
    border-radius: 4px;
    overflow: hidden;
    transition: all var(--transition-smooth);
}

.spotify-embed:hover {
    border-color: var(--accent);
    box-shadow: 0 4px 16px var(--shadow);
}

/* ========================================
   Teaching Evaluation Table
   ======================================== */
.eval-table-container {
    margin: 2.5rem 0;
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-card);
    box-shadow: 0 2px 12px var(--shadow);
}

.eval-table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--font-mono);
    font-size: 0.875rem;
}

.eval-table thead {
    background: var(--bg-secondary);
    border-bottom: 2px solid var(--accent);
}

.eval-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 1px;
}

.eval-table tbody tr {
    border-bottom: 1px solid var(--border);
    transition: all var(--transition-fast);
}

.eval-table tbody tr:last-child {
    border-bottom: none;
}

.eval-table tbody tr:hover {
    background: var(--bg-secondary);
}

.eval-table td {
    padding: 1rem;
    color: var(--text-secondary);
}

.eval-table td.course-name {
    font-weight: 600;
    color: var(--text-primary);
}

.eval-table td.score {
    color: var(--accent-secondary);
    font-weight: 600;
}

.eval-table .syllabus-link {
    color: var(--accent);
    padding: 0.25rem 0.75rem;
    border: 1px solid var(--accent);
    border-radius: 2px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all var(--transition-fast);
    display: inline-block;
}

.eval-table .syllabus-link:hover {
    background: var(--accent);
    color: var(--bg-primary);
    transform: translateY(-1px);
}

@media (max-width: 768px) {
    .eval-table {
        font-size: 0.75rem;
    }
    
    .eval-table th,
    .eval-table td {
        padding: 0.75rem 0.5rem;
    }
}

/* ========================================
   Chatbot
   ======================================== */
#chatbot-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 999;
    font-family: var(--font-sans);
}

#chatbot-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--accent);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 102, 204, 0.3);
    transition: all var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

#chatbot-toggle:hover {
    background: var(--green);
    transform: scale(1.1);
    box-shadow: 0 6px 24px rgba(45, 90, 61, 0.4);
}

#chatbot-toggle.active {
    background: var(--green);
}

.chatbot-icon {
    width: 24px;
    height: 24px;
    color: white;
}

@keyframes slideIn {
    to { opacity: 1; }
}

#chatbot-panel {
    position: absolute;
    bottom: calc(100% + 1rem);
    right: 0;
    width: 380px;
    max-height: 500px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px) saturate(180%);
    border: 2px solid rgba(0, 102, 204, 0.2);
    border-radius: 16px;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 0 rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: bottom right;
}

#chatbot-panel.chatbot-hidden {
    opacity: 0;
    transform: translateY(-10px) scale(0.98);
    pointer-events: none;
}

.chatbot-header {
    padding: 1.25rem;
    border-bottom: 1px solid rgba(224, 224, 224, 0.3);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.chatbot-title h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    border: none;
    padding: 0;
}

.chatbot-title h3::before {
    display: none;
}

.chatbot-title p {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin: 0.25rem 0 0 0;
}

#chatbot-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all var(--transition-fast);
}

#chatbot-close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-primary);
}

#chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.chatbot-message {
    max-width: 80%;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    font-size: 0.9375rem;
    line-height: 1.5;
    animation: messageSlide 0.3s ease;
}

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

.bot-message {
    align-self: flex-start;
    background: rgba(0, 102, 204, 0.1);
    color: var(--text-primary);
    border: 1px solid rgba(0, 102, 204, 0.2);
}

.user-message {
    align-self: flex-end;
    background: var(--accent);
    color: white;
}

.chatbot-input-container {
    padding: 1rem;
    border-top: 1px solid rgba(224, 224, 224, 0.3);
    display: flex;
    gap: 0.5rem;
}

#chatbot-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid rgba(224, 224, 224, 0.5);
    border-radius: 24px;
    font-family: var(--font-sans);
    font-size: 0.9375rem;
    outline: none;
    transition: all var(--transition-fast);
}

#chatbot-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

#chatbot-send {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

#chatbot-send:hover {
    background: var(--accent-hover);
    transform: scale(1.05);
}

.chatbot-suggestions {
    padding: 0 1rem 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.suggestion-btn {
    padding: 0.5rem 0.75rem;
    background: rgba(0, 102, 204, 0.05);
    border: 1px solid rgba(0, 102, 204, 0.2);
    border-radius: 16px;
    font-size: 0.8125rem;
    color: var(--accent);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: var(--font-sans);
}

.suggestion-btn:hover {
    background: rgba(0, 102, 204, 0.1);
    border-color: var(--accent);
    transform: translateY(-2px);
}

/* ========================================
   Writing Page
   ======================================== */
.writing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    margin: 2.5rem 0;
}

.writing-card {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(224, 224, 224, 0.3);
    border-radius: 8px;
    padding: 1.75rem;
    transition: all var(--transition-smooth);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    box-shadow: 0 2px 12px var(--shadow);
}

.writing-card:hover {
    transform: translateY(-4px);
    border-color: var(--green-light);
    box-shadow: 0 12px 32px rgba(45, 90, 61, 0.2);
}

.writing-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-mono);
    font-size: 0.75rem;
}

.writing-date {
    color: var(--green);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.writing-outlet {
    color: var(--text-muted);
    font-style: italic;
}

.writing-title {
    margin: 0;
    padding: 0;
    border: none;
}

.writing-title::before {
    display: none;
}

.writing-title a {
    color: var(--text-primary);
    font-size: 1.125rem;
    font-weight: 600;
    text-decoration: none;
    transition: color var(--transition-fast);
}

.writing-title a:hover {
    color: var(--green);
}

.writing-excerpt {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    line-height: 1.6;
    margin: 0;
    flex-grow: 1;
}

.writing-footer {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.writing-tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: rgba(45, 90, 61, 0.08);
    border: 1px solid rgba(45, 90, 61, 0.2);
    border-radius: 12px;
    font-size: 0.75rem;
    font-family: var(--font-mono);
    color: var(--green);
    font-weight: 500;
}

.writing-cta {
    text-align: center;
    padding: 3rem 2rem;
    background: linear-gradient(135deg, rgba(45, 90, 61, 0.05) 0%, rgba(0, 102, 204, 0.05) 100%);
    border-radius: 12px;
    border: 1px solid rgba(45, 90, 61, 0.1);
    margin-top: 3rem;
}

.writing-cta h2 {
    margin-top: 0;
}

/* ========================================
   Interactive Maps
   ======================================== */
.map-container {
    width: 100%;
    height: 500px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin: 2.5rem 0;
    border: 1px solid var(--border);
    transition: box-shadow var(--transition-smooth);
}

.map-container:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

/* Blue tint for map tiles to match site accent color */
.map-tiles-blue {
    filter: hue-rotate(190deg) saturate(0.8) brightness(1.05);
    mix-blend-mode: normal;
}

.map-caption {
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-muted);
    font-style: italic;
    margin-top: 0.75rem;
    font-family: var(--font-mono);
}

/* Custom Black Markers with Pulse */
.custom-black-marker {
    background: transparent;
    border: none;
    transition: opacity 0.4s ease;
}

.marker-pulse-outer {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.15);
    border-radius: 50%;
    animation: pulse 2s ease-out infinite;
}

.marker-outer {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.3);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.marker-inner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #000000;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    transition: all 0.3s ease;
}

@keyframes pulse {
    0% {
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 0.8;
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0;
    }
}

/* Hover effects */
.custom-black-marker.marker-hover .marker-outer {
    background: rgba(0, 0, 0, 0.5);
    transform: translate(-50%, -50%) scale(1.2);
}

.custom-black-marker.marker-hover .marker-inner {
    background: #1a1a1a;
    transform: translate(-50%, -50%) scale(1.3);
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.6);
}

/* Leaflet popup customization */
.leaflet-popup-content-wrapper {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(0, 0, 0, 0.08);
    padding: 0;
    overflow: hidden;
}

.leaflet-popup-content {
    margin: 0;
    line-height: 1.4;
}

.leaflet-popup-tip {
    background: white;
    box-shadow: 0 3px 14px rgba(0,0,0,0.15);
    border: 1px solid rgba(0, 0, 0, 0.08);
}

/* Custom popup styling */
.map-popup {
    font-family: 'Space Grotesk', sans-serif;
    padding: 1rem;
}

.map-popup-header {
    font-size: 1rem;
    font-weight: 600;
    color: #000;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.map-popup-badge {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    background: rgba(0, 0, 0, 0.06);
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    color: #333;
    margin-bottom: 0.75rem;
    font-family: var(--font-mono);
}

.map-popup-location {
    font-size: 0.875rem;
    color: #666;
    line-height: 1.4;
}

.map-popup-list {
    font-size: 0.875rem;
    color: #444;
    line-height: 1.6;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    max-height: 200px;
    overflow-y: auto;
}

.map-popup-list::-webkit-scrollbar {
    width: 4px;
}

.map-popup-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 2px;
}

.map-popup-list::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 2px;
}

.map-popup-list::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* Map loading state */
.map-container.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.02) 0%, rgba(0, 0, 0, 0.04) 100%);
}

.map-container.loading::after {
    content: 'Loading map...';
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: #666;
    animation: fadeInOut 2s ease-in-out infinite;
}

@keyframes fadeInOut {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

/* Leaflet attribution */
.leaflet-control-attribution {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(4px);
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
}

/* Zoom controls */
.leaflet-control-zoom {
    border: none !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden;
}

.leaflet-control-zoom a {
    background: white !important;
    color: #000 !important;
    border: none !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08) !important;
    width: 32px;
    height: 32px;
    line-height: 32px !important;
    font-size: 18px !important;
    transition: background 0.2s ease;
}

.leaflet-control-zoom a:hover {
    background: rgba(0, 0, 0, 0.05) !important;
}

.leaflet-control-zoom a:last-child {
    border-bottom: none !important;
}

@media (max-width: 768px) {
    .map-container {
        height: 400px;
        border-radius: 8px;
    }
    
    .map-popup-header {
        font-size: 0.9rem;
    }
    
    .map-popup-list {
        font-size: 0.8rem;
        max-height: 150px;
    }
}

@media (max-width: 768px) {
    .writing-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    #chatbot-container {
        bottom: 1rem;
        right: 1rem;
    }
    
    #chatbot-toggle {
        width: 56px;
        height: 56px;
    }
    
    #chatbot-panel {
        width: calc(100vw - 2rem);
        max-width: 380px;
        max-height: 500px;
    }
    
    .chatbot-badge {
        font-size: 0.875rem;
    }
}

/* ========================================
   Back to Top Button
   ======================================== */
#back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 48px;
    height: 48px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-smooth);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
}

#back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

#back-to-top:hover {
    background: var(--accent-hover);
    transform: translateY(-4px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

#back-to-top:active {
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    #back-to-top {
        bottom: 5rem;
        right: 1rem;
        width: 44px;
        height: 44px;
    }
}

/* ========================================
   Breadcrumbs
   ======================================== */
.breadcrumbs {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
    padding-top: calc(var(--nav-height) + 1rem);
    padding-bottom: 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.875rem;
}

.breadcrumbs-list {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    list-style: none;
    color: var(--text-muted);
}

.breadcrumbs-list li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.breadcrumbs-list a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.breadcrumbs-list a:hover {
    color: var(--accent);
    text-decoration: none;
    transform: none;
}

.breadcrumbs-list .separator {
    color: var(--text-muted);
    opacity: 0.5;
}

.breadcrumbs-list .current {
    color: var(--text-primary);
    font-weight: 500;
}

/* ========================================
   Site Search
   ======================================== */
.search-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 6px;
    transition: all var(--transition-fast);
}

.search-toggle:hover {
    background: rgba(0, 102, 204, 0.1);
    color: var(--accent);
}

.search-toggle svg {
    width: 20px;
    height: 20px;
}

.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding-top: 10vh;
    animation: fadeIn 0.2s ease;
}

.search-overlay.active {
    display: flex;
}

.search-modal {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    animation: slideDown 0.3s ease;
}

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

.search-input-wrapper {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.search-input {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1.125rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-family: var(--font-sans);
    transition: all var(--transition-fast);
}

.search-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(0, 102, 204, 0.1);
}

.search-results {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.search-result-item {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: 1px solid transparent;
}

.search-result-item:hover {
    background: rgba(0, 102, 204, 0.05);
    border-color: rgba(0, 102, 204, 0.2);
}

.search-result-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.search-result-page {
    font-size: 0.875rem;
    color: var(--accent);
    margin-bottom: 0.5rem;
}

.search-result-url {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
    margin-top: 0.5rem;
}

.search-result-excerpt {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-top: 0.5rem;
}

.search-result-excerpt mark {
    background: rgba(45, 90, 61, 0.2);
    color: var(--green);
    padding: 0.125rem 0.25rem;
    border-radius: 3px;
    font-weight: 500;
}

.search-no-results {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}

.search-instructions {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* ========================================
   Publications Search & Filter
   ======================================== */
.publications-search-container {
    margin: 2rem 0;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 102, 204, 0.15);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

.search-header {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.search-box-wrapper {
    flex: 1;
    position: relative;
}

#pub-search {
    width: 100%;
    padding: 0.875rem 3rem 0.875rem 1.25rem;
    border: 2px solid rgba(0, 102, 204, 0.2);
    border-radius: 12px;
    font-family: var(--font-sans);
    font-size: 1rem;
    background: white;
    transition: all var(--transition-smooth);
}

#pub-search:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(0, 102, 204, 0.1);
}

#clear-search {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all var(--transition-fast);
}

#clear-search:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-primary);
}

.filter-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    background: white;
    border: 2px solid rgba(0, 102, 204, 0.2);
    border-radius: 12px;
    font-family: var(--font-sans);
    font-size: 1rem;
    font-weight: 500;
    color: var(--accent);
    cursor: pointer;
    transition: all var(--transition-smooth);
}

.filter-toggle:hover,
.filter-toggle.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.filter-toggle svg {
    transition: transform var(--transition-smooth);
}

.filter-toggle.active svg {
    transform: rotate(180deg);
}

.filter-panel {
    background: rgba(248, 250, 252, 0.8);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(0, 0, 0, 0.06);
    transition: all var(--transition-smooth);
    max-height: 600px;
    overflow: hidden;
}

.filter-panel.hidden {
    max-height: 0;
    padding: 0;
    margin: 0;
    border-width: 0;
    opacity: 0;
}

.filter-group {
    margin-bottom: 1.5rem;
}

.filter-group:last-of-type {
    margin-bottom: 0;
}

.filter-group h4 {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    margin: 0 0 0.75rem 0;
    padding: 0;
    border: none;
}

.filter-group h4::before {
    display: none;
}

.year-range-inputs {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.year-range-inputs input {
    flex: 1;
    padding: 0.625rem 1rem;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    font-family: var(--font-mono);
    font-size: 0.9375rem;
}

.year-range-inputs span {
    color: var(--text-muted);
    font-weight: 600;
}

.filter-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    max-height: 200px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.filter-checkboxes::-webkit-scrollbar {
    width: 6px;
}

.filter-checkboxes::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 3px;
}

.filter-checkboxes::-webkit-scrollbar-thumb {
    background: rgba(0, 102, 204, 0.3);
    border-radius: 3px;
}

.filter-checkboxes label {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    cursor: pointer;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    transition: background var(--transition-fast);
}

.filter-checkboxes label:hover {
    background: rgba(0, 102, 204, 0.05);
}

.filter-checkboxes input[type="checkbox"] {
    cursor: pointer;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.filter-search {
    width: 100%;
    padding: 0.625rem 1rem;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    font-family: var(--font-sans);
    font-size: 0.9375rem;
    margin-bottom: 0.75rem;
}

.filter-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.btn-primary,
.btn-secondary {
    flex: 1;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-family: var(--font-sans);
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-smooth);
    border: none;
}

.btn-primary {
    background: var(--green);
    color: white;
}

.btn-primary:hover {
    background: var(--green-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(45, 90, 61, 0.3);
}

.btn-secondary {
    background: white;
    color: var(--text-secondary);
    border: 1px solid rgba(0, 0, 0, 0.15);
}

.btn-secondary:hover {
    background: rgba(0, 0, 0, 0.03);
    color: var(--text-primary);
}

.search-results-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 0.75rem 0;
}

#results-count {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.filter-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    background: rgba(0, 102, 204, 0.1);
    border: 1px solid rgba(0, 102, 204, 0.25);
    border-radius: 20px;
    font-size: 0.8125rem;
    font-family: var(--font-sans);
    color: var(--accent);
    animation: slideInRight 0.3s ease;
}

.filter-badge button {
    background: none;
    border: none;
    color: var(--accent);
    font-size: 1.125rem;
    cursor: pointer;
    padding: 0;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all var(--transition-fast);
}

.filter-badge button:hover {
    background: rgba(0, 102, 204, 0.2);
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.topic-cloud {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.topic-cloud h4 {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    margin: 0 0 1rem 0;
    padding: 0;
    border: none;
}

.topic-cloud h4::before {
    display: none;
}

.tag-cloud-items {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.topic-tag {
    background: rgba(0, 102, 204, 0.06);
    border: 1px solid rgba(0, 102, 204, 0.2);
    border-radius: 16px;
    padding: 0.375rem 0.875rem;
    font-family: var(--font-sans);
    color: var(--accent);
    cursor: pointer;
    transition: all var(--transition-smooth);
    white-space: nowrap;
}

.topic-tag:hover {
    background: rgba(0, 102, 204, 0.12);
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0, 102, 204, 0.15);
}

.topic-tag.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
    transform: scale(1.05);
}

@media (max-width: 768px) {
    .search-header {
        flex-direction: column;
    }
    
    .filter-actions {
        flex-direction: column;
    }
    
    .search-results-info {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ========================================
   Back to Top Button
   ======================================== */
#back-to-top {
    position: fixed;
    bottom: 6rem;
    right: 2rem;
    width: 48px;
    height: 48px;
    background: var(--accent);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 102, 204, 0.3);
    transition: all var(--transition-smooth);
    z-index: 998;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px);
}

#back-to-top.visible {
    opacity: 1;
    pointer-events: all;
    transform: translateY(0);
}

#back-to-top:hover {
    background: var(--green);
    transform: translateY(-4px);
    box-shadow: 0 6px 20px rgba(45, 90, 61, 0.4);
}

#back-to-top svg {
    width: 24px;
    height: 24px;
}

/* ========================================
   Reading Progress Bar
   ======================================== */
#reading-progress {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--green));
    z-index: 999;
    transition: width 0.1s ease;
    box-shadow: 0 1px 3px rgba(0, 102, 204, 0.3);
}

/* ========================================
   Dark Mode Styles
   ======================================== */
.dark-mode-toggle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.dark-mode-toggle:hover {
    background: var(--accent);
    border-color: var(--accent);
    transform: rotate(180deg);
}

.dark-mode-toggle svg {
    width: 20px;
    height: 20px;
    color: var(--text-primary);
    transition: color var(--transition-fast);
}

.dark-mode-toggle:hover svg {
    color: white;
}

.sun-icon {
    position: absolute;
    opacity: 1;
    transform: rotate(0deg);
    transition: all var(--transition-smooth);
}

.moon-icon {
    position: absolute;
    opacity: 0;
    transform: rotate(180deg);
    transition: all var(--transition-smooth);
}

body.dark-mode .sun-icon {
    opacity: 0;
    transform: rotate(180deg);
}

body.dark-mode .moon-icon {
    opacity: 1;
    transform: rotate(0deg);
}

body.dark-mode {
    --bg-primary: #0f1419;
    --bg-secondary: #161b22;
    --bg-card: #1c2128;
    
    --text-primary: #e6edf3;
    --text-secondary: #8b949e;
    --text-muted: #6e7681;
    
    --border: #30363d;
    --shadow: rgba(0, 0, 0, 0.3);
}

body.dark-mode::before {
    background-image: 
        linear-gradient(rgba(0, 102, 204, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 102, 204, 0.04) 1px, transparent 1px),
        linear-gradient(rgba(0, 102, 204, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 102, 204, 0.02) 1px, transparent 1px);
}

/* Dark mode specific component fixes */
body.dark-mode .position-card {
    background: rgba(28, 33, 40, 0.8);
    border-color: rgba(48, 54, 61, 0.6);
}

body.dark-mode .erdos-card {
    background: linear-gradient(135deg, rgba(74, 124, 89, 0.12) 0%, rgba(74, 124, 89, 0.05) 100%);
    border-color: rgba(74, 124, 89, 0.3);
}

body.dark-mode .card {
    background: var(--bg-card);
    border-color: var(--border);
}

body.dark-mode .blockquote,
body.dark-mode blockquote {
    background: rgba(22, 27, 34, 0.6);
    border-left-color: var(--green-light);
}

body.dark-mode .nav {
    background: rgba(15, 20, 25, 0.95);
    border-bottom-color: var(--border);
}

body.dark-mode .modal-content {
    background: var(--bg-card);
    color: var(--text-primary);
}

body.dark-mode .modal-header {
    background: var(--bg-card);
    border-bottom-color: var(--border);
}

body.dark-mode .action-secondary {
    background: var(--bg-card);
    border-color: var(--green);
}

body.dark-mode .action-primary {
    background: var(--green);
    border-color: var(--green);
}

body.dark-mode .contact-link {
    background: var(--bg-card);
    border-color: var(--border);
}

body.dark-mode .contact-link:hover {
    border-color: var(--accent);
}

body.dark-mode .mobile-menu {
    background: var(--bg-primary);
}

body.dark-mode .hero-image-photo {
    border-color: var(--border);
}

body.dark-mode .footer {
    background: var(--bg-card);
    border-top-color: var(--border);
}

/* ========================================
   Utility Classes
   ======================================== */

/* Flex utilities */
.flex-center {
    display: flex;
    align-items: center;
}

/* Map caption variants */
.map-caption-left {
    text-align: left;
    margin-top: 0.5rem;
}

/* Contact grid spacing */
.contact-grid-spaced {
    margin-top: 2rem;
}

/* GitHub link styling */
.github-link {
    margin-top: 2rem;
}

.github-link a {
    font-family: var(--font-mono);
    font-size: 0.875rem;
}

/* Erdős container */
.erdos-container {
    max-width: 800px;
    margin: 2rem auto;
}

/* Year header flex container */
.year-header-content {
    display: flex;
    align-items: center;
}

/* ========================================
   Toast Notifications
   ======================================== */
.toast-container {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1001;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    pointer-events: none;
}

.toast {
    background: rgba(45, 90, 61, 0.95);
    backdrop-filter: blur(8px);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    font-family: var(--font-sans);
    font-size: 0.9375rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: toastSlideIn 0.3s ease, toastSlideOut 0.3s ease 2.7s;
    pointer-events: all;
}

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

@keyframes toastSlideOut {
    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}

.toast svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* ========================================
   Modal Overlays
   ======================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    background: white;
    border-radius: 16px;
    max-width: 800px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: white;
    z-index: 1;
}

.modal-header h3 {
    margin: 0;
    padding: 0;
    border: none;
}

.modal-header h3::before {
    display: none;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-primary);
}

.modal-body {
    padding: 2rem;
}

/* ========================================
   Share Button
   ======================================== */
.share-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 10px;
    font-family: var(--font-sans);
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-smooth);
    box-shadow: 0 2px 8px rgba(0, 102, 204, 0.2);
}

.share-button:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.3);
}

.share-button svg {
    width: 18px;
    height: 18px;
}

/* ========================================
   Print Styles
   ======================================== */
@media print {
    body {
        background: white;
        color: black;
    }
    
    .nav,
    .mobile-menu,
    .nav-toggle,
    .footer,
    .spotify-embed {
        display: none;
    }
    
    .page {
        padding-top: 0;
    }
    
    a {
        color: #0066cc;
        text-decoration: underline;
    }
    
    .card,
    blockquote,
    .eval-table-container {
        break-inside: avoid;
        page-break-inside: avoid;
    }
    
    h1, h2, h3 {
        page-break-after: avoid;
    }
}


/* ==========================================
   Advanced Features CSS
   ======================================== */

/* Dark mode for advanced features */
body.dark-mode .year-header {
    background: rgba(28, 33, 40, 0.8);
    border-color: var(--border);
}

body.dark-mode .year-content-inner {
    background: rgba(22, 27, 34, 0.6);
    border-color: var(--border);
}

body.dark-mode .year-content-inner p:hover {
    background: rgba(74, 124, 89, 0.15);
    border-left-color: var(--green-light);
}

