/* ==========================================================================
   FOGLIO DI STILE PRINCIPALE - PORTFOLIO GIUSEPPE NICITA
   ========================================================================== */

:root {
    --colore-sfondo: #0f172a;               
    --colore-testo: #f8fafc;                
    --colore-testo-mutato: #94a3b8;         
    --colore-accento: #38bdf8;              
    --colore-accento-hover: #0284c7;        
    --colore-accento-testo: #0f172a;        
    
    --vetro-sfondo: rgba(30, 41, 59, 0.75); 
    --vetro-bordo: rgba(255, 255, 255, 0.12); 
    --vetro-header: rgba(15, 23, 42, 0.92); 
    --sfondo-input: rgba(15, 23, 42, 0.85); 
    --bordo-input: rgba(255, 255, 255, 0.2);
    --sfondo-griglia: rgba(255, 255, 255, 0.05); 

    --ombra-pannello: 0 10px 25px -5px rgba(0, 0, 0, 0.4);
    --ombra-foto: 0 15px 35px -5px rgba(56, 189, 248, 0.25);
    --raggio-bordo-sm: 8px;
    --raggio-bordo-md: 12px;
    --raggio-bordo-lg: 20px;
    --raggio-bordo-pillola: 9999px;

    --font-principale: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', Consolas, Monaco, monospace;
    --font-retro: 'VT323', monospace;

    --altezza-navbar: 70px;
    --larghezza-massima-contenitore: 1200px;
}

body.light-theme {
    --colore-sfondo: #f1f5f9;
    --colore-testo: #1e293b;
    --colore-testo-mutato: #64748b;
    --colore-accento: #2563eb;
    --colore-accento-hover: #1d4ed8;
    --colore-accento-testo: #ffffff;
    --vetro-sfondo: rgba(255, 255, 255, 0.85);
    --vetro-bordo: rgba(0, 0, 0, 0.08);
    --vetro-header: rgba(255, 255, 255, 0.94);
    --sfondo-input: #ffffff;
    --bordo-input: #cbd5e1;
    --sfondo-griglia: rgba(0, 0, 0, 0.05);
    --ombra-pannello: 0 10px 25px -5px rgba(0, 0, 0, 0.08);
    --ombra-foto: 0 15px 35px -5px rgba(37, 99, 235, 0.2);
}

body.retro-theme {
    --colore-sfondo: #000000;
    --colore-testo: #33ff33;
    --colore-testo-mutato: #22aa22;
    --colore-accento: #33ff33;
    --colore-accento-hover: #22bb22;
    --colore-accento-testo: #000000;
    --vetro-sfondo: #050e05;
    --vetro-bordo: #33ff33;
    --vetro-header: #000000;
    --sfondo-input: #000000;
    --bordo-input: #33ff33;
    --sfondo-griglia: rgba(51, 255, 51, 0.07);
    --ombra-pannello: 0 0 10px rgba(51, 255, 51, 0.2);
    --ombra-foto: 0 0 20px rgba(51, 255, 51, 0.5);
    --raggio-bordo-sm: 0px;
    --raggio-bordo-md: 0px;
    --raggio-bordo-lg: 0px;
    --raggio-bordo-pillola: 0px;
    font-family: var(--font-retro);
    text-shadow: 0 0 4px rgba(51, 255, 51, 0.45);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--altezza-navbar) + 20px); }
body {
    font-family: var(--font-principale); background-color: var(--colore-sfondo);
    color: var(--colore-testo); line-height: 1.6; min-height: 100vh; overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
    background-image: linear-gradient(to right, var(--sfondo-griglia) 1px, transparent 1px),
                      linear-gradient(to bottom, var(--sfondo-griglia) 1px, transparent 1px);
    background-size: 36px 36px;
    -webkit-user-select: none; -ms-user-select: none; user-select: none;
    cursor: default; 
}
input, textarea { -webkit-user-select: text; -ms-user-select: text; user-select: text; }
body.retro-theme::after {
    content: ""; position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.35) 50%);
    background-size: 100% 4px; z-index: 900; pointer-events: none; opacity: 0.7;
}

.contenitore { width: 100%; max-width: var(--larghezza-massima-contenitore); margin-left: auto; margin-right: auto; padding-left: 1.25rem; padding-right: 1.25rem; }
.sezione { padding-top: 4.5rem; padding-bottom: 4.5rem; }

/* NOTA: Modificato header sezione per permettere il tastino sulla destra */
.header-sezione { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; flex-wrap: wrap; gap: 1rem; }
.titolo-sezione { font-size: 1.75rem; font-weight: 700; display: flex; align-items: center; gap: 0.75rem; }
.titolo-sezione i { color: var(--colore-accento); }
.sottotitolo-sezione { color: var(--colore-testo-mutato); font-size: 1rem; margin-bottom: 2.5rem; line-height: 1.6; }
.pannello-vetro {
    background: var(--vetro-sfondo); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--vetro-bordo); border-radius: var(--raggio-bordo-lg);
    box-shadow: var(--ombra-pannello); padding: 1.5rem;
}
.citazione-evidenziata { border-left: 4px solid var(--colore-accento); padding-left: 1.25rem; font-style: italic; color: var(--colore-testo-mutato); margin: 1.25rem 0; font-size: 1.05rem; }

/* HOVER EFFECT E PULSANTI */
.pulsante-primario {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
    padding: 0.75rem 1.75rem; border-radius: var(--raggio-bordo-md);
    border: 2px solid var(--colore-accento); color: var(--colore-accento);
    background: transparent; font-weight: 600; font-size: 1rem; text-decoration: none;
    cursor: pointer; transition: all 0.25s ease;
}
.pulsante-primario:hover {
    background-color: var(--colore-accento); 
    color: var(--colore-accento-testo);
    box-shadow: 0 0 15px var(--colore-accento);
    transform: translateY(-3px);
}
.btn-hover-effect { cursor: pointer; transition: all 0.3s ease; }
.btn-hover-effect:hover { text-shadow: 0 0 8px var(--colore-accento); transform: translateY(-3px); }

/* NOTA: STILE DEL TASTINO "TORNA SU" FUTURISTICO */
.tastino-up {
    display: inline-flex; justify-content: center; align-items: center;
    width: 38px; height: 38px; border-radius: 8px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--colore-accento); color: var(--colore-accento);
    text-decoration: none; font-size: 1.1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: inset 0 0 5px rgba(56, 189, 248, 0.2);
}
.tastino-up:hover {
    background: var(--colore-accento); color: var(--colore-accento-testo);
    box-shadow: 0 0 15px var(--colore-accento), inset 0 0 10px rgba(255,255,255,0.5);
    transform: translateY(-4px);
}

.barra-navigazione { position: fixed; top: 0; left: 0; width: 100%; height: var(--altezza-navbar); background: var(--vetro-header); backdrop-filter: blur(14px); border-bottom: 1px solid var(--vetro-bordo); z-index: 1000; display: flex; align-items: center; }
.barra-navigazione__contenitore { display: flex; align-items: center; justify-content: space-between; width: 100%; }
.logo-brand { font-size: 1.25rem; font-weight: 800; color: var(--colore-accento); text-decoration: none; font-family: var(--font-mono); position: relative; cursor: pointer; }
.pulsante-hamburger { display: flex; flex-direction: column; justify-content: space-around; width: 32px; height: 32px; background: transparent; border: none; cursor: pointer; padding: 4px; z-index: 1050; }
.pulsante-hamburger span { width: 100%; height: 2px; background-color: var(--colore-testo); transition: all 0.3s ease; }
.pulsante-hamburger[aria-expanded="true"] span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.pulsante-hamburger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.pulsante-hamburger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
.menu-navigazione { position: fixed; top: var(--altezza-navbar); left: 0; width: 100%; background: var(--vetro-header); backdrop-filter: blur(16px); border-bottom: 1px solid var(--vetro-bordo); padding: 1.5rem; display: none; flex-direction: column; gap: 1.25rem; }
.menu-navigazione.menu-aperto { display: flex; }
.menu-navigazione a { color: var(--colore-testo); text-decoration: none; font-weight: 500; padding: 0.5rem 0.75rem; border-radius: var(--raggio-bordo-sm); transition: color 0.2s ease, background-color 0.2s ease, text-shadow 0.2s ease; cursor: pointer; }
.menu-navigazione a:hover { color: var(--colore-accento); background: rgba(255, 255, 255, 0.05); text-shadow: 0 0 5px var(--colore-accento); }
.selettore-temi { display: flex; align-items: center; gap: 0.5rem; }
.pulsante-tema { width: 38px; height: 38px; border-radius: var(--raggio-bordo-pillola); border: 1px solid var(--vetro-bordo); background: var(--vetro-sfondo); color: var(--colore-testo); cursor: pointer; transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease; }
.pulsante-tema:hover { transform: translateY(-2px); border-color: var(--colore-accento); box-shadow: 0 0 10px rgba(56, 189, 248, 0.4); }
.pulsante-tema[data-tema="light-theme"] i { color: #f59e0b; }
.pulsante-tema[data-tema="dark-theme"] i { color: #38bdf8; }
.pulsante-tema[data-tema="retro-theme"] i { color: #22c55e; }

.sezione-hero { padding-top: calc(var(--altezza-navbar) + 3rem); padding-bottom: 3rem; }
.sezione-hero__griglia { display: flex; flex-direction: column-reverse; align-items: center; gap: 2.5rem; }
.eroe-contenuto { display: flex; flex-direction: column; align-items: flex-start; gap: 1rem; width: 100%; }
.badge-stato { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.3rem 0.85rem; border-radius: var(--raggio-bordo-pillola); border: 1px solid var(--colore-accento); font-family: var(--font-mono); font-size: 0.85rem; color: var(--colore-accento); }
.indicatore-pulsante { width: 8px; height: 8px; border-radius: 50%; background-color: #22c55e; animation: pulsazione-verde 2s infinite; }
@keyframes pulsazione-verde { 0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); } 70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); } 100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); } }
.titolo-principale { font-size: 2.5rem; font-weight: 800; line-height: 1.15; letter-spacing: -0.03em; }
.sottotitolo-ruolo { font-size: 1.35rem; font-weight: 300; color: var(--colore-testo-mutato); display: inline-block; min-height: 2rem;}
.profilo-foto-wrapper { position: relative; z-index: 950; }
.profilo-foto-cornice { width: 220px; height: 220px; border-radius: 50%; border: 4px solid var(--colore-accento); box-shadow: var(--ombra-foto); overflow: hidden; background-color: #1e293b; transition: transform 0.3s ease, box-shadow 0.3s ease; }
.profilo-foto-cornice:hover { transform: scale(1.03); box-shadow: 0 15px 45px -5px rgba(56, 189, 248, 0.5); }
.profilo-foto-cornice img { width: 100%; height: 100%; object-fit: cover; }

.testo-biografia { display: flex; flex-direction: column; gap: 1.25rem; font-size: 1.05rem; }
.timeline { position: relative; padding-left: 2rem; border-left: 2px solid var(--colore-accento); margin-top: 1.5rem; }
.timeline__voce { position: relative; margin-bottom: 2.5rem; }
.timeline__punto { position: absolute; left: calc(-2rem - 6px); top: 6px; width: 10px; height: 10px; border-radius: 50%; background-color: var(--colore-accento); box-shadow: 0 0 0 3px var(--colore-sfondo); }
.timeline__titolo { font-size: 1.2rem; font-weight: 700; }
.timeline__ruolo { color: var(--colore-accento); font-weight: 600; font-size: 0.95rem; }
.timeline__dettaglio { color: var(--colore-testo-mutato); font-size: 0.95rem; margin-top: 0.5rem; }

/* NOTA: AGGIUNTE REGOLE PER LE NUOVE SEZIONI SKILLS E LINGUE */
.griglia-schede { display: grid; grid-template-columns: 1fr; gap: 1rem; }
.griglia-schede--due-colonne { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
.scheda-elemento { background: var(--vetro-sfondo); border: 1px solid var(--vetro-bordo); border-radius: var(--raggio-bordo-md); padding: 1rem 1.25rem; cursor: pointer;}
.scheda-elemento--in-evidenza { border-left: 4px solid var(--colore-accento); }
.scheda-titolo { font-weight: 700; font-size: 1rem; margin-bottom: 0.25rem; }
.scheda-autore { font-size: 0.85rem; color: var(--colore-testo-mutato); }
.lista-subvoci { margin-top: 0.6rem; padding-left: 1.25rem; font-size: 0.8rem; color: var(--colore-testo-mutato); }

.skills-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; }
.skill-tag { 
    background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.15); 
    padding: 0.4rem 0.85rem; border-radius: var(--raggio-bordo-pillola); 
    font-size: 0.85rem; font-weight: 500; font-family: var(--font-mono); 
    transition: all 0.3s ease; 
}
.skill-tag:hover { background: var(--colore-accento); color: var(--colore-accento-testo); border-color: var(--colore-accento); transform: translateY(-2px); }

.badge-lingua { 
    display: inline-block; padding: 0.3rem 0.6rem; border-radius: 6px; 
    background: rgba(56, 189, 248, 0.15); color: #38bdf8; font-size: 0.8rem; 
    font-weight: 600; border: 1px solid rgba(56, 189, 248, 0.3);
}

.modulo-contatto { display: flex; flex-direction: column; gap: 1.25rem; }
.gruppo-campo { display: flex; flex-direction: column; gap: 0.4rem; }
.etichetta-campo { font-size: 0.9rem; font-weight: 500; }
.campo-input, .campo-textarea { padding: 0.75rem 1rem; border-radius: var(--raggio-bordo-sm); background-color: var(--sfondo-input); border: 1px solid var(--bordo-input); color: var(--colore-testo); font-family: inherit; font-size: 0.95rem; transition: border-color 0.2s ease, box-shadow 0.2s ease; }
.campo-input:focus, .campo-textarea:focus { outline: none; border-color: var(--colore-accento); box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2); }
.campo-textarea { resize: vertical; min-height: 120px; }

.social-footer-links a { color: var(--colore-testo); text-decoration: none; transition: color 0.3s ease, transform 0.3s ease, text-shadow 0.3s ease; }
.social-footer-links a:hover { color: var(--colore-accento); transform: translateY(-3px); text-shadow: 0 0 10px var(--colore-accento); }


/* BARRA DI PROGRESSO */
.barra-progresso { position: fixed; top: 0; left: 0; width: 0%; height: 3px; background: var(--colore-accento); z-index: 1100; transition: width 0.1s ease-out; box-shadow: 0 0 5px var(--colore-accento); }

/* EFFETTO MACCHINA DA SCRIVERE */
.cursore-lampeggiante { display: inline-block; color: var(--colore-accento); animation: blink 1s step-end infinite; font-weight: 700; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

/* TILT 3D SULLE SCHEDE */
.scheda-3d { transform-style: preserve-3d; transition: transform 0.1s ease-out, box-shadow 0.2s ease-out, border-color 0.2s ease; will-change: transform; }
.scheda-3d:hover { border-color: var(--colore-accento); box-shadow: 0 15px 30px rgba(0,0,0,0.5); }
.hover-glow:hover { box-shadow: 0 0 25px rgba(56, 189, 248, 0.15); border-color: rgba(56, 189, 248, 0.4); }

/* EFFETTO GLITCH (CYBERPUNK) SUL LOGO */
.glitch:hover { position: relative; }
.glitch:hover::before, .glitch:hover::after { content: attr(data-text); position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: var(--vetro-header); }
.glitch:hover::before { left: 2px; text-shadow: -2px 0 #ff00c1; clip-path: polygon(0 0, 100% 0, 100% 45%, 0 45%); animation: glitch-anim-1 2.5s infinite linear alternate-reverse; }
.glitch:hover::after { left: -2px; text-shadow: -2px 0 #00fff9; clip-path: polygon(0 80%, 100% 20%, 100% 100%, 0 100%); animation: glitch-anim-2 3s infinite linear alternate-reverse; }
@keyframes glitch-anim-1 { 0% { clip-path: inset(20% 0 80% 0); } 20% { clip-path: inset(60% 0 10% 0); } 40% { clip-path: inset(40% 0 50% 0); } 60% { clip-path: inset(80% 0 5% 0); } 80% { clip-path: inset(10% 0 70% 0); } 100% { clip-path: inset(30% 0 20% 0); } }
@keyframes glitch-anim-2 { 0% { clip-path: inset(10% 0 60% 0); } 20% { clip-path: inset(30% 0 20% 0); } 40% { clip-path: inset(70% 0 10% 0); } 60% { clip-path: inset(20% 0 50% 0); } 80% { clip-path: inset(90% 0 5% 0); } 100% { clip-path: inset(40% 0 30% 0); } }

/* ANIMAZIONI DI SCORRIMENTO */
.fade-in-scroll { opacity: 0; transform: translateY(30px); transition: opacity 0.6s ease-out, transform 0.6s ease-out; will-change: opacity, transform; }
.fade-in-scroll.mostra-elemento { opacity: 1; transform: translateY(0); }

/* MEDIA QUERIES */
@media (min-width: 640px) {
    .griglia-schede { grid-template-columns: repeat(2, 1fr); }
    .profilo-foto-cornice { width: 260px; height: 260px; }
}
@media (min-width: 992px) {
    .pulsante-hamburger { display: none; }
    .menu-navigazione { position: static; display: flex; flex-direction: row; background: transparent; backdrop-filter: none; border-bottom: none; padding: 0; gap: 0.5rem; }
    .sezione-hero__griglia { flex-direction: row; justify-content: space-between; gap: 3rem; }
    .titolo-principale { font-size: 4rem; }
    .sottotitolo-ruolo { font-size: 1.75rem; }
    .profilo-foto-cornice { width: 320px; height: 320px; }
    .griglia-schede--tre-colonne { grid-template-columns: repeat(3, 1fr); }
    .griglia-schede--quattro-colonne { grid-template-columns: repeat(4, 1fr); }
    .griglia-schede--due-colonne { grid-template-columns: repeat(2, 1fr); }
}