/* ── Statmech@UChicago Shared Styles ── */

:root {
    --maroon: #800000;
    --maroon-light: #9a1515;
    --maroon-dark: #5c0000;
    --grey: #767676;
    --text-dark: #1a1a1a;
    --text-muted: #555;
    --bg-warm: #faf8f5;
    --bg-section: #eae5dc;
    --accent-blue: #2c5aa0;
    --accent-red: #c62828;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background: var(--bg-warm);
}

/* ── Header ── */
header {
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    transition: box-shadow 0.3s;
}

header.scrolled {
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.8rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    font-family: 'Inter', sans-serif;
    font-size: 1.4rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.logo .stat { color: #c62828; }
.logo .mech { color: var(--accent-blue); }
.logo .at { color: var(--grey); font-weight: 300; margin: 0 1px; }
.logo .uchicago { color: var(--maroon); }

nav {
    display: flex;
    gap: 2rem;
    align-items: center;
}

nav a {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.9rem;
    letter-spacing: 0.02em;
    transition: color 0.3s;
    position: relative;
}

nav a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--maroon);
    transition: width 0.3s;
}

nav a:hover { color: var(--maroon); }
nav a:hover::after { width: 100%; }

.nav-toggle {
    display: none;
    font-size: 1.5rem;
    background: none;
    border: none;
    color: var(--text-dark);
    cursor: pointer;
    padding: 0.5rem;
}

/* ── Page Layout ── */
.page-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 7rem 2rem 4rem;
}

.page-title {
    font-family: 'Source Serif 4', Georgia, serif;
    font-size: clamp(2rem, 3.5vw, 2.8rem);
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.page-subtitle {
    font-size: 1.05rem;
    color: var(--text-muted);
    max-width: 600px;
    line-height: 1.7;
    margin-bottom: 3rem;
}

.section-label {
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--maroon);
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.section-title {
    font-family: 'Source Serif 4', Georgia, serif;
    font-size: clamp(1.8rem, 3vw, 2.4rem);
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 1rem;
    line-height: 1.3;
}

/* ── Footer ── */
footer {
    background: #1a1a1a;
    color: rgba(255,255,255,0.7);
    padding: 3rem 2rem;
    margin-top: 4rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 3rem;
}

footer h3 {
    color: white;
    font-size: 0.85rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 1rem;
    font-weight: 600;
}

footer p, footer a {
    font-size: 0.9rem;
    line-height: 1.8;
}

footer a {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: color 0.2s;
}

footer a:hover {
    color: white;
}

.footer-bottom {
    max-width: 1200px;
    margin: 2rem auto 0;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 0.8rem;
    color: rgba(255,255,255,0.4);
}

/* ── Animations ── */
.fade-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.fade-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ── Cards ── */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.card {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    border: 1px solid rgba(0,0,0,0.06);
    transition: transform 0.3s, box-shadow 0.3s;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.06);
}

/* ── Links & Badges ── */
a {
    color: var(--accent-blue);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    margin-right: 0.5rem;
}

.badge-maroon {
    color: var(--maroon);
    background: rgba(128,0,0,0.06);
}

.badge-blue {
    color: var(--accent-blue);
    background: rgba(44,90,160,0.06);
}

/* ── Responsive ── */
@media (max-width: 900px) {
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    .card-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .nav-toggle {
        display: block;
    }

    nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(255,255,255,0.98);
        backdrop-filter: blur(12px);
        flex-direction: column;
        padding: 1rem 2rem;
        box-shadow: 0 4px 12px rgba(0,0,0,0.08);
        gap: 0;
    }

    nav.active {
        display: flex;
    }

    nav a {
        padding: 0.75rem 0;
        border-bottom: 1px solid rgba(0,0,0,0.04);
    }
    nav a::after { display: none; }

    .header-content {
        position: relative;
    }

    .page-container {
        padding-top: 5rem;
    }
}
