/* ===== Variables & Reset ===== */
:root {
    --bg: #fff;
    --bg-alt: #f6f7f9;
    --text: #1a1a1a;
    --text-muted: #555;
    --accent: #4b6cb7;
    --accent-light: #e8edf5;
    --border: #e0e0e0;
    --card-bg: #fff;
    --card-shadow: 0 1px 3px rgba(0,0,0,0.06);
    --nav-bg: rgba(255,255,255,0.95);
    --font-serif: 'Source Serif 4', Georgia, serif;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --max-w: 960px;
}

[data-theme="dark"] {
    --bg: #111;
    --bg-alt: #1a1a1a;
    --text: #e0e0e0;
    --text-muted: #999;
    --accent: #7da0e0;
    --accent-light: #1e2a3d;
    --border: #2a2a2a;
    --card-bg: #1a1a1a;
    --card-shadow: 0 1px 3px rgba(0,0,0,0.3);
    --nav-bg: rgba(17,17,17,0.95);
}

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

html { scroll-behavior: smooth; scroll-padding-top: 70px; }

body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    line-height: 1.65;
    font-size: 16px;
    transition: background 0.3s, color 0.3s;
}

img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
ul { list-style: disc; padding-left: 1.3em; }

.container { max-width: var(--max-w); margin: 0 auto; padding: 0 1.5rem; }

section {
    padding: 4rem 0;
}

section h2 {
    font-family: var(--font-serif);
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 2rem;
    color: var(--text);
}

.alt-bg { background: var(--bg-alt); }

/* ===== Navbar ===== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--nav-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
    z-index: 100;
}

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

.nav-brand {
    font-family: var(--font-serif);
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--text);
    text-decoration: none;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-link {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
}
.nav-link:hover, .nav-link.active { color: var(--accent); text-decoration: none; }

.theme-toggle {
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-muted);
    cursor: pointer;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    transition: color 0.2s, border-color 0.2s;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); }

/* Mobile nav toggle */
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}
.nav-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text);
    border-radius: 1px;
    transition: transform 0.2s, opacity 0.2s;
}

/* ===== Hero ===== */
.hero {
    padding-top: 96px;
    padding-bottom: 3rem;
}

.hero-content {
    display: flex;
    gap: 2.5rem;
    align-items: flex-start;
}

.hero-image {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 3px solid var(--border);
}

.hero-text h1 {
    font-family: var(--font-serif);
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

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

.bio {
    margin-bottom: 1.25rem;
    max-width: 580px;
    line-height: 1.7;
}

.hero-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}
.hero-links a {
    font-size: 0.9rem;
    font-weight: 500;
}

/* ===== About ===== */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 2.5rem;
    align-items: start;
}

.about-text p { margin-bottom: 1rem; }

.about-text h3 {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

ul.interests {
    columns: 2;
    list-style: none;
    padding-left: 0;
}

ul.interests li {
    padding: 0.2rem 0;
    font-size: 0.925rem;
    color: var(--text-muted);
}
ul.interests li::before {
    content: "–";
    margin-right: 0.5rem;
    color: var(--accent);
}

/* ===== Sidebar cards ===== */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    box-shadow: var(--card-shadow);
}

.card h3 {
    font-family: var(--font-serif);
    font-size: 1rem;
    margin-bottom: 0.75rem;
}

.edu-item {
    margin-bottom: 1rem;
}
.edu-item:last-child { margin-bottom: 0; }
.edu-item strong { display: block; font-size: 0.925rem; }
.edu-item span { display: block; font-size: 0.85rem; color: var(--text-muted); }
.edu-item .muted { font-style: italic; }

.skill-group { margin-bottom: 0.75rem; }
.skill-group:last-child { margin-bottom: 0; }
.skill-group h4 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}

/* ===== Tags ===== */
.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}
.tags span {
    font-size: 0.78rem;
    padding: 0.2rem 0.55rem;
    background: var(--accent-light);
    color: var(--accent);
    border-radius: 4px;
    font-weight: 500;
}

/* ===== Entries (research, UTA, leadership) ===== */
.entry {
    margin-bottom: 2.5rem;
    padding-bottom: 2.5rem;
    border-bottom: 1px solid var(--border);
}
.entry:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }

.entry-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.entry-header h3 {
    font-family: var(--font-serif);
    font-size: 1.15rem;
    font-weight: 600;
}

.entry-org {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

.entry-date {
    font-size: 0.85rem;
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}

.entry ul {
    margin-bottom: 0.75rem;
}
.entry li {
    margin-bottom: 0.4rem;
    font-size: 0.925rem;
}

.entry p {
    font-size: 0.925rem;
}

.entry .tags {
    margin-top: 0.75rem;
}

/* UTA sub-roles */
.uta-role {
    margin-top: 1.25rem;
}
.uta-role h4 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
}

/* ===== Project grid ===== */
.project-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.project-card {
    display: block;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.25rem;
    text-decoration: none;
    color: var(--text);
    transition: border-color 0.2s, box-shadow 0.2s;
}
.project-card:hover {
    border-color: var(--accent);
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    text-decoration: none;
}

.project-card h3 {
    font-family: var(--font-serif);
    font-size: 1rem;
    margin-bottom: 0.4rem;
}

.project-card p {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* ===== Contact ===== */
.contact-section {
    text-align: center;
}

.contact-section p {
    max-width: 520px;
    margin: 0 auto 1.25rem;
    color: var(--text-muted);
}

.contact-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}
.contact-links a {
    font-size: 0.95rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* ===== Footer ===== */
.footer {
    border-top: 1px solid var(--border);
    padding: 1.5rem 0;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .nav-toggle { display: flex; }

    .nav-menu {
        display: none;
        position: absolute;
        top: 56px;
        left: 0;
        right: 0;
        background: var(--nav-bg);
        flex-direction: column;
        padding: 1rem 1.5rem;
        border-bottom: 1px solid var(--border);
        gap: 0.75rem;
    }
    .nav-menu.open { display: flex; }

    .hero-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

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

    .about-grid {
        grid-template-columns: 1fr;
    }

    .about-sidebar { order: -1; }

    ul.interests { columns: 1; }

    .project-grid { grid-template-columns: 1fr; }

    .entry-header { flex-direction: column; }
    .entry-date { margin-top: 0; }
}

@media (max-width: 480px) {
    .hero-text h1 { font-size: 1.75rem; }
    section { padding: 3rem 0; }
    section h2 { font-size: 1.4rem; }
}
