/* --- 1. VARIABILI & RESET --- */
:root {
    /* Palette Cyber-Blue Corporate */
    --bg-dark: #0f172a;       /* Blu Notte Profondo (Sfondo principale) */
    --bg-card: #1e293b;       /* Blu/Grigio per le card */
    --text-main: #f8fafc;     /* Bianco quasi puro per titoli */
    --text-muted: #94a3b8;    /* Grigio chiaro per testi lunghi */
    
    --primary: #3b82f6;       /* Blu Tech (Bottoni, Link) */
    --accent: #06b6d4;        /* Ciano (Dettagli, Glow) */
    
    --border: #334155;        /* Bordi sottili */
    
    /* Font */
    --font-main: 'Inter', sans-serif;
    --font-code: 'JetBrains Mono', monospace;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth; /* Scorrimento fluido quando clicchi i link */
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-main);
    line-height: 1.6;
    overflow-x: hidden;
}

/* --- 2. SFONDO TECNICO (GRIGLIA) --- */
.tech-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    /* Crea una griglia sottilissima stile "carta millimetrata" */
    background-image: 
        linear-gradient(rgba(59, 130, 246, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(59, 130, 246, 0.05) 1px, transparent 1px);
    background-size: 50px 50px;
    background-position: center;
}

/* --- 3. COMPONENTI COMUNI --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.section {
    padding: 100px 0;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 3rem;
    text-align: center;
}

.accent-text {
    color: var(--primary);
    position: relative;
}

/* Sottolineatura stilosa per i titoli */
.accent-text::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 4px;
    background: var(--accent);
    bottom: 5px;
    left: 0;
    opacity: 0.3;
    z-index: -1;
}

/* Bottoni */
.btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.4);
}

.btn-primary:hover {
    background: #2563eb;
    transform: translateY(-2px);
}

.btn-outline {
    border: 2px solid var(--border);
    color: var(--text-main);
    background: transparent;
}

.btn-outline:hover {
    border-color: var(--text-main);
    background: rgba(255,255,255,0.05);
}

/* --- 4. NAVBAR --- */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 1.2rem 0;
    background: rgba(15, 23, 42, 0.85); /* Sfondo semi-trasparente */
    backdrop-filter: blur(12px);          /* Effetto vetro sfocato */
    border-bottom: 1px solid rgba(255,255,255,0.05);
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-left: 5%;
    padding-right: 5%;
}

.logo {
    font-family: var(--font-code);
    font-weight: 700;
    font-size: 1.5rem;
    letter-spacing: -1px;
}

.logo .bracket { color: var(--accent); }

.nav-links {
    display: flex;
    list-style: none;
    gap: 30px;
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.3s;
}

.nav-links a:hover { color: var(--primary); }

.btn-contact {
    border: 1px solid var(--primary);
    padding: 8px 18px;
    border-radius: 4px;
    color: var(--primary) !important;
}

.btn-contact:hover {
    background: rgba(59, 130, 246, 0.1);
}

.hamburger { display: none; color: white; font-size: 1.5rem; cursor: pointer; }

/* --- 5. HERO SECTION --- */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding-top: 60px;
}

.hero-content { max-width: 800px; }

.greeting {
    font-family: var(--font-code);
    color: var(--accent);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.name {
    font-size: 4.5rem;
    line-height: 1.1;
    font-weight: 800;
    margin-bottom: 1rem;
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.role {
    font-size: 1.8rem;
    color: var(--primary);
    margin-bottom: 1.5rem;
    font-weight: 400;
}

.bio {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.cta-group { display: flex; gap: 15px; justify-content: center; }

/* --- 6. ABOUT SECTION --- */
.about-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 50px;
    align-items: start;
}

.about-text p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    font-size: 1.05rem;
}

.about-text strong { color: white; }

.soft-skills-box {
    background: rgba(59, 130, 246, 0.05);
    border-left: 4px solid var(--primary);
    padding: 20px;
    border-radius: 0 8px 8px 0;
    margin-top: 2rem;
}

.soft-skills-box h4 { margin-bottom: 15px; color: var(--text-main); }

.soft-skills-box ul { list-style: none; padding-left: 0; }

.soft-skills-box li {
    margin-bottom: 10px;
    font-size: 0.95rem;
    color: var(--text-muted);
}

.about-stats {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.stat-card {
    background: var(--bg-card);
    padding: 25px;
    border-radius: 12px;
    border: 1px solid var(--border);
    transition: transform 0.3s;
    text-align: center;
}

.stat-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
}

.stat-card i {
    font-size: 2rem;
    color: var(--accent);
    margin-bottom: 15px;
}

.stat-card h4 { font-size: 1.2rem; margin-bottom: 5px; }
.stat-card p { color: var(--text-muted); font-size: 0.9rem; }
.stat-card small { 
    display: block; 
    margin-top: 10px; 
    color: var(--primary); 
    font-family: var(--font-code); 
    font-size: 0.8rem;
}

/* --- 7. SKILLS SECTION --- */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.skill-card {
    background: var(--bg-card);
    padding: 35px;
    border-radius: 16px;
    border: 1px solid var(--border);
    transition: all 0.3s;
}

.skill-card:hover {
    border-color: var(--accent);
    box-shadow: 0 10px 30px -10px rgba(6, 182, 212, 0.15);
}

.icon-box {
    width: 60px;
    height: 60px;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.icon-box i { font-size: 1.8rem; color: var(--primary); }

.skill-card h3 { margin-bottom: 20px; font-size: 1.4rem; }

.skill-list { list-style: none; }

.skill-list li {
    margin-bottom: 12px;
    padding-left: 20px;
    position: relative;
    color: var(--text-muted);
}

/* Bullet point personalizzato */
.skill-list li::before {
    content: '▹';
    position: absolute;
    left: 0;
    color: var(--accent);
}

/* --- 8. PROJECTS SECTION --- */
.projects-wrapper {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.project-card {
    background: linear-gradient(145deg, var(--bg-card), #161f2e);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 40px;
    transition: transform 0.3s;
    position: relative;
    overflow: hidden;
}

.project-card:hover { transform: translateY(-3px); }

/* Linea colorata laterale */
.project-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary);
}

.project-tag {
    font-family: var(--font-code);
    color: var(--accent);
    font-size: 0.8rem;
    letter-spacing: 1px;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.project-card h3 {
    font-size: 1.8rem;
    margin-bottom: 15px;
    color: white;
}

.project-card p {
    color: var(--text-muted);
    margin-bottom: 20px;
    max-width: 900px;
}

.tech-stack {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.tech-stack span {
    background: rgba(255, 255, 255, 0.05);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--text-main);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* --- 9. FOOTER --- */
footer {
    padding: 80px 0 40px;
    background: #0b1120;
    border-top: 1px solid var(--border);
    text-align: center;
}

.footer-cta { margin-bottom: 60px; }
.footer-cta h2 { font-size: 2rem; margin-bottom: 15px; }
.footer-cta p { margin-bottom: 30px; color: var(--text-muted); }

.big-btn {
    padding: 15px 40px;
    font-size: 1.1rem;
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.05);
    padding-top: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding-left: 20px; padding-right: 20px;
}

.social-links { display: flex; gap: 20px; }
.social-links a { font-size: 1.5rem; color: var(--text-muted); transition: color 0.3s; }
.social-links a:hover { color: white; }

/* --- 10. MOBILE RESPONSIVE --- */
@media (max-width: 768px) {
    .navbar { padding: 1rem 20px; }
    .nav-links { display: none; } /* Qui servirebbe JS per il menu mobile */
    .hamburger { display: block; }
    
    .name { font-size: 2.8rem; }
    .role { font-size: 1.2rem; }
    
    .about-grid { grid-template-columns: 1fr; }
    .hero-content { padding: 0 15px; }
    
    .footer-bottom { flex-direction: column; gap: 20px; }
}
/* --- AGGIUNTE PER JAVASCRIPT --- */

/* 1. Stile per il Menu Mobile Aperto */
@media (max-width: 768px) {
    .nav-links.active {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 70px; /* Altezza navbar */
        right: 0;
        width: 100%;
        background: var(--bg-card);
        padding: 30px;
        border-bottom: 1px solid var(--border);
        animation: slideDown 0.3s ease forwards;
    }
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 2. Classi per Animazione Scroll (Fade In Up) */
.skill-card, .project-card, .about-text, .stat-card {
    opacity: 0;
    transform: translateY(30px); /* Parte più in basso */
    transition: all 0.8s ease;   /* Durata animazione */
}

.show {
    opacity: 1 !important;
    transform: translateY(0) !important; /* Torna alla posizione originale */
}

/* Delay sfalsato per le card delle skills (effetto cascata) */
.skill-card:nth-child(2) { transition-delay: 100ms; }
.skill-card:nth-child(3) { transition-delay: 200ms; }
.stat-card:nth-child(2) { transition-delay: 100ms; }
.stat-card:nth-child(3) { transition-delay: 200ms; }


/* --- CURSORE PERSONALIZZATO (Target System) --- */
body {
    cursor: none; /* Nasconde il cursore standard di Windows */
}

/* Il punto centrale (Precisione) */
.cursor-dot {
    width: 8px;
    height: 8px;
    background-color: var(--accent); /* Ciano */
    position: fixed;
    top: 0;
    left: 0;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    z-index: 9999;
    pointer-events: none; /* Il click passa attraverso */
}

/* Il cerchio esterno (Fluidità) */
.cursor-outline {
    width: 40px;
    height: 40px;
    border: 2px solid var(--accent); /* Bordo Ciano */
    position: fixed;
    top: 0;
    left: 0;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    z-index: 9998;
    pointer-events: none;
    transition: width 0.2s, height 0.2s, background-color 0.2s; /* Animazione scattante */
}

/* Effetto quando passi sopra i link o bottoni (Lock-on) */
body.hovering .cursor-outline {
    width: 60px;
    height: 60px;
    background-color: rgba(6, 182, 212, 0.1); /* Sfondo leggero */
    border-color: var(--primary); /* Cambia colore in Blu */
}

/* Nascondiamo il cursore sui dispositivi touch (cellulari) per evitare bug */
@media (max-width: 768px) {
    .cursor-dot, .cursor-outline { display: none; }
    body { cursor: auto; }
}
