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

:root {
    --color-bg: #ffffff;
    --color-text: #1a1a1a;
    --color-text-light: #666;
    --color-accent: #e85a4f;
    
    --font-main: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    
    --nav-width: 140px;
    --page-padding: 48px;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: var(--font-main);
    font-weight: 400;
    line-height: 1.6;
    color: var(--color-text);
    background: var(--color-bg);
}

a {
    color: inherit;
    text-decoration: none;
}

/* === LAYOUT === */
.container {
    display: flex;
    min-height: 100vh;
    padding: var(--page-padding);
    gap: 80px;
}

/* === NAV === */
.nav {
    position: sticky;
    top: var(--page-padding);
    height: fit-content;
    width: var(--nav-width);
    flex-shrink: 0;
}

/* === HAMBURGER (hidden on desktop) === */
.hamburger {
    display: none;
}

.mobile-top-fade {
    display: none;
}

.nav ul {
    list-style: none;
}

.nav li {
    margin-bottom: 8px;
}

.nav a {
    font-size: 0.9375rem;
    transition: color 0.15s ease;
    line-height: 1.2;
}

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

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

/* === CONTENT === */
.content {
    flex: 1;
    max-width: 600px;
}

/* === ABOUT === */
.about h1 {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 32px;
}

.about p {
    margin-bottom: 16px;
    max-width: 50ch;
}

.about .lead {
    font-size: 1.0625rem;
    line-height: 1.65;
}

.info-block {
    margin-top: 32px;
}

.info-block p {
    font-size: 0.875rem;
    color: var(--color-text-light);
}

.info-block a {
    transition: color 0.15s ease;
}

.info-block a:hover {
    color: var(--color-accent);
}

/* === PROJECTS PAGE === */
.page-header {
    margin-bottom: 40px;
}

.page-header h1 {
    font-size: 1rem;
    font-weight: 500;
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 24px;
}

/* === MOSAIC GRID === */
.project-mosaic {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.mosaic-card {
    display: block;
    text-decoration: none;
}

.mosaic-thumb {
    width: 100%;
    aspect-ratio: 16 / 9;
    background-size: cover;
    background-position: center;
    background-color: #e0e0e0;
    transition: opacity 0.15s ease;
}

.mosaic-thumb-cycle {
    position: relative;
}

.cycle-frame {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    animation: cycle-fade 12s infinite;
}

@keyframes cycle-fade {
    0% { opacity: 0; }
    4% { opacity: 1; }
    25% { opacity: 1; }
    29% { opacity: 0; }
    100% { opacity: 0; }
}

.mosaic-thumb-video {
    overflow: hidden;
}

.mosaic-thumb-video video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.mosaic-card:hover .mosaic-thumb {
    opacity: 0.8;
}

.mosaic-info {
    padding: 8px 0 4px;
}

.mosaic-title {
    font-size: 0.8125rem;
    font-weight: 500;
}

.mosaic-meta {
    font-size: 0.75rem;
    color: var(--color-text-light);
}

.mosaic-award {
    font-size: 0.6875rem;
    color: var(--color-text-light);
    margin-top: 2px;
    line-height: 1.4;
}

.project-card {
    display: block;
}

.project-thumb {
    width: 100%;
    aspect-ratio: 1 / 1.2;
    object-fit: cover;
    background: #e0e0e0;
    margin-bottom: 10px;
    transition: opacity 0.15s ease;
    display: block;
}

.project-card:hover .project-thumb {
    opacity: 0.8;
}

.project-title {
    font-size: 0.8125rem;
    font-weight: 400;
    line-height: 1.4;
}

.project-meta {
    font-size: 0.75rem;
    color: var(--color-text-light);
    margin-top: 2px;
}

/* === COLLAGE GRID === */
.collage-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 24px;
    align-items: start;
}

.collage-item {
    display: block;
}

.collage-item img {
    width: 100%;
    height: auto;
    display: block;
    background: #e0e0e0;
    margin-bottom: 10px;
    transition: opacity 0.15s ease;
}

.collage-item:hover img {
    opacity: 0.8;
}

@media (max-width: 700px) {
    .collage-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
}

/* === LIST PAGES (papers, talks, etc) === */
.item-list {
    list-style: none;
}

.item-list > li {
    margin-bottom: 28px;
}

.item-title {
    font-size: 0.9375rem;
    font-weight: 400;
    line-height: 1.5;
    margin-bottom: 4px;
}

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

.item-subtitle {
    font-size: 0.875rem;
    color: var(--color-text-light);
}

.item-meta {
    font-size: 0.8125rem;
    color: var(--color-text-light);
    margin-top: 2px;
}

.item-link {
    display: inline-block;
    font-size: 0.8125rem;
    color: var(--color-accent);
    margin-top: 4px;
}

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

/* === CV PAGE === */
.cv-download {
    font-size: 0.875rem;
    font-weight: 500;
    display: inline-block;
    margin-bottom: 32px;
    color: var(--color-accent);
}

.cv-download:hover {
    text-decoration: underline;
}

.cv-section {
    margin-bottom: 48px;
}

.cv-section h2 {
    font-size: 0.8125rem;
    font-weight: 500;
    text-transform: lowercase;
    color: var(--color-text-light);
    margin-bottom: 20px;
}

.cv-entry {
    margin-bottom: 20px;
}

.cv-entry-title {
    font-size: 0.9375rem;
    font-weight: 500;
}

.cv-entry-title a {
    transition: color 0.15s ease;
}

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

.cv-entry-org {
    font-size: 0.875rem;
    color: var(--color-text-light);
}

.cv-entry-date {
    font-size: 0.8125rem;
    color: var(--color-text-light);
}

.cv-entry-desc {
    font-size: 0.875rem;
    color: var(--color-text-light);
    margin-top: 6px;
    max-width: 55ch;
}

.cv-skills {
    font-size: 0.875rem;
    color: var(--color-text-light);
    max-width: 50ch;
}

/* === DROPDOWN NAV === */
.has-dropdown {
    position: relative;
}

.has-dropdown > a::after {
    content: none;
}

.dropdown-toggle {
    background: none;
    border: none;
    font-family: inherit;
    font-size: 1.125rem;
    font-weight: 400;
    color: #666;
    cursor: pointer;
    padding: 0;
    margin-left: 8px;
    transition: color 0.15s ease;
    line-height: 1;
}

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

.dropdown {
    display: none;
    list-style: none;
    padding: 6px 0 6px 12px;
    margin-top: 4px;
}

.has-dropdown.dropdown-open .dropdown {
    display: block;
}

.dropdown li {
    margin-bottom: 3px;
}

.dropdown a {
    font-size: 0.75rem;
    font-style: italic;
    color: #999;
    line-height: 1.4;
    display: inline-block;
}

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

/* Mobile dropdown - handled in main responsive block */

/* === PROJECT DETAIL PAGE === */
.project-detail {
    max-width: 600px;
}

.project-header {
    margin-bottom: 32px;
}

.back-link {
    font-size: 0.8125rem;
    color: var(--color-text-light);
    display: inline-block;
    margin-bottom: 24px;
    transition: color 0.15s ease;
}

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

.project-detail h1 {
    font-size: 1.5rem;
    font-weight: 500;
    margin-bottom: 8px;
}

.project-tagline {
    font-size: 1rem;
    color: var(--color-text-light);
    margin-bottom: 4px;
}

.project-date {
    font-size: 0.8125rem;
    color: var(--color-text-light);
}

.project-website {
    margin-top: 8px;
    margin-bottom: 4px;
}

.project-website a {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-accent);
    transition: color 0.15s ease;
}

.project-website a:hover {
    text-decoration: underline;
}

.project-award-line {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-light);
    margin: 0;
    line-height: 1.4;
}

.project-body p {
    margin-bottom: 16px;
    line-height: 1.7;
}

.project-body h2 {
    font-size: 0.875rem;
    font-weight: 500;
    margin-top: 32px;
    margin-bottom: 12px;
}

.project-image {
    width: 100%;
    max-width: 500px;
    margin-top: 24px;
    background: #e0e0e0;
}

.project-video {
    margin: 24px 0;
}

.project-video iframe,
.project-video video {
    width: 100%;
    max-width: 500px;
    aspect-ratio: 16 / 9;
    border: none;
}

/* === VIDEO CAROUSEL === */
.video-carousel {
    margin: 24px 0;
    max-width: 500px;
}

.carousel-slide {
    display: none;
}

.carousel-slide.active {
    display: block;
}

.carousel-slide iframe {
    width: 100%;
    aspect-ratio: 16 / 9;
    border: none;
}

.carousel-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 10px;
}

.carousel-btn {
    background: none;
    border: 1px solid #ddd;
    font-family: inherit;
    font-size: 0.875rem;
    color: var(--color-text-light);
    padding: 4px 12px;
    cursor: pointer;
    transition: all 0.15s ease;
}

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

.carousel-counter {
    font-size: 0.8125rem;
    color: var(--color-text-light);
}

.project-features {
    list-style: none;
    padding: 0;
}

.project-features li {
    font-size: 0.9375rem;
    color: var(--color-text-light);
    margin-bottom: 8px;
    padding-left: 16px;
    position: relative;
}

.project-features li::before {
    content: "–";
    position: absolute;
    left: 0;
    color: var(--color-text-light);
}

.project-links {
    list-style: none;
    padding: 0;
}

.project-links li {
    margin-bottom: 8px;
}

.project-links a {
    font-size: 0.9375rem;
    color: var(--color-accent);
}

.project-links a:hover {
    text-decoration: underline;
}

.project-highlights {
    background: #f0f0f0;
    padding: 20px 24px;
    margin-bottom: 28px;
    font-size: 0.9375rem;
    line-height: 1.7;
    color: var(--color-text);
}

.project-highlights h3 {
    font-weight: 500;
    font-size: 0.9375rem;
    margin-bottom: 10px;
}

.project-highlights ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.project-highlights li {
    padding-left: 16px;
    position: relative;
    margin-bottom: 4px;
}

.project-highlights li::before {
    content: "—";
    position: absolute;
    left: 0;
    color: var(--color-text-light);
}

.project-note {
    background: #f0f0f0;
    padding: 20px 24px;
    margin-bottom: 28px;
    font-size: 0.9375rem;
    line-height: 1.7;
    color: var(--color-text);
}

.project-note p {
    margin: 0;
}

.project-note strong {
    font-weight: 500;
}

/* === EXPANDABLE ITEMS === */
.expandable-list {
    list-style: none;
}

.expandable-item {
    margin-bottom: 8px;
}

.expandable-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    background: none;
    border: none;
    padding: 12px 0;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    border-bottom: 1px solid #eee;
    transition: border-color 0.15s ease;
}

.expandable-header:hover {
    border-color: var(--color-accent);
}

.expandable-header:hover .item-title {
    color: var(--color-accent);
}

.expand-icon {
    font-size: 1.25rem;
    color: var(--color-text-light);
    line-height: 1;
    flex-shrink: 0;
    margin-left: 16px;
    transition: color 0.15s ease;
}

.expandable-header:hover .expand-icon {
    color: var(--color-accent);
}

.expandable-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    padding: 0;
}

.expandable-item.open .expandable-content {
    max-height: 600px;
    padding: 20px 0 32px 0;
}

.item-description {
    font-size: 0.9375rem;
    color: var(--color-text-light);
    max-width: 50ch;
    margin-bottom: 20px;
    line-height: 1.6;
}

.item-media {
    max-width: 100%;
    max-height: 300px;
    object-fit: cover;
    background: #e0e0e0;
}

.item-video {
    width: 100%;
    max-width: 500px;
    aspect-ratio: 16 / 9;
    border: none;
}

/* === RESPONSIVE === */
@media (max-width: 700px) {
    .container {
        flex-direction: column;
        padding: 32px 24px;
        gap: 40px;
    }

    /* Hamburger button */
    .hamburger {
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 5px;
        background: none;
        border: none;
        cursor: pointer;
        padding: 8px;
        z-index: 1001;
        position: fixed;
        top: 24px;
        left: 24px;
    }

    .content {
        padding-top: 48px;
    }

    .mobile-top-fade {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 80px;
        background: linear-gradient(to bottom, var(--color-bg) 65%, transparent);
        z-index: 1000;
        pointer-events: none;
    }

    .hamburger span {
        display: block;
        width: 24px;
        height: 2px;
        background: var(--color-text);
        transition: all 0.3s ease;
    }

    .nav.nav-open .hamburger span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .nav.nav-open .hamburger span:nth-child(2) {
        opacity: 0;
    }

    .nav.nav-open .hamburger span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }

    /* Nav overlay */
    .nav {
        position: static;
        width: auto;
    }

    .nav > ul {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--color-bg);
        z-index: 1000;
        flex-direction: column;
        padding: 72px 32px 32px;
        overflow-y: auto;
        gap: 0;
    }

    .nav.nav-open > ul {
        display: flex;
    }

    .nav li {
        margin-bottom: 4px;
    }

    .nav > ul > li > a {
        font-size: 1.125rem;
        padding: 8px 0;
        display: inline-block;
    }

    /* Dropdowns in mobile menu */
    .has-dropdown.dropdown-open .dropdown {
        display: block;
        padding: 4px 0 8px 16px;
    }

    .dropdown a {
        padding: 4px 0;
    }

    .project-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .project-mosaic {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Project category headers */
.project-category {
    font-size: 1.1rem;
    font-weight: 400;
    color: #666;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #eee;
}

.project-category:first-of-type {
    margin-top: 1.5rem;
}

/* Dropdown category labels */
.dropdown-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.5rem 0 0.2rem 0;
    margin-top: 0.3rem;
    pointer-events: none;
}

.dropdown-label:first-child {
    margin-top: 0;
}

/* === NEWS PAGE === */
.news-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 32px;
}

.news-tag-btn {
    background: none;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-family: inherit;
    font-size: 0.75rem;
    color: var(--color-text-light);
    padding: 4px 10px;
    cursor: pointer;
    transition: all 0.15s ease;
}

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

.news-tag-btn.active {
    background: var(--color-text);
    border-color: var(--color-text);
    color: #fff;
}

.news-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
}

.news-tag {
    font-size: 0.6875rem;
    color: var(--color-text-light);
    background: #f0f0f0;
    padding: 2px 8px;
    border-radius: 2px;
}

/* === HELLO PAGE === */
.hello-videos {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 48px;
}

.hello-videos video {
    width: 100%;
    border-radius: 4px;
    display: block;
}

.hello-intro {
    margin-bottom: 40px;
}

.hello-intro h1 {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 12px;
}

.hello-intro p {
    font-size: 0.9375rem;
    color: var(--color-text-light);
    max-width: 55ch;
    line-height: 1.6;
}

.hello-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    margin-bottom: 48px;
}

.stat-card {
    flex: 1;
    min-width: 0;
}

.stat-number {
    font-size: 1.75rem;
    font-weight: 500;
    line-height: 1.2;
    color: var(--color-accent);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--color-text-light);
    margin-top: 2px;
}

.hello-section {
    margin-bottom: 48px;
}

.hello-section h2 {
    font-size: 0.8125rem;
    font-weight: 500;
    text-transform: lowercase;
    margin-bottom: 20px;
    color: var(--color-text);
}

.hello-featured {
    list-style: none;
    padding: 0;
}

.hello-featured li {
    margin-bottom: 20px;
}

.hello-featured a {
    display: block;
    text-decoration: none;
}

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

.hello-featured-title {
    font-size: 0.9375rem;
    font-weight: 500;
    transition: color 0.15s ease;
}

.hello-featured-desc {
    font-size: 0.8125rem;
    color: var(--color-text-light);
    margin-top: 2px;
    max-width: 55ch;
    line-height: 1.5;
}

.hello-news {
    list-style: none;
    padding: 0;
}

.hello-news li {
    margin-bottom: 16px;
}

.hello-news a {
    display: block;
    text-decoration: none;
}

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

.hello-news-title {
    font-size: 0.9375rem;
    font-weight: 500;
    transition: color 0.15s ease;
}

.hello-news-meta {
    font-size: 0.75rem;
    color: var(--color-text-light);
    margin-top: 2px;
}

.hello-more {
    font-size: 0.8125rem;
    color: var(--color-text-light);
    transition: color 0.15s ease;
}

.hello-more:hover {
    color: var(--color-accent);
}

.hello-publication {
    margin-bottom: 12px;
}

.hello-pub-title {
    font-size: 0.9375rem;
    font-weight: 500;
    max-width: 55ch;
}

.hello-pub-authors {
    font-size: 0.8125rem;
    color: var(--color-text-light);
    margin-top: 4px;
}

.hello-pub-venue {
    font-size: 0.8125rem;
    color: var(--color-text-light);
    font-style: italic;
    margin-top: 2px;
}

.hello-exhibits-note {
    font-size: 0.8125rem;
    color: var(--color-text-light);
    line-height: 1.5;
    max-width: 55ch;
    margin-top: 16px;
    margin-bottom: 12px;
}

.work-subsection {
    margin-top: 64px;
    padding-top: 32px;
    border-top: 1px solid #eee;
}

.hello-collabs {
    list-style: none;
    padding: 0;
}

.hello-collabs li {
    margin-bottom: 14px;
}

.hello-collab-name {
    font-size: 0.9375rem;
    font-weight: 500;
}

.hello-collab-name a {
    transition: color 0.15s ease;
}

.hello-collab-name a:hover {
    color: var(--color-accent);
}

.hello-collab-detail {
    font-size: 0.8125rem;
    color: var(--color-text-light);
    margin-top: 2px;
}

/* === MOBILE HELLO OVERRIDES (must come after base hello styles) === */
@media (max-width: 700px) {
    .hello-stats {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 20px 16px;
    }

    .stat-number {
        font-size: 1.25rem;
    }

    .stat-label {
        font-size: 0.6875rem;
    }
}
