/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #fafafa;
    --text: #2c2416;
    --interactive: #155e75;
    --programming: #166534;
    --sound: #581c87;
    --community: #9a3412;
    --context: #78716c;
    --popup-bg: #fff;
    --shadow: rgba(0, 0, 0, 0.15);
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.5;
}

/* Background video */
.background-video {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    z-index: 0;
    opacity: 0.04;
    pointer-events: none;
    object-fit: cover;
}

/* Header */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    z-index: 100;
    background: linear-gradient(to bottom, var(--bg) 0%, var(--bg) 70%, transparent 100%);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-video {
    width: 36px;
    height: 36px;
    object-fit: cover;
    filter: grayscale(100%) contrast(1.2);
    opacity: 0.8;
    border: 1px solid #999;
}

.site-title {
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', monospace;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0;
}

.site-subtitle {
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', monospace;
    font-size: 11px;
    color: #666;
}

.header-nav {
    display: flex;
    gap: 20px;
    align-items: center;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', monospace;
    font-size: 12px;
}

.cv-link {
    color: var(--text);
    text-decoration: none;
    transition: color 0.2s;
}

.cv-link:hover {
    color: teal;
}

.contact-dropdown {
    position: relative;
}

.contact-link {
    color: var(--text);
    text-decoration: none;
    transition: color 0.2s;
    cursor: pointer;
}

.contact-link:hover {
    color: teal;
}

.contact-list {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 14px;
    display: none;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    padding: 10px 14px;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.2s, transform 0.2s;
    background: var(--bg);
    border: 1px solid #ccc;
}

.contact-list.open {
    display: flex;
    opacity: 1;
    transform: translateY(0);
}

.contact-list a {
    color: #555;
    text-decoration: none;
    font-size: 11px;
    white-space: nowrap;
    transition: color 0.2s;
}

.contact-list a:hover {
    color: teal;
}

/* Scattered container - full viewport */
.scattered-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

/* Project words - main clickable items */
.project-word {
    position: absolute;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', monospace;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s;
    white-space: nowrap;
    z-index: 10;
}

.project-word:not(.umbrella-project):hover,
.project-word:not(.umbrella-project).popup-active {
    color: #000 !important;
}

/* Category colors */
.project-word[data-category="interactive"] {
    color: var(--interactive);
}

.project-word[data-category="programming"] {
    color: var(--programming);
}

.project-word[data-category="sound"] {
    color: var(--sound);
}

.project-word[data-category="community"] {
    color: var(--community);
}

/* Category filter states */
.project-word.category-dimmed {
    opacity: 0.15;
    transition: opacity 0.3s;
    pointer-events: none;
}

.project-word.category-highlighted {
    opacity: 1;
    transition: opacity 0.3s;
}

.sub-project.category-dimmed {
    opacity: 0.15;
    transition: opacity 0.3s;
    pointer-events: none;
}

.sub-project.category-highlighted {
    opacity: 1;
    transition: opacity 0.3s;
}

/* Context words - smaller decorative words */
.context-word {
    position: absolute;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', monospace;
    color: var(--context);
    font-size: 9px;
    font-weight: 400;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0.5;
}

/* Hover popup modal */
.project-popup {
    position: fixed;
    display: none;
    z-index: 200;
    pointer-events: none;
}

.project-popup.active {
    display: block;
    pointer-events: auto;
}

.popup-close {
    display: none;
}

.popup-content {
    background: var(--popup-bg);
    border: 1px solid #ccc;
    overflow: hidden;
    width: 380px;
    max-width: 90vw;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', monospace;
}

.popup-media {
    width: 100%;
    height: 180px;
    background: #e0e0e0;
    overflow: hidden;
}

.popup-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.popup-media video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    background: #000;
}

.popup-media img[src=""],
.popup-media img:not([src]) {
    display: none;
}

/* Placeholder when no image */
.popup-media:has(img[src=""]),
.popup-media:has(img:not([src])) {
    background: linear-gradient(135deg, #ddd 0%, #eee 100%);
}

.popup-info {
    padding: 16px;
    border-top: 1px solid #ddd;
}

.popup-title {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.popup-title::before {
    content: "// ";
    color: #999;
}

.popup-description {
    font-size: 11px;
    line-height: 1.6;
    color: #555;
    margin-bottom: 12px;
}

.popup-meta {
    display: flex;
    gap: 16px;
    margin-bottom: 12px;
    font-size: 10px;
    color: #666;
    border-top: 1px solid #eee;
    padding-top: 10px;
}

.popup-tech {
    flex: 1;
}

.popup-tech::before {
    content: "tech: ";
    color: #999;
}

.popup-year {
    white-space: nowrap;
}

.popup-year::before {
    content: "year: ";
    color: #999;
}

.popup-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
}

.popup-link {
    display: inline-block;
    color: teal;
    text-decoration: none;
    font-size: 11px;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', monospace;
    pointer-events: auto;
    transition: color 0.2s;
}

.popup-link::before {
    content: '[';
    color: #999;
}

.popup-link::after {
    content: ']';
    color: #999;
}

.popup-link:hover {
    color: firebrick;
}

.popup-link:hover::before,
.popup-link:hover::after {
    color: firebrick;
}

/* Audio Player - bracket/monospace aesthetic */
.audio-player {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #ccc;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', monospace;
    font-size: 11px;
}

.audio-track-list {
    max-height: 120px;
    overflow-y: auto;
    margin-bottom: 10px;
}

.audio-track {
    padding: 2px 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    color: #333;
    line-height: 1.4;
}

.audio-track:hover {
    color: firebrick;
}

.audio-track.active {
    color: #000;
}

.audio-track::before {
    content: "[ ]";
    color: #999;
}

.audio-track:hover::before {
    color: firebrick;
}

.audio-track.active::before {
    content: "[●]";
    color: teal;
}

.audio-track-number {
    display: none;
}

.audio-track-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.audio-controls {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.audio-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 11px;
    padding: 0;
    color: #666;
    font-family: inherit;
}

.audio-btn:hover {
    color: firebrick;
}

.audio-btn:active {
    color: #000;
}

.audio-play-btn {
    font-size: 11px;
    color: teal;
}

.audio-play-btn:hover {
    color: firebrick;
}

.audio-progress-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.audio-time {
    font-size: 10px;
    color: #666;
    min-width: 36px;
    font-family: inherit;
}

.audio-progress {
    flex: 1;
    height: 4px;
    background: #ddd;
    cursor: pointer;
    position: relative;
}

.audio-progress-bar {
    height: 100%;
    background: teal;
    width: 0%;
}

.audio-progress:hover .audio-progress-bar {
    background: firebrick;
}

.audio-volume-container {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
}

.audio-volume-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 11px;
    padding: 0;
    color: #666;
    font-family: inherit;
}

.audio-volume-btn:hover {
    color: firebrick;
}

.audio-volume-btn.muted {
    color: #999;
}

.audio-volume {
    flex: 1;
    height: 4px;
    background: #ddd;
    cursor: pointer;
    position: relative;
    max-width: 80px;
}

.audio-volume-bar {
    height: 100%;
    background: teal;
    width: 100%;
}

.audio-volume:hover .audio-volume-bar {
    background: firebrick;
}

/* Global Mini Audio Player - bracket/monospace aesthetic */
.mini-audio-player {
    position: fixed;
    bottom: 80px;
    right: 20px;
    background: #fafafa;
    padding: 8px 12px;
    z-index: 1000;
    display: none;
    flex-direction: column;
    gap: 6px;
    min-width: 200px;
    max-width: 280px;
    border: 1px solid #ccc;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', monospace;
    font-size: 10px;
}

.mini-audio-player.visible {
    display: flex;
}

.mini-audio-info {
    display: flex;
    align-items: center;
    padding-right: 20px;
}

.mini-audio-track {
    font-size: 10px;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.mini-audio-track::before {
    content: "[●] ";
    color: teal;
}

.mini-audio-controls {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 8px;
}

.mini-audio-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 10px;
    padding: 0;
    color: #666;
    font-family: inherit;
}

.mini-audio-btn:hover {
    color: firebrick;
}

.mini-audio-btn:active {
    color: #000;
}

.mini-audio-play-btn {
    color: teal;
}

.mini-audio-play-btn:hover {
    color: firebrick;
}

.mini-audio-progress {
    width: 100%;
    height: 3px;
    background: #ddd;
    cursor: pointer;
    position: relative;
}

.mini-audio-progress-bar {
    height: 100%;
    background: teal;
    width: 0%;
}

.mini-audio-close {
    position: absolute;
    top: 4px;
    right: 4px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 10px;
    color: #999;
    padding: 0;
    line-height: 1;
    font-family: inherit;
}

.mini-audio-volume-container {
    display: flex;
    align-items: center;
    gap: 4px;
}

.mini-audio-volume-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 10px;
    padding: 0;
    color: #666;
    font-family: inherit;
}

.mini-audio-volume-btn:hover {
    color: firebrick;
}

.mini-audio-volume-btn.muted {
    color: #999;
}

.mini-audio-volume {
    width: 50px;
    height: 3px;
    background: #ddd;
    cursor: pointer;
    position: relative;
}

.mini-audio-volume-bar {
    height: 100%;
    background: teal;
    width: 100%;
}

.mini-audio-volume:hover .mini-audio-volume-bar {
    background: firebrick;
}

.mini-audio-close:hover {
    color: firebrick;
}

/* Footer */
.site-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px 30px;
    z-index: 100;
    background: linear-gradient(to top, var(--bg) 0%, var(--bg) 70%, transparent 100%);
}

.footer-links {
    display: flex;
    gap: 24px;
    justify-content: center;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', monospace;
    font-size: 11px;
}

.footer-links a {
    color: #666;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: teal;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .site-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 12px 15px;
    }

    .header-left {
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .header-video {
        display: none;
    }

    .site-title {
        font-size: 13px;
    }

    .site-subtitle {
        display: none;
    }

    .header-nav {
        display: flex;
        gap: 10px;
        font-size: 10px;
    }

    .project-word {
        font-size: 14px;
    }

    .popup-content {
        width: 300px;
    }

    .popup-media {
        height: 140px;
    }

    .popup-info {
        padding: 15px;
    }

    .context-word {
        display: none;
    }
}

@media (max-width: 600px) {
    html, body {
        overflow: auto !important;
        height: auto !important;
    }

    .site-header {
        margin: 10px !important;
        padding: 6px 12px !important;
        border: 1px solid #ccc !important;
        background: var(--bg) !important;
        width: calc(100% - 20px) !important;
        box-sizing: border-box !important;
    }

    .header-video {
        display: none !important;
    }

    .contact-list {
        right: -12px !important;
    }

    .scattered-container {
        position: relative !important;
        height: auto !important;
        min-height: auto !important;
        overflow-y: visible !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 10px !important;
        padding: 70px 20px 160px !important;
        padding-bottom: 160px !important;
        align-items: center !important;
    }

    .project-word,
    .project-word.umbrella-project,
    .scattered-container > .project-word {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;
        transform: none !important;
        font-size: 15px !important;
        text-align: left !important;
        display: block !important;
        width: auto !important;
        margin: 0 !important;
        padding-left: 0 !important;
    }

    /* Hide sub-projects container and umbrella indicator on mobile */
    .sub-projects {
        display: none !important;
    }

    .umbrella-indicator {
        display: none !important;
    }

    /* Show [+] indicator on mobile for umbrella projects */
    .umbrella-project::after {
        content: '[+]' !important;
        display: inline-block !important;
        margin-left: 6px;
        font-size: 11px;
        font-weight: 400;
        color: #999;
    }

    .umbrella-project.mobile-expanded::after {
        content: '[−]' !important;
        color: teal;
    }

    .project-popup {
        position: fixed;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%);
    }

    .popup-content {
        width: calc(100vw - 40px);
        max-height: 70vh;
        overflow-y: auto;
    }

    /* Footer area adjustments - fixed at bottom */
    .category-legend {
        position: fixed !important;
        bottom: 35px !important;
        left: 10px !important;
        right: 10px !important;
        padding: 6px 8px !important;
        justify-content: space-around !important;
        flex-wrap: nowrap !important;
        gap: 2px !important;
        background: var(--bg) !important;
        border: 1px solid #ccc !important;
        font-size: 9px !important;
        z-index: 100 !important;
    }

    .legend-item {
        padding: 2px 3px !important;
        gap: 2px !important;
        font-size: 9px !important;
    }

    /* Shorter category names on mobile */
    .legend-item span:last-child {
        font-size: 8px;
    }

    .site-footer {
        padding: 8px 15px !important;
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        background: var(--bg) !important;
        z-index: 99 !important;
    }

    .footer-links {
        gap: 8px !important;
        flex-wrap: wrap !important;
        font-size: 10px !important;
        justify-content: center !important;
    }

    /* Audio player above legend - same width as category box */
    .mini-audio-player {
        bottom: 75px !important;
        left: 10px !important;
        right: 10px !important;
        width: auto !important;
        max-width: none !important;
        min-width: auto !important;
        z-index: 100 !important;
    }

    /* Hide the floating popup on mobile - we use inline accordion instead */
    .project-popup {
        display: none !important;
    }

    /* Mobile accordion - inline project details */
    .mobile-accordion {
        display: block;
        width: 100%;
        background: var(--popup-bg);
        border: 1px solid #ccc;
        margin-top: 8px;
        margin-bottom: 8px;
        font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', monospace;
        overflow: hidden;
    }

    .mobile-accordion .accordion-media {
        width: 100%;
        height: 160px;
        background: #e0e0e0;
        overflow: hidden;
    }

    .mobile-accordion .accordion-media img,
    .mobile-accordion .accordion-media video {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }

    .mobile-accordion .accordion-info {
        padding: 12px;
        border-top: 1px solid #ddd;
    }

    .mobile-accordion .accordion-title {
        font-size: 11px;
        font-weight: 600;
        margin-bottom: 6px;
        color: var(--text);
        text-transform: uppercase;
        letter-spacing: 0.05em;
    }

    .mobile-accordion .accordion-title::before {
        content: "// ";
        color: #999;
    }

    .mobile-accordion .accordion-description {
        font-size: 10px;
        line-height: 1.5;
        color: #555;
        margin-bottom: 10px;
    }

    .mobile-accordion .accordion-meta {
        display: flex;
        gap: 12px;
        font-size: 9px;
        color: #666;
        border-top: 1px solid #eee;
        padding-top: 8px;
    }

    .mobile-accordion .accordion-tech {
        flex: 1;
    }

    .mobile-accordion .accordion-tech::before {
        content: "tech: ";
        color: #999;
    }

    .mobile-accordion .accordion-year::before {
        content: "year: ";
        color: #999;
    }

    .mobile-accordion .accordion-links {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        margin-top: 8px;
    }

    .mobile-accordion .accordion-link {
        color: teal;
        text-decoration: none;
        font-size: 10px;
    }

    .mobile-accordion .accordion-link::before {
        content: '[';
        color: #999;
    }

    .mobile-accordion .accordion-link::after {
        content: ']';
        color: #999;
    }

    /* Project word expanded state */
    .project-word.mobile-expanded {
        color: #000 !important;
    }

    /* Sub-projects list inside accordion */
    .accordion-sub-list {
        padding: 8px 12px;
        border-top: 1px solid #ddd;
        background: #f5f5f5;
    }

    .mobile-sub-item {
        padding: 8px 0;
        cursor: pointer;
        font-size: 12px;
        font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', monospace;
        border-bottom: 1px solid #e0e0e0;
    }

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

    .mobile-sub-item::before {
        content: '→ ';
        color: #999;
    }

    .mobile-sub-item[data-category="interactive"] {
        color: var(--interactive);
    }

    .mobile-sub-item[data-category="programming"] {
        color: var(--programming);
    }

    .mobile-sub-item[data-category="sound"] {
        color: var(--sound);
    }

    .mobile-sub-item[data-category="community"] {
        color: var(--community);
    }

    .mobile-sub-item.active {
        color: #000 !important;
    }

    .mobile-sub-item.active::before {
        content: '● ';
        color: teal;
    }

    /* Sub-project accordion (nested inside main accordion) */
    .mobile-sub-accordion {
        margin: 0;
        border: none;
        border-top: 1px solid #ccc;
    }
}

/* Popup appears immediately - no animation for functional aesthetic */
.project-popup.active .popup-content {
    /* No animation - instant appearance */
}

/* Legend for categories */
.category-legend {
    position: fixed;
    bottom: 60px;
    left: 30px;
    display: flex;
    gap: 16px;
    font-size: 11px;
    z-index: 50;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', monospace;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    padding: 4px 6px;
    transition: color 0.2s, opacity 0.2s;
}

.legend-item:hover {
    color: teal;
}

.legend-item.active {
    color: teal;
}

.legend-item.dimmed {
    opacity: 0.4;
}

.legend-bracket {
    color: #999;
}

.legend-item:hover .legend-bracket,
.legend-item.active .legend-bracket {
    color: teal;
}

.legend-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.legend-dot.interactive {
    background: var(--interactive);
}

.legend-dot.programming {
    background: var(--programming);
}

.legend-dot.sound {
    background: var(--sound);
}

.legend-dot.community {
    background: var(--community);
}

/* =====================================================
   UMBRELLA PROJECTS - Expandable with sub-projects
   ===================================================== */

/* Umbrella project styling */
.umbrella-project {
    position: relative;
    display: inline-block;
    text-align: center;
}

/* Indicator that it's expandable (+ sign) */
.umbrella-project::after {
    content: '[+]';
    display: inline-block;
    margin-left: 6px;
    font-size: 11px;
    font-weight: 400;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', monospace;
    color: #999;
    transition: color 0.3s ease;
}

.umbrella-project.expanded::after {
    content: '[−]';
    color: teal;
}

.umbrella-project:hover::after {
    color: teal;
}

.umbrella-project.direct-hover,
.umbrella-project.popup-active,
.umbrella-project.expanded {
    color: #000 !important;
}

/* Sub-projects container - centered on parent text */
.sub-projects {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 5;
}

/* Individual sub-project */
.sub-project {
    position: absolute;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', monospace;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    opacity: 0;
    --x: 0px;
    --y: 0px;
    transform: translate(calc(var(--x) - 50%), calc(var(--y) - 50%)) scale(0);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
    z-index: 15;
}

/* When umbrella is expanded, show sub-projects */
.umbrella-project.expanded .sub-projects {
    pointer-events: auto;
}

.umbrella-project.expanded .sub-project {
    opacity: 1;
    transform: translate(calc(var(--x) - 50%), calc(var(--y) - 50%)) scale(1);
    pointer-events: auto;
}

/* Sub-project hover effect */
.sub-project:hover,
.sub-project.popup-active {
    color: #000 !important;
}

/* Category colors for sub-projects */
.sub-project[data-category="interactive"] {
    color: var(--interactive);
}

.sub-project[data-category="programming"] {
    color: var(--programming);
}

.sub-project[data-category="sound"] {
    color: var(--sound);
}

.sub-project[data-category="community"] {
    color: var(--community);
}

/* Staggered animation for sub-projects */
.umbrella-project.expanded .sub-project:nth-child(1) { transition-delay: 0.05s; }
.umbrella-project.expanded .sub-project:nth-child(2) { transition-delay: 0.1s; }
.umbrella-project.expanded .sub-project:nth-child(3) { transition-delay: 0.15s; }
.umbrella-project.expanded .sub-project:nth-child(4) { transition-delay: 0.2s; }
.umbrella-project.expanded .sub-project:nth-child(5) { transition-delay: 0.25s; }
.umbrella-project.expanded .sub-project:nth-child(6) { transition-delay: 0.3s; }

/* Collapse animation - no delay */
.umbrella-project:not(.expanded) .sub-project {
    transition-delay: 0s;
}

/* Dim other projects when one umbrella is expanded */
.scattered-container.has-expanded .project-word:not(.expanded):not(.sub-project) {
    opacity: 0.3;
    transition: opacity 0.3s ease;
}

.scattered-container.has-expanded .context-word {
    opacity: 0.2;
}

word {
    opacity: 0.2;
}

/* Gallery Styles */
.popup-media {
    position: relative;
}

.gallery-nav-area {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 25%;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.gallery-nav-area:hover {
    opacity: 1;
}

.gallery-nav-prev {
    left: 0;
    background: linear-gradient(to right, rgba(0,0,0,0.5) 0%, transparent 100%);
}

.gallery-nav-next {
    right: 0;
    background: linear-gradient(to left, rgba(0,0,0,0.5) 0%, transparent 100%);
}

.gallery-arrow {
    color: white;
    font-size: 12px;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', monospace;
    user-select: none;
}

/* Popup Dots */
.popup-dots {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 4px;
    z-index: 20;
    pointer-events: auto;
    background: rgba(0, 0, 0, 0.6);
    padding: 4px 8px;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', monospace;
    font-size: 10px;
}

.popup-dot {
    display: block;
    width: auto;
    height: auto;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    margin: 0;
    transition: color 0.2s ease;
    appearance: none;
    -webkit-appearance: none;
    color: rgba(255, 255, 255, 0.4);
    font-size: 8px;
    line-height: 1;
}

.popup-dot::before {
    content: "○";
}

.popup-dot:hover {
    color: rgba(255, 255, 255, 0.8);
}

.popup-dot.active {
    color: #fff;
}

.popup-dot.active::before {
    content: "●";
}
