:root {
    --primary: #FFD600;
    --accent: #233056;
    --dark: #18181B;
    --gray-light: #F5F6FA;
    --gray-medium: #A1A1AA;
}

/* Body & Typography */
body {
    font-family: 'Lato', Arial, sans-serif;
    background: var(--dark);
    color: var(--gray-light);
    margin: 0;
    padding: 0;
}

h1,
h2,
h3,
h4 {
    font-family: 'Playfair Display', serif;
    letter-spacing: -.02em;
}

/* Navbar */
.navbar {
    background: rgba(24, 24, 27, 0.92);
    border-bottom: 1.5px solid #23305644;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 50;
}

.nav-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
}

.brand {
    color: var(--primary);
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -.02em;
}

.links a {
    color: var(--gray-light);
    margin-left: 2.2rem;
    font-size: 1rem;
    text-decoration: none;
    transition: color .15s;
    font-weight: 600;
}

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

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 2.1rem;
    color: var(--primary, #FFD600);
    cursor: pointer;
}

.mobile-menu {
    display: none;
}

.mobile-menu.hidden {
    display: none !important;
}

@media (max-width: 900px) {
    .links {
        display: none;
    }

    .menu-toggle {
        display: block;
    }

    .mobile-menu {
        display: flex;
        flex-direction: column;
        background: #23272F;
        padding: 1rem;
        position: absolute;
        right: 1.5rem;
        top: 4.5rem;
        border-radius: 10px;
        z-index: 200;
        box-shadow: 0 4px 24px #23305619;
        gap: 1rem;
    }

    .mobile-menu a {
        color: var(--gray-light);
        font-size: 1.15rem;
        padding: 0.6rem 0;
        text-decoration: none;
        font-weight: 600;
        border-bottom: 1px solid #23305655;
        transition: color .15s;
    }

    .mobile-menu a:last-child {
        border-bottom: none;
    }

    .mobile-menu a:hover {
        color: var(--primary);
    }
}

/* Hero Section */
.hero-bg {
    background: linear-gradient(120deg, #233056 0%, #18181B 100%);
    padding: 5.5rem 1.5rem 4.5rem 1.5rem;
}

.hero-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 3.5rem;
    flex-wrap: wrap;
}

.hero-left {
    flex: 1 1 320px;
}

.hero-right {
    flex: 1 1 320px;
    display: flex;
    justify-content: center;
}

.hero-left h1 {
    color: var(--primary);
    font-size: 2.6rem;
    line-height: 1.15;
    margin-bottom: 0.7rem;
    font-weight: 800;
    letter-spacing: -.02em;
}

.hero-left p {
    color: var(--gray-light);
    font-size: 1.25rem;
    margin-bottom: 1.3rem;
}

.hero-left button {
    background: var(--primary);
    color: var(--accent);
    font-weight: 700;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    padding: 0.9rem 2.5rem;
    cursor: pointer;
    transition: background .18s, color .16s, box-shadow .15s;
    box-shadow: 0 3px 18px #FFD60033;
}

.hero-left button:hover {
    background: var(--accent);
    color: var(--primary);
}

.profile-img {
    border-radius: 50%;
    border: 4px solid var(--primary);
    box-shadow: 0 6px 32px #FFD60022, 0 1.5px 0 0 #23305622;
    width: 250px;
    height: 250px;
    object-fit: cover;
    background: #fff;
    transition: box-shadow .18s, transform .14s;
}

.profile-img:hover {
    box-shadow: 0 12px 40px #FFD60066, 0 4px 0 0 #FFD60022;
    transform: scale(1.05) rotate(-2deg);
}

/* Section Titles */
h2 {
    font-family: 'Playfair Display', serif;
    font-size: 2.4rem !important;
    letter-spacing: -.01em;
    color: var(--primary);
    border-bottom: 3px solid var(--primary);
    display: inline-block;
    padding-bottom: 0.3rem;
    margin: 0 auto 1.5rem auto;
    background: none;
}

section {
    max-width: 1100px;
    margin: 0 auto;
    padding: 4rem 1.5rem 3rem 1.5rem;
}

/* About */
.about-content p {
    color: var(--gray-light);
    font-size: 1.13rem;
    line-height: 1.7;
    margin-bottom: 1.15rem;
    text-align: left;
}

/* Processo di lavoro */
.process-section .process-desc {
    color: var(--gray-medium);
    text-align: center;
    font-size: 1.07rem;
    margin-bottom: 2.2rem;
}

.process-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 1.6rem;
}

.process-card {
    background: #23272F;
    border: 1.5px solid var(--accent);
    border-radius: 18px;
    box-shadow: 0 4px 24px #23305619;
    padding: 2.3rem 1.3rem;
    text-align: center;
    transition: box-shadow 0.22s, border 0.18s, transform .16s;
}

.process-card:hover {
    border-color: var(--primary);
    box-shadow: 0 10px 28px #FFD60044;
    transform: scale(1.06) translateY(-6px);
}

.process-card i {
    font-size: 2.6rem;
    color: var(--primary);
    margin-bottom: .7rem;
    transition: color 0.13s;
}

/* Portfolio */
.portfolio-section .portfolio-desc {
    color: var(--gray-medium);
    text-align: center;
    font-size: 1.07rem;
    margin-bottom: 2.3rem;
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2.1rem;
    justify-items: center;
}

@media (max-width: 900px) {
    .portfolio-grid {
        grid-template-columns: 1fr 1fr;
        gap: 1.1rem;
    }
}

@media (max-width: 650px) {
    .portfolio-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .portfolio-card {
        max-width: 100%;
    }
}

.portfolio-card {
    background: #23272F;
    border: 1.5px solid var(--accent);
    border-radius: 19px;
    box-shadow: 0 4px 24px #23305619;
    padding: 1.2rem 0.7rem 1.1rem 0.7rem;
    max-width: 340px;
    width: 100%;
    min-width: 0;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: box-shadow 0.25s, border 0.2s, transform 0.15s;
}

.portfolio-card:hover {
    border-color: var(--primary);
    box-shadow: 0 10px 32px #FFD60044;
    transform: translateY(-6px) scale(1.04);
    z-index: 2;
}

.portfolio-header {
    display: flex;
    align-items: center;
    gap: .52rem;
    margin-bottom: .5rem;
}

.portfolio-header i {
    font-size: 1.07rem;
    color: var(--primary);
}

.portfolio-card h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.07rem;
    font-weight: 700;
    margin: 0;
    color: var(--gray-light);
    letter-spacing: -.01em;
}

.portfolio-img {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 12px #FFD60022;
    margin: 0.7rem 0 0.8rem 0;
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    transition: transform .15s, box-shadow .15s;
    max-height: 120px;
}

.portfolio-tags {
    margin-bottom: .25rem;
    display: flex;
    gap: .13rem;
    flex-wrap: wrap;
}

.portfolio-card p {
    color: var(--gray-light);
    font-size: .97rem;
    text-align: center;
    margin: 0.38rem 0 0.42rem 0;
}

.portfolio-btn {
    background: var(--primary);
    color: var(--accent);
    border-radius: 99px;
    font-weight: 700;
    font-size: .96rem;
    padding: 0.35rem 1.2rem;
    text-decoration: none;
    transition: background .16s, color .16s, transform .12s;
    box-shadow: 0 2px 10px #FFD60033;
    margin-top: .14rem;
    display: inline-block;
}

.portfolio-btn:hover,
.portfolio-btn:focus {
    background: var(--accent);
    color: var(--primary);
    transform: scale(1.07);
}

/* Tag colori coerenti */
.portfolio-tag {
    display: inline-block;
    background: var(--primary);
    color: var(--accent);
    font-size: .88rem;
    font-weight: 700;
    padding: 0.19rem 0.85rem;
    border-radius: 99px;
    box-shadow: 0 2px 8px #FFD60022;
    margin-bottom: 0.13rem;
    opacity: 1;
    letter-spacing: .03em;
    transition: background .16s, color .14s;
}

.portfolio-tag.laravel {
    background: #FFD600;
    color: #233056;
}

.portfolio-tag.vue {
    background: #233056;
    color: #FFD600;
}

.portfolio-tag.mysql {
    background: #23272F;
    color: #FFD600;
}

.portfolio-tag.java {
    background: #FFD600;
    color: #233056;
}

.portfolio-tag.sql {
    background: #23272F;
    color: #FFD600;
}

.portfolio-tag.tailwind {
    background: #F5F6FA;
    color: #233056;
}

.portfolio-tag.storage {
    background: #A1A1AA;
    color: #23272F;
}

/* --- TECNOLOGIE: GRIGLIA SEMPRE IN COLONNE, MAI FLEX --- */
.tech-section .tech-desc {
    color: var(--gray-medium);
    text-align: center;
    font-size: 1.07rem;
    margin-bottom: 2.2rem;
}

.tech-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.8rem;
}

@media (max-width: 900px) {
    .tech-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 1.3rem;
        justify-items: center;
    }
}

@media (max-width: 600px) {
    .tech-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.3rem;
    }
}

.techicon-tooltip {
    position: relative;
    display: inline-block;
    margin: .5rem .2rem;
}

.techicon-tooltip img {
    background: #23272F;
    padding: .5rem;
    border-radius: 1.1rem;
    box-shadow: 0 2px 12px #23305620;
    border: 1.5px solid #23305633;
    width: 58px;
    transition: transform 0.18s, box-shadow 0.18s;
}

.techicon-tooltip:hover img,
.techicon-tooltip:focus-within img {
    transform: scale(1.13) rotate(-5deg);
    box-shadow: 0 8px 18px #FFD60033;
}

.techicon-label {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.16s, transform 0.16s;
    position: absolute;
    left: 50%;
    bottom: -8px;
    transform: translate(-50%, 120%);
    background: #233056;
    color: #FFD600;
    padding: 0.17rem 0.8rem;
    font-size: .98rem;
    border-radius: 0.6rem;
    box-shadow: 0 2px 12px #23305644;
    white-space: nowrap;
    z-index: 10;
    font-family: 'Lato', Arial, sans-serif;
    font-weight: 700;
    letter-spacing: .02em;
}

.techicon-tooltip:hover .techicon-label,
.techicon-tooltip:focus-within .techicon-label {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, 100%);
}

@media (max-width: 700px) {
    .techicon-label {
        font-size: 0.95rem;
        bottom: auto;
        top: 102%;
        transform: translate(-50%, 0);
    }
}

/* Contatti */
.contact-section .contact-desc {
    color: var(--gray-medium);
    text-align: center;
    font-size: 1.07rem;
    margin-bottom: 1.5rem;
}

.contact-form {
    max-width: 440px;
    margin: 0 auto;
    background: #23272F;
    padding: 2.1rem 1.3rem;
    border-radius: 15px;
    box-shadow: 0 4px 24px #23305622;
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
}

.contact-form input,
.contact-form textarea {
    border: none;
    border-radius: 9px;
    padding: 0.95rem;
    font-size: 1.03rem;
    color: #233056;
    background: #F5F6FA;
    font-family: 'Lato', Arial, sans-serif;
    outline: none;
    transition: box-shadow .14s, border .13s;
    resize: none;
}

.contact-form input:focus,
.contact-form textarea:focus {
    box-shadow: 0 0 0 2.5px var(--primary);
}

.contact-form button {
    background: var(--primary);
    color: var(--accent);
    font-weight: 800;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    padding: 0.92rem 0;
    cursor: pointer;
    transition: background .16s, color .14s, box-shadow .13s;
    box-shadow: 0 2px 10px #FFD60022;
    display: flex;
    align-items: center;
    gap: .65rem;
    justify-content: center;
}

.contact-form button:hover {
    background: var(--accent);
    color: var(--primary);
}

.form-status {
    margin-top: .7rem;
    text-align: center;
    font-size: 1.1rem;
    display: none;
}

.text-green-400 {
    color: #22c55e;
}

.text-red-400 {
    color: #ef4444;
}

.animate-fade-in {
    animation: fade-in .5s;
}

@keyframes fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Footer */
footer {
    background: #161616;
    border-top: 1.5px solid #23305644;
    color: var(--gray-medium);
    padding: 2.4rem 1rem 1.3rem 1rem;
    margin-top: 2.5rem;
    text-align: center;
}

.footer-social {
    display: flex;
    gap: 1.4rem;
    justify-content: center;
    align-items: center;
    margin-bottom: .8rem;
}

.footer-social a {
    color: var(--gray-medium);
    font-size: 1.7rem;
    transition: color .15s;
}

.footer-social a:hover {
    color: var(--primary);
}

footer p {
    font-size: 1.04rem;
    margin: 0;
}

/* Responsive generale */
@media (max-width: 950px) {

    .hero-content,
    .process-grid {
        flex-direction: column;
        gap: 2rem;
    }
}

@media (max-width: 650px) {
    .hero-content {
        flex-direction: column;
        gap: 2.2rem;
        text-align: center;
    }

    .navbar {
        padding: .85rem 0;
    }

    .brand {
        font-size: 1.19rem;
    }

    .links a {
        font-size: 0.98rem;
        margin-left: 1.3rem;
    }

    section {
        padding: 3.3rem 0.5rem 2.5rem 0.5rem;
    }

    .portfolio-card,
    .process-card,
    .contact-form {
        padding: 1.3rem 0.6rem;
    }

    .portfolio-img {
        width: 100%;
    }
}

/* Accessibility - focus outline */
a:focus,
button:focus,
input:focus,
textarea:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}