/* ====================================
   Homepage 2.0 - Stile Tecnico-Artistico
   ==================================== */

:root {
    --primary-gradient: linear-gradient(135deg, #1e3a5f 0%, #2d5a87 50%, #3a7ca5 100%);
    --accent-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --tech-blue: #2d5a87;
    --tech-dark: #0f172a;
    --tech-light: #e2e8f0;
    --blueprint-pattern: repeating-linear-gradient(0deg,
            transparent,
            transparent 40px,
            rgba(45, 90, 135, 0.03) 40px,
            rgba(45, 90, 135, 0.03) 41px),
        repeating-linear-gradient(90deg,
            transparent,
            transparent 40px,
            rgba(45, 90, 135, 0.03) 40px,
            rgba(45, 90, 135, 0.03) 41px);
}

.hero-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 10px 24px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.25);
    letter-spacing: 0.5px;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', monospace;
}

/* Media Placeholder - Stile Blueprint */
.media-placeholder {
    background:
        var(--blueprint-pattern),
        linear-gradient(135deg, #e8f4fc 0%, #d1e8f5 100%);
    border: 2px solid var(--tech-blue);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    color: var(--tech-blue);
    font-weight: 500;
    text-align: center;
    padding: 40px;
    position: relative;
    overflow: hidden;
}

.media-placeholder::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    bottom: 10px;
    border: 1px dashed rgba(45, 90, 135, 0.3);
    border-radius: 8px;
    pointer-events: none;
}

.media-placeholder::after {
    content: '⊕';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 8rem;
    opacity: 0.05;
    color: var(--tech-blue);
}

.media-placeholder i {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    opacity: 0.8;
    position: relative;
    z-index: 1;
}

.media-placeholder .placeholder-text {
    font-size: 1rem;
    max-width: 280px;
    font-weight: 600;
    position: relative;
    z-index: 1;
}

.media-placeholder .placeholder-specs {
    font-size: 0.75rem;
    opacity: 0.7;
    margin-top: 0.5rem;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', monospace;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    position: relative;
    z-index: 1;
}

/* Split Sections - Layout Tecnico */
.split-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    align-items: center;
}

.split-section.reverse {
    direction: rtl;
}

.split-section.reverse>* {
    direction: ltr;
}

.split-content h2 {
    font-size: 2.8rem;
    margin-bottom: 1.5rem;
    color: var(--tech-dark);
    font-weight: 700;
    line-height: 1.2;
}

.split-content p {
    font-size: 1.1rem;
    color: #4b5563;
    line-height: 1.9;
    margin-bottom: 1.5rem;
}

/* Feature List - Stile Tecnico */
.feature-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.feature-list li {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 0;
    font-size: 1rem;
    color: #374151;
    border-bottom: 1px solid rgba(45, 90, 135, 0.1);
}

.feature-list li:last-child {
    border-bottom: none;
}

.feature-list li i {
    color: var(--tech-blue);
    font-size: 1.4rem;
}

/* Target Cards - Glassmorphism */
.target-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
}

.target-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 35px 28px;
    text-align: center;
    box-shadow:
        0 4px 24px rgba(0, 0, 0, 0.06),
        0 1px 2px rgba(0, 0, 0, 0.04);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(45, 90, 135, 0.08);
    position: relative;
    overflow: hidden;
}

.target-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent-gradient);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.target-card:hover {
    transform: translateY(-8px);
    box-shadow:
        0 20px 50px rgba(0, 0, 0, 0.12),
        0 8px 20px rgba(0, 0, 0, 0.08);
}

.target-card:hover::before {
    opacity: 1;
}

.target-card .icon {
    font-size: 3rem;
    margin-bottom: 1.2rem;
    display: block;
}

.target-card h3 {
    font-size: 1.2rem;
    margin-bottom: 0.8rem;
    color: var(--tech-dark);
    font-weight: 600;
}

.target-card p {
    color: #6b7280;
    font-size: 0.9rem;
    line-height: 1.7;
}

/* Gallery con stile tecnico */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-top: 40px;
}

.gallery-item {
    border-radius: 10px;
    overflow: hidden;
    aspect-ratio: 4/3;
    border: 1px solid rgba(45, 90, 135, 0.1);
}

.gallery-item img {
    transition: transform 0.35s ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

/* ---- Tour 360 Section ---- */
.tour360-features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-top: 50px;
}

.tour360-features p {
    color: rgba(255, 255, 255, 0.7);
}

/* ---- Materials Section ---- */
.materials-footer {
    text-align: center;
    margin-top: 40px;
}

.materials-footer p {
    color: #6b7280;
    margin-bottom: 20px;
}

/* ---- Target Section ---- */
.target-section {
    padding: 100px 0;
    background: linear-gradient(180deg, #fafbfc 0%, #ffffff 100%);
}

.target-card-home {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
}

.target-card-hobby {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
}

.target-card-student {
    background: linear-gradient(135deg, #f3e8ff 0%, #e9d5ff 100%);
}

/* ---- Final CTA Box ---- */
.final-cta-box {
    text-align: center;
    margin-top: 60px;
    padding: 50px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 24px;
}

.final-cta-box h3 {
    color: white;
    font-size: 1.8rem;
    margin-bottom: 15px;
}

.final-cta-box p {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 30px;
    font-size: 1.1rem;
}

.final-cta-box .btn-primary-light {
    background: white;
    color: #667eea;
    font-weight: 600;
    padding: 15px 40px;
}

.final-cta-box .btn-outline-light {
    border-color: white;
    color: white;
    margin-left: 15px;
}

/* Materials Showcase */
.materials-showcase {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
    margin-top: 40px;
}

.material-item {
    aspect-ratio: 1;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(45, 90, 135, 0.1);
    transition: transform 0.3s ease;
}

.material-item:hover {
    transform: scale(1.05);
}

/* Responsive */
@media (max-width: 1024px) {
    .split-section {
        grid-template-columns: 1fr;
        gap: 50px;
    }

    .split-section.reverse {
        direction: ltr;
    }

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

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

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

    .tour360-features {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .target-grid {
        grid-template-columns: 1fr;
    }

    .split-content h2 {
        font-size: 2rem;
    }

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

    .final-cta-box .btn-outline-light {
        margin-left: 0;
        margin-top: 10px;
    }
}

/* Feature card AI highlight (nella griglia features) */
.feature-card-ai-highlight {
    background: linear-gradient(160deg, #0d1117 0%, #111827 100%) !important;
    border: 1px solid rgba(102, 126, 234, 0.35) !important;
    position: relative;
}

/* Barra superiore colorata con gradiente AI invece del blu primario */
.feature-card-ai-highlight::before {
    background: linear-gradient(90deg, #667eea, #764ba2) !important;
}

/* Override: hover border rimane viola, non blu */
.feature-card-ai-highlight:hover {
    border-color: rgba(167, 139, 250, 0.6) !important;
    box-shadow: 0 20px 40px rgba(102, 126, 234, 0.25) !important;
}

/* Icona con gradiente AI */
.feature-card-ai-highlight .card-icon-modern {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.45);
}

/* Titolo: bianco su sfondo dark, allineato a sinistra */
.feature-card-ai-highlight .card-body h4 {
    color: #e2d9f3 !important;
    text-align: left;
}

/* Testo body: bianco semitrasparente su sfondo dark, sinistra */
.feature-card-ai-highlight .card-body p {
    color: rgba(255, 255, 255, 0.62) !important;
    text-align: left;
}

/* Footer: sfondo slightly lighter sul dark */
.feature-card-ai-highlight .card-footer {
    background: rgba(255, 255, 255, 0.04) !important;
    border-top-color: rgba(255, 255, 255, 0.08) !important;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

/* Testo stat nel footer */
.feature-card-ai-highlight .card-footer .stat,
.feature-card-ai-highlight .card-footer small {
    color: rgba(255, 255, 255, 0.5) !important;
}

/* Badge AI */
.card-badge-ai {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white !important;
    font-size: 0.7rem !important;
    border: none !important;
}

/* Link "Scopri come" */
.feature-card-ai-link {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 600;
    color: #a78bfa;
    text-decoration: none;
    letter-spacing: 0.3px;
    transition: color 0.2s, letter-spacing 0.2s;
}

.feature-card-ai-link:hover {
    color: #c4b5fd;
    letter-spacing: 0.6px;
}

/* ====================================
   SEZIONE AI RENDERING — FLAGSHIP
   ==================================== */

.ai-render-section {
    position: relative;
    padding: 120px 0;
    background: linear-gradient(160deg, #060b18 0%, #0d1730 40%, #111827 70%, #0a0f1e 100%);
    overflow: hidden;
    color: white;
}

/* Hero Iframe Styles */
.hero-iframe-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
}

#hero-iframe {
    width: 100%;
    height: 100%;
    border: none;
    pointer-events: auto;
}

#hero::before {
    z-index: 1; /* Ensure overlay is above iframe but below content */
}

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

/* Glow di sfondo */
.ai-bg-glow {
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    filter: blur(120px);
    pointer-events: none;
    z-index: 0;
}

.ai-glow-left {
    background: radial-gradient(circle, rgba(102, 126, 234, 0.18) 0%, transparent 70%);
    top: -100px;
    left: -200px;
}

.ai-glow-right {
    background: radial-gradient(circle, rgba(118, 75, 162, 0.15) 0%, transparent 70%);
    bottom: -100px;
    right: -200px;
}

.ai-render-section .container {
    position: relative;
    z-index: 1;
}

/* Header */
.ai-render-header {
    text-align: center;
    margin-bottom: 80px;
}

.ai-badge-premium {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
    border: 1px solid rgba(102, 126, 234, 0.4);
    color: #a78bfa;
    padding: 8px 22px;
    border-radius: 50px;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 24px;
}

.ai-badge-premium .material-icons {
    font-size: 16px;
    color: #c4b5fd;
}

.ai-render-title {
    font-size: clamp(2rem, 4vw, 3.2rem);
    font-weight: 700;
    color: #ffffff;
    line-height: 1.2;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #ffffff 0%, #c4b5fd 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.ai-render-subtitle {
    font-size: 1.15rem;
    color: rgba(255, 255, 255, 0.65);
    max-width: 640px;
    margin: 0 auto;
    line-height: 1.7;
}

/* Formula ricetta */
.ai-recipe-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 90px;
    flex-wrap: wrap;
}

.ai-recipe-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 32px 28px;
    text-align: center;
    width: 160px;
    flex-shrink: 0;
    backdrop-filter: blur(10px);
    transition: all 0.35s ease;
}

.ai-recipe-card:hover {
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(167, 139, 250, 0.4);
    transform: translateY(-6px);
    box-shadow: 0 20px 40px rgba(102, 126, 234, 0.15);
}

.recipe-emoji {
    font-size: 2.4rem;
    margin-bottom: 10px;
    line-height: 1;
}

.recipe-big-num {
    font-size: 3rem;
    font-weight: 800;
    color: #c4b5fd;
    line-height: 1;
    margin-bottom: 6px;
}

.recipe-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.recipe-desc {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.4;
}

.ai-recipe-plus {
    font-size: 2.5rem;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.3);
    flex-shrink: 0;
    padding: 0 4px;
}

/* Segno uguale con badge IA */
.ai-recipe-equals {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    padding: 0 8px;
}

.ai-equals-line {
    width: 2px;
    height: 28px;
    background: linear-gradient(to bottom, transparent, rgba(167, 139, 250, 0.6), transparent);
}

.ai-equals-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 14px;
    padding: 10px 16px;
    box-shadow: 0 0 30px rgba(102, 126, 234, 0.5);
}

.ai-equals-badge .material-icons {
    font-size: 20px;
    color: white;
}

.ai-equals-badge span:last-child {
    font-size: 0.7rem;
    font-weight: 700;
    color: white;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* Card risultato (WOW) */
.ai-recipe-result-card {
    border-color: rgba(167, 139, 250, 0.35);
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.12) 0%, rgba(118, 75, 162, 0.12) 100%);
    box-shadow: 0 0 40px rgba(102, 126, 234, 0.12), inset 0 0 20px rgba(167, 139, 250, 0.05);
}

.result-ai-num {
    font-size: 2.2rem;
    background: linear-gradient(135deg, #a78bfa 0%, #f0abfc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Keypoints */
.ai-keypoints {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-top: 60px;
    margin-bottom: 70px;
}

.ai-keypoint {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 22px 18px;
    transition: all 0.3s ease;
}

.ai-keypoint:hover {
    background: rgba(102, 126, 234, 0.08);
    border-color: rgba(167, 139, 250, 0.25);
}

.ai-keypoint > .material-icons {
    font-size: 26px;
    color: #a78bfa;
    flex-shrink: 0;
    margin-top: 2px;
}

.ai-keypoint strong {
    display: block;
    font-size: 0.9rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 5px;
}

.ai-keypoint p {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.5;
    margin: 0;
}

/* CTA */
.ai-render-cta {
    text-align: center;
    margin-top: 30px;
}

.ai-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white !important;
    padding: 18px 48px;
    border-radius: 14px;
    font-size: 1.05rem;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 8px 32px rgba(102, 126, 234, 0.45);
    transition: all 0.3s ease;
    letter-spacing: 0.3px;
}

.ai-cta-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 45px rgba(102, 126, 234, 0.6);
    color: white !important;
}

.ai-cta-btn .material-icons {
    font-size: 20px;
}

.ai-cta-note {
    margin-top: 14px;
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.4);
}

/* ---- Responsive AI Section ---- */
@media (max-width: 1100px) {
    .ai-keypoints {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 800px) {
    .ai-render-section {
        padding: 80px 0;
    }

    .ai-recipe-container {
        flex-direction: column;
        gap: 12px;
    }

    .ai-recipe-plus,
    .ai-recipe-equals {
        transform: rotate(90deg);
    }

    .ai-recipe-card {
        width: 100%;
        max-width: 300px;
    }

    .ai-slider-container {
        aspect-ratio: 4 / 3;
    }

    .ai-keypoints {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .ai-render-title {
        font-size: 1.85rem;
    }
}

/* ====================================
   STATS BAR — Animated counters
   ==================================== */
.stats-bar-section {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 60%, #2d5a87 100%);
    padding: 48px 0;
    position: relative;
    overflow: hidden;
}

.stats-bar-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        90deg,
        transparent,
        transparent 80px,
        rgba(255,255,255,0.02) 80px,
        rgba(255,255,255,0.02) 81px
    );
    pointer-events: none;
}

.stats-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    position: relative;
    z-index: 1;
}

.stats-bar-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 16px 24px;
    border-right: 1px solid rgba(255,255,255,0.08);
    transition: transform 0.3s ease;
}

.stats-bar-item:last-child {
    border-right: none;
}

.stats-bar-item:hover {
    transform: translateY(-4px);
}

.stats-num {
    font-size: 3rem;
    font-weight: 700;
    font-family: 'Poppins', sans-serif;
    color: #ffffff;
    line-height: 1;
    letter-spacing: -1px;
    background: linear-gradient(135deg, #ffffff 0%, #a78bfa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stats-label {
    font-size: 0.78rem;
    color: rgba(255,255,255,0.55);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 500;
}

@media (max-width: 768px) {
    .stats-bar {
        grid-template-columns: repeat(2, 1fr);
    }
    .stats-bar-item {
        border-right: 1px solid rgba(255,255,255,0.08);
        border-bottom: 1px solid rgba(255,255,255,0.08);
        padding: 20px 16px;
    }
    .stats-bar-item:nth-child(2n) {
        border-right: none;
    }
    .stats-num {
        font-size: 2.2rem;
    }
}

/* ====================================
   MATERIAL SWATCHES
   ==================================== */
.material-swatch {
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    aspect-ratio: 1;
    cursor: default;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transition: transform 0.35s cubic-bezier(0.4,0,0.2,1), box-shadow 0.35s ease;
    border: 1px solid rgba(0,0,0,0.06) !important;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-end;
    padding: 16px;
}

.material-swatch:hover {
    transform: scale(1.06) translateY(-4px);
    box-shadow: 0 16px 40px rgba(0,0,0,0.18);
}

.material-swatch-shine {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.25) 0%, transparent 55%);
    pointer-events: none;
    z-index: 1;
}

.material-info {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.material-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 6px rgba(0,0,0,0.5);
    letter-spacing: 0.3px;
}

.material-sub {
    font-size: 0.68rem;
    color: rgba(255,255,255,0.75);
    text-shadow: 0 1px 4px rgba(0,0,0,0.5);
    letter-spacing: 0.5px;
}

/* Individual material gradients */
.material-legno {
    background:
        repeating-linear-gradient(
            12deg,
            rgba(0,0,0,0.04) 0px,
            rgba(0,0,0,0.04) 2px,
            transparent 2px,
            transparent 14px
        ),
        linear-gradient(170deg, #a0714f 0%, #7a4f2e 30%, #c49a6c 60%, #8b5e3c 100%);
}

.material-marmo {
    background:
        repeating-linear-gradient(
            -30deg,
            rgba(140,130,120,0.12) 0px,
            rgba(140,130,120,0.12) 1px,
            transparent 1px,
            transparent 22px
        ),
        linear-gradient(145deg, #f5f0ea 0%, #e8ddd0 30%, #f0ebe3 55%, #d6cbbf 100%);
}

.material-marmo .material-name,
.material-marmo .material-sub {
    color: #4a3f35;
    text-shadow: 0 1px 2px rgba(255,255,255,0.6);
}

.material-metallo {
    background: linear-gradient(
        135deg,
        #b8c4cc 0%,
        #d8e0e6 20%,
        #8e9eaa 40%,
        #c8d4dc 60%,
        #a0aeba 80%,
        #d0dce4 100%
    );
}

.material-metallo .material-name,
.material-metallo .material-sub {
    color: #2c3e50;
    text-shadow: 0 1px 2px rgba(255,255,255,0.4);
}

.material-tessuto {
    background:
        repeating-linear-gradient(
            0deg,
            rgba(255,255,255,0.04) 0px,
            rgba(255,255,255,0.04) 1px,
            transparent 1px,
            transparent 4px
        ),
        repeating-linear-gradient(
            90deg,
            rgba(255,255,255,0.04) 0px,
            rgba(255,255,255,0.04) 1px,
            transparent 1px,
            transparent 4px
        ),
        linear-gradient(135deg, #6b7aad 0%, #4a5899 50%, #8b96c8 100%);
}

.material-vetro {
    background: linear-gradient(
        135deg,
        rgba(180,220,255,0.9) 0%,
        rgba(140,200,255,0.7) 30%,
        rgba(200,235,255,0.85) 60%,
        rgba(160,215,250,0.8) 100%
    );
    backdrop-filter: blur(2px);
}

.material-vetro .material-name,
.material-vetro .material-sub {
    color: #1a3a5c;
    text-shadow: 0 1px 3px rgba(255,255,255,0.5);
}

.material-pietra {
    background:
        repeating-linear-gradient(
            60deg,
            rgba(255,255,255,0.03) 0px,
            rgba(255,255,255,0.03) 1px,
            transparent 1px,
            transparent 18px
        ),
        linear-gradient(160deg, #5a5f65 0%, #3e4349 40%, #6e7480 70%, #454a52 100%);
}

/* ====================================
   SCROLL REVEAL
   ==================================== */
[data-reveal] {
    opacity: 0;
    transform: translateY(36px);
    transition: opacity 0.65s cubic-bezier(0.4,0,0.2,1),
                transform 0.65s cubic-bezier(0.4,0,0.2,1);
}

[data-reveal].revealed {
    opacity: 1;
    transform: translateY(0);
}

[data-reveal="fade-up-slow"] {
    transition-duration: 0.9s;
}

[data-reveal="fade-left"] {
    transform: translateX(-40px);
}

[data-reveal="fade-left"].revealed {
    transform: translateX(0);
}

[data-reveal="fade-right"] {
    transform: translateX(40px);
}

[data-reveal="fade-right"].revealed {
    transform: translateX(0);
}

[data-reveal][data-reveal-delay="100"] { transition-delay: 0.1s; }
[data-reveal][data-reveal-delay="200"] { transition-delay: 0.2s; }
[data-reveal][data-reveal-delay="300"] { transition-delay: 0.3s; }
[data-reveal][data-reveal-delay="400"] { transition-delay: 0.4s; }
[data-reveal][data-reveal-delay="500"] { transition-delay: 0.5s; }
[data-reveal][data-reveal-delay="600"] { transition-delay: 0.6s; }

/* --- NEW INTERACTIVITY STYLES --- */

/* REVEAL ON SCROLL UNIFICATION */
[data-reveal].active {
    opacity: 1;
    transform: translate(0, 0) !important;
}

/* STATS BAR ENHANCEMENTS */
.stats-num {
    font-variant-numeric: tabular-nums;
    font-weight: 800;
}

/* AI SHOWCASE SLIDER REPLACEMENT */
.ai-showcase-container {
    max-width: 1000px;
    margin: 60px auto 60px;
    padding: 0 20px;
}

.ai-slider-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    background: #f1f5f9;
}

.before-image-wrap,
.after-image-wrap {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.before-image-wrap img,
.after-image-wrap img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.after-image-wrap {
    z-index: 2;
    overflow: hidden;
    clip-path: inset(0 50% 0 0); /* Reveals LEFT 50% of After image, shows Before image on RIGHT */
}

/* Labels */
.slider-label {
    position: absolute;
    bottom: 20px;
    padding: 6px 12px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 6px;
    pointer-events: none;
    z-index: 3;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.label-before { left: 20px; }
.label-after { right: 20px; }

/* Handle */
.slider-handle {
    position: absolute;
    top: 0;
    left: 50%;
    width: 2px;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    z-index: 4;
    cursor: ew-resize;
    transform: translateX(-50%);
    box-shadow: 0 0 10px rgba(0,0,0,0.3);
}

/* Invisible wider hit area for the handle */
.slider-handle::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    width: 40px;
    height: 100%;
    transform: translateX(-50%);
    background: transparent;
    z-index: -1;
}

.slider-handle::after {
    content: "↔";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    background: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 18px;
    color: #667eea;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* ====================================
   AI Gallery — Prima → Dopo (no slider)
   ==================================== */

.ai-gallery-section {
    padding: 100px 0 80px;
    background: linear-gradient(180deg, #0a0f1a 0%, #111827 50%, #0f172a 100%);
    position: relative;
    overflow: hidden;
}

.ai-gallery-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 600px 400px at 20% 30%, rgba(102, 126, 234, .08), transparent),
        radial-gradient(ellipse 500px 350px at 80% 70%, rgba(118, 75, 162, .06), transparent);
    pointer-events: none;
}

.ai-gallery-header {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 60px;
}

.ai-gallery-header .section-title {
    color: #fff;
    font-size: 2.4rem;
    line-height: 1.25;
    margin-bottom: 1rem;
}

.ai-gallery-header .section-subtitle {
    color: rgba(255,255,255,.65);
    font-size: 1.1rem;
    line-height: 1.7;
}

/* --- Blocco singola coppia prima/dopo --- */
.ai-ba-block {
    margin-bottom: 70px;
}

.ai-ba-context {
    margin-bottom: 28px;
}

.ai-ba-badge {
    display: inline-block;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 6px 16px;
    border-radius: 50px;
    margin-bottom: 12px;
}

.ai-ba-context h3 {
    color: #fff;
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.ai-ba-context p {
    color: rgba(255,255,255,.6);
    font-size: .95rem;
    line-height: 1.65;
    max-width: 720px;
}

.ai-ba-context p strong {
    color: rgba(255,255,255,.85);
}

/* --- Layout comparazione --- */
.ai-ba-comparison {
    display: flex;
    align-items: center;
    gap: 0;
}

.ai-ba-card {
    flex: 1;
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    background: #1a1f2e;
}

.ai-ba-card img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform .4s ease;
}

.ai-ba-card:hover img {
    transform: scale(1.02);
}

.ai-ba-label {
    position: absolute;
    top: 14px;
    left: 14px;
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    padding: 5px 14px;
    border-radius: 6px;
    z-index: 2;
}

.ai-ba-before .ai-ba-label {
    background: rgba(255, 255, 255, .15);
    backdrop-filter: blur(8px);
    color: #e2e8f0;
    border: 1px solid rgba(255,255,255,.2);
}

.ai-ba-after .ai-ba-label {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
}

.ai-ba-caption {
    display: block;
    text-align: center;
    padding: 10px 0;
    font-size: .8rem;
    color: rgba(255,255,255,.45);
    letter-spacing: .5px;
}

/* --- Freccia centrale --- */
.ai-ba-arrow {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0 20px;
    flex-shrink: 0;
}

.ai-ba-arrow .material-icons {
    font-size: 36px;
    color: #667eea;
    animation: pulseArrow 2s ease-in-out infinite;
}

.ai-ba-arrow-label {
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: #764ba2;
    margin-top: 4px;
    text-transform: uppercase;
}

@keyframes pulseArrow {
    0%, 100% { transform: translateX(0); opacity: .7; }
    50%      { transform: translateX(6px); opacity: 1; }
}

/* --- Blocco SEO + CTA --- */
.ai-ba-seo-block {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-top: 20px;
    align-items: start;
}

.ai-ba-seo-text h3 {
    color: #fff;
    font-size: 1.4rem;
    margin-bottom: 16px;
}

.ai-ba-seo-text ul {
    list-style: none;
    padding: 0;
    margin: 0 0 18px 0;
}

.ai-ba-seo-text ul li {
    position: relative;
    padding-left: 24px;
    margin-bottom: 12px;
    color: rgba(255,255,255,.6);
    font-size: .93rem;
    line-height: 1.6;
}

.ai-ba-seo-text ul li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #667eea;
    font-weight: 700;
}

.ai-ba-seo-text ul li strong {
    color: rgba(255,255,255,.85);
}

.ai-ba-seo-text > p {
    color: rgba(255,255,255,.55);
    font-size: .9rem;
    line-height: 1.7;
}

.ai-ba-seo-text > p strong {
    color: #667eea;
}

/* --- CTA Box --- */
.ai-ba-cta-box {
    background: linear-gradient(135deg, rgba(102,126,234,.12), rgba(118,75,162,.1));
    border: 1px solid rgba(102,126,234,.25);
    border-radius: 20px;
    padding: 36px 32px;
    text-align: center;
}

.ai-ba-cta-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.ai-ba-cta-icon .material-icons {
    font-size: 28px;
    color: #fff;
}

.ai-ba-cta-box h3 {
    color: #fff;
    font-size: 1.3rem;
    margin-bottom: 10px;
}

.ai-ba-cta-box > p {
    color: rgba(255,255,255,.6);
    font-size: .9rem;
    line-height: 1.6;
    margin-bottom: 20px;
}

.ai-ba-cta-box > p strong {
    color: rgba(255,255,255,.85);
}

.ai-ba-cta-box .ai-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    font-weight: 600;
    font-size: 1rem;
    padding: 14px 32px;
    border-radius: 50px;
    text-decoration: none;
    transition: transform .25s, box-shadow .25s;
    box-shadow: 0 4px 20px rgba(102,126,234,.35);
}

.ai-ba-cta-box .ai-cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(102,126,234,.5);
}

.ai-ba-trust {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 18px;
    flex-wrap: wrap;
}

.ai-ba-trust span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: .78rem;
    color: rgba(255,255,255,.45);
}

.ai-ba-trust .material-icons {
    font-size: 16px;
    color: #667eea;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .ai-gallery-header .section-title {
        font-size: 1.6rem;
    }

    .ai-ba-comparison {
        flex-direction: column;
        gap: 8px;
    }

    .ai-ba-arrow {
        flex-direction: row;
        padding: 8px 0;
        gap: 6px;
    }

    .ai-ba-arrow .material-icons {
        font-size: 28px;
        animation-name: pulseArrowDown;
    }

    @keyframes pulseArrowDown {
        0%, 100% { transform: translateY(0); opacity: .7; }
        50%      { transform: translateY(4px); opacity: 1; }
    }

    .ai-ba-arrow .material-icons {
        transform: rotate(90deg);
    }

    .ai-ba-seo-block {
        grid-template-columns: 1fr;
    }

    .ai-ba-context h3 {
        font-size: 1.2rem;
    }

    .ai-ba-trust {
        flex-direction: column;
        align-items: center;
        gap: 8px;
    }
}

