:root {
    --bg-color: #050505;
    --text-color: #ffffff;
}

/* REGULAR 400 */
@font-face {
    font-family: 'Helvetica Neue';
    src: url('/fonts/HelveticaNeue-Roman.woff2') format('woff2'),
         url('/fonts/HelveticaNeue-Roman.woff') format('woff');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/* ITALIC 400 */
@font-face {
    font-family: 'Helvetica Neue';
    src: url('/fonts/HelveticaNeue-Italic.woff2') format('woff2'),
         url('/fonts/HelveticaNeue-Italic.woff') format('woff');
    font-weight: 400;
    font-style: italic;
    font-display: swap;
}

/* BOLD 700 */
@font-face {
    font-family: 'Helvetica Neue';
    src: url('/fonts/HelveticaNeue-Bold.woff2') format('woff2'),
         url('/fonts/HelveticaNeue-Bold.woff') format('woff');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* HEAVY 900 */
@font-face {
    font-family: 'Helvetica Neue';
    src: url('/fonts/HelveticaNeue-Heavy.woff2') format('woff2'),
         url('/fonts/HelveticaNeue-Heavy.woff') format('woff');
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}


body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    overflow: hidden;
	-webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

#canvas-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
}

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

/* --- HEADER & TYPING TEXT --- */
header {
    position: absolute;
    top: 40px;
    left: 40px;
    pointer-events: auto;
    max-width: 300px;
    z-index: 30;
}

h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: -0.03em;
    white-space: nowrap; 
}

h2 {
    font-size: 1rem;
    font-weight: 400;
    margin: 4px 0 0 0;
    opacity: 0.5;
}

#typing-container {
    margin-top: 15px;
    font-size: 0.85rem;
    color: #aaa;
    line-height: 1.4;
    min-height: 3em;
    opacity: 1;
    transition: opacity 1s ease;
    white-space: normal;
}

.cursor {
    display: inline-block;
    width: 2px;
    height: 1em;
    background-color: #fff;
    margin-left: 2px;
    vertical-align: bottom;
    animation: blink 0.8s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* --- ABOUT BUTTON --- */
.about-btn {
    position: absolute;
    top: 40px; 
    right: 40px;
    pointer-events: auto;
    text-decoration: none;
    color: #fff;
    border: 1px solid rgba(255,255,255,0.3);
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
    z-index: 30;
    white-space: nowrap;
}

.about-btn:hover {
    background: #fff;
    color: #000;
    border-color: #fff;
}

/* --- PROJECT WINDOWS --- */
.project-window {
    position: absolute;
    width: 300px; 
    height: auto; 
    background: rgba(20, 20, 20, 0.65);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    opacity: 0;
    transform: translateY(30px) scale(0.95);
    transition: opacity 0.6s ease, transform 0.8s cubic-bezier(0.16, 1, 0.3, 1), background 0.3s ease, border-color 0.3s ease;
    pointer-events: auto;
    cursor: pointer;
    z-index: 20;
    visibility: hidden;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
    padding-bottom: 20px;
}

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

.project-window:hover {
    background: #0a0a0a; 
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(0) scale(1.02);
}

.pw-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 10px; 
    box-sizing: border-box;
}

/* IMAGE STYLES */
.pw-img, .pw-placeholder-img {
    width: 100%;
    height: 220px; 
    object-fit: cover; 
    display: block;
    border-radius: 8px; 
}

.pw-placeholder-img {
    background: #1a1a1a;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    font-weight: 700;
    color: #333;
    text-transform: uppercase;
}

.pw-details {
    padding: 15px 5px 0 5px; 
}

.pw-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 4px;
    letter-spacing: -0.01em;
    color: #fff;
    line-height: 1.2;
}

.pw-cat {
    font-size: 0.8rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 5px;
}

/* --- PROGRESS DOTS --- */
.scroll-progress {
    position: fixed;
    right: 40px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 14px;
    z-index: 15;
}

.dot {
    width: 4px;
    height: 4px;
    background-color: #333;
    border-radius: 50%;
    transition: all 0.4s ease;
}
.dot.active {
    background-color: #fff;
    transform: scale(1.5);
}

/* --- SCROLL HINT (DESKTOP ADJUSTED) --- */
.scroll-hint {
    position: fixed;
    top: 50%;
    /* Positioned relative to center to stay close to head */
    left: 62%; 
    right: auto;
    bottom: auto;
    
    transform: translateY(-50%);
    font-size: 0.75rem;
    opacity: 0.4;
    letter-spacing: 0.15em;
    transition: opacity 0.8s ease; /* Smoother fade out */
    pointer-events: none; /* Ensure it doesn't block clicks */
    z-index: 25;
    white-space: nowrap;
}

/* --- PRELOADER --- */
#loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.8s ease-out;
}

.loader-content {
    text-align: center;
    color: white;
}

#loader-name {
    font-size: 1.5rem; 
    font-weight: 700;
    letter-spacing: -0.03em;
    text-transform: uppercase;
    margin-bottom: 10px;
    white-space: nowrap;
}

#loader-sub {
    font-size: 0.8rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 2px;
    opacity: 0;
    transition: opacity 0.5s ease;
}

#canvas-container canvas {
    opacity: 0;
    transition: opacity 1s ease;
}
#canvas-container canvas.visible {
    opacity: 1;
}

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

/* --- MOBILE ADJUSTMENTS --- */
@media (max-width: 768px) {
    header { 
        top: 20px; 
        left: 20px; 
        width: calc(100% - 40px);
    }
    
    .scroll-hint { 
        top: auto;
        right: auto;
        left: 50%;
        bottom: 90px;
        transform: translateX(-50%); 
    }

    .about-btn { 
        top: auto; 
        right: auto;
        bottom: 35px;
        left: 50%;
        transform: translateX(-50%);
        font-size: 0.75rem;
        padding: 12px 24px;
        background: rgba(10,10,10,0.8);
    }

    /* --- MOBILE WINDOW DISTRIBUTION --- */
    .project-window { 
        width: 220px !important; 
        height: auto !important; 
        margin: 0;
        
        /* Reset positioning defaults */
        top: auto !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;
    }
    
    /* 1. MUSEO (Was overlapping) -> Move to BOTTOM Left */
    .project-window:nth-child(1) {
        bottom: 120px !important;
        left: 20px !important;
        right: auto !important;
        transform: translateY(30px) scale(0.95);
    }

    /* 2. SUPERVISIONE -> Stay UPPER Right (Safe zone) */
    .project-window:nth-child(2) {
        top: 280px !important; /* 280px clears the header comfortably */
        left: auto !important;
        right: 20px !important;
        transform: translateY(30px) scale(0.95);
    }

    /* 3. SIFOLA (Was overlapping) -> Move to BOTTOM Left */
    .project-window:nth-child(3) {
        bottom: 120px !important;
        left: 20px !important;
        right: auto !important;
        transform: translateY(30px) scale(0.95);
    }

    /* 4. PAGRA -> Stay UPPER Right */
    .project-window:nth-child(4) {
        top: 280px !important;
        left: auto !important;
        right: 20px !important;
        transform: translateY(30px) scale(0.95);
    }

    /* 5. LUNA (Was overlapping) -> Move to BOTTOM Right */
    .project-window:nth-child(5) {
        bottom: 120px !important;
        left: auto !important;
        right: 20px !important;
        transform: translateY(30px) scale(0.95);
    }

    /* 6. SIRENUSSA -> Stay UPPER Right */
    .project-window:nth-child(6) {
        top: 280px !important;
        left: auto !important;
        right: 20px !important;
        transform: translateY(30px) scale(0.95);
    }

    /* 7. SOCIETAS (Was overlapping) -> Move to BOTTOM Right */
    .project-window:nth-child(7) {
        bottom: 120px !important;
        left: auto !important;
        right: 20px !important;
        transform: translateY(30px) scale(0.95);
    }

    /* Active Animation States */
    .project-window.active {
        transform: translateY(0) scale(1) !important;
    }
    
    /* Mobile Image sizing */
    .pw-img, .pw-placeholder-img {
        height: 140px; 
    }

    .pw-title {
        font-size: 1rem;
    }
    
    .scroll-progress { display: none; }
    
}

