/* Tactile Industrial Brutalism — Prisma Pitture Custom CSS */

:root {
    --safety-orange: #FF4D00;
    --dark: #111111;
    --concrete: #F5F5F5;
}

html {
    scroll-behavior: smooth;
}

body {
    -webkit-font-smoothing: antialiased;
}

/* Animations */
@keyframes modalEnter {
    from { opacity: 0; transform: scale(0.95) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.animate-modal-enter {
    animation: modalEnter 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Custom scrollbar for modal */
#service-modal .overflow-y-auto::-webkit-scrollbar,
#project-modal .overflow-y-auto::-webkit-scrollbar {
    width: 4px;
}
#service-modal .overflow-y-auto::-webkit-scrollbar-track,
#project-modal .overflow-y-auto::-webkit-scrollbar-track {
    background: rgba(26, 26, 26, 0.05);
}
#service-modal .overflow-y-auto::-webkit-scrollbar-thumb,
#project-modal .overflow-y-auto::-webkit-scrollbar-thumb {
    background: #FF4D00;
}

/* Timeline Glow & Animation */
#timeline-progress {
    box-shadow: 0 0 20px rgba(255, 77, 0, 0.6), 0 0 40px rgba(255, 77, 0, 0.2);
    filter: drop-shadow(0 0 10px rgba(255, 77, 0, 0.4));
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slowZoom {
    0% { transform: scale(1.1); }
    100% { transform: scale(1.2); }
}



.animate-fade-in-up {
    opacity: 0;
    animation: fadeInUp 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-slow-zoom {
    animation: slowZoom 30s ease-in-out infinite alternate;
}



.delay-200 { animation-delay: 0.2s; }

/* Text Outline Effect */
.text-outline {
    -webkit-text-stroke: 1.5px rgba(255, 255, 255, 0.4);
    color: transparent;
}

/* Custom Scrollbar — Brutalist Style */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: var(--dark);
}

::-webkit-scrollbar-thumb {
    background: var(--safety-orange);
    border: 3px solid var(--dark);
}

/* Concrete Grain Texture (Subtle) */
body::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('https://www.transparenttextures.com/patterns/black-linen.png');
    opacity: 0.05;
    pointer-events: none;
    z-index: 9999;
}

/* Bento Grid Structural Transitions */
.grid > div {
    transition: all 0.4s cubic-bezier(0.2, 0, 0, 1);
}

.group:hover .lucide {
    transform: translateY(-5px) scale(1.1);
    transition: transform 0.3s ease;
}

/* Header mix-blend-mode refinement */
header {
    transition: transform 0.5s ease;
}

header.hide {
    transform: translateY(-100%);
}

/* Utility: Kerning for display */
.tracking-tighter {
    letter-spacing: -0.05em;
}

/* Link Underlines */
a {
    position: relative;
}

a::after {
    content: "";
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: currentColor;
    transition: width 0.3s ease;
}

a:hover::after {
    width: 100%;
}

/* JS Toggle Helper Classes (Tailwind JIT CDN fallbacks) */
#mobile-menu-overlay.opacity-100,
#project-modal.opacity-100,
#modal-backdrop.opacity-100,
#modal-content.opacity-100 {
    opacity: 1 !important;
}

#mobile-menu-overlay.pointer-events-auto,
#project-modal.pointer-events-auto {
    pointer-events: auto !important;
}

#mobile-menu-overlay.translate-y-0,
#modal-content.translate-y-0 {
    transform: translateY(0) !important;
}

@media (max-width: 768px) {
    header {
        top: 0 !important;
        left: 0 !important;
    }

    html, body {
        touch-action: manipulation;
    }

    .text-outline {
        -webkit-text-stroke: 1px rgba(255, 255, 255, 0.3);
    }

    /* 1. Global typography adjustments for mobile to prevent cutoff and center titles */
    h1 {
        font-size: clamp(2.25rem, 10vw, 3.5rem) !important;
        text-align: center !important;
        line-height: 1.15 !important;
        word-wrap: break-word !important;
        word-break: break-word !important;
    }
    
    h2 {
        font-size: clamp(1.85rem, 8vw, 2.5rem) !important;
        text-align: center !important;
        line-height: 1.2 !important;
        word-wrap: break-word !important;
        word-break: break-word !important;
    }

    h3 {
        font-size: clamp(1.4rem, 6vw, 1.85rem) !important;
        text-align: center !important;
        line-height: 1.25 !important;
        word-wrap: break-word !important;
        word-break: break-word !important;
    }

    /* Target bracketed labels like [ EST. 1998 — MILANO ] */
    .font-mono.text-industrial-safety {
        text-align: center !important;
        margin-left: auto !important;
        margin-right: auto !important;
        display: flex !important;
        justify-content: center !important;
    }

    /* Center section paragraphs, footer paragraphs, grid text */
    section p, footer p, .grid p, .step-content p {
        text-align: center !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }

    /* 2. Hero Sections & Container centering */
    section.relative.min-h-screen .max-w-5xl,
    section.pt-48.pb-20 .container,
    section.relative.h-\[60vh\] .container {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
    }

    /* Center CTA button containers in hero */
    section.relative.min-h-screen .flex.flex-col.md\:flex-row {
        align-items: center !important;
        justify-content: center !important;
        width: 100% !important;
    }
    
    /* Ensure hero CTA button itself is centered */
    section.relative.min-h-screen a.group {
        margin-left: auto !important;
        margin-right: auto !important;
    }

    /* 3. Section adjustments */
    
    /* "Chi Siamo" & "IL NOSTRO TEAM" Section layout */
    section.py-32 .lg\:col-span-7 {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
    }

    /* Grid Items Centering (Values Cards, Bento grids, etc.) */
    .grid.md\:grid-cols-2.lg\:grid-cols-4 > div {
        text-align: center !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
    }
    
    .grid.md\:grid-cols-2.lg\:grid-cols-4 .flex.items-end.gap-3 {
        justify-content: center !important;
    }

    .grid.md\:grid-cols-2.lg\:grid-cols-4 .w-12.h-12 {
        margin-left: auto !important;
        margin-right: auto !important;
    }

    /* 4. "Eccellenza" Section */
    #eccellenza .grid.md\:grid-cols-2 {
        text-align: center !important;
    }
    #eccellenza .space-y-6,
    #eccellenza .space-y-10 {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
    }
    #eccellenza .flex.items-end.gap-4 {
        justify-content: center !important;
        align-items: center !important;
    }
    #eccellenza .lg\:col-span-4 .bg-industrial-black {
        text-align: center !important;
        align-items: center !important;
    }

    /* 5. Timeline Section Mobile Layout */
    #timeline-container > div.absolute.left-6 {
        display: none !important;
    }
    #timeline-container .timeline-step {
        align-items: center !important;
        text-align: center !important;
    }
    #timeline-container .timeline-step .relative.z-20 {
        margin-left: auto !important;
        margin-right: auto !important;
    }
    #timeline-container .timeline-step .step-content {
        padding-left: 0 !important;
        padding-right: 0 !important;
        margin-top: 1.5rem !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
    }

    /* 6. Recensioni Section Layout Adjustments */
    section.py-60 .grid.lg\:grid-cols-12 {
        text-align: center !important;
    }
    section.py-60 blockquote p {
        text-align: center !important;
    }
    section.py-60 .lg\:col-span-2,
    section.py-60 .flex.flex-col {
        align-items: center !important;
        text-align: center !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
    section.py-60 .border-l,
    section.py-60 .border-r {
        border: none !important;
        padding: 0 !important;
    }
    section.py-60 .h-32.w-\[1px\] {
        display: none !important;
    }
    section.py-60 .lg\:col-start-2 .flex-col {
        align-items: center !important;
    }
    section.py-60 .lg\:col-start-2 .font-mono {
        justify-content: center !important;
    }

    /* 7. CTA / Contatti CTA Section Alignment */
    #contatti-cta .flex-col {
        align-items: center !important;
        text-align: center !important;
    }
    #contatti-cta .flex-col.items-end {
        align-items: center !important;
    }

    /* 8. Servizi Page List Layout centering */
    #servizi-vertical .min-h-screen {
        text-align: center !important;
        align-items: center !important;
    }
    #servizi-vertical .w-full.md\:w-1\/2 {
        align-items: center !important;
        text-align: center !important;
        padding: 2.5rem 1.5rem !important;
    }
    #servizi-vertical .flex.flex-wrap {
        justify-content: center !important;
    }

    /* 9. Progetti Page Spotlight Alignment */
    section.py-48 .group.relative {
        align-items: center !important;
        text-align: center !important;
    }
    section.py-48 .group.relative h2 {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        margin-left: 0 !important;
    }
    section.py-48 .group.relative h2 span {
        margin-left: 0 !important;
    }
    section.py-48 .group.relative .mt-12 {
        justify-content: center !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }

    /* 10. Contatti Page Elements centering */
    section.py-32 .grid.lg\:grid-cols-2 {
        text-align: center !important;
    }
    section.py-32 .space-y-12,
    section.py-32 .space-y-10 {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
    }
    section.py-32 .flex.items-start {
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
    }
    section.py-32 .flex.items-start .w-12 {
        margin-bottom: 1rem !important;
    }

    /* 11. Footer Centering & Stack */
    footer {
        text-align: center !important;
    }
    footer .grid {
        text-align: center !important;
    }
    footer ul {
        text-align: center !important;
    }
    footer .space-y-8,
    footer .space-y-6 {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
    }
    footer .flex.space-x-6 {
        justify-content: center !important;
    }
    footer .pt-12.border-t {
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        gap: 1.5rem !important;
    }

    /* 12. Mobile Overlay Navigation Center */
    #mobile-menu-overlay .flex-col {
        align-items: center !important;
        text-align: center !important;
    }
    
    /* Spotlight Section Project text fixes in index.html */
    .group.relative.overflow-hidden.h-\[600px\] .absolute.bottom-10 {
        left: 1.25rem !important;
        right: 1.25rem !important;
        text-align: center !important;
    }
}

