/* ===================================
   DESIGN SYSTEM
   =================================== */

:root {
    /* Colors */
    --color-bg: #000000;
    --color-surface: #0A0A0A;
    --color-text-primary: #FFFFFF;
    --color-text-secondary: #A0A0A0;
    
    /* Accent Colors (evolve with scroll) */
    --color-accent-structure: #00A8FF;
    --color-accent-friction: #FF6B35;
    --color-accent-flow-cyan: #00FFC8;
    --color-accent-flow-magenta: #FF0080;
    
    /* Spacing */
    --space-xs: 8px;
    --space-sm: 16px;
    --space-md: 32px;
    --space-lg: 64px;
    --space-xl: 128px;
    
    /* Typography */
    --font-display: 'Inter', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    
    /* Layout */
    --container-max: 1200px;
    --container-padding: var(--space-md);
}

/* ===================================
   BASE STYLES
   =================================== */

body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    color: var(--color-text-primary);
    background-color: var(--color-bg);
    overflow-x: hidden;
    transition: background-color 0.8s ease;
}

/* ===================================
   CANVAS CONTAINER
   =================================== */

#canvas-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

#canvas-container canvas {
    display: block;
}

/* ===================================
   LAYOUT
   =================================== */

main {
    position: relative;
    z-index: 1;
}

.section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: var(--space-xl) 0;
    position: relative;
}

.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

/* ===================================
   NAVIGATION DOTS
   =================================== */

.nav-dots {
    position: fixed;
    right: var(--space-md);
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.nav-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--color-text-secondary);
    opacity: 0.3;
    transition: all 0.3s ease;
    position: relative;
}

.nav-dot::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 24px;
    height: 24px;
    border-radius: 50%;
}

.nav-dot:hover {
    opacity: 0.7;
    transform: scale(1.2);
}

.nav-dot.active {
    background-color: var(--color-accent-structure);
    opacity: 1;
    box-shadow: 0 0 20px var(--color-accent-structure);
}

/* ===================================
   TOP BAR
   Deliberately quiet: no background at all over the hero, so the opening
   frame is untouched. It fades one in once you scroll past the fold.
   =================================== */

.home-topbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 90;
    padding: var(--space-sm) var(--container-padding);
    background-color: transparent;
    border-bottom: 1px solid transparent;
    transition: background-color 0.4s ease, border-color 0.4s ease;
}

.home-topbar.is-stuck {
    background-color: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

.home-topbar-inner {
    max-width: var(--container-max);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
}

.home-brand,
.home-menu a {
    font-family: var(--font-mono);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--color-text-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.home-brand {
    letter-spacing: 0.18em;
}

.home-brand:hover,
.home-menu a:hover {
    color: var(--color-text-primary);
}

.home-menu {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

/* The exhibition link is the one thing here worth noticing, so it sits at full
   brightness with a live dot. That says "running now" without a word of label. */
.home-menu .home-menu-live {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--color-text-primary);
}

.home-menu .home-menu-live:hover {
    color: var(--color-accent-flow-cyan);
}

/* The dates sit a step back from the name so the pair reads as one label
   rather than two competing links. */
.live-when {
    color: var(--color-text-secondary);
}

.live-when::before {
    content: '\00b7';
    margin: 0 8px;
    opacity: 0.6;
}

/* "Exhibition" is the fallback the narrow layouts swap in for the name. */
.live-short {
    display: none;
}

@media (max-width: 1080px) {
    .live-when {
        display: none;
    }
}

@media (max-width: 780px) {
    .live-name {
        display: none;
    }

    .live-short {
        display: inline;
    }
}

.live-dot {
    width: 7px;
    height: 7px;
    flex-shrink: 0;
    border-radius: 50%;
    background-color: var(--color-accent-flow-cyan);
    box-shadow: 0 0 8px var(--color-accent-flow-cyan);
    animation: livePulse 2.4s ease-in-out infinite;
}

@keyframes livePulse {
    0%, 100% { opacity: 1;    transform: scale(1); }
    50%      { opacity: 0.45; transform: scale(0.8); }
}

/* The name is already the largest thing on the hero, so on a narrow screen it
   is the part to drop rather than crowding the links. */
@media (max-width: 620px) {
    .home-topbar {
        padding: 10px var(--space-sm);
    }

    .home-brand {
        display: none;
    }

    .home-menu {
        width: 100%;
        justify-content: space-between;
        gap: var(--space-sm);
    }

    .home-menu a {
        font-size: 11px;
        letter-spacing: 0.08em;
    }
}

@media (prefers-reduced-motion: reduce) {
    .live-dot {
        animation: none;
    }

    .home-topbar {
        transition: none;
    }
}

/* ===================================
   TYPOGRAPHY
   =================================== */

.section-title {
    font-family: var(--font-display);
    font-size: clamp(36px, 5vw, 56px);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--space-lg);
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, var(--color-text-primary) 0%, var(--color-accent-flow-cyan) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-title-center {
    font-family: var(--font-display);
    font-size: clamp(36px, 5vw, 56px);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--space-lg);
    letter-spacing: -0.02em;
    text-align: center;
    background: linear-gradient(135deg, var(--color-text-primary) 0%, var(--color-accent-structure) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===================================
   HERO SECTION
   =================================== */

.hero-section {
    justify-content: center;
    padding-top: var(--space-md);
}

.hero-section .container {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(48px, 8vw, 96px);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.03em;
    margin-bottom: var(--space-sm);
    background: linear-gradient(135deg, var(--color-text-primary) 0%, var(--color-accent-structure) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    transition: transform 0.3s ease;
}

/* 3D depth layers using pseudo-element */
.hero-title-stack {
    position: relative;
    display: inline-block;
}

.hero-title-stack::before {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    font-family: var(--font-display);
    font-size: clamp(48px, 8vw, 96px);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.03em;
    color: transparent;
    text-shadow:
        1px 1px 0 rgba(0, 168, 255, 0.4),
        2px 2px 0 rgba(0, 168, 255, 0.35),
        3px 3px 0 rgba(0, 168, 255, 0.3),
        4px 4px 0 rgba(0, 168, 255, 0.25),
        5px 5px 0 rgba(0, 168, 255, 0.2),
        6px 6px 0 rgba(0, 168, 255, 0.15),
        8px 8px 15px rgba(0, 0, 0, 0.4);
    z-index: -1;
    pointer-events: none;
    transition: text-shadow 0.4s ease;
}

.hero-title-stack:hover::before {
    text-shadow:
        2px 2px 0 rgba(0, 255, 200, 0.4),
        4px 4px 0 rgba(0, 255, 200, 0.35),
        6px 6px 0 rgba(0, 255, 200, 0.3),
        8px 8px 0 rgba(0, 255, 200, 0.25),
        10px 10px 0 rgba(255, 0, 128, 0.2),
        12px 12px 0 rgba(255, 0, 128, 0.15),
        15px 15px 25px rgba(0, 0, 0, 0.5);
}

#hero-title-3d {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.hero-subtitle {
    font-family: var(--font-mono);
    font-size: clamp(14px, 2vw, 18px);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--color-accent-structure);
    margin-bottom: var(--space-md);
}

.hero-hook {
    font-size: clamp(18px, 2.5vw, 24px);
    color: var(--color-text-secondary);
    max-width: 600px;
    margin-bottom: var(--space-lg);
    line-height: 1.6;
}

/* Colorful animated shape - positioned above title */
#hero-shape-canvas {
    position: relative;
    width: 350px;
    height: 350px;
    margin-bottom: var(--space-sm);
    z-index: 1;
    pointer-events: none;
}

#hero-shape-canvas canvas {
    display: block;
}

/* Make hero content sit above shape */
.hero-title,
.hero-subtitle,
.hero-hook,
.scroll-indicator {
    position: relative;
    z-index: 1;
}

.scroll-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xs);
    color: var(--color-text-secondary);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-top: var(--space-xl);
    animation: bounce 2s infinite;
}

.scroll-indicator svg {
    opacity: 0.5;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(10px);
    }
}

/* ===================================
   STORY SECTION - INTERACTIVE JOURNEY
   =================================== */

.story-section {
    padding: var(--space-xl) 0;
}

.section-title-center {
    font-family: var(--font-display);
    font-size: clamp(36px, 5vw, 56px);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--space-xl);
    letter-spacing: -0.02em;
    text-align: center;
}

.journey-container {
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
    padding: var(--space-lg) 0;
}

/* p5.js Path Canvas */
#journey-path-canvas {
    position: absolute;
    left: 50%;
    top: 0;
    transform: translateX(-50%);
    width: 4px;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

#journey-path-canvas canvas {
    display: block;
}

/* Journey Nodes */
.journey-node {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 80px 1fr;
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
    align-items: center;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.journey-node.active {
    opacity: 1;
    transform: translateY(0);
}

.journey-node:last-child {
    margin-bottom: 0;
}

/* Node Marker (Center Circle) */
.node-marker {
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2;
}

.node-circle {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: var(--color-text-secondary);
    border: 3px solid var(--color-bg);
    transition: all 0.5s ease;
    position: relative;
}

.journey-node.active .node-circle {
    width: 24px;
    height: 24px;
    background-color: var(--color-accent-structure);
    box-shadow: 0 0 20px var(--color-accent-structure);
}

/* Pulse animation for active node */
.journey-node.active .node-circle::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid var(--color-accent-structure);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(2);
        opacity: 0;
    }
}

/* Node Content */
.node-content {
    z-index: 1;
}

.node-text {
    padding: var(--space-md);
    background-color: rgba(10, 10, 10, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    backdrop-filter: blur(10px);
}

.node-title {
    font-size: clamp(20px, 3vw, 28px);
    font-weight: 700;
    background: linear-gradient(135deg, var(--color-text-primary) 0%, var(--color-accent-structure) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: var(--space-sm);
    letter-spacing: -0.01em;
}

.node-text p {
    font-size: clamp(15px, 2vw, 17px);
    line-height: 1.7;
    color: var(--color-text-secondary);
    margin-bottom: var(--space-sm);
}

.node-text p:last-child {
    margin-bottom: 0;
}

.node-text em {
    color: var(--color-accent-friction);
    font-style: italic;
}

/* Color variations for nodes based on state */
.journey-node[data-node="0"].active .node-circle {
    background-color: var(--color-accent-structure);
    box-shadow: 0 0 20px var(--color-accent-structure);
}

.journey-node[data-node="1"].active .node-circle {
    background-color: var(--color-accent-friction);
    box-shadow: 0 0 20px var(--color-accent-friction);
}

.journey-node[data-node="2"].active .node-circle {
    background-color: var(--color-accent-flow-cyan);
    box-shadow: 0 0 20px var(--color-accent-flow-cyan);
}

.journey-node[data-node="3"].active .node-circle {
    background-color: var(--color-accent-structure);
    box-shadow: 0 0 20px var(--color-accent-structure);
}

.journey-node[data-node="0"].active .node-circle::after {
    border-color: var(--color-accent-structure);
}

.journey-node[data-node="1"].active .node-circle::after {
    border-color: var(--color-accent-friction);
}

.journey-node[data-node="2"].active .node-circle::after {
    border-color: var(--color-accent-flow-cyan);
}

.journey-node[data-node="3"].active .node-circle::after {
    border-color: var(--color-accent-structure);
}

/* ===================================
   TV STATIC NODE (The Unknown)
   =================================== */

.journey-node-final {
    margin-bottom: 0;
}

.node-marker-static {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 80px;
    height: 80px;
    z-index: 2;
}

#static-canvas {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    opacity: 0.7;
    transition: all 0.5s ease;
}

.journey-node-final.active #static-canvas {
    opacity: 1;
    box-shadow:
        0 0 20px rgba(255, 255, 255, 0.4),
        0 0 40px rgba(0, 255, 200, 0.2),
        0 0 60px rgba(255, 0, 128, 0.1);
}

/* Pulse animation for static node */
.journey-node-final.active .node-marker-static::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.5);
    animation: pulse 2s infinite;
}

/* ===================================
   WORK SECTION
   =================================== */

.work-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: var(--space-md);
}

.project-card {
    position: relative;
    background: linear-gradient(135deg, rgba(10, 10, 10, 0.95) 0%, rgba(0, 168, 255, 0.05) 100%);
    border: none;
    border-radius: 12px;
    overflow: visible;
    transition: transform 0.3s ease;
    cursor: pointer;
}

/* Animated gradient border */
.project-card::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 14px;
    padding: 2px;
    background: linear-gradient(
        90deg,
        var(--color-accent-flow-cyan),
        var(--color-accent-structure),
        var(--color-accent-flow-magenta),
        var(--color-accent-friction),
        var(--color-accent-flow-cyan)
    );
    background-size: 300% 100%;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: borderGradient 4s linear infinite paused;
    opacity: 0.3;
    transition: opacity 0.4s ease;
    z-index: -1;
}

.project-card:hover::before {
    animation-play-state: running;
    opacity: 1;
}

@keyframes borderGradient {
    0% { background-position: 0% 50%; }
    100% { background-position: 300% 50%; }
}

.project-card:hover {
    transform: translateY(-8px);
    box-shadow:
        0 0 20px rgba(0, 255, 200, 0.3),
        0 0 40px rgba(0, 255, 200, 0.1),
        0 8px 32px rgba(0, 0, 0, 0.4);
    animation: glowPulse 2s ease-in-out infinite;
}

@keyframes glowPulse {
    0%, 100% {
        box-shadow:
            0 0 20px rgba(0, 255, 200, 0.3),
            0 0 40px rgba(0, 255, 200, 0.1),
            0 8px 32px rgba(0, 0, 0, 0.4);
    }
    50% {
        box-shadow:
            0 0 30px rgba(0, 255, 200, 0.5),
            0 0 60px rgba(0, 168, 255, 0.2),
            0 12px 40px rgba(0, 0, 0, 0.5);
    }
}

/* Corner accents */
.project-card .corner-tl {
    position: absolute;
    top: -1px;
    left: -1px;
    width: 30px;
    height: 30px;
    border-top: 2px solid var(--color-accent-flow-cyan);
    border-left: 2px solid var(--color-accent-flow-cyan);
    border-radius: 12px 0 0 0;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.3s ease;
    z-index: 10;
    pointer-events: none;
}

.project-card .corner-br {
    position: absolute;
    bottom: -1px;
    right: -1px;
    width: 30px;
    height: 30px;
    border-bottom: 2px solid var(--color-accent-flow-magenta);
    border-right: 2px solid var(--color-accent-flow-magenta);
    border-radius: 0 0 12px 0;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.3s ease 0.1s;
    z-index: 10;
    pointer-events: none;
}

.project-card:hover .corner-tl,
.project-card:hover .corner-br {
    opacity: 1;
    transform: scale(1);
}

.project-number-badge {
    position: absolute;
    top: var(--space-sm);
    left: var(--space-sm);
    z-index: 10;
    font-family: var(--font-mono);
    font-size: 18px;
    font-weight: 700;
    color: var(--color-bg);
    background: linear-gradient(135deg, var(--color-accent-flow-cyan), var(--color-accent-structure));
    padding: 8px 14px;
    border-radius: 4px;
    clip-path: polygon(0 0, 100% 0, 100% 70%, 85% 100%, 0 100%);
    transition: all 0.3s ease;
}

.project-card:hover .project-number-badge {
    background: linear-gradient(135deg, var(--color-accent-flow-magenta), var(--color-accent-flow-cyan));
    transform: scale(1.05);
}

.project-image {
    width: 100%;
    aspect-ratio: 4 / 3;
    background-color: rgba(255, 255, 255, 0.02);
    overflow: hidden;
    position: relative;
    border-radius: 12px 12px 0 0;
}

/* Scan lines effect */
.project-image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 255, 200, 0.03) 2px,
        rgba(0, 255, 200, 0.03) 4px
    );
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.project-card:hover .project-image::after {
    opacity: 1;
    animation: scanMove 8s linear infinite;
}

@keyframes scanMove {
    0% { transform: translateY(0); }
    100% { transform: translateY(100%); }
}

.project-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.3s ease;
}

.project-card:hover .project-img {
    transform: scale(1.05);
}

.project-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-secondary);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.project-info {
    padding: var(--space-md);
}

.project-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: var(--space-sm);
    background: linear-gradient(135deg, var(--color-text-primary) 0%, var(--color-accent-flow-cyan) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: var(--color-text-primary);
}

.project-description {
    font-size: 14px;
    line-height: 1.6;
    color: var(--color-text-secondary);
    margin-bottom: var(--space-md);
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
}

.tag {
    font-family: var(--font-mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 4px 12px;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    color: var(--color-text-secondary);
}

.coming-soon-label {
    display: inline-block;
    margin-top: var(--space-xs);
    font-family: var(--font-mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-secondary);
    opacity: 0.6;
}

/* ===================================
   EXPERIMENTS SECTION
   =================================== */

.experiments-section {
    min-height: 100vh;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.5) 0%, rgba(0, 168, 255, 0.05) 100%);
}

.section-subtitle {
    font-size: clamp(16px, 2vw, 18px);
    color: var(--color-text-secondary);
    text-align: center;
    margin-top: var(--space-sm);
    margin-bottom: var(--space-xl);
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.experiments-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: var(--space-lg);
    max-width: 1200px;
    margin: 0 auto;
}

.experiment-card {
    position: relative;
    background-color: var(--color-surface);
    border: 2px solid rgba(0, 255, 200, 0.2);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.4s ease;
    cursor: pointer;
    box-shadow: 0 10px 40px rgba(0, 255, 200, 0.1);
}

.experiment-card:hover {
    transform: translateY(-12px) scale(1.02);
    border-color: var(--color-accent-flow-cyan);
    box-shadow: 0 20px 60px rgba(0, 255, 200, 0.3);
}

.experiment-visual {
    width: 100%;
    aspect-ratio: 16 / 9;
    background-color: rgba(0, 0, 0, 0.8);
    overflow: hidden;
    position: relative;
}

.experiment-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.4s ease, filter 0.4s ease;
    filter: brightness(0.9);
}

.experiment-card:hover .experiment-img {
    transform: scale(1.08);
    filter: brightness(1.1);
}

.experiment-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.7) 100%);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: var(--space-md);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.experiment-card:hover .experiment-overlay {
    opacity: 1;
}

.experiment-badge {
    font-family: var(--font-mono);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--color-accent-flow-cyan) 0%, var(--color-accent-flow-magenta) 100%);
    color: var(--color-bg);
    border-radius: 6px;
    font-weight: 700;
    box-shadow: 0 4px 16px rgba(0, 255, 200, 0.4);
}

.experiment-info {
    padding: var(--space-lg);
    background: linear-gradient(180deg, var(--color-surface) 0%, rgba(0, 168, 255, 0.05) 100%);
}

.experiment-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: var(--space-sm);
    background: linear-gradient(135deg, var(--color-accent-flow-cyan) 0%, var(--color-accent-flow-magenta) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.experiment-description {
    font-size: 15px;
    line-height: 1.7;
    color: var(--color-text-secondary);
    margin-bottom: var(--space-md);
}

.experiment-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
}

.experiment-card .tag {
    background-color: rgba(0, 255, 200, 0.1);
    border-color: rgba(0, 255, 200, 0.3);
    color: var(--color-accent-flow-cyan);
    font-weight: 500;
}

/* ===================================
   CONTACT SECTION
   =================================== */

.contact-section {
    min-height: 80vh;
}

.contact-content {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.contact-statement {
    font-size: clamp(18px, 2.5vw, 24px);
    line-height: 1.6;
    color: var(--color-text-secondary);
    margin-bottom: var(--space-lg);
}

.contact-links {
    display: flex;
    justify-content: center;
    gap: var(--space-md);
    flex-wrap: wrap;
}

.contact-link {
    font-family: var(--font-mono);
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: var(--space-sm) var(--space-md);
    border: 2px solid var(--color-text-primary);
    border-radius: 4px;
    color: var(--color-text-primary);
    transition: all 0.3s ease;
}

.contact-link:hover {
    background-color: var(--color-text-primary);
    color: var(--color-bg);
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(255, 255, 255, 0.3);
}

/* Contact Form */
.contact-form {
    max-width: 500px;
    margin: var(--space-lg) auto 0;
    text-align: left;
}

.form-group {
    margin-bottom: var(--space-md);
}

.form-group label {
    display: block;
    font-family: var(--font-mono);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-text-secondary);
    margin-bottom: var(--space-xs);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: var(--space-sm);
    background-color: var(--color-surface);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    color: var(--color-text-primary);
    font-family: var(--font-body);
    font-size: 16px;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-accent-flow-cyan);
    box-shadow: 0 0 0 3px rgba(0, 255, 200, 0.1);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--color-text-secondary);
    opacity: 0.5;
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.contact-submit {
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    font-family: var(--font-mono);
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    background-color: transparent;
    border: 2px solid var(--color-text-primary);
    border-radius: 4px;
    color: var(--color-text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.contact-submit:hover {
    background-color: var(--color-text-primary);
    color: var(--color-bg);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(255, 255, 255, 0.3);
}

.contact-submit:active {
    transform: translateY(0);
}

/* ===================================
   FOOTER
   =================================== */

.footer {
    position: relative;
    height: 60px;
    background-color: var(--color-bg);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    overflow: hidden;
}

#footer-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.footer-content {
    position: relative;
    z-index: 1;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.footer-text {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--color-text-secondary);
    letter-spacing: 0.05em;
}

/* ===================================
   PROJECT MODAL
   =================================== */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal[data-state="open"] {
    opacity: 1;
    pointer-events: auto;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
}

.modal-content {
    position: relative;
    width: 90vw;
    max-width: 1200px;
    height: 85vh;
    background-color: var(--color-surface);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

/* Larger modal for 3D projects */
.modal[data-project-id="solarpunk-3d"] .modal-content,
.modal[data-project-id="game-emotion-viz"] .modal-content {
    width: 95vw;
    max-width: 1600px;
    height: 92vh;
}

.modal[data-state="open"] .modal-content {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: var(--space-sm);
    right: var(--space-sm);
    width: 44px;
    height: 44px;
    background-color: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: var(--color-text-primary);
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background-color: var(--color-accent-flow-cyan);
    border-color: var(--color-accent-flow-cyan);
    transform: rotate(90deg);
}

.modal-close:focus {
    outline: 2px solid var(--color-accent-flow-cyan);
    outline-offset: 2px;
}

.modal-header {
    padding: var(--space-md);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-title {
    font-size: clamp(20px, 3vw, 28px);
    font-weight: 700;
    color: var(--color-text-primary);
    margin: 0;
}

.modal-body {
    flex: 1;
    position: relative;
    overflow: hidden;
    background-color: #000000;
}

.modal-loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 5;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--color-accent-flow-cyan);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.modal-loading span {
    font-family: var(--font-mono);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-text-secondary);
}

.modal-embed {
    width: 100%;
    height: 100%;
    display: none;
}

.modal-iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Error State */
.embed-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: var(--space-lg);
    text-align: center;
}

.embed-error-icon {
    font-size: 64px;
    margin-bottom: var(--space-md);
    opacity: 0.5;
}

.embed-error-message {
    font-size: 16px;
    color: var(--color-text-secondary);
    margin-bottom: var(--space-md);
    max-width: 400px;
}

.embed-error-actions {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
    justify-content: center;
}

.embed-retry-btn,
.embed-open-btn {
    font-family: var(--font-mono);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 12px 24px;
    border: 2px solid var(--color-accent-structure);
    border-radius: 4px;
    background-color: transparent;
    color: var(--color-text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.embed-retry-btn:hover,
.embed-open-btn:hover {
    background-color: var(--color-accent-flow-cyan);
    border-color: var(--color-accent-flow-cyan);
    transform: translateY(-2px);
}

/* Project Badge */
.project-badge {
    position: absolute;
    bottom: var(--space-sm);
    right: var(--space-sm);
    font-family: var(--font-mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 6px 12px;
    background-color: rgba(0, 255, 200, 0.2);
    border: 1px solid var(--color-accent-flow-cyan);
    border-radius: 4px;
    color: var(--color-text-primary);
    z-index: 2;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.project-card:hover .project-badge {
    opacity: 1;
}

.project-badge.coming-soon {
    background-color: rgba(160, 160, 160, 0.2);
    border-color: var(--color-text-secondary);
    opacity: 1;
}

.project-card[data-has-embed="true"] {
    cursor: pointer;
}

.project-card[data-has-embed="false"] {
    cursor: default;
    opacity: 0.7;
}

/* Custom styling for Epluribus/Agile project card */
.project-card[data-project-id="epluribus"] .project-image {
    background-color: #000000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
}

.project-card[data-project-id="epluribus"] .project-img {
    object-fit: contain;
    width: 50%;
    height: auto;
    border-radius: 16px;
}
