/* ===== RESET & BASE STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Windows 8 Metro Colors - Modern Palette */
    --win8-blue: #0078d7;
    --win8-teal: #00a8a8;
    --win8-purple: #8e44ad;
    --win8-orange: #ff8c00;
    --win8-green: #00cc6a;
    --win8-red: #e74c3c;
    --win8-pink: #e91e63;
    
    /* Neutral Colors */
    --bg-dark: #1a1a1a;
    --bg-light: #f5f5f5;
    --text-dark: #ffffff;
    --text-muted: #b0b0b0;
    --tile-bg: #2d2d2d;
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 3rem;
    --spacing-xl: 4rem;
    
    /* Typography */
    --font-main: 'Roboto', Helvetica, Arial, sans-serif;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-dark);
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
    height: 100%;
}

.page-wrapper {
    position: relative;
}

.page-wrapper > section,
.page-wrapper > header {
    height: 100vh;
    scroll-snap-align: start;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

/* ===== HERO SECTION ===== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0a0a0a;
    position: relative;
    overflow: hidden;
}

.node-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.hero-content {
    text-align: center;
    z-index: 2;
    position: relative;
    animation: fadeInUp 1s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-title {
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 300;
    letter-spacing: -2px;
    margin-bottom: var(--spacing-sm);
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

.hero-subtitle {
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    font-weight: 300;
    margin-bottom: var(--spacing-lg);
    color: rgba(255, 255, 255, 0.9);
}

.hero-cta {
    display: flex;
    gap: var(--spacing-md);
    justify-content: center;
    flex-wrap: wrap;
}

.cta-button {
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    text-decoration: none;
    color: white;
    background-color: transparent;
    border: 2px solid white;
    border-radius: 50px;
    backdrop-filter: blur(2px);
    transition: all 0.3s ease;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.cta-button:hover {
    background-color: white;
    color: var(--win8-blue);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.cta-button.secondary {
    background-color: transparent;
}

.cta-button.secondary:hover {
    background-color: white;
    color: var(--win8-blue);
}

/* ===== SECTION STYLES ===== */
.projects-section {
    padding: var(--spacing-xl) 0;
    min-height: 100vh;
    position: relative;
    background-color: #000000;
    overflow: hidden;
}

.grid-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    opacity: 1;
}

.projects-section .container {
    position: relative;
    z-index: 2;
    max-width: none;
    overflow: visible;
}

.projects-section #projectsTitle {
    margin-bottom: var(--spacing-lg);
    position: relative;
}

.projects-section #projectsTitle::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120%;
    height: 150%;
    background: radial-gradient(ellipse at center, rgba(100, 180, 255, 0.15) 0%, transparent 70%);
    filter: blur(30px);
    z-index: -1;
    pointer-events: none;
}

.projects-section #projectsGrid {
    opacity: 1;
}

/* ===== PROJECT LIST STYLE ===== */
.projects-list {
    max-width: 500px;
    margin-top: var(--spacing-xl);
    margin-left: 120px;
    padding: var(--spacing-lg);
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(3px);
    border-radius: 15px;
}

.project-list-item {
    position: relative;
    margin-bottom: var(--spacing-xs);
    cursor: pointer;
}

.project-list-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    transition: all 0.3s ease;
    margin: 0;
    padding: var(--spacing-xs) 0;
}

.project-list-item:hover .project-list-title {
    color: rgba(100, 180, 255, 1);
    text-shadow: 0 0 20px rgba(100, 180, 255, 0.5);
    transform: translateX(20px);
}

.project-popup {
    position: fixed;
    left: 550px;
    right: auto;
    top: 0px;
    bottom: auto;
    transform: scale(0);
    transform-origin: left top;
    background: rgba(20, 20, 30, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(100, 180, 255, 0.3);
    border-radius: 15px;
    padding: var(--spacing-lg);
    width: 1150px;
    height: 600px;
    opacity: 0;
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 100;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5),
                0 0 20px rgba(100, 180, 255, 0.2);
    overflow-y: auto;
}

.project-list-item:hover .project-popup,
.project-list-item.popup-active .project-popup {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}

.popup-content {
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
}

.popup-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
}

.popup-icon {
    font-size: 2rem;
}

.popup-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
    color: rgba(100, 180, 255, 1);
}

.popup-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin: var(--spacing-xs) 0 0 0;
}

.popup-description {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: auto;
    color: var(--text-secondary);
}

.popup-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: var(--spacing-md);
    gap: var(--spacing-md);
}

.popup-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
    flex: 1;
}

.popup-tag {
    padding: var(--spacing-xs) var(--spacing-sm);
    background: rgba(100, 180, 255, 0.15);
    border: 1px solid rgba(100, 180, 255, 0.3);
    border-radius: 20px;
    font-size: 0.85rem;
    color: rgba(100, 180, 255, 1);
}

.popup-button {
    display: inline-block;
    padding: var(--spacing-xs) var(--spacing-sm);
    background: rgba(100, 180, 255, 0.2);
    border: 1px solid rgba(100, 180, 255, 0.4);
    border-radius: 8px;
    color: rgba(100, 180, 255, 1);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    text-align: center;
    white-space: nowrap;
}

.popup-button:hover {
    background: rgba(100, 180, 255, 0.35);
    border-color: rgba(100, 180, 255, 0.7);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(100, 180, 255, 0.3);
}

.about-section {
    padding: var(--spacing-xl) 0;
    min-height: 100vh;
    position: relative;
    background-color: #000000;
    color: var(--text-dark);
}

.section-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    text-align: center;
    letter-spacing: -1px;
    text-shadow: 0 0 20px rgba(100, 180, 255, 0.3),
                 0 0 40px rgba(100, 180, 255, 0.15);
}

/* ===== WINDOWS 8 TILES GRID ===== */
.tiles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-md);
    margin-top: var(--spacing-lg);
}

.project-tile {
    position: relative;
    aspect-ratio: 1;
    background-color: var(--tile-bg);
    border-radius: 20px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    transform: scale(0.8) translateY(50px);
}

.project-tile.visible {
    opacity: 1;
    transform: scale(1) translateY(0);
}

.project-tile:hover {
    transform: scale(1.05) translateY(-10px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    z-index: 10;
}

/* Tile Background Image */
.tile-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.tile-background.active {
    opacity: 0.4;
}

.project-tile:hover .tile-background.active {
    opacity: 0.6;
}

/* Tile Overlay Color */
.tile-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--tile-color) 0%, rgba(0, 0, 0, 0.8) 100%);
    mix-blend-mode: multiply;
    transition: opacity 0.3s ease;
}

.project-tile:hover .tile-overlay {
    opacity: 0.9;
}

/* Tile Content */
.tile-content {
    position: relative;
    z-index: 2;
    padding: var(--spacing-md);
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.tile-header {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-sm);
}

.tile-icon {
    font-size: 2.5rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.tile-title {
    font-size: 1.8rem;
    font-weight: 400;
    margin-bottom: var(--spacing-xs);
    line-height: 1.2;
}

.tile-description {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: var(--spacing-md);
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease 0.1s;
}

.project-tile:hover .tile-description {
    opacity: 1;
    transform: translateY(0);
}

.tile-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
    margin-top: auto;
}

.tag {
    padding: 0.3rem 0.8rem;
    background-color: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    font-size: 0.85rem;
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
}

.project-tile:hover .tag {
    background-color: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
}

/* Tile Color Variants */
.project-tile[data-color="blue"] { --tile-color: var(--win8-blue); }
.project-tile[data-color="teal"] { --tile-color: var(--win8-teal); }
.project-tile[data-color="purple"] { --tile-color: var(--win8-purple); }
.project-tile[data-color="orange"] { --tile-color: var(--win8-orange); }
.project-tile[data-color="green"] { --tile-color: var(--win8-green); }
.project-tile[data-color="red"] { --tile-color: var(--win8-red); }
.project-tile[data-color="pink"] { --tile-color: var(--win8-pink); }

/* ===== ABOUT SECTION ===== */
.about-section {
    background-color: #000000;
    color: var(--text-dark);
}

.about-section .container {
    padding: 0;
    background: transparent;
}

.about-layout {
    display: flex;
    gap: var(--spacing-xl);
    padding: 0 120px;
    background: transparent;
}

.about-left {
    flex: 1;
    max-width: 50%;
}

.about-header {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    color: rgba(100, 180, 255, 1);
    margin-bottom: var(--spacing-lg);
    text-shadow: 0 0 20px rgba(100, 180, 255, 0.3),
                 0 0 40px rgba(100, 180, 255, 0.15);
}

.about-description {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
}

.cv-button {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm) var(--spacing-lg);
    background: rgba(100, 180, 255, 0.15);
    border: 1px solid rgba(100, 180, 255, 0.3);
    border-radius: 8px;
    color: rgba(100, 180, 255, 1);
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    transition: all 0.3s ease;
    margin-top: var(--spacing-sm);
    -webkit-tap-highlight-color: transparent;
    -moz-tap-highlight-color: transparent;
    outline: none;
}

.cv-button:focus {
    outline: none;
}

.cv-button:active {
    -webkit-tap-highlight-color: transparent;
}

.cv-button svg {
    fill: rgba(100, 180, 255, 1);
    transition: fill 0.3s ease;
}

.cv-button:hover {
    background: rgba(100, 180, 255, 0.25);
    border-color: rgba(100, 180, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(100, 180, 255, 0.3);
}

.about-right {
    flex: 1;
    max-width: 50%;
    background: transparent;
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
    margin-top: var(--spacing-sm);
    background: transparent;
}

.photo-item {
    aspect-ratio: 1;
    background: rgba(100, 180, 255, 0.1);
    border: 1px solid rgba(100, 180, 255, 0.2);
    border-radius: 15px;
    transition: all 0.3s ease;
}

.photo-item:hover {
    background: rgba(100, 180, 255, 0.15);
    border-color: rgba(100, 180, 255, 0.4);
    transform: translateY(-5px);
}

/* ===== SIDE NAVIGATION ===== */
.side-nav {
    position: fixed;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 2rem;
    border-radius: 0 12px 12px 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.side-nav::before {
    content: '';
    position: absolute;
    left: 0;
    top: -2rem;
    bottom: -2rem;
    width: 150px;
    z-index: -1;
}

.side-nav:hover {
    padding-right: 4rem;
    padding-top: 3rem;
    padding-bottom: 3rem;
}

.side-nav:hover .nav-dot .dot {
    width: 16px;
    height: 16px;
    transform: scale(1.3);
}

.side-nav:hover .nav-dot .label {
    opacity: 1;
    transform: translateX(0);
    font-size: 1.1rem;
    pointer-events: auto;
}

.nav-dot {
    display: flex;
    align-items: center;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.nav-dot .dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--text-muted);
    border: 2px solid var(--text-muted);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.nav-dot .label {
    position: absolute;
    left: 30px;
    white-space: nowrap;
    color: var(--text-dark);
    font-size: 0.9rem;
    font-weight: 500;
    opacity: 0;
    transform: translateX(-20px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.nav-dot.active .dot {
    background-color: var(--win8-blue);
    border-color: var(--win8-blue);
    height: 60px;
    border-radius: 6px;
    box-shadow: 0 0 15px rgba(100, 180, 255, 0.4),
                0 0 30px rgba(100, 180, 255, 0.2);
}

/* ===== FOOTER ===== */
.footer {
    background-color: #000000;
    padding-top: var(--spacing-xl);
    padding-bottom: 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-md);
}

.footer-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background: transparent;
    border: none;
    color: rgba(100, 180, 255, 1);
    font-size: 1.5rem;
    text-decoration: none;
    transition: all 0.3s ease;
}

.footer-icon svg {
    fill: #ffffff;
    transition: fill 0.3s ease;
}

.footer-icon:hover {
    transform: translateY(-5px);
}

.footer-icon:hover svg {
    fill: #ffffff;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 1024px) {
    .projects-list {
        margin-left: 60px;
    }
    
    .project-popup {
        left: 450px;
        width: calc(100vw - 470px);
    }
    
    .about-layout {
        padding: 0 60px;
    }
}

@media (max-width: 768px) {
    .side-nav {
        display: none;
    }
    
    .projects-list {
        margin-left: var(--spacing-md);
        margin-right: var(--spacing-md);
        max-width: 100%;
    }
    
    .project-popup {
        position: fixed;
        left: var(--spacing-md);
        right: var(--spacing-md);
        width: auto;
        top: 50%;
        transform: translateY(-50%) scale(0);
        max-height: 80vh;
        overflow-y: auto;
    }
    
    .project-list-item:hover .project-popup,
    .project-list-item.popup-active .project-popup {
        transform: translateY(-50%) scale(1);
    }
    
    .about-layout {
        flex-direction: column;
        padding: 0 var(--spacing-md);
        gap: 0;
    }
    
    .about-left,
    .about-right {
        max-width: 100%;
        background: transparent;
    }
    
    .about-left {
        margin-bottom: var(--spacing-md);
    }
    
    .about-right {
        margin-bottom: calc(-1.5 * var(--spacing-md));
    }
    
    .photo-grid {
        margin-top: 0;
        margin-bottom: 0;
        background: transparent;
    }
    
    .tiles-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: var(--spacing-sm);
    }
    
    .hero-cta {
        flex-direction: column;
        align-items: center;
    }
    
    .cta-button {
        width: 100%;
        max-width: 300px;
    }
    
    .project-tile {
        aspect-ratio: 4/3;
    }
    
    /* Make hover effects work better on touch devices */
    .tile-description {
        opacity: 1;
        transform: translateY(0);
    }
    
    .footer {
        position: relative;
        margin-top: var(--spacing-lg);
        padding-top: var(--spacing-md);
        padding-bottom: var(--spacing-md);
    }
    
    .footer-links {
        gap: var(--spacing-md);
        margin-bottom: var(--spacing-sm);
    }
    
    .footer-icon {
        width: 40px;
        height: 40px;
    }
    
    .footer-icon svg {
        width: 20px;
        height: 20px;
    }
    
    .footer p {
        font-size: 0.8rem;
        padding: 0 var(--spacing-sm);
    }
}

@media (max-width: 480px) {
    :root {
        --spacing-md: 1rem;
        --spacing-lg: 2rem;
        --spacing-xl: 3rem;
    }
    
    .tiles-grid {
        grid-template-columns: 1fr;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .projects-list {
        margin-left: var(--spacing-sm);
        margin-right: var(--spacing-sm);
        padding: var(--spacing-md);
    }
    
    .project-list-title {
        font-size: 1.5rem;
    }
    
    .project-popup {
        padding: var(--spacing-md);
        height: auto;
        max-height: 70vh;
    }
    
    .popup-title {
        font-size: 1.5rem;
    }
    
    .popup-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-md);
    }
    
    .popup-button {
        width: 100%;
    }
    
    .about-header {
        font-size: 2rem;
    }
    
    .about-description {
        font-size: 1rem;
    }
    
    .about-layout {
        padding: 0 var(--spacing-sm);
    }
    
    .photo-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-xs);
    }
    
    .photo-item {
        min-height: 120px;
    }
}

/* ===== SMOOTH SCROLLING ===== */
html {
    scroll-behavior: smooth;
    scroll-snap-type: y mandatory;
    height: 100%;
    overflow-y: auto;
}

body {
    scroll-snap-type: y mandatory;
}

/* ===== SECTION SNAP POINTS ===== */
/* Snap points are now handled on body and .page-wrapper > section */

/* ===== ANIMATION DELAYS FOR STAGGERED EFFECT ===== */
.tile-animate:nth-child(1) { transition-delay: 0.1s; }
.tile-animate:nth-child(2) { transition-delay: 0.2s; }
.tile-animate:nth-child(3) { transition-delay: 0.3s; }
.tile-animate:nth-child(4) { transition-delay: 0.4s; }
.tile-animate:nth-child(5) { transition-delay: 0.5s; }
.tile-animate:nth-child(6) { transition-delay: 0.6s; }
