/* ===== RUASIS PORTFOLIO - MAIN STYLES ===== */

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Primary Color Scheme - F3F3F3 & 3C3C3C */
    --primary-light: #F3F3F3;
    --primary-dark: #3C3C3C;
    --accent-gray: #646464;
    --light-gray: #B5B5B5;
    --dark-gray: #131313;
    
    /* Logo Colors for Project Dots */
    --logo-red: #dc3545;
    --logo-yellow: #ffc107;
    --logo-black: #000000;
    
    /* Text Colors */
    --text-light: #F3F3F3;
    --text-dark: #3C3C3C;
    --text-muted: #B5B5B5;
    
    /* Grid Settings - RESPONSIVE */
    --grid-size: 30px;
    --grid-opacity: 0.1;
    --dot-size: 18px;
    --dot-offset: 6px; /* (30-18)/2 = 6px */
}

html, body {
    height: 100%;
    overflow-x: hidden;
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-weight: 400;
}

body {
    background: linear-gradient(135deg, var(--dark-gray) 0%, var(--primary-dark) 100%);
    color: var(--text-light);
    position: relative;
}

/* ===== LOADING SCREEN ===== */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--primary-dark);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.loading-screen.fade-out {
    opacity: 0;
    pointer-events: none;
    transform: scale(1.1);
}

.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--text-light);
}

.loading-logo {
    width: 280px;
    height: auto;
    display: block;
    margin: 0 auto 40px auto;
    filter: drop-shadow(0 0 30px rgba(243, 243, 243, 0.3));
    animation: logoFloat 3s ease-in-out infinite;
}

@keyframes logoFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.loading-progress {
    width: 300px;
    height: 4px;
    background: rgba(243, 243, 243, 0.1);
    border-radius: 2px;
    margin: 0 auto 20px auto;
    overflow: hidden;
}

.loading-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-light), var(--light-gray));
    border-radius: 2px;
    width: 0%;
    transition: width 0.3s ease;
    box-shadow: 0 0 10px rgba(243, 243, 243, 0.3);
}

.loading-text {
    font-size: 16px;
    color: var(--light-gray);
    font-weight: 300;
    letter-spacing: 1px;
    animation: loadingPulse 2s infinite;
    text-align: center;
}

@keyframes loadingPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* ===== MAIN CONTAINER WITH FULL PAGE GRID ===== */
.main-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    opacity: 0;
    transition: opacity 1.5s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* FULL PAGE GRID BACKGROUND - PROPERLY ALIGNED */
    background-image: 
        linear-gradient(rgba(243, 243, 243, var(--grid-opacity)) 1px, transparent 1px),
        linear-gradient(90deg, rgba(243, 243, 243, var(--grid-opacity)) 1px, transparent 1px);
    background-size: var(--grid-size) var(--grid-size);
    background-position: 0 0, 0 0;
}

.main-container.visible {
    opacity: 1;
}

/* ===== CENTER LOGO - BETTER GRID ALIGNMENT ===== */
.center-logo {
    position: fixed;
    /* FIXED: Better grid alignment - snap to grid lines properly */
    top: calc(var(--grid-size) * 11); /* 11 grid rows from top */
    left: 50%;
    transform: translateX(-50%);
    z-index: 15;
    text-align: center;
    opacity: 0;
    transition: opacity 1.5s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    
    /* Better proportional container */
    width: calc(var(--grid-size) * 14); /* 14 grid units wide */
    height: calc(var(--grid-size) * 7); /* 7 grid rows high */
    display: flex;
    align-items: center;
    justify-content: center;
}

.center-logo.show {
    opacity: 1;
}

.center-logo .logo {
    /* FIXED: Better proportional sizing to maintain logo shape */
    max-width: calc(var(--grid-size) * 13); /* Max 13 grid units wide */
    max-height: calc(var(--grid-size) * 6); /* Max 6 grid rows high */
    width: auto;
    height: auto;
    
    /* Keep original aspect ratio while fitting in grid */
    object-fit: contain;
    
    /* ENHANCED: Much larger white glow for better visibility */
    filter: 
        drop-shadow(0 0 80px rgba(243, 243, 243, 1.0))
        drop-shadow(0 0 50px rgba(255, 255, 255, 0.8))
        drop-shadow(0 0 120px rgba(243, 243, 243, 0.6))
        drop-shadow(0 0 200px rgba(243, 243, 243, 0.4));
    
    animation: logoBreath3D 5s ease-in-out infinite;
    display: block;
    transform-style: preserve-3d;
}

@keyframes logoBreath3D {
    0%, 100% { 
        transform: scale(1) rotateX(0deg) rotateY(0deg);
        filter: 
            drop-shadow(0 0 80px rgba(243, 243, 243, 1.0))
            drop-shadow(0 0 50px rgba(255, 255, 255, 0.8))
            drop-shadow(0 0 120px rgba(243, 243, 243, 0.6))
            drop-shadow(0 0 200px rgba(243, 243, 243, 0.4));
    }
    50% { 
        transform: scale(1.03) rotateX(2deg) rotateY(2deg);
        filter: 
            drop-shadow(0 0 100px rgba(243, 243, 243, 1.2))
            drop-shadow(0 0 70px rgba(255, 255, 255, 1.0))
            drop-shadow(0 0 150px rgba(243, 243, 243, 0.8))
            drop-shadow(0 0 250px rgba(243, 243, 243, 0.6));
    }
}

/* ===== PROJECT DOTS - STATIC FIXED RESPONSIVE ===== */
.project-dots {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 10;
    pointer-events: none;
}

.project-dot {
    position: absolute;
    width: var(--dot-size);
    height: var(--dot-size);
    border-radius: 3px;
    cursor: pointer;
    /* REMOVED: auto-movement transitions - only hover transitions now */
    transition: transform 0.3s ease, opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    transform: scale(0);
    border: 1px solid rgba(243, 243, 243, 0.3);
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(243, 243, 243, 0.1);
    z-index: 10;
    pointer-events: all;
    
    /* PERFECT GRID POSITIONING - STATIC RESPONSIVE */
    left: calc((var(--grid-x, 0) * var(--grid-size)) + var(--dot-offset));
    top: calc((var(--grid-y, 0) * var(--grid-size)) + var(--dot-offset));
}

/* Updated colors based on RUASIS logo */
.project-dot.ongoing {
    background: var(--logo-red);
    border-color: rgba(220, 53, 69, 0.6);
    box-shadow: 
        0 2px 8px rgba(220, 53, 69, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.project-dot.completed {
    background: var(--logo-yellow);
    border-color: rgba(255, 193, 7, 0.6);
    box-shadow: 
        0 2px 8px rgba(255, 193, 7, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.project-dot.proposal {
    background: var(--logo-black);
    border-color: rgba(0, 0, 0, 0.8);
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.project-dot:hover {
    transform: scale(1.5);
    z-index: 20;
    border-radius: 6px;
}

.project-dot.show {
    opacity: 1;
    transform: scale(1);
    animation: dotAppear3D 1s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes dotAppear3D {
    0% {
        opacity: 0;
        transform: scale(0) rotateX(90deg);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.3) rotateX(45deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotateX(0deg);
    }
}

/* REMOVED: All auto-movement related CSS - dots are now static */

/* ===== RESPONSIVE DESIGN - FIXED FOR ALL DEVICES ===== */
@media (max-width: 768px) {
    .center-logo {
        /* FIXED: Responsive grid alignment for tablets */
        top: calc(var(--grid-size) * 9);
        width: calc(var(--grid-size) * 12);
        height: calc(var(--grid-size) * 6);
    }
    
    .center-logo .logo {
        /* Responsive: Better proportions on tablets */
        max-width: calc(var(--grid-size) * 11);
        max-height: calc(var(--grid-size) * 5);
    }
    
    .loading-logo {
        width: 200px;
    }
    
    .loading-progress {
        width: 250px;
    }
    
    :root {
        --grid-size: 25px;
        --dot-size: 14px; /* Smaller dots for tablets */
        --dot-offset: 5px; /* (25-14)/2 = 5.5 ≈ 5px */
    }
}

@media (max-width: 414px) {
    .center-logo {
        /* FIXED: Responsive grid alignment for mobile */
        top: calc(var(--grid-size) * 8);
        width: calc(var(--grid-size) * 10);
        height: calc(var(--grid-size) * 5);
    }
    
    .center-logo .logo {
        /* Responsive: Better proportions on mobile */
        max-width: calc(var(--grid-size) * 9);
        max-height: calc(var(--grid-size) * 4);
    }
    
    .loading-logo {
        width: 160px;
    }
    
    .loading-progress {
        width: 200px;
    }
    
    :root {
        --grid-size: 20px;
        --dot-size: 10px; /* Much smaller dots for mobile */
        --dot-offset: 5px; /* (20-10)/2 = 5px */
    }
}

/* ===== EXTRA SMALL MOBILE DEVICES ===== */
@media (max-width: 375px) {
    :root {
        --grid-size: 18px;
        --dot-size: 8px; /* Very small dots for tiny screens */
        --dot-offset: 5px; /* (18-8)/2 = 5px */
    }
    
    .center-logo {
        top: calc(var(--grid-size) * 7);
        width: calc(var(--grid-size) * 8);
        height: calc(var(--grid-size) * 4);
    }
    
    .center-logo .logo {
        max-width: calc(var(--grid-size) * 7);
        max-height: calc(var(--grid-size) * 3);
    }
}