:root {
    --bg-color: #020202;
    --text-color: #EAEAEA;
    --text-muted: #666;
    --accent-color: #ffee00ff;
    --font-main: 'Manrope', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    cursor: none; /* Hide default cursor */
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-main);
    overflow: hidden;
    height: 100vh;
}

#canvas-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

/* UI Layer */
.ui-layer {
    position: relative;
    z-index: 10;
    height: 100vh;
    width: 100%;
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: opacity 0.8s ease, transform 0.8s ease, filter 0.8s ease;
}

.ui-layer.fade-out {
    opacity: 0;
    transform: scale(1.05);
    filter: blur(15px);
    pointer-events: none;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.85rem;
    font-weight: 600;
}

.logo {
    font-weight: 800;
    letter-spacing: 4px;
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

.logo:hover {
    color: var(--accent-color);
}

.date-display {
    color: var(--text-muted);
}

/* Hero Center */
.hero-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    width: 100%;
    mix-blend-mode: exclusion;
    z-index: 5;
}

h1 {
    font-size: 10vw;
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 0.85;
    margin: 0;
    opacity: 0.95;
    pointer-events: none;
    transition: letter-spacing 1s ease;
    text-transform: uppercase;
}

.ui-layer.fade-out h1 {
    letter-spacing: 0.2em;
}

/* Corner Nav */
.corner-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    width: 100%;
    text-transform: uppercase;
}

.nav-item {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: var(--text-muted);
    border-top: 1px solid rgba(255,255,255,0.15);
    padding-top: 1rem;
    transition: color 0.3s ease, border-color 0.3s ease;
    position: relative;
    overflow: hidden;
}

.nav-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: var(--text-color);
    transform: translateX(-100%);
    transition: transform 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}

.nav-item:hover {
    color: var(--text-color);
}

.nav-item:hover::before {
    transform: translateX(0);
}

.nav-item .num {
    font-size: 0.75rem;
    margin-bottom: 0.5rem;
    display: block;
    font-weight: 600;
}

.nav-item .label {
    font-size: 1.25rem;
    font-weight: 300;
}

/* Full Screen Detail Overlay */
.detail-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 10vw;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.8s ease;
    background: transparent; /* Let the warp background show through */
}

.detail-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.detail-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    max-width: 1800px;
    margin: 0 auto;
    width: 100%;
}

.detail-header {
    border-right: 1px solid rgba(255,255,255,0.2);
    padding-right: 4rem;
}

.detail-num {
    font-size: 1.5rem;
    font-weight: 700;
    display: block;
    margin-bottom: 2rem;
    color: var(--accent-color);
}

.detail-container h2 {
    font-size: 6vw;
    font-weight: 300;
    line-height: 0.9;
    text-transform: uppercase;
    letter-spacing: -2px;
    margin: 0;
    color: #fff;
}

.detail-body {
    padding-left: 2rem;
}

.detail-body p {
    font-size: 1.5rem;
    font-weight: 300;
    line-height: 1.6;
    color: #ccc;
    margin-bottom: 3rem;
    max-width: 600px;
}

.detail-link {
    display: inline-block;
    font-size: 1.2rem;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--bg-color);
    background: var(--text-color);
    padding: 1rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    transition: transform 0.3s ease, background 0.3s ease;
}

.detail-link:hover {
    transform: scale(1.05);
    background: var(--accent-color);
}

/* App Bubbles */
.app-bubble-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.action-container {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.client-bubbles {
    display: flex;
    gap: 10px;
}

.app-bubble {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    overflow: hidden;
    transition: transform 0.3s ease, border-color 0.3s ease;
    cursor: none; /* Keep custom cursor feel */
}

.app-bubble img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: filter 0.3s ease, opacity 0.3s ease;
}

.app-bubble:hover {
    transform: scale(1.1);
    border-color: var(--accent-color);
    z-index: 10;
}

.app-bubble.retired {
    border-color: rgba(255, 255, 255, 0.05);
}

.app-bubble.retired img {
    filter: grayscale(100%);
    opacity: 0.4;
}

.app-bubble.retired:hover img {
    opacity: 0.6;
}

.close-btn {
    position: absolute;
    top: 3rem;
    right: 3rem;
    font-size: 1rem;
    font-weight: 700;
    background: none;
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    cursor: none;
    padding: 1rem 2rem;
    border-radius: 50px;
    text-transform: uppercase;
    transition: background 0.3s, border-color 0.3s;
}

.close-btn:hover {
    background: rgba(255,255,255,0.1);
    border-color: #fff;
}


/* Custom Cursor */
.cursor-dot {
    width: 6px;
    height: 6px;
    background-color: var(--accent-color);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 999;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 10px var(--accent-color);
}

.cursor-outline {
    width: 50px;
    height: 50px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 999;
    transition: transform 0.1s linear; /* Improved latency */
    transform: translate(-50%, -50%);
    mix-blend-mode: overlay;
}

/* Responsive */
@media (width > 1024px) {
    .corner-nav {
        display: flex;
        justify-content: space-between;
        position: absolute;
        bottom: 3rem;
        left: 3rem;
        right: 3rem;
        width: auto;
        gap: 6rem;
    }
    
    .nav-item {
        width: 250px;
    }
}

@media (max-width: 1024px) {
    .detail-container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .detail-header {
        border-right: none;
        border-bottom: 1px solid rgba(255,255,255,0.2);
        padding-right: 0;
        padding-bottom: 2rem;
    }
    
    .detail-container h2 {
        font-size: 3.5rem;
    }
    
    .detail-body {
        padding-left: 0;
    }
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    /* Allow scrolling and hide cursor */
    body {
        overflow-y: auto;
        height: auto;
        cursor: auto; /* Restore default cursor */
    }

    .cursor-dot, .cursor-outline {
        display: none;
    }

    /* Header & Layout */
    .ui-layer {
        padding: 1.5rem;
    }

    header {
        font-size: 0.75rem;
    }

    /* Hero Text */
    h1 {
        font-size: 13vw; /* Smaller to prevent crowding */
        letter-spacing: -0.02em;
        margin-bottom: 2rem; /* Clear space for bottom nav? */
    }

    /* Stacked Navigation */
    .corner-nav {
        display: flex;
        flex-direction: column;
        grid-template-columns: none;
        position: absolute;
        bottom: 2rem;
        left: 2rem;
        right: 2rem;
        width: auto;
        gap: 1rem;
    }

    .nav-item {
        width: 100%;
        display: flex;
        flex-direction: row; /* Horizontal row: 01 Left, Name Right */
        justify-content: space-between;
        align-items: center;
        padding-top: 0.75rem;
        border-top: 1px solid rgba(255,255,255,0.2);
    }

    .nav-item .num {
        margin-bottom: 0;
        font-size: 0.8rem;
    }

    .nav-item .label {
        font-size: 1rem;
    }

    /* Detail Overlay - Force Scrollable Block */
    .detail-overlay {
        padding: 1.5rem;
        display: block; /* Override flex */
        overflow-y: auto;
    }

    .detail-container {
        display: flex;
        flex-direction: column; /* Stack vertically */
        height: auto;
        min-height: 100%;
        padding-top: 4rem; /* Top padding for close button */
        padding-bottom: 4rem;
        gap: 2rem;
    }

    .close-btn {
        top: 1.5rem;
        right: 1.5rem;
        padding: 0.5rem 1.25rem;
        font-size: 0.85rem;
    }

    .detail-header {
        border-right: none;
        border-bottom: 1px solid rgba(255,255,255,0.2);
        padding-right: 0;
        padding-bottom: 1.5rem;
    }

    .detail-num {
        font-size: 1.2rem;
        margin-bottom: 0.5rem;
    }

    .detail-container h2 {
        font-size: 3rem; /* Cap size */
        margin-top: 0;
    }

    .detail-body {
        padding-left: 0;
    }

    .detail-body p {
        font-size: 1.1rem;
        line-height: 1.5;
        margin-bottom: 2rem;
    }

    /* Bubbles & Actions */
    .app-bubble {
        width: 60px;
        height: 60px;
    }

    .app-bubble-container {
        gap: 1rem;
    }

    .action-container {
        gap: 1rem;
    }

    .detail-link {
        width: 100%;
        text-align: center;
        padding: 1rem;
    }
}
