/* =========================================
   DARK MODE DESIGN SYSTEM
   ========================================= */

:root {
    /* Colors - Dark & Atmospheric */
    --bg-primary: #0A0A0A;
    --bg-secondary: #141414;
    --bg-elevated: #1A1A1A;
    
    --text-primary: #FFFFFF;
    --text-secondary: #A0A0A0;
    --text-tertiary: #666666;
    
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-medium: rgba(255, 255, 255, 0.12);
    --border-strong: rgba(255, 255, 255, 0.2);
    
    --accent: #FFFFFF;
    --glow: rgba(255, 255, 255, 0.1);
    
    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.6);
    --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.7);
    
    /* Glow Effects */
    --glow-subtle: 0 0 20px rgba(255, 255, 255, 0.03);
    --glow-medium: 0 0 40px rgba(255, 255, 255, 0.06);
    --glow-strong: 0 0 60px rgba(255, 255, 255, 0.1);
    
    /* Typography */
    --font-display: 'Inter', -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    
    /* Spacing (8px base) */
    --sp-1: 0.5rem;
    --sp-2: 1rem;
    --sp-3: 1.5rem;
    --sp-4: 2rem;
    --sp-5: 3rem;
    --sp-6: 4rem;
    --sp-8: 6rem;
    
    /* Transitions */
    --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* =========================================
   RESET & BASE
   ========================================= */

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

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-display);
    font-size: 16px;
    line-height: 1.5;
    color: var(--text-primary);
    background: var(--bg-primary);
    overflow: hidden;
    position: relative;
}

/* Atmospheric Background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.02) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.02) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* =========================================
   LOGO MARK
   ========================================= */

.logo-mark {
    position: fixed;
    top: var(--sp-5);
    left: var(--sp-5);
    z-index: 1000;
    width: 56px;
    height: 56px;
    display: block;
    opacity: 0.9;
    transition: all 0.3s var(--ease-smooth);
}

.logo-mark:hover {
    opacity: 1;
    transform: scale(1.05);
}

.logo-mark svg {
    width: 100%;
    height: 100%;
    fill: var(--text-primary);
    filter: drop-shadow(var(--glow-subtle));
}

/* =========================================
   GRID VIEWPORT
   ========================================= */

.grid-viewport {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    cursor: grab;
}

.grid-viewport:active {
    cursor: grabbing;
}

/* =========================================
   GRID SCROLLER
   ========================================= */

.grid-scroller {
    position: absolute;
    top: 0;
    left: 0;
    display: grid;
    grid-template-columns: repeat(30, 340px);
    gap: var(--sp-4);
    padding: var(--sp-8);
    will-change: transform, filter;
}

/* =========================================
   PROJECT ITEMS - Pure Image Focus
   ========================================= */

.project-item {
    width: 340px;
    height: 340px;
    position: relative;
    background: var(--bg-elevated);
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.4s var(--ease-smooth);
    border: 1px solid var(--border-subtle);
}

/* Hover State */
.project-item:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow-xl), var(--glow-medium);
    transform: translateY(-4px);
}

/* Image Container */
.project-item__image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--sp-4);
    background: var(--bg-secondary);
    position: relative;
    overflow: hidden;
}

.project-item__image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.02) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.4s var(--ease-smooth);
}

.project-item:hover .project-item__image::before {
    opacity: 1;
}

.project-item__image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    transition: transform 0.6s var(--ease-smooth);
    filter: brightness(0.95);
}

.project-item:hover .project-item__image img {
    transform: scale(1.03);
    filter: brightness(1);
}

/* =========================================
   RESPONSIVE BREAKPOINTS
   ========================================= */

@media (max-width: 1800px) {
    .grid-scroller {
        grid-template-columns: repeat(30, 300px);
        gap: var(--sp-3);
    }
    
    .project-item {
        width: 300px;
        height: 300px;
    }
}

@media (max-width: 1400px) {
    .grid-scroller {
        grid-template-columns: repeat(25, 280px);
    }
    
    .project-item {
        width: 280px;
        height: 280px;
    }
}

@media (max-width: 1200px) {
    .logo-mark {
        top: var(--sp-4);
        left: var(--sp-4);
        width: 48px;
        height: 48px;
    }
    
    .grid-scroller {
        grid-template-columns: repeat(20, 260px);
        padding: var(--sp-6);
    }
    
    .project-item {
        width: 260px;
        height: 260px;
    }
}

@media (max-width: 768px) {
    .logo-mark {
        top: var(--sp-3);
        left: var(--sp-3);
        width: 40px;
        height: 40px;
    }
    
    .grid-scroller {
        grid-template-columns: repeat(15, 240px);
        gap: var(--sp-2);
        padding: var(--sp-4);
    }
    
    .project-item {
        width: 240px;
        height: 240px;
    }
    
    .project-item__image {
        padding: var(--sp-3);
    }
}

@media (max-width: 480px) {
    .grid-scroller {
        grid-template-columns: repeat(10, 200px);
    }
    
    .project-item {
        width: 200px;
        height: 200px;
    }
}

/* =========================================
   PERFORMANCE OPTIMIZATIONS
   ========================================= */

.grid-scroller {
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
    perspective: 1000px;
}

.project-item {
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
}

img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

/* =========================================
   SELECTION & INTERACTIONS
   ========================================= */

::selection {
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
}

::-moz-selection {
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
}

/* Disable text selection during drag */
.grid-viewport.dragging {
    user-select: none;
    -webkit-user-select: none;
}

/* Hide scrollbars */
::-webkit-scrollbar {
    display: none;
}

* {
    scrollbar-width: none;
    -ms-overflow-style: none;
}
