/* style.css - SOS Chef: Mobile-Optimized Modern & Edgy Style */
@import url('https://fonts.googleapis.com/css2?family=Syncopate:wght@400;700&family=Work+Sans:wght@300;400;600;800&display=swap');

:root {
    --bg-dark: #0a0a0a;
    --bg-panel: #161616;
    --accent-fire: #ff4500;
    --accent-gold: #f39c12;
    --text-light: #e0e0e0;
    --text-dark: #888888;
    --white: #ffffff;

    --font-head: 'Syncopate', sans-serif;
    --font-body: 'Work Sans', sans-serif;

    --ease: cubic-bezier(0.23, 1, 0.32, 1);
    --time: 0.6s;
}

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

html, body {
    scroll-behavior: smooth;
    background-color: var(--bg-dark);
    color: var(--text-light);
    font-family: var(--font-body);
    font-size: 16px;
    /* Previene lo scorrimento orizzontale su mobile */
    overflow-x: hidden;
    width: 100%;
}
/* FIX PER TESTO TAGLIATO SU MOBILE */
h1, h2, h3, h4, p, a, span {
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
    hyphens: auto; /* Permette al browser di inserire il trattino per andare a capo */
}

html, body {
    max-width: 100vw; /* Assicura che la pagina non superi mai la larghezza dello schermo */
}

body {
    line-height: 1.7;
}

.container {
    width: 90%;
    max-width: 1300px;
    margin: auto;
    /* Su mobile riduciamo il padding laterale per recuperare spazio */
    padding: 0 15px;
}

/* Tipografia Fluida */
h1, h2, h3, h4, .btn {
    font-family: var(--font-head);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: -1px;
}
h2.section-title {
    /* Si adatta automaticamente: min 1.5rem, max 3rem */
    font-size: 20px;
    text-align: left;
    margin-bottom: 50px;
    position: relative;
    color: var(--white);
    line-height: 1.2;
}

h2.section-title::before {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 0;
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-fire), var(--accent-gold));
}

p {
    margin-bottom: 20px;
    color: var(--text-light);
    font-weight: 300;
}

em {
    color: var(--accent-gold);
    font-style: normal;
    font-weight: 600;
}

/* Header & Nav */
header {
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: var(--white);
    padding: 15px 0;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: clamp(1.2rem, 3vw, 1.5rem);
    color: var(--white);
    text-decoration: none;
    transition: color 0.3s;
}

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

header nav ul {
    list-style: none;
    display: flex;
    gap: 30px;
}

header nav ul li a {
    color: var(--text-light);
    text-decoration: none;
    font-family: var(--font-head);
    font-size: 0.8rem;
    letter-spacing: 1px;
    position: relative;
    padding: 5px 0;
    transition: color 0.3s;
}

/* Sections */
section {
    padding: 100px 0;
    position: relative;
}

.alt-bg { background-color: var(--bg-panel); }

/* Hero Sections - Ottimizzato per browser mobile (svh) */
.hero {
    min-height: 100vh;
    min-height: 100svh; /* Ignora l'interfaccia a comparsa di iOS/Android */
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background-color: var(--bg-dark);
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    position: relative;
    padding-top: 80px;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to bottom, rgba(10,10,10,0.6), rgba(10,10,10,1));
    z-index: 1;
}

.hero .container { position: relative; z-index: 2; }

.hero h2 {
    font-size: clamp(2.5rem, 8vw, 5rem);
    line-height: 1;
    margin-bottom: 20px;
    color: var(--white);
    text-shadow: 0 0 20px rgba(255,69,0,0.5);
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp var(--time) var(--ease) forwards 0.3s;
}

.hero p {
    font-size: clamp(1rem, 3vw, 1.4rem);
    max-width: 800px;
    margin: 0 auto 40px auto;
    color: var(--text-light);
    font-weight: 300;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp var(--time) var(--ease) forwards 0.6s;
}

/* Buttons - Touch Friendly */
.hero-btn-container {
    opacity: 0;
    animation: fadeIn var(--time) var(--ease) forwards 0.9s;
}

.btn {
    display: inline-block;
    padding: 16px 32px;
    background: transparent;
    color: var(--white);
    text-decoration: none;
    border: 2px solid var(--accent-fire);
    transition: all 0.3s var(--ease);
    cursor: pointer;
    font-size: 0.9rem;
    position: relative;
    overflow: hidden;
    z-index: 1;
    text-align: center;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0; left: -100%; width: 100%; height: 100%;
    background: var(--accent-fire);
    transition: all 0.4s var(--ease);
    z-index: -1;
}

.btn:hover {
    color: var(--bg-dark);
    box-shadow: 0 0 20px rgba(255,69,0,0.6);
}
.btn:hover::before { left: 0; }

/* Grids & Cards */
.grid-2, .grid-3 {
    display: grid;
    gap: 30px;
    align-items: start;
}

.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }

.card {
    background: var(--bg-panel);
    padding: 30px;
    border: 1px solid rgba(255,255,255,0.03);
    transition: transform 0.4s var(--ease);
    height: 100%;
}

.card h3 {
    color: var(--accent-gold);
    margin-bottom: 15px;
    font-size: 1.1rem;
}

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

.img-box {
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255,255,255,0.05);
}

.img-box img {
    width: 100%;
    height: auto;
    display: block;
    filter: grayscale(50%) contrast(110%);
}

/* Form - Prevenzione Zoom su iOS */
form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-width: 700px;
    margin: 0 auto;
}

input, textarea, select {
    padding: 16px;
    background-color: var(--bg-panel);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--white);
    font-family: var(--font-body);
    font-size: 16px !important; /* !important previene lo zoom su iOS Safari */
    border-radius: 0; /* Evita stili nativi iOS */
    -webkit-appearance: none;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--accent-fire);
}

/* Menu Trigger Mobile */
.menu-trigger {
    display: none;
    background: none;
    border: none;
    color: var(--white);
    font-size: 1.8rem;
    cursor: pointer;
    z-index: 1002;
}

/* Overlay per mobile menu */
.menu-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(5px);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s;
}

/* Animazioni Base */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
.animate-on-scroll.appeared { opacity: 1; transform: translateY(0); }

/* --- OTTIMIZZAZIONE MEDIA QUERIES (TABLET & MOBILE) --- */
@media(max-width: 1024px) {
    .grid-3 { grid-template-columns: 1fr 1fr; }
    /* Su tablet disabilitiamo il background-attachment: fixed per evitare glitch */
    .hero { background-attachment: scroll; }
}

@media(max-width: 768px) {
    section { padding: 70px 0; }

    .grid-2, .grid-3 { grid-template-columns: 1fr; gap: 20px; }

    /* Configurazione Menu Mobile */
    .menu-trigger { display: block; }

    header nav {
        position: fixed;
        top: 0; right: -100%;
        width: 75%; max-width: 300px;
        height: 100svh;
        background: var(--bg-panel);
        display: flex; align-items: center; justify-content: center;
        transition: right 0.4s var(--ease);
        box-shadow: -5px 0 20px rgba(0,0,0,0.8);
        z-index: 1001;
    }

    header nav.active { right: 0; }
    .menu-overlay.active { display: block; opacity: 1; }

    header nav ul { flex-direction: column; text-align: center; gap: 35px; width: 100%; }
    header nav ul li a { font-size: 1.3rem; display: block; padding: 10px; }

    .btn { display: block; width: 100%; } /* Pulsanti full width su mobile */
    .card { padding: 25px 20px; }
}
/* --- FIX ANIMAZIONI E TESTO SU HERO MOBILE --- */

/* 1. Ripristino le animazioni che rendono visibile il testo */
@keyframes fadeInUp {
    0% { opacity: 0; transform: translateY(30px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

/* 2. Ottimizzazione extra per il testo su mobile (lo fa apparire più velocemente) */
@media(max-width: 768px) {
    .hero {
        /* Centra meglio il contenuto tenendo conto dell'header */
        padding-top: 0;
    }

    .hero h2 {
        /* Riduco il ritardo così il titolo appare quasi istantaneamente */
        animation-delay: 0.1s;
    }

    .hero p {
        animation-delay: 0.3s;
    }

    .hero-btn-container {
        animation-delay: 0.5s;
    }
}

/* =========================================
   MODERN FOOTER
========================================= */
.site-footer {
    background-color: #050505; /* Sfondo leggermente più scuro del body */
    border-top: 1px solid rgba(255, 69, 0, 0.2); /* Linea superiore sottile color fuoco */
    padding: 70px 0 20px;
    color: var(--text-dark);
    font-family: var(--font-body);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 50px;
}

.footer-brand .logo {
    font-size: 1.8rem;
    display: block;
    margin-bottom: 15px;
}

.footer-tagline {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 25px;
    max-width: 320px;
    letter-spacing: 1px;
    line-height: 1.6;
}

.social-icons {
    display: flex;
    gap: 15px;
}

.social-icons a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    border-radius: 5px; /* Design squadrato moderno */
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.05);
    color: var(--white);
    text-decoration: none;
    transition: all 0.3s var(--ease);
    font-size: 1.2rem;
}

.social-icons a:hover {
    background: var(--accent-fire);
    border-color: var(--accent-fire);
    transform: translateY(-5px);
    color: #fff;
    box-shadow: 0 5px 15px rgba(255,69,0,0.3);
}

.footer-links h4, .footer-contact h4 {
    color: var(--white);
    font-family: var(--font-head);
    font-size: 1.1rem;
    margin-bottom: 25px;
    position: relative;
    text-transform: uppercase;
}

.footer-links h4::after, .footer-contact h4::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 30px;
    height: 2px;
    background: var(--accent-fire); /* Trattino di design sotto i titoli */
}

.footer-links ul {
    list-style: none;
    padding: 0;
}

.footer-links ul li {
    margin-bottom: 15px;
}

.footer-links ul li a {
    color: var(--text-dark);
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    display: inline-block;
}

.footer-links ul li a:hover {
    color: var(--accent-gold);
    transform: translateX(5px); /* Piccolo effetto di slittamento a destra al passaggio del mouse */
}

.footer-contact p {
    font-size: 0.95rem;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.footer-contact p i {
    color: var(--accent-fire);
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.05);
    padding-top: 25px;
    text-align: center;
    font-size: 0.8rem;
    color: #666;
}

/* Responsive per Tablet e Smartphone */
@media(max-width: 900px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media(max-width: 768px) {
    .site-footer {
        padding: 50px 0 20px;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 40px;
        text-align: center; /* Centra tutto su mobile */
    }

    .footer-tagline {
        margin: 0 auto 25px auto;
    }

    .social-icons {
        justify-content: center;
    }

    .footer-links h4::after, .footer-contact h4::after {
        left: 50%;
        transform: translateX(-50%); /* Centra il trattino rosso su mobile */
    }

    .footer-contact p {
        justify-content: center;
    }

    .footer-links ul li a:hover {
        transform: none; /* Disattiva lo slide su mobile per evitare glitch touch */
    }
}