:root {
    --bg-color: #000000;
    --accent: #2997ff;
    --accent-hover: #147ce5;
    --text-main: #f5f5f7;
    --text-muted: #86868b;
    --glass-bg: rgba(255, 255, 255, 0.04);
    --glass-border: rgba(255, 255, 255, 0.08);
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

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

body {
    background-color: var(--bg-color);
    background-image:
        radial-gradient(circle at 0% 0%, rgba(41, 151, 255, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 100% 100%, rgba(255, 255, 255, 0.05) 0%, transparent 40%);
    background-attachment: fixed;
    color: var(--text-main);
    font-family: var(--font-family);
    line-height: 1.5;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* CONTAINER CORRETTO: solo padding laterale, non tocca il top/bottom! */
.container {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    padding-left: 24px;
    padding-right: 24px;
}

/* Navbar Glass */
header {
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    border-bottom: 1px solid var(--glass-border);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 64px;
}

.logo {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-main);
    text-decoration: none;
    letter-spacing: -0.02em;
}

.logo span {
    color: var(--accent);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 28px;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.3s ease;
}

body[data-page="home"] .nav-home,
body[data-page="competenze"] .nav-competenze,
body[data-page="esperienza"] .nav-esperienza,
body[data-page="contatti"] .nav-contatti {
    color: var(--text-main);
}

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

/* MAIN CONTENT: qui c'è il padding corretto per Desktop */
main {
    flex: 1;
    padding-top: 140px;
    padding-bottom: 100px;
}

.page-header {
    margin-top: 20px;
    margin-bottom: 60px;
    text-align: center;
}

.page-title {
    font-size: 3rem;
    font-weight: 700;
    letter-spacing: -0.04em;
    margin-bottom: 16px;
}

.page-subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Hero Section */
.hero-content {
    max-width: 700px;
    margin: 0 auto;
    text-align: center;
}

.tagline {
    display: inline-block;
    padding: 6px 14px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: var(--accent);
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 24px;
}

h1 {
    font-size: 4rem;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 24px;
    letter-spacing: -0.04em;
}

h1 span {
    color: var(--accent);
}

.hero-desc {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 40px;
}

/* Bottoni */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: 30px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: var(--text-main);
    color: #000;
}

.btn-primary:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 14px rgba(255, 255, 255, 0.1);
}

/* Componenti Glass (Card & Timeline) */
.grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.card,
.timeline-item {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    padding: 32px;
    border-radius: 24px;
    transition: transform 0.3s ease, background 0.3s ease;
}

.card:hover,
.timeline-item:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
}

.card h3 {
    font-size: 1.3rem;
    margin-bottom: 12px;
    font-weight: 600;
}

.card p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Timeline Specifica */
.timeline {
    display: flex;
    flex-direction: column;
    gap: 24px;
    max-width: 800px;
    margin: 0 auto;
}

.timeline-date {
    font-size: 0.85rem;
    color: var(--accent);
    font-weight: 500;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.timeline-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.timeline-sub {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.timeline-desc {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Form e Contatti */
.contact-layout {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 60px;
    align-items: start;
}

.contact-method {
    margin-bottom: 32px;
}

.contact-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.contact-value {
    font-size: 1.1rem;
    font-weight: 500;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.span-2 {
    grid-column: span 2;
}

label {
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-muted);
    padding-left: 12px;
}

input,
textarea {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 16px;
    padding: 16px 20px;
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color 0.3s ease;
}

input:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.08);
}

/* Footer */
footer {
    padding: 40px 0;
    border-top: 1px solid var(--glass-border);
    font-size: 0.85rem;
    color: var(--text-muted);
    background: rgba(0, 0, 0, 0.3);
}

.footer-wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 24px;
}

.footer-left {
    line-height: 1.8;
}

.footer-socials a {
    color: var(--text-muted);
    text-decoration: none;
    margin-left: 24px;
    font-weight: 500;
    transition: color 0.3s ease;
}

.footer-socials a:hover {
    color: var(--text-main);
}


/* ==========================================================
   RESPONSIVENESS MOBILE (UNA SOLA MEDIA QUERY PULITA) 
   ========================================================== */
@media (max-width: 768px) {

    /* Spingiamo in giù il main per compensare la navbar che va a capo */
    main {
        padding-top: 190px;
        padding-bottom: 60px;
    }

    h1 {
        font-size: 2.5rem;
    }

    .page-title {
        font-size: 2.2rem;
    }

    /* La navbar va su due righe e centra i link */
    nav {
        flex-wrap: wrap;
        height: auto;
        padding: 16px 0;
        gap: 16px;
        justify-content: center;
    }

    .nav-links {
        gap: 16px;
        justify-content: center;
        width: 100%;
        flex-wrap: wrap;
    }

    /* Griglie per form e contatti che passano a 1 colonna */
    .contact-layout {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .span-2 {
        grid-column: span 1;
    }

    /* Footer centrato */
    .footer-wrap {
        flex-direction: column;
        text-align: center;
        justify-content: center;
    }

    .footer-socials a {
        margin: 0 12px;
    }
}