/* =============================================
   BASE & VARIABILI
   ============================================= */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --primary:      #1c2b3a;
    --accent:       #b5803a;
    --accent-dark:  #8a6028;
    --light:        #faf8f5;
    --warm:         #f2ebe0;
    --text:         #2d2d2d;
    --text-muted:   #6b6b6b;
    --white:        #ffffff;
    --border:       #e8e0d5;
    --shadow:       rgba(28, 43, 58, 0.12);
    --radius:       10px;
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif;
    color: var(--text);
    line-height: 1.7;
    font-size: 16px;
    background: var(--white);
}

h1, h2, h3 {
    font-family: 'Playfair Display', Georgia, serif;
    line-height: 1.25;
}

.container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 24px;
}

.section-sub {
    color: var(--text-muted);
    font-size: 1.05rem;
    margin: 12px auto 48px;
    max-width: 560px;
    text-align: center;
}

/* =============================================
   NAVBAR
   ============================================= */
.navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 900;
    padding: 20px 0;
    transition: background 0.35s, padding 0.35s, box-shadow 0.35s;
}

.navbar.scrolled {
    background: var(--primary);
    padding: 12px 0;
    box-shadow: 0 2px 20px rgba(0,0,0,0.25);
}

.navbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    color: var(--white);
    text-decoration: none;
    font-family: 'Playfair Display', serif;
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1.2;
}

.nav-logo span {
    display: block;
    font-size: 0.7rem;
    font-family: 'Inter', sans-serif;
    font-weight: 300;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    opacity: 0.75;
}

.nav-links {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-links a {
    color: rgba(255,255,255,0.88);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 400;
    letter-spacing: 0.04em;
    transition: color 0.2s;
}

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

.nav-cta {
    background: var(--accent);
    color: var(--white) !important;
    padding: 9px 22px;
    border-radius: 50px;
    font-weight: 500 !important;
    transition: background 0.2s !important;
}

.nav-cta:hover { background: var(--accent-dark) !important; }

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--white);
    border-radius: 2px;
    transition: transform 0.3s, opacity 0.3s;
}

/* =============================================
   HERO
   ============================================= */
.hero {
    position: relative;
    height: 100vh;
    min-height: 600px;
    background: url('../img/hero.jpg') center/cover no-repeat;
    background-color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(10, 18, 28, 0.55) 0%,
        rgba(10, 18, 28, 0.45) 60%,
        rgba(10, 18, 28, 0.65) 100%
    );
}

.hero-content {
    position: relative;
    z-index: 1;
    color: var(--white);
    padding: 20px;
    max-width: 760px;
}

.hero-pretitle {
    font-size: 0.8rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    opacity: 0.8;
    margin-bottom: 20px;
    font-weight: 400;
}

.hero-content h1 {
    font-size: clamp(2.4rem, 5vw, 4rem);
    font-weight: 700;
    margin-bottom: 20px;
    text-shadow: 0 2px 12px rgba(0,0,0,0.4);
}

.hero-content h1 em {
    font-style: italic;
    color: #f0d098;
}

.hero-sub {
    font-size: clamp(1rem, 2vw, 1.2rem);
    margin-bottom: 36px;
    opacity: 0.9;
    font-weight: 300;
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
}

.hero-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-hero {
    display: inline-block;
    background: var(--accent);
    color: var(--white);
    padding: 15px 36px;
    border-radius: 50px;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    transition: background 0.25s, transform 0.25s, box-shadow 0.25s;
}

.btn-hero:hover {
    background: var(--accent-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.btn-hero-outline {
    display: inline-block;
    border: 2px solid rgba(255,255,255,0.7);
    color: var(--white);
    padding: 13px 34px;
    border-radius: 50px;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 400;
    transition: border-color 0.25s, background 0.25s;
}

.btn-hero-outline:hover {
    border-color: var(--white);
    background: rgba(255,255,255,0.1);
}

.hero-scroll {
    position: absolute;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    animation: bounce 2s infinite;
    z-index: 1;
}

@keyframes bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50%       { transform: translateX(-50%) translateY(8px); }
}

/* =============================================
   PROOF BAR
   ============================================= */
.proof-bar {
    background: var(--primary);
    padding: 24px 0;
    border-top: 1px solid rgba(255,255,255,0.06);
}

.proof-bar-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    flex-wrap: wrap;
}

.proof-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 40px;
}

.proof-number {
    font-family: 'Playfair Display', serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--accent);
    line-height: 1.1;
}

.proof-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255,255,255,0.55);
    margin-top: 4px;
}

.proof-divider {
    width: 1px;
    height: 40px;
    background: rgba(255,255,255,0.12);
}

/* =============================================
   COME FUNZIONA
   ============================================= */
.come-funziona {
    padding: 96px 0;
    background: var(--warm);
    text-align: center;
}

.come-funziona h2 {
    font-size: clamp(1.8rem, 3vw, 2.4rem);
    color: var(--primary);
    margin-bottom: 0;
}

.come-funziona .section-sub {
    margin: 12px auto 56px;
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    position: relative;
}

.steps-grid::before {
    content: '';
    position: absolute;
    top: 28px;
    left: calc(16.66% + 20px);
    right: calc(16.66% + 20px);
    height: 1px;
    background: var(--border);
}

.step {
    position: relative;
    padding: 0 16px;
    text-align: center;
}

.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--accent);
    font-family: 'Playfair Display', serif;
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 24px;
    position: relative;
    z-index: 1;
}

.step h3 {
    font-size: 1.2rem;
    color: var(--primary);
    margin-bottom: 12px;
}

.step p {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.7;
}

/* =============================================
   PORTFOLIO
   ============================================= */
.portfolio {
    padding: 96px 0;
    background: var(--primary);
    text-align: center;
}

.portfolio h2 {
    font-size: clamp(1.8rem, 3vw, 2.4rem);
    color: var(--white);
}

.portfolio .section-sub {
    color: rgba(255,255,255,0.6);
    margin: 12px auto 48px;
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.portfolio-item {
    position: relative;
    overflow: hidden;
    border-radius: 6px;
    cursor: pointer;
    aspect-ratio: 1 / 1;
    background: rgba(255,255,255,0.05);
}

/* Varietà visiva nella griglia: celle di dimensioni diverse */
.portfolio-item:nth-child(1)  { grid-column: span 2; grid-row: span 2; }
.portfolio-item:nth-child(7)  { grid-column: span 2; }
.portfolio-item:nth-child(11) { grid-column: span 2; }

.portfolio-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.portfolio-item:hover img { transform: scale(1.06); }

.portfolio-overlay {
    position: absolute;
    inset: 0;
    background: rgba(28, 43, 58, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.portfolio-overlay span {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid var(--white);
    color: var(--white);
    font-size: 1.6rem;
    line-height: 40px;
    text-align: center;
}

.portfolio-item:hover .portfolio-overlay { opacity: 1; }

.portfolio-cta {
    margin-top: 48px;
}

.btn-outline {
    display: inline-block;
    border: 2px solid rgba(255,255,255,0.5);
    color: var(--white);
    padding: 13px 36px;
    border-radius: 50px;
    text-decoration: none;
    font-size: 0.95rem;
    transition: border-color 0.25s, background 0.25s;
}

.btn-outline:hover {
    border-color: var(--white);
    background: rgba(255,255,255,0.08);
}

/* =============================================
   LIGHTBOX
   ============================================= */
.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.94);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.lightbox.active { display: flex; }

.lightbox img {
    max-width: 90vw;
    max-height: 88vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 24px 64px rgba(0,0,0,0.6);
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: absolute;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: var(--white);
    cursor: pointer;
    font-size: 1.4rem;
    line-height: 1;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(255,255,255,0.2);
}

.lightbox-close { top: 20px; right: 20px; font-size: 1.6rem; }
.lightbox-prev  { left: 20px; top: 50%; transform: translateY(-50%); }
.lightbox-next  { right: 20px; top: 50%; transform: translateY(-50%); }

/* =============================================
   SERVIZI
   ============================================= */
.servizi {
    padding: 96px 0;
    background: var(--light);
    text-align: center;
}

.servizi h2 {
    font-size: clamp(1.8rem, 3vw, 2.4rem);
    color: var(--primary);
}

.servizi .section-sub {
    margin: 12px auto 52px;
}

.servizi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 24px;
}

.servizio-card {
    background: var(--white);
    padding: 36px 24px;
    border-radius: var(--radius);
    box-shadow: 0 4px 20px var(--shadow);
    text-align: left;
    border-top: 3px solid var(--accent);
    transition: transform 0.3s, box-shadow 0.3s;
}

.servizio-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 32px var(--shadow);
}

.servizio-icon {
    font-size: 2rem;
    margin-bottom: 16px;
    display: block;
}

.servizio-card h3 {
    font-size: 1.15rem;
    margin-bottom: 12px;
    color: var(--primary);
}

.servizio-card p {
    font-size: 0.92rem;
    color: var(--text-muted);
    line-height: 1.7;
}

/* =============================================
   TESTIMONIALS
   ============================================= */
.testimonials {
    padding: 96px 0;
    background: var(--warm);
    text-align: center;
}

.testimonials h2 {
    font-size: clamp(1.8rem, 3vw, 2.4rem);
    color: var(--primary);
    margin-bottom: 48px;
}

.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
}

.testimonial-card {
    background: var(--white);
    padding: 36px 28px;
    border-radius: var(--radius);
    box-shadow: 0 4px 16px var(--shadow);
    text-align: left;
    display: flex;
    flex-direction: column;
}

.testimonial-stars {
    color: var(--accent);
    font-size: 1rem;
    letter-spacing: 2px;
    margin-bottom: 16px;
}

.testimonial-text {
    font-size: 0.95rem;
    color: var(--text);
    line-height: 1.75;
    font-style: italic;
    flex: 1;
    margin-bottom: 24px;
}

.testimonial-text::before { content: '\201C'; }
.testimonial-text::after  { content: '\201D'; }

.testimonial-author {
    display: flex;
    flex-direction: column;
    border-top: 1px solid var(--border);
    padding-top: 16px;
}

.testimonial-author strong {
    font-size: 0.9rem;
    color: var(--primary);
    font-style: normal;
}

.testimonial-author span {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* =============================================
   CHI SONO
   ============================================= */
.about {
    padding: 96px 0;
    background: var(--white);
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 72px;
    align-items: center;
}

.about-grid.about-solo {
    grid-template-columns: 1fr;
    max-width: 680px;
    margin: 0 auto;
}

.about-label {
    display: inline-block;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--accent);
    font-weight: 500;
    margin-bottom: 12px;
}

.about-text h2 {
    font-size: clamp(1.6rem, 2.5vw, 2.2rem);
    color: var(--primary);
    margin-bottom: 24px;
}

.about-text p {
    color: var(--text-muted);
    line-height: 1.8;
    margin-bottom: 32px;
}

.btn-primary {
    display: inline-block;
    background: var(--primary);
    color: var(--white);
    padding: 14px 32px;
    border-radius: 50px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 0.25s, transform 0.25s;
}

.btn-primary:hover {
    background: var(--accent);
    transform: translateY(-2px);
}

.about-img img {
    width: 100%;
    border-radius: var(--radius);
    box-shadow: 0 16px 48px var(--shadow);
    display: block;
}

/* =============================================
   CTA BANNER
   ============================================= */
.cta-banner {
    position: relative;
    padding: 96px 0;
    background: var(--accent) url('../img/hero.jpg') center/cover no-repeat;
    text-align: center;
}

.cta-banner-overlay {
    position: absolute;
    inset: 0;
    background: rgba(28, 43, 58, 0.75);
}

.cta-banner-content {
    position: relative;
    z-index: 1;
    color: var(--white);
}

.cta-banner h2 {
    font-size: clamp(1.8rem, 3vw, 2.8rem);
    margin-bottom: 16px;
    color: var(--white);
}

.cta-banner p {
    font-size: 1.1rem;
    opacity: 0.85;
    margin-bottom: 36px;
}

/* =============================================
   CONTATTI
   ============================================= */
.contatti {
    padding: 96px 0;
    background: var(--light);
    text-align: center;
}

.contatti h2 {
    font-size: clamp(1.8rem, 3vw, 2.4rem);
    color: var(--primary);
}

.contatti .section-sub {
    margin: 12px auto 48px;
    text-align: center;
}

.contact-form {
    max-width: 640px;
    margin: 0 auto;
    text-align: left;
}

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

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 20px;
}

.form-row .form-group { margin-bottom: 0; }

.form-group label {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--primary);
    letter-spacing: 0.03em;
}

.contact-form input,
.contact-form select,
.contact-form textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--text);
    background: var(--white);
    transition: border-color 0.2s, box-shadow 0.2s;
    appearance: none;
}

.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(181,128,58,0.12);
}

.contact-form textarea { resize: vertical; }

.btn-submit {
    width: 100%;
    padding: 15px;
    background: var(--accent);
    color: var(--white);
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    letter-spacing: 0.04em;
    transition: background 0.25s, transform 0.25s;
    font-family: inherit;
}

.btn-submit:hover {
    background: var(--accent-dark);
    transform: translateY(-1px);
}

.alert-success {
    background: #eaf6ee;
    color: #1a6633;
    border: 1px solid #b3dfc2;
    padding: 14px 20px;
    border-radius: 8px;
    margin-bottom: 24px;
    font-weight: 500;
}

.alert-error {
    background: #fdf0f0;
    color: #9b2c2c;
    border: 1px solid #f5c6c6;
    padding: 14px 20px;
    border-radius: 8px;
    margin-bottom: 24px;
}

/* =============================================
   FOOTER
   ============================================= */
footer {
    background: var(--primary);
    color: rgba(255,255,255,0.7);
    padding: 48px 0 28px;
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 24px;
    padding-bottom: 32px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    margin-bottom: 24px;
}

.footer-brand {
    display: flex;
    flex-direction: column;
}

.footer-brand strong {
    font-family: 'Playfair Display', serif;
    font-size: 1.1rem;
    color: var(--white);
    font-weight: 700;
}

.footer-brand span {
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    opacity: 0.55;
    margin-top: 2px;
}

.footer-nav {
    display: flex;
    gap: 28px;
    flex-wrap: wrap;
}

.footer-nav a {
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    font-size: 0.88rem;
    transition: color 0.2s;
}

.footer-nav a:hover { color: var(--white); }

.footer-social a {
    color: var(--accent);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
    transition: color 0.2s;
}

.footer-social a:hover { color: #d4a055; }

.footer-copy {
    text-align: center;
    font-size: 0.78rem;
    opacity: 0.4;
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 900px) {
    .portfolio-grid { grid-template-columns: repeat(3, 1fr); }
    .portfolio-item:nth-child(1)  { grid-column: span 2; grid-row: span 1; }
    .portfolio-item:nth-child(7)  { grid-column: span 1; }
    .portfolio-item:nth-child(11) { grid-column: span 1; }
    .testimonials-grid { grid-template-columns: 1fr 1fr; }
    .steps-grid { gap: 24px; }
    .steps-grid::before { display: none; }
}

/* Hero mobile: testo sovrapposto in basso sulla foto, navbar libera */
@media (max-width: 768px) {
    .hero {
        height: auto;
        min-height: calc(64px + 56.25vw + 40px);
        background-size: 100% auto;
        background-position: top 64px center;
        background-repeat: no-repeat;
        background-color: #0d1c2a;
        display: flex;
        flex-direction: column;
        justify-content: flex-end;
        padding-top: 64px;
        padding-bottom: 0px;
    }

    .hero-overlay {
        background: linear-gradient(to bottom,
            rgba(13,28,42,0) 30%,
            rgba(13,28,42,0.65) 65%,
            rgba(13,28,42,0.95) 100%
        );
    }

    .hero-content {
        position: relative;
        z-index: 1;
        padding: 0 24px;
        text-align: center;
    }

    .hero-pretitle {
        margin-bottom: 14px;
    }

    .hero-content h1 {
        font-size: 2rem;
        line-height: 1.2;
        margin-bottom: 16px;
    }

    .hero-sub {
        margin-bottom: 28px;
    }

    .hero-actions {
        flex-direction: column;
        align-items: center;
        gap: 12px;
        margin-bottom: 20px;
    }

    .hero-scroll { display: none; }
}

@media (max-width: 768px) {
    .nav-toggle { display: flex; }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0; right: 0;
        background: var(--primary);
        flex-direction: column;
        padding: 16px 24px 24px;
        gap: 0;
        border-top: 1px solid rgba(255,255,255,0.08);
    }

    .nav-links.open { display: flex; }

    .nav-links li { width: 100%; }

    .nav-links a {
        display: block;
        padding: 12px 0;
        border-bottom: 1px solid rgba(255,255,255,0.06);
        font-size: 1rem;
    }

    .nav-links li:last-child a { border-bottom: none; }

    .nav-cta {
        margin-top: 8px;
        text-align: center;
        border-radius: 8px !important;
    }

    .hero-content h1 { font-size: 2.2rem; }
    .hero-actions { flex-direction: column; align-items: center; }

    .proof-bar-inner { gap: 0; }
    .proof-item { padding: 8px 20px; }
    .proof-divider { height: 30px; }

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

    .portfolio-grid { grid-template-columns: repeat(2, 1fr); }
    .portfolio-item:nth-child(1) { grid-column: span 2; }
    .portfolio-item:nth-child(7) { grid-column: span 2; }

    .about-grid { grid-template-columns: 1fr; gap: 40px; }

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

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

    .footer-inner { flex-direction: column; align-items: flex-start; }

    .lightbox-prev { left: 8px; }
    .lightbox-next { right: 8px; }
}

@media (max-width: 480px) {
    .proof-bar-inner { flex-wrap: wrap; justify-content: center; }
    .proof-divider { display: none; }
    .proof-item { padding: 10px 24px; }
    .portfolio-grid { grid-template-columns: 1fr 1fr; }
    .portfolio-item:nth-child(1) { grid-column: span 2; }
    .portfolio-item:nth-child(7) { grid-column: span 2; }
}
