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

:root {
    --primary-color: #000000;
    --text-primary: #000000;
    --text-secondary: #666666;
    --background: #ffffff;
    --border-color: #e0e0e0;
    --accent: #1a5dab;
    --accent-hover: #144a8a;
    --accent-subtle: rgba(26, 93, 171, 0.08);
    --card-hover-bg: rgba(0, 0, 0, 0.02);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --transition-fast: 0.2s ease;
    --transition-base: 0.3s ease;
    --font-heading: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --primary-color: #ffffff;
        --text-primary: #e8e8e8;
        --text-secondary: #a0a0a0;
        --background: #1a1a1a;
        --border-color: #333333;
        --accent: #5a9fd4;
        --accent-hover: #7ab4e0;
        --accent-subtle: rgba(90, 159, 212, 0.1);
        --card-hover-bg: rgba(255, 255, 255, 0.03);
        --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.2);
        --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
    }
}

[data-theme="dark"] {
    --primary-color: #ffffff;
    --text-primary: #e8e8e8;
    --text-secondary: #a0a0a0;
    --background: #1a1a1a;
    --border-color: #333333;
    --accent: #5a9fd4;
    --accent-hover: #7ab4e0;
    --accent-subtle: rgba(90, 159, 212, 0.1);
    --card-hover-bg: rgba(255, 255, 255, 0.03);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
}

body {
    font-family: var(--font-body);
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--background);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Header & Navigation */
header {
    background-color: var(--background);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

nav {
    max-width: 900px;
    margin: 0 auto;
    padding: 1.5rem 2rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.logo {
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    margin-right: auto;
}

.logo a {
    color: var(--text-primary);
    text-decoration: none;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 400;
    font-size: 0.9rem;
    transition: color var(--transition-fast);
}

.nav-links a:hover {
    color: var(--accent);
}

.nav-links a.active {
    color: var(--text-primary);
    font-weight: 500;
}

/* Theme toggle */
.theme-toggle {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    padding: 0.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: color var(--transition-fast), border-color var(--transition-fast);
}

.theme-toggle:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.theme-toggle svg {
    width: 18px;
    height: 18px;
}

.theme-toggle .icon-moon { display: none; }
.theme-toggle .icon-sun { display: none; }

:root:not([data-theme]) .theme-toggle .icon-moon { display: block; }
:root:not([data-theme]) .theme-toggle .icon-sun { display: none; }

@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) .theme-toggle .icon-moon { display: none; }
    :root:not([data-theme]) .theme-toggle .icon-sun { display: block; }
}

[data-theme="light"] .theme-toggle .icon-moon { display: block; }
[data-theme="light"] .theme-toggle .icon-sun { display: none; }

[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }

/* Hamburger menu button -- hidden on desktop */
.nav-toggle {
    display: none;
}

/* Bottom tab bar -- hidden on desktop */
.bottom-tab-bar {
    display: none;
}

/* Hero Section */
#hero {
    padding: 8rem 2rem 6rem;
    background: var(--background);
}

.hero-content {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 3rem;
}

.hero-text {
    flex: 1;
}

.hero-image {
    flex-shrink: 0;
}

.headshot {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: var(--shadow-md);
    border: 3px solid var(--border-color);
}

.hero-content h1 {
    font-family: var(--font-heading);
    font-size: 2.75rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-weight: 700;
    letter-spacing: -1px;
    line-height: 1.1;
}

.tagline {
    font-size: 1.05rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
    font-weight: 400;
    line-height: 1.5;
}

.subtitle {
    font-size: 1.05rem;
    color: var(--text-secondary);
    margin-bottom: 1.75rem;
    font-weight: 400;
}

.cta-buttons {
    display: flex;
    gap: 1.5rem;
}

.btn {
    padding: 0;
    text-decoration: none;
    font-weight: 400;
    font-size: 0.9rem;
    display: inline-block;
    border-bottom: 1px solid var(--text-primary);
    color: var(--text-primary);
    transition: color var(--transition-fast), border-bottom-color var(--transition-fast);
}

.btn:hover {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.btn-primary {
    color: var(--text-primary);
}

.btn-secondary {
    color: var(--text-secondary);
    border-bottom-color: var(--text-secondary);
}

/* Page load transition */
main {
    animation: fadeIn 0.4s ease-out;
}

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

/* Sections */
section {
    padding: 4rem 2rem;
    max-width: 900px;
    margin: 0 auto;
}

section h2 {
    font-family: var(--font-heading);
    font-size: 1.125rem;
    margin-bottom: 3rem;
    color: var(--text-primary);
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* About Section */
.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: start;
}

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

.about-image {
    width: 100%;
    border-radius: 6px;
    overflow: hidden;
    position: sticky;
    top: 6rem;
}

.about-image img {
    width: 100%;
    height: auto;
    display: block;
}

/* Experience Section -- Timeline */
.experience-grid {
    display: grid;
    gap: 0;
    position: relative;
    padding-left: 32px;
}

.experience-grid::before {
    content: '';
    position: absolute;
    left: 5px;
    top: 0.5rem;
    bottom: 0.5rem;
    width: 2px;
    background: var(--border-color);
}

.experience-item {
    padding: 1rem 1.5rem 2.5rem;
    border-bottom: none;
    position: relative;
}

.experience-item:last-child {
    padding-bottom: 1rem;
}

.experience-item::before {
    content: '';
    position: absolute;
    left: -32px;
    top: 1.4rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent);
    z-index: 1;
}

.experience-logo {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

.experience-content h3 {
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    font-weight: 500;
    font-size: 1rem;
}

.experience-content .company {
    color: var(--text-secondary);
    font-weight: 400;
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
}

.experience-content .period {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.experience-content .description {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.7;
}

.experience-content .description p {
    margin-bottom: 0.75rem;
}

.experience-content .description ul {
    list-style-type: none;
    padding-left: 0;
    margin-top: 0.75rem;
}

.experience-content .description li {
    margin-bottom: 0.5rem;
    line-height: 1.7;
    font-size: 0.9rem;
    padding-left: 1rem;
    position: relative;
}

.experience-content .description li:before {
    content: "\2014";
    position: absolute;
    left: 0;
}

/* Projects Section */
.projects-grid {
    display: grid;
    gap: 2.5rem;
}

.project-card {
    padding: 1.5rem;
    margin: 0 -1.5rem;
    border-bottom: 1px solid var(--border-color);
    border-radius: 8px;
}

.project-card:last-child {
    border-bottom: none;
}

.project-card h3 {
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    font-weight: 500;
    font-size: 1rem;
    line-height: 1.5;
}

.project-card p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-size: 0.9rem;
    line-height: 1.7;
}

.project-card .authors {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.project-links {
    display: flex;
    gap: 1rem;
}

.project-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 400;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--text-secondary);
    transition: color var(--transition-fast), border-bottom-color var(--transition-fast);
}

.project-links a:hover {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.presentation-info {
    margin-top: 1rem;
}

.presentation-info p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-style: italic;
}

.presentation-info ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.presentation-info li {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
    padding-left: 1rem;
    position: relative;
}

.presentation-info li:before {
    content: "\2014";
    position: absolute;
    left: 0;
}

/* Featured Work Section */
.featured-grid {
    display: grid;
    gap: 4rem;
}

.featured-item {
    display: grid;
    gap: 2rem;
    padding-bottom: 4rem;
    border-bottom: 1px solid var(--border-color);
}

.featured-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.featured-image {
    width: 100%;
    overflow: hidden;
}

.featured-image img {
    width: 100%;
    height: auto;
}

.featured-content h3 {
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.featured-meta {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-style: italic;
}

.featured-content p {
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
}

/* Press & Media Section */
.press-grid {
    display: grid;
    gap: 2.5rem;
}

.press-item {
    padding: 1.5rem;
    margin: 0 -1.5rem;
    border-bottom: 1px solid var(--border-color);
    border-radius: 8px;
}

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

.press-item h3 {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.press-source {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-style: italic;
    margin-bottom: 0.75rem;
}

.press-description {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 1rem;
}

.press-link {
    font-size: 0.9rem;
    color: var(--text-primary);
    text-decoration: none;
    border-bottom: 1px solid var(--text-primary);
    font-weight: 400;
    transition: color var(--transition-fast), border-bottom-color var(--transition-fast);
}

.press-link:hover {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* Section Header with Image */
.section-header-with-image {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-bottom: 3rem;
}

.section-header-image {
    flex-shrink: 0;
    width: 120px;
    height: 120px;
    border-radius: 4px;
    overflow: hidden;
}

.section-header-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.section-header-with-image h2 {
    margin-bottom: 0;
}

/* Talks Section */
.talks-grid {
    display: grid;
    gap: 2.5rem;
}

.talk-item {
    padding: 1.5rem;
    margin: 0 -1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: grid;
    gap: 1.5rem;
    border-radius: 8px;
}

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

/* If talk has an image, use two-column grid */
.talk-item:has(.talk-image) {
    grid-template-columns: 200px 1fr;
}

/* If talk has no image, content spans full width */
.talk-item:not(:has(.talk-image)) {
    grid-template-columns: 1fr;
}

.talk-image {
    width: 100%;
    height: auto;
    overflow: hidden;
    border-radius: 4px;
}

.talk-image img {
    width: 100%;
    height: auto;
    object-fit: cover;
}

.talk-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.talk-title {
    font-size: 1rem;
    color: var(--text-primary);
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.talk-venue {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.talk-date {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.talk-venues {
    list-style: none;
    padding-left: 0;
    margin: 0.5rem 0 0 0;
}

.talk-venues li {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
    padding-left: 1rem;
    position: relative;
}

.talk-venues li:before {
    content: "\2014";
    position: absolute;
    left: 0;
}

/* Contact Section */
#contact > .container > p {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.7;
}

.contact-intro {
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 3rem;
    max-width: 600px;
}

.contact-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.contact-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 2rem 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-secondary);
    transition: border-color var(--transition-fast),
                box-shadow var(--transition-fast),
                transform var(--transition-fast);
}

.contact-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.contact-card:hover svg {
    color: var(--accent);
}

.contact-card svg {
    transition: color var(--transition-fast);
}

.contact-card-label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.contact-card-value {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.contact-location {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-style: italic;
}

.contact-info {
    margin-bottom: 1.5rem;
}

.contact-info p {
    margin: 0.5rem 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.contact-info a {
    color: var(--text-primary);
    text-decoration: none;
    border-bottom: 1px solid var(--text-primary);
    transition: color var(--transition-fast), border-bottom-color var(--transition-fast);
}

.contact-info a:hover {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.contact-links {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.contact-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 400;
    border-bottom: 1px solid var(--text-secondary);
    transition: color var(--transition-fast), border-bottom-color var(--transition-fast);
}

.contact-links a:hover {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* Footer */
footer {
    border-top: 1px solid var(--border-color);
    padding: 2.5rem 2rem;
    margin-top: 4rem;
}

.footer-content {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-copyright {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.footer-links {
    display: flex;
    gap: 1.25rem;
    align-items: center;
}

.footer-links a {
    color: var(--text-secondary);
    transition: color var(--transition-fast), transform var(--transition-fast);
    display: flex;
    align-items: center;
}

.footer-links a:hover {
    color: var(--accent);
    transform: translateY(-2px);
}

/* Legacy footer (for pages not yet updated) */
footer p {
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-align: center;
}

footer a {
    color: var(--text-secondary);
    text-decoration: none;
    border-bottom: 1px solid var(--border-color);
    transition: color var(--transition-fast), border-bottom-color var(--transition-fast);
}

footer a:hover {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* Scroll animations */
.fade-in-up {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.3s ease-out, transform 0.3s ease-out;
}

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

.fade-in-up:nth-child(2) { transition-delay: 0.05s; }
.fade-in-up:nth-child(3) { transition-delay: 0.1s; }
.fade-in-up:nth-child(4) { transition-delay: 0.15s; }

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .fade-in-up {
        opacity: 1;
        transform: none;
        transition: none;
    }
    main {
        animation: none;
    }
}

/* View Transitions */
@view-transition {
    navigation: auto;
}

::view-transition-old(root) {
    animation: 0.15s ease-out both fade-out;
}

::view-transition-new(root) {
    animation: 0.15s ease-in both fade-in;
}

@keyframes fade-out {
    to { opacity: 0; }
}

@keyframes fade-in {
    from { opacity: 0; }
}

/* Responsive Design */
@media (max-width: 768px) {
    nav {
        padding: 1rem 1.25rem;
    }

    .nav-links {
        display: none;
    }

    .logo {
        font-size: 0.9rem;
    }

    body {
        padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px));
    }

    .bottom-tab-bar {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 100;
        background: var(--background);
        border-top: 1px solid var(--border-color);
        padding: 0.4rem 0 calc(0.4rem + env(safe-area-inset-bottom, 0px));
        justify-content: space-around;
        align-items: center;
    }

    .tab-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.2rem;
        text-decoration: none;
        color: var(--text-secondary);
        font-size: 0.65rem;
        font-weight: 400;
        padding: 0.25rem 0.5rem;
        transition: color var(--transition-fast);
        -webkit-tap-highlight-color: transparent;
    }

    .tab-item svg {
        width: 20px;
        height: 20px;
    }

    .tab-item.active {
        color: var(--accent);
    }

    .tab-item:hover {
        color: var(--accent);
    }

    #hero {
        padding: 4rem 1rem 3rem;
    }

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

    .cta-buttons {
        justify-content: center;
    }

    .headshot {
        width: 160px;
        height: 160px;
    }

    .hero-content h1 {
        font-size: 2rem;
    }

    .tagline {
        font-size: 0.9rem;
    }

    .subtitle {
        font-size: 0.9rem;
    }

    section {
        padding: 3rem 1rem;
    }

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

    .about-image {
        margin-top: 1.5rem;
        position: static;
    }

    .experience-grid {
        padding-left: 24px;
    }

    .experience-grid::before {
        left: 4px;
    }

    .experience-item::before {
        left: -24px;
        width: 10px;
        height: 10px;
    }

    .experience-item {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .experience-logo {
        width: 36px;
        height: 36px;
    }

    .featured-content h3 {
        font-size: 1.1rem;
    }

    .featured-content p {
        font-size: 0.9rem;
    }

    .talk-item:has(.talk-image) {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

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

    .section-header-with-image {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
    }

    .section-header-image {
        width: 100px;
        height: 100px;
    }

    .contact-cards {
        grid-template-columns: 1fr;
    }

    .footer-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}
