:root {
    --bg-color: #000000;
    --text-color: #f5f5f7;
    --text-secondary: #86868b;
    --accent-color: #2997ff;
    --nav-bg: rgba(0, 0, 0, 0.8);
    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    --section-spacing: 80px;
}

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

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background-color: var(--nav-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-content {
    max-width: 980px;
    margin: 0 auto;
    padding: 0 20px;
    height: 44px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
}

.nav-links {
    display: flex;
    list-style: none;
    display: flex;
    list-style: none;
    gap: 24px;
}

.hamburger {
    display: none;
}

.nav-links a {
    color: #e8e8ed;
    text-decoration: none;
    font-size: 12px;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.nav-links a:hover {
    opacity: 1;
}

/* Hero Section */
.hero-section {
    height: 100vh;
    height: 100svh;
    /* Mobile viewport height fix */
    min-height: 600px;
    /* Prevent squashing on very short screens */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    text-align: center;
    padding-top: 60px;
    /* Space for navbar */
    padding-bottom: 0;
    overflow: hidden;
}

.hero-content {
    margin-bottom: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 100%;
    z-index: 1;
    opacity: 0;
    animation: fadeUp 1s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.hero-eyebrow {
    color: #f56300;
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 8px;
}

.hero-title {
    font-size: 56px;
    font-weight: 700;
    margin-bottom: 6px;
    letter-spacing: -0.005em;
}

.hero-subtitle {
    font-size: 24px;
    font-weight: 400;
    color: var(--text-color);
    margin-bottom: 24px;
}

.cta-container {
    display: flex;
    gap: 20px;
    justify-content: center;
    align-items: center;
}

.btn {
    text-decoration: none;
    font-size: 17px;
    padding: 8px 16px;
    border-radius: 980px;
    transition: all 0.3s ease;
}

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

.btn-primary:hover {
    background-color: #0077ed;
}

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

.btn-link:hover {
    text-decoration: underline;
}

.hero-image-container {
    max-width: 600px;
    width: 100%;
    padding: 0 20px;
    opacity: 0;
    animation: fadeUp 1s cubic-bezier(0.2, 0.8, 0.2, 1) 0.3s forwards;
    flex-shrink: 0;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    margin-top: 20px;
}

.hero-image {
    width: auto;
    height: auto;
    max-height: 50vh;
    /* Limit height to 50% of viewport */
    max-width: 100%;
    display: block;
    border-radius: 20px;
    /* Optional: Add a subtle shadow for depth */
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

/* Content Sections */
.content-section {
    padding: var(--section-spacing) 20px;
    background-color: #000000;
    /* Default to black */
    color: var(--text-color);
    text-align: center;
}

.alt-bg {
    background-color: #1d1d1f;
    /* Alternating dark gray */
}

.contact-btn {
    margin-top: 30px;
    display: inline-block;
}

.social-links {
    display: flex;
    gap: 24px;
    justify-content: center;
    align-items: center;
    margin-top: 30px;
}

.social-icon {
    color: #86868b;
    transition: color 0.3s ease, transform 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.social-icon:hover {
    color: #f5f5f7;
    transform: translateY(-2px);
}

.section-content {
    max-width: 980px;
    margin: 0 auto;
}

.section-content.full-width {
    max-width: 100%;
    padding: 0;
    overflow: hidden;
}

.section-header {
    max-width: 980px;
    margin: 0 auto 40px;
    padding: 0 20px;
    /* This 20px is what we add to the calc above */
    text-align: left;
}

.section-header h2 {
    font-size: 56px;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--text-color);
    /* White */
}

.section-subtitle {
    font-size: 56px;
    font-weight: 700;
    color: var(--text-color);
    line-height: 1.1;
}

#publications,
#projects {
    padding-left: 0;
    padding-right: 0;
}

/* Horizontal Scroller */
.highlights-scroller {
    display: flex;
    overflow-x: auto;
    overflow-y: visible;
    gap: 20px;
    padding: 0 20px;
    /* Fallback, overridden by JS */
    padding-bottom: 40px;
    padding-top: 10px;
    margin-top: 10px;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    /* Firefox */
}

.highlights-scroller::-webkit-scrollbar {
    display: none;
    /* Chrome/Safari */
}

.highlight-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
    flex: 0 0 500px;
    /* Match the card width */
}

.highlight-card {
    flex: 0 0 500px;
    width: 100%;
    height: 520px;
    background-color: #1d1d1f;
    /* Slightly lighter than black for contrast */
    border-radius: 28px;
    padding: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    text-align: left;
    scroll-snap-align: start;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, opacity 0.6s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);

    /* Animation start state */
    opacity: 0;
    transform: translateY(30px);
}

.highlight-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.highlight-card:hover {
    transform: scale(1.02);
    z-index: 10;
}

.card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    opacity: 0.9;
    transition: opacity 0.3s ease;
}

.card-image-placeholder {
    width: 100%;
    height: 200px;
    background-color: #3a3a3c;
    opacity: 0.9;
    transition: opacity 0.3s ease;
}

.highlight-card:hover .card-image {
    opacity: 1;
}

.highlight-card:hover .card-image-placeholder {
    opacity: 1;
}

.card-content {
    padding: 24px;
    width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    z-index: 2;
}

.card-eyebrow {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 8px;
    display: block;
}

.card-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 12px;
    line-height: 1.2;
}

.card-desc {
    font-size: 17px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.section-content h2 {
    font-size: 40px;
    font-weight: 600;
    margin-bottom: 20px;
}

.section-content p {
    font-size: 21px;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* Footer */
footer {
    background-color: #1d1d1f;
    padding: 40px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 12px;
    color: var(--text-secondary);
    text-align: center;
}

/* Publications List */
.publications-list {
    margin-top: 20px;
    max-width: 980px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 20px;
}

.publication-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 32px 0;
    text-align: left;
    transition: all 0.3s ease;
}

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

.publication-item:hover {
    background-color: rgba(255, 255, 255, 0.02);
    padding-left: 20px;
    margin-left: -20px;
    margin-right: -20px;
    border-radius: 12px;
}

.publication-venue {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: #f56300;
    margin-bottom: 8px;
    display: block;
    letter-spacing: 0.5px;
}

.publication-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 12px;
    line-height: 1.3;
    color: var(--text-color);
}

.publication-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.publication-title a:hover {
    color: var(--accent-color);
}

.publication-authors {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-style: italic;
}

.publication-authors .author-name {
    font-weight: bold;
    color: #b3b3b8;
}

.publication-description {
    font-size: 17px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
}

/* Service List */
.service-list {
    margin-top: 20px;
    max-width: 980px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 20px;
}

.service-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 32px 0;
    text-align: left;
    transition: all 0.3s ease;
}

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

.service-item:hover {
    background-color: rgba(255, 255, 255, 0.02);
    padding-left: 20px;
    margin-left: -20px;
    margin-right: -20px;
    border-radius: 12px;
}

.service-venue {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 8px;
    display: block;
    letter-spacing: 0.5px;
}

.service-role {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 12px;
    line-height: 1.3;
    color: var(--text-color);
}

.service-authors {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-style: italic;
}

.service-description {
    font-size: 17px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
}

/* Carousel Controls */
.carousel-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-top: 40px;
    padding-bottom: 20px;
}

.pagination-container {
    background: rgba(60, 60, 60, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    height: 32px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 12px;
}

.pagination-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
}

.pagination-dot.active {
    background-color: rgba(255, 255, 255, 0.8);
    width: 40px;
    border-radius: 4px;
}

/* Animations */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive */
@media (max-width: 768px) {
    .hero-title {
        font-size: 40px;
    }

    .hero-subtitle {
        font-size: 20px;
    }

    .nav-links {
        position: fixed;
        right: 0;
        height: 100vh;
        top: 0;
        background-color: #1d1d1f;
        /* Dark background like Apple */
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        /* Left align */
        justify-content: flex-start;
        /* Start from top */
        padding-top: 100px;
        /* Space for close button */
        padding-left: 40px;
        /* Left indentation */
        width: 100%;
        transform: translateX(100%);
        transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
        /* Smoother easing */
        z-index: 999;
    }

    .nav-links.nav-active {
        transform: translateX(0%);
    }

    .nav-links li {
        opacity: 0;
        width: 100%;
    }

    .nav-links a {
        font-size: 28px;
        /* Larger font */
        font-weight: 600;
        /* Bolder */
        color: #f5f5f7;
        /* White text */
        margin: 4px 0;
        /* 0.4x of previous 10px */
        display: block;
        transition: opacity 0.3s ease;
    }

    .nav-links a:hover {
        opacity: 0.7;
    }

    .hamburger {
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 6px;
        /* Precise gap */
        cursor: pointer;
        z-index: 1000;
        width: 25px;
        /* Explicit width */
        height: 25px;
        /* Explicit height for touch target */
    }

    .hamburger div {
        width: 100%;
        /* Full width of container */
        height: 2px;
        background-color: var(--text-color);
        margin: 0;
        /* Remove margin to rely on gap */
        transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
        /* Smoother animation */
        transform-origin: center;
    }

    /* Hamburger Animation */
    .toggle .line1 {
        transform: translateY(4px) rotate(45deg);
        /* 6px gap / 2 + 2px height / 2 = 4px? No. Gap is 6px. Center to center is 2/2 + 6 + 2/2 = 8px. Half is 4px. */
    }

    .toggle .line2 {
        transform: translateY(-4px) rotate(-45deg);
    }

    @keyframes navLinkFade {
        from {
            opacity: 0;
            transform: translateX(50px);
        }

        to {
            opacity: 1;
            transform: translateX(0);
        }
    }

    .highlight-card,
    .highlight-card-link {
        flex: 0 0 85vw;
        max-width: 400px;
        /* Prevent them from getting too huge on larger mobile screens */
    }

    .card-title {
        font-size: 24px;
        /* Slightly smaller title on mobile */
    }

    /* Publications List Mobile Styles */
    .publication-item {
        padding: 24px 0;
    }

    .publication-item:hover {
        padding-left: 16px;
        margin-left: -16px;
        margin-right: -16px;
    }

    .publication-title {
        font-size: 20px;
        line-height: 1.4;
    }

    .publication-description {
        font-size: 16px;
    }
}