:root {
    --bg-color: #000000;
    --accent-primary: #00f2ff;
    --text-primary: #ffffff;
    --text-secondary: #666666;
    --border-color: rgba(255, 255, 255, 0.05);
    --font-main: 'Outfit', sans-serif;
    --font-mono: 'Space Mono', monospace;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-main);
    overflow-x: hidden;
    min-height: 100vh;
}

.noise {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3%3Ffilter id='noiseFilter'%3E%3FfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3F/filter%3E%3Frect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3F/svg%3E");
    opacity: 0.05;
    pointer-events: none;
    z-index: 9999;
}

.glow-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

/* Loader */
.loader-container {
    height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 20px;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.loader {
    width: 40px;
    height: 40px;
    border: 2px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Minimal Nav */
.minimal-nav {
    position: fixed;
    top: 0;
    width: 100%;
    height: 80px; /* Altezza fissa stabilizzata per prevenire variazioni */
    padding: 0 30px; /* Padding solo orizzontale, allineamento verticale gestito da flex */
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 2000; /* Priorità assoluta sopra tutto */
    background: linear-gradient(to bottom, rgba(0,0,0,0.8), transparent);
}

.logo {
    font-weight: 900;
    font-size: 1rem;
    letter-spacing: 5px;
    display: flex;
    align-items: center;
}

.logo-img {
    height: 40px; /* Logo height for desktop */
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 0 10px rgba(255,255,255,0.1));
}

.nav-links {
    display: flex;
    gap: 20px;
    align-items: center;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: color 0.3s;
}

.nav-links a:hover { color: var(--text-primary); }

.access-code {
    font-family: var(--font-mono);
    font-size: 0.5rem;
    color: var(--accent-primary);
    border: 1px solid var(--accent-primary);
    padding: 4px 10px;
    border-radius: 4px;
}

/* Main Experience Player - Fullscreen Mode */
.main-experience {
    height: 100dvh;
    width: 100%;
    position: relative;
    overflow: hidden;
    background: #000;
}

.video-container {
    width: 100%;
    height: 100%;
    position: relative;
}

.video-wrapper {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.player-layer {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    transform: translate(-50%, -50%);
}

iframe, video {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100vw;
    height: 56.25vw; /* 16:9 ratio */
    min-height: 100dvh;
    min-width: 177.77dvh; /* Aspect ratio cover */
    transform: translate(-50%, -50%);
    object-fit: cover;
    border: none;
}

.volume-btn {
    position: absolute;
    bottom: 150px; /* Spostato in basso */
    right: 30px;
    background: rgba(0,0,0,0.6);
    border: 1px solid var(--accent-primary);
    color: var(--accent-primary);
    padding: 10px 20px;
    font-family: var(--font-mono);
    font-size: 0.6rem;
    cursor: pointer;
    z-index: 500;
    opacity: 0;
    transition: opacity 0.5s, background 0.3s;
    pointer-events: auto;
    letter-spacing: 2px;
}

.volume-btn.visible { opacity: 1; }
.volume-btn:hover { background: var(--accent-primary); color: #000; }

#yt-player {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100vw;
    height: 56.25vw;
    min-height: 100dvh;
    min-width: 177.77dvh;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

/* RAW View Overlay */
.raw-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    clip-path: inset(0 100% 0 0);
    transition: clip-path 0.8s cubic-bezier(0.77, 0, 0.175, 1);
    z-index: 10;
}

.raw-overlay.visible { clip-path: inset(0 0 0 0); }

.raw-label {
    position: absolute;
    top: 80px;
    right: 30px;
    background: #ff4444;
    color: #fff;
    font-family: var(--font-mono);
    font-size: 0.6rem;
    padding: 4px 12px;
    z-index: 20;
    border-radius: 2px;
    text-transform: uppercase;
}

/* Player Controls Overlay */
.player-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 50px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    z-index: 30;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, transparent 100%);
    pointer-events: none;
}

.project-meta { max-width: 600px; }

.meta-tag {
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--accent-primary);
    margin-bottom: 5px;
    display: block;
}

.project-meta h2 {
    font-size: 3.5rem;
    font-weight: 900;
    margin-bottom: 5px;
    letter-spacing: -2px;
    text-transform: uppercase;
    line-height: 0.9;
}

.project-meta p {
    color: var(--text-secondary);
    font-size: 0.7rem;
    font-family: var(--font-mono);
    letter-spacing: 1px;
}

.action-buttons {
    display: flex;
    gap: 15px;
    pointer-events: auto;
}

.btn-raw, .btn-full {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
    padding: 12px 25px;
    font-family: var(--font-mono);
    font-size: 0.6rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
}

.status-dot {
    width: 6px;
    height: 6px;
    background: #fff;
    border-radius: 50%;
}

.btn-raw.active { background: #fff; color: #000; border-color: #fff; }
.btn-raw.active .status-dot { background: #ff4444; animation: blink 1s infinite; }
.btn-full:hover { background: rgba(255,255,255,0.1); border-color: #fff; }

/* Timeline Section */
.archive-section {
    padding: 100px 50px;
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 80px;
    border-top: 1px solid var(--border-color);
}

.section-info h2 {
    font-size: 2.5rem;
    font-weight: 900;
    margin-bottom: 15px;
    letter-spacing: -1px;
}

.serial-num {
    font-family: var(--font-mono);
    font-size: 0.5rem;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 5px;
}

.timeline-year-group { position: relative; margin-bottom: 60px; }

.year-label {
    font-size: 5rem;
    font-weight: 900;
    color: rgba(255,255,255,0.03);
    position: absolute;
    top: -30px;
    left: -15px;
    line-height: 1;
    z-index: -1;
}

.year-projects {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

.timeline-item { cursor: pointer; transition: 0.4s; }

.project-thumb {
    width: 100%;
    aspect-ratio: 16/9;
    overflow: hidden;
    position: relative;
    border-radius: 4px;
    background: #0a0a0a;
    margin-bottom: 12px;
    border: 1px solid var(--border-color);
}

.project-thumb img { width: 100%; height: 100%; object-fit: cover; opacity: 0.6; transition: 0.6s; }
.thumb-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: linear-gradient(to top, rgba(0,0,0,0.8), transparent); }
.auto-tag { position: absolute; top: 10px; left: 10px; background: var(--accent-primary); color: #000; font-family: var(--font-mono); font-size: 0.5rem; font-weight: 900; padding: 2px 6px; border-radius: 2px; z-index: 5; }

.timeline-item:hover .project-thumb img { opacity: 1; transform: scale(1.05); }
.timeline-item.active .project-thumb { border-color: var(--accent-primary); box-shadow: 0 0 15px rgba(0, 242, 255, 0.2); }
.timeline-item.active .project-thumb img { opacity: 1; }

.proj-title { font-size: 0.9rem; font-weight: 700; text-transform: uppercase; margin-bottom: 3px; }
.proj-owner { font-size: 0.5rem; font-family: var(--font-mono); color: var(--text-secondary); text-transform: uppercase; }

/* Loader Mini */
.loader-mini { padding: 40px; display: flex; flex-direction: column; align-items: center; gap: 10px; font-family: var(--font-mono); font-size: 0.5rem; color: var(--text-secondary); text-transform: uppercase; }
.dot-loader { width: 15px; height: 15px; border: 2px solid var(--border-color); border-top-color: var(--accent-primary); border-radius: 50%; animation: spin 0.8s linear infinite; }

/* Secondary Info */
.secondary-info { padding: 80px 50px; background: #050505; }
.info-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; }
.info-block h4 { font-size: 0.6rem; text-transform: uppercase; letter-spacing: 2px; margin-bottom: 15px; color: var(--accent-primary); }
.info-block p { color: var(--text-secondary); font-size: 0.8rem; }

/* Footer */
.footer-minimal { padding: 40px 50px; display: flex; justify-content: space-between; font-size: 0.5rem; letter-spacing: 2px; color: #333; border-top: 1px solid var(--border-color); }

/* Responsive */
@media (max-width: 768px) {
    .minimal-nav {
        height: 55px; /* Altezza fissa stabilizzata su mobile */
        padding: 0 20px;
    }
    .logo-img { height: 25px; }
    
    .main-experience { height: 100dvh; }
    
    .player-controls {
        padding: 30px 20px;
        flex-direction: column;
        align-items: flex-start;
        gap: 30px;
    }

    .project-meta h2 { font-size: 2.2rem; }
    .action-buttons { width: 100%; }
    .btn-raw, .btn-full { flex: 1; justify-content: center; padding: 15px; font-size: 0.5rem; }

    .archive-section {
        padding: 50px 20px;
        grid-template-columns: 1fr;
        gap: 50px;
    }

    .section-info h2 { font-size: 2rem; }
    .year-label { font-size: 4rem; }
    .info-grid { grid-template-columns: 1fr; gap: 30px; }

    /* Fix Volume button on mobile to avoid overlap with title */
    .volume-btn {
        top: 90px !important;
        bottom: auto !important;
        right: 20px !important;
        padding: 8px 15px !important;
        font-size: 0.5rem !important;
    }
}

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