/* =============================================
   POULIDOR Audit & Développement — Styles
   ============================================= */

/* --- Base --- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
    overflow-x: clip;
}

body {
    font-family: 'Inter', sans-serif;
    margin: 0;
    overflow-x: hidden;
    overflow-x: clip;
}

html.lightbox-open,
body.lightbox-open {
    overflow: hidden;
}

main {
    min-width: 0;
}

#tab-wrapper .tab-panel,
#tab-wrapper .flex > *,
#tab-wrapper .grid > * {
    min-width: 0;
}

/* =============================================
   SCROLL PROGRESS BAR
   ============================================= */
#scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #FACC15, #F59E0B);
    transform-origin: left;
    transform: scaleX(0);
    z-index: 100;
    will-change: transform;
    transition: none;
    pointer-events: none;
}

/* =============================================
   HERO ANIMATED BORDER
   ============================================= */
.hero-border {
    position: relative;
    border-bottom: none !important;
}
.hero-border::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #FACC15, #F59E0B, #EAB308, #FACC15);
    background-size: 200% 100%;
    animation: borderShimmer 4s linear infinite;
}
@keyframes borderShimmer {
    0%   { background-position: 0% 0; }
    100% { background-position: 200% 0; }
}

/* =============================================
   SCROLL REVEAL ANIMATIONS
   ============================================= */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered children */
.reveal-child {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.5s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal-child.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* =============================================
   TAB TRANSITIONS
   ============================================= */
.tab-panel {
    transition: opacity 0.35s ease, transform 0.35s ease;
}
.tab-panel.tab-hidden {
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
    position: absolute;
    visibility: hidden;
    height: 0;
    overflow: hidden;
}
.tab-panel.tab-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    position: relative;
    visibility: visible;
}

/* =============================================
   CARD HOVER — SUBTLE LIFT
   ============================================= */
.card-hover {
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08), 0 4px 10px rgba(0, 0, 0, 0.04);
}

/* =============================================
   CTA BUTTON SUBTLE PULSE
   ============================================= */
.cta-pulse {
    animation: subtlePulse 3s ease-in-out infinite;
}
@keyframes subtlePulse {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.02); }
}

/* =============================================
   ANIMATED PRICE COUNTER
   ============================================= */
.price-animate {
    display: inline-block;
    transition: transform 0.15s ease;
}
.price-animate.bump {
    transform: scale(1.08);
}

/* =============================================
   INFRA ACCORDION — COLLAPSIBLE SECTIONS
   ============================================= */
.infra-chevron {
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.infra-chevron.rotated {
    transform: rotate(180deg);
}
.infra-collapsible {
    will-change: max-height, opacity;
}

/* =============================================
   PIPELINE STEPPER
   ============================================= */
.pipeline-stepper {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    padding: 1.5rem;
}

.pipeline-step {
    transition: transform 0.2s ease;
}

.pipeline-step:hover {
    transform: scale(1.05);
}

/* =============================================
   IMAGE LIGHTBOX
   ============================================= */
.lightbox-trigger {
    cursor: pointer;
    transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.lightbox-trigger:hover,
.lightbox-trigger:focus-visible {
    transform: translateY(-2px);
    border-color: rgba(250, 204, 21, 0.55);
    box-shadow: 0 18px 34px rgba(15, 23, 42, 0.22);
    outline: none;
}

.lightbox-overlay {
    position: fixed;
    inset: 0;
    z-index: 150;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: rgba(2, 6, 23, 0.9);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.lightbox-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
}

.lightbox-frame {
    width: min(1100px, 100%);
    max-height: calc(100vh - 3rem);
    border-radius: 1rem;
    overflow: hidden;
    background: rgba(15, 23, 42, 0.96);
    box-shadow: 0 28px 80px rgba(2, 6, 23, 0.5);
}

.lightbox-image {
    display: block;
    width: 100%;
    max-height: calc(100vh - 3rem);
    object-fit: contain;
    background: #020617;
}

.lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.8);
    color: #fff;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.lightbox-close:hover,
.lightbox-close:focus-visible {
    background: rgba(30, 41, 59, 0.95);
    border-color: rgba(250, 204, 21, 0.65);
    outline: none;
}

@media (max-width: 767px) {
    .pipeline-stepper {
        padding: 1rem;
    }

    .lightbox-overlay {
        padding: 1rem;
    }

    .lightbox-frame,
    .lightbox-image {
        max-height: calc(100vh - 2rem);
    }

    .lightbox-close {
        top: 0.75rem;
        right: 0.75rem;
    }
}
