/* --- BRAND VARIABLES --- */
:root {
    --bg-color: #ffffff;
    --text-main: #111111;
    --text-muted: #666666;
    --accent-color: #111111; 
    --link-color: #0056b3; /* Refined academic blue */
    --nav-border: #eaeaea;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Inter", sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    margin: 0;
    padding: 0;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* --- TOP NAVIGATION --- */
.top-nav {
    position: fixed;
    top: 0; left: 0; right: 0; height: 60px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--nav-border);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 2rem; z-index: 1000;
}

.nav-logo { font-weight: 700; font-size: 1.1rem; text-decoration: none; color: var(--text-main); letter-spacing: -0.02em; transition: color 0.2s ease, opacity 0.2s ease; }
.nav-logo:hover { color: var(--accent-color); }
.nav-links { display: flex; gap: 2rem; align-items: center; }
.nav-links a { text-decoration: none; color: var(--text-muted); font-size: 0.9rem; font-weight: 500; transition: color 0.2s; }
.nav-links a:hover, .nav-links a.active { color: var(--accent-color); font-weight: 700; }


/* --- HERO SECTION (INDEX) --- */
.hero {
    max-width: 900px;
    margin: 150px auto 4rem;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4rem;
}

.hero-text { flex: 1; }

.hero h1 {
    font-size: 4rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1;
    margin: 0 0 0.5rem 0;
}

.hero-tagline {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-main);
    margin: 0 0 1.5rem 0;
    letter-spacing: -0.02em;
}

.hero p {
    font-size: 1.15rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
    max-width: 95%;
}

.hero-updates {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-bottom: 2rem;
}

.update-badge {
    display: inline-flex;
    align-items: center;
    background: #f9f9f9;
    border: 1px solid #eaeaea;
    padding: 0.4rem 1rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #333;
    width: fit-content;
}

.update-badge span { margin-right: 8px; font-size: 1rem; }

.hero-image-container {
    flex-shrink: 0;
    width: 280px;
    height: 350px;
    background-color: #f4f4f4;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--nav-border);
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.04);
}

.hero-image-container img { width: 100%; height: 100%; object-fit: cover; }

/* --- TWO-PILLAR SPLIT --- */
.pillars-section {
    max-width: 900px;
    margin: 4rem auto 2rem;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
}

.pillar { border-top: 2px solid var(--accent-color); padding-top: 1.5rem; }
.pillar h2 { font-size: 1.5rem; margin: 0 0 1rem 0; letter-spacing: -0.01em; }
.pillar p { color: var(--text-muted); margin-bottom: 1.5rem; font-size: 1rem; }

.pillar-link {
    display: inline-block; font-weight: 600; color: var(--text-main);
    text-decoration: none; border-bottom: 1px solid var(--text-main);
    padding-bottom: 2px; transition: opacity 0.2s;
}
.pillar-link:hover { opacity: 0.6; }

/* --- RESEARCH PAGE LAYOUT --- */
.container { max-width: 800px; margin: 120px auto 6rem; padding: 0 2rem; }
.container-narrow { max-width: 680px; margin: 140px auto 6rem; padding: 0 2rem; font-size: 1.1rem; }

.subtitle { font-size: 1.15rem; color: var(--text-muted); margin-bottom: 2rem; }

.impact-dashboard {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    background: #fafafa;
    border: 1px solid var(--nav-border);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 4rem;
}

.metric-stat { display: flex; flex-direction: column; }
.metric-number { font-size: 3rem; font-weight: 800; line-height: 1; letter-spacing: -0.05em; }
.metric-label { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); font-weight: 600; margin-top: 0.5rem; }

.citation-graph { display: flex; align-items: flex-end; gap: 6px; height: 60px; }
.bar-container { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.bar { width: 16px; background-color: #dcdcdc; border-radius: 3px 3px 0 0; transition: background-color 0.2s; }
.bar-container:hover .bar { background-color: var(--accent-color); }
.year-label { font-size: 0.7rem; color: #999; font-family: monospace; }

.section-title { font-size: 1.3rem; font-weight: 700; border-bottom: 2px solid var(--accent-color); padding-bottom: 0.5rem; margin-top: 4rem; margin-bottom: 2rem; text-transform: uppercase; letter-spacing: 0.05em; }
.entry { margin-bottom: 2.5rem; }
.entry-meta { font-size: 0.85rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.03em; margin-bottom: 0.4rem; font-weight: 600; }
.entry-title { font-size: 1.2rem; font-weight: 700; margin: 0 0 0.5rem 0; line-height: 1.4; }
.entry-desc { font-size: 0.95rem; color: #444; margin-bottom: 0.8rem; }
.asset-links { font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace; font-size: 0.85rem; }
.asset-links a { color: #555; text-decoration: none; margin-right: 15px; border-bottom: 1px solid transparent; transition: all 0.2s; }
.asset-links a:hover { color: var(--accent-color); border-bottom: 1px solid var(--accent-color); }

/* --- WIKI PAGE LAYOUT --- */
.wiki-container { max-width: 900px; margin: 120px auto 6rem; padding: 0 2rem; }
.wiki-header { margin-bottom: 2rem; border-bottom: 1px solid var(--nav-border); padding-bottom: 1rem; }
.wiki-header-meta { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin-bottom: 0.5rem; font-weight: 600; }

.wiki-content a { color: var(--link-color); text-decoration: none; border-bottom: 1px solid transparent; transition: border-color 0.2s; }
.wiki-content a:hover { border-bottom-color: var(--link-color); }
.wiki-content p { margin-bottom: 1.2rem; color: #222; font-size: 1.05rem; line-height: 1.7; }
.wiki-content h2 { font-size: 1.5rem; font-weight: 700; margin-top: 3rem; margin-bottom: 1rem; border-bottom: 1px solid var(--nav-border); padding-bottom: 0.5rem; letter-spacing: -0.01em; }
.wiki-content h3 { font-size: 1.15rem; font-weight: 700; margin-top: 2rem; margin-bottom: 0.5rem; }

.infobox {
    float: right; width: 280px; background: #fafafa; border: 1px solid var(--nav-border);
    border-radius: 12px; padding: 1.5rem; margin: 0 0 2rem 2.5rem; font-size: 0.9rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.02);
}
.infobox-title { text-align: center; font-weight: 800; font-size: 1.2rem; margin-bottom: 1rem; letter-spacing: -0.02em; }
.infobox-image { width: 100%; height: auto; border-radius: 8px; margin-bottom: 0.5rem; border: 1px solid #eaeaea; }
.infobox-caption { text-align: center; font-size: 0.8rem; color: var(--text-muted); margin-bottom: 1.5rem; }
.infobox-table { width: 100%; border-collapse: collapse; }
.infobox-table th { text-align: left; vertical-align: top; padding: 0.5rem 0; font-weight: 600; color: var(--text-muted); width: 35%; border-top: 1px solid var(--nav-border); }
.infobox-table td { vertical-align: top; padding: 0.5rem 0 0.5rem 0.5rem; color: #111; border-top: 1px solid var(--nav-border); }

.toc { background: #fafafa; border: 1px solid var(--nav-border); border-radius: 8px; padding: 1.5rem; display: inline-block; margin: 2rem 0; min-width: 250px; }
.toc h3 { margin-top: 0; margin-bottom: 1rem; font-size: 1rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); }
.toc ul { list-style: none; padding: 0; margin: 0; }
.toc li { margin-bottom: 0.5rem; font-size: 0.95rem; }
.toc a { color: var(--text-main); font-weight: 500; }
.toc a:hover { color: var(--link-color); }

.citation { font-size: 0.75em; vertical-align: super; line-height: 0; margin-left: 2px; }
ul.pub-list { padding-left: 1.2rem; }
ul.pub-list li { margin-bottom: 1rem; font-size: 0.95rem; }
.references { font-size: 0.9rem; color: #444; }
.references ol { padding-left: 1.5rem; }
.references li { margin-bottom: 0.5rem; }

.wiki-content::after { content: ""; display: table; clear: both; }

/* --- NOW PAGE LAYOUT --- */
.timestamp {
    font-size: 0.95rem; color: var(--text-muted); font-family: "SFMono-Regular", Consolas, monospace;
    display: block; margin-bottom: 3rem; border-bottom: 1px solid var(--nav-border); padding-bottom: 1.5rem;
}

.status-widget {
    display: inline-flex; align-items: center; gap: 12px; background: #fafafa;
    border: 1px solid var(--nav-border); padding: 0.6rem 1.2rem; border-radius: 50px;
    margin-bottom: 2rem; font-size: 0.9rem; color: var(--text-muted);
}

.pulse-dot {
    width: 8px; height: 8px; background-color: #27ae60; border-radius: 50%;
    animation: pulse 2s infinite;
}

.photo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1.5rem; margin-bottom: 3rem; }
.photo-card { width: 100%; border-radius: 8px; overflow: hidden; background-color: #f4f4f4; border: 1px solid var(--nav-border); }
.photo-card img { width: 100%; height: 200px; object-fit: cover; display: block; transition: transform 0.3s ease; }
.photo-card:hover img { transform: scale(1.03); }
.photo-caption { padding: 0.8rem; font-size: 0.85rem; color: var(--text-muted); text-align: center; background: #fff; }

.now-note {
    text-align: center; padding: 1.5rem 0; color: #999; font-size: 0.85rem; margin-bottom: 2rem;
}
.now-note a { border-bottom: 1px dotted #999; color: #999; text-decoration: none; }
.now-note a:hover { color: var(--text-main); border-bottom-style: solid; }

/* --- THE DRAWER (Footer) --- */
.site-footer {
    border-top: 1px solid var(--nav-border);
    background: #fafafa;
    padding: 4rem 2rem;
    margin-top: 6rem;
}

.footer-grid {
    max-width: 900px; margin: 0 auto;
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem;
}

.footer-column h4 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin: 0 0 1rem 0; }
.footer-column ul { list-style: none; padding: 0; margin: 0; }
.footer-column li { margin-bottom: 0.5rem; }
.footer-column a, .footer-column span { text-decoration: none; color: var(--text-main); font-size: 0.95rem; transition: color 0.2s; cursor: pointer; }
.footer-column a:hover, .footer-column span:hover { color: var(--text-muted); }

.copyright { max-width: 900px; margin: 3rem auto 0; text-align: center; font-size: 0.8rem; color: #999; }
.copied-feedback { color: #27ae60 !important; font-weight: 600; }

/* --- CALENDAR MODAL --- */
.modal-overlay {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.7); z-index: 2000; align-items: center; justify-content: center; backdrop-filter: blur(5px);
}
.modal-content { background: white; border-radius: 12px; width: 90%; max-width: 600px; position: relative; overflow: hidden; box-shadow: 0 25px 50px rgba(0,0,0,0.25); }
.iframe-container { position: relative; padding-bottom: 100%; height: 0; overflow: hidden; }
.iframe-container iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
.close-btn { position: absolute; top: 15px; right: 20px; font-size: 30px; font-weight: bold; color: #333; cursor: pointer; z-index: 1010; background: white; border-radius: 50%; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 5px rgba(0,0,0,0.2); }

/* --- ANIMATIONS --- */
@keyframes pulse {
    0% { opacity: 1; box-shadow: 0 0 0 0 rgba(39, 174, 96, 0.4); }
    50% { opacity: 0.5; }
    70% { box-shadow: 0 0 0 6px rgba(39, 174, 96, 0); }
    100% { opacity: 1; box-shadow: 0 0 0 0 rgba(39, 174, 96, 0); }
}

/* --- SLASH DIRECTORY LAYOUT --- */
.slash-directory {
    margin-top: 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.directory-group {
    display: grid;
    grid-template-columns: 48px 1fr;
    gap: 1.5rem;
    border-top: 1px solid var(--nav-border);
    padding-top: 1.5rem;
}

.directory-letter {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-muted);
    font-family: "SFMono-Regular", Consolas, Menlo, monospace;
    line-height: 1.2;
}

.directory-entries {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.directory-entry {
    display: flex;
    flex-direction: column;
}

.directory-link {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--link-color);
    text-decoration: none;
    font-family: "SFMono-Regular", Consolas, Menlo, monospace;
    letter-spacing: -0.01em;
    transition: color 0.2s ease, opacity 0.2s ease;
    width: fit-content;
}

.directory-link:hover {
    opacity: 0.75;
    text-decoration: underline;
}

.directory-desc {
    margin: 0.3rem 0 0 0;
    color: var(--text-muted);
    font-size: 0.98rem;
    line-height: 1.5;
}

/* Header RSS Badge Component */
.header-with-badge {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 0.5rem;
}

.rss-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background-color: var(--nav-border, #f0f0f0);
    border-radius: 6px;
    font-size: 0.85rem;
    color: var(--text-main, #111111);
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.rss-badge:hover {
    background-color: #e2e2e2;
    transform: translateY(-1px);
}

/* --- MOBILE RESPONSIVE MEDIA QUERIES --- */
@media (max-width: 768px) {
    .hero, .pillars-section { flex-direction: column; grid-template-columns: 1fr; gap: 2rem; }
    .hero { text-align: left; margin-top: 120px; } 
    .hero-image-container { margin: 0 auto; }
    .footer-grid { grid-template-columns: 1fr; text-align: center; }
    
    .top-nav { 
        flex-direction: column;
        height: auto; 
        padding: 12px 1rem; 
        gap: 8px; 
    }
    .nav-logo { margin-bottom: 0; }
    .nav-links { gap: 1.2rem; width: 100%; justify-content: center; }
    .nav-links a { font-size: 0.85rem; }

    .infobox { float: none; width: auto; margin: 0 0 2rem 0; }
    .photo-grid { grid-template-columns: 1fr; }
    h1 { font-size: 2.5rem; }

    .directory-group {
        grid-template-columns: 32px 1fr;
        gap: 1rem;
    }
}
