/* ── OptiIA integration dans CBL template ── */

/* Cacher les slides cinématiques (texte Space Grotesk) — le JS les garde dans le DOM */
.cinematic-container { visibility: hidden !important; }

/* ── Brand reveal : texte 3D au centre quand le O éclate ── */
#brand-reveal {
    position: fixed;
    inset: 0;
    z-index: 12;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.25s ease;
    perspective: 600px;
}
@media (max-width: 768px) {
    #brand-reveal {
        align-items: flex-end;
        padding-bottom: 12rem;
    }
    .brand-reveal-text {
        font-size: clamp(3.2rem, 18vw, 5rem) !important;
    }
}
.brand-reveal-text {
    font-family: Outfit, sans-serif;
    font-size: clamp(3.5rem, 11vw, 8rem);
    font-weight: 900;
    letter-spacing: -0.02em;
    color: #e8f0ff;
    display: block;
    transform-style: preserve-3d;
    transform: perspective(400px) rotateX(28deg) rotateY(-6deg);
    /* Long shadow extrudé diagonal vers bas-droite — couleurs lumineuses pour fond sombre */
    text-shadow:
        1px 1px 0 #7090e8,
        2px 2px 0 #6080d8,
        3px 3px 0 #5070c8,
        4px 4px 0 #4060b8,
        5px 5px 0 #3858a8,
        6px 6px 0 #305098,
        7px 7px 0 #284888,
        8px 8px 0 #204078,
        9px 9px 0 #183868,
        10px 10px 0 #103058,
        11px 11px 0 #0c2850,
        12px 12px 0 #0a2048,
        13px 13px 0 #081840,
        14px 14px 0 #061438,
        15px 15px 0 #051030,
        16px 16px 0 #040e28,
        17px 17px 0 #030c22,
        18px 18px 0 #020a1c,
        19px 19px 0 #020816,
        20px 20px 0 #010610,
        22px 22px 0 #01050c,
        24px 24px 0 #010408,
        26px 26px 0 #010306,
        28px 28px 0 #010204,
        30px 30px 18px rgba(30,60,180,0.55),
        38px 38px 30px rgba(20,40,140,0.35);
    animation: brand-float 4s ease-in-out infinite;
    will-change: transform, opacity;
}
.brand-reveal-text em {
    font-style: normal;
    color: #60a5fa;
    text-shadow:
        1px 1px 0 #1a60ff,
        2px 2px 0 #1858f0,
        3px 3px 0 #1650e0,
        4px 4px 0 #1448d0,
        5px 5px 0 #1240c0,
        6px 6px 0 #1038b0,
        7px 7px 0 #0e30a0,
        8px 8px 0 #0c2890,
        9px 9px 0 #0a2080,
        10px 10px 0 #081870,
        12px 12px 0 #061060,
        14px 14px 0 #040c50,
        16px 16px 0 #030840,
        18px 18px 0 #020630,
        20px 20px 0 #010420,
        22px 22px 0 #010318,
        26px 26px 14px rgba(10,60,255,0.45),
        32px 32px 26px rgba(8,40,200,0.28);
}
@keyframes brand-float {
    0%, 100% { transform: perspective(400px) rotateX(28deg) rotateY(-6deg) translateY(0); }
    50%       { transform: perspective(400px) rotateX(24deg) rotateY(-4deg) translateY(-6px); }
}

/* Zone hero avec border-radius sur tous les écrans */
#webgl, .cinematic-container, .optiia-scroll-hint {
    border-radius: 0 0 2rem 2rem;
    overflow: hidden;
}
#webgl { clip-path: inset(0 0 0 0 round 0 0 2rem 2rem); }

/* Overlay hero CBL-style au-dessus du canvas (z-index canvas = 1, cinematic-container = 10) */
.optiia-hero-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 15;
    pointer-events: none;
    display: flex;
    align-items: center;
    border-radius: 0 0 2rem 2rem;
    overflow: hidden;
}
.optiia-hero-content {
    pointer-events: auto;
    max-width: 560px;
    padding: 2rem 1.5rem 2rem 4rem;
    margin-top: 5rem;
}
/* Tablette (769px – 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    .optiia-hero-overlay {
        align-items: flex-start !important;
        justify-content: center !important;
        padding: 0 2rem;
    }
    .optiia-hero-content {
        padding: 2rem !important;
        margin-top: 5.5rem !important;
        max-width: 680px;
        width: 100%;
        text-align: center;
    }
    .optiia-hero-lead { max-width: 100%; }
    .optiia-hero-cta { justify-content: center; }
    .optiia-hero-badges { justify-content: center; }
    .optiia-hero-title { font-size: clamp(2.4rem, 5vw, 3.2rem) !important; }
}

/* Mobile (≤ 768px) */
@media (max-width: 768px) {
    /* Sortir l'overlay du fixed pour qu'il soit dans le flux normal du document.
       Le canvas reste fixed en arrière-plan (z:1), l'overlay prend 100svh,
       le contenu suit immédiatement — aucun scroll-stage, aucun blocage touch. */
    .optiia-hero-overlay {
        position: relative !important;
        height: 100svh;
        min-height: 580px;
        align-items: flex-start !important;
        padding-top: 5rem;
        border-radius: 0 !important;
        overflow: visible !important;
    }
    .optiia-hero-content {
        padding: 1.5rem !important;
        margin-top: 0 !important;
        max-width: 100%;
    }
    .optiia-hero-title { font-size: 2rem !important; }
    .optiia-hero-lead { font-size: 0.875rem !important; }
    .optiia-hero-cta { flex-direction: column; }
    .optiia-btn-primary, .optiia-btn-outline { justify-content: center; }
    .optiia-hero-badges { gap: 0.6rem; }
    .optiia-scroll-hint { display: none !important; }
}
.optiia-hero-location {
    font-size: 0.8rem; color: rgba(255,255,255,0.65);
    letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 1.25rem;
    font-family: Inter, sans-serif;
}
.optiia-hero-title {
    font-size: clamp(2.2rem,5vw,3.6rem); font-weight: 800; line-height: 1.1;
    letter-spacing: -0.03em; color: #fff; margin-bottom: 1.25rem;
    font-family: Outfit, sans-serif;
    text-shadow: 0 2px 32px rgba(0,0,0,0.5);
}
.optiia-hero-title .accent { color: #60a5fa; }
.optiia-hero-lead {
    font-size: 1rem; line-height: 1.7; color: rgba(255,255,255,0.72);
    margin-bottom: 2rem; max-width: 420px; font-family: Inter, sans-serif;
}
.optiia-hero-cta { display:flex; flex-wrap:wrap; gap:0.75rem; margin-bottom:1.75rem; }
.optiia-btn-primary {
    display:inline-flex; align-items:center; gap:0.5rem;
    padding:0.85rem 1.75rem; border-radius:999px;
    background:#2563eb; color:#fff; font-weight:700; font-size:0.875rem;
    text-decoration:none; transition:background 0.2s,transform 0.2s;
    font-family:Inter,sans-serif;
}
.optiia-btn-primary:hover { background:#1d4ed8; transform:scale(1.04); }
.optiia-btn-outline {
    display:inline-flex; align-items:center; gap:0.5rem;
    padding:0.85rem 1.75rem; border-radius:999px;
    background:rgba(10,20,40,0.55); border:1px solid rgba(255,255,255,0.25);
    color:#fff; font-weight:600; font-size:0.875rem; text-decoration:none;
    transition:background 0.2s,transform 0.2s; font-family:Inter,sans-serif;
}
.optiia-btn-outline:hover { background:rgba(10,20,40,0.75); transform:scale(1.03); }
.optiia-hero-badges { display:flex; flex-wrap:wrap; gap:0.9rem; }
.optiia-hero-badge {
    display:flex; align-items:center; gap:0.4rem;
    font-size:0.78rem; color:rgba(255,255,255,0.65); font-weight:500;
    font-family:Inter,sans-serif;
}
.optiia-hero-badge svg { width:14px; height:14px; color:#60a5fa; }
/* Scroll hint */
.optiia-scroll-hint {
    position: fixed; bottom: 2rem; left: 50%; transform: translateX(-50%);
    z-index: 6; display:flex; flex-direction:column; align-items:center; gap:0.5rem;
    color:rgba(255,255,255,0.4); font-size:0.65rem; letter-spacing:0.15em;
    text-transform:uppercase; pointer-events:none; font-family:Inter,sans-serif;
    animation: optiia-bounce 2s infinite;
}
.optiia-scroll-hint svg { width:16px; height:16px; }
@keyframes optiia-bounce {
    0%,100% { transform:translateX(-50%) translateY(0); opacity:0.4; }
    50%      { transform:translateX(-50%) translateY(6px); opacity:0.8; }
}

/* Header au-dessus de tout (z-index cinematic = 20, header = 50) */
#siteHeader {
    z-index: 50 !important;
    background: transparent !important;
    border: none !important;
}
/* Texte blanc sur fond sombre (animation) */
#siteHeader a:not(.contact-btn-cbl),
#siteHeader span { color: rgba(255,255,255,0.9) !important; }
#siteHeader .text-blue-400,
#siteHeader .text-blue-600 { color: #60a5fa !important; }
/* Bouton CTA reste bleu */
#siteHeader a[href*="contact"].hidden,
#siteHeader a.bg-blue-600 { background-color: #2563eb !important; color: #fff !important; }

/* Curseurs OptiIA — toujours cachés, curseur normal rétabli */
.cursor-inner,
.cursor-outer,
.cursor-label { display: none !important; }
body, canvas { cursor: auto !important; }
/* Rétablir le curseur sur les éléments interactifs du hero */
.optiia-hero-content * { cursor: auto !important; }
.optiia-hero-content a { cursor: pointer !important; }
.ecofood-layer a, footer a { cursor: pointer !important; }

/* Quand scrollé APRÈS l'animation (body.past-stage) */
body.past-stage #siteHeader {
    background: rgba(255,255,255,0.97) !important;
    backdrop-filter: blur(12px) !important;
    border-bottom: 1px solid rgba(0,0,0,0.08) !important;
    box-shadow: 0 2px 20px rgba(0,0,0,0.08) !important;
}
body.past-stage #siteHeader a:not(.bg-blue-600),
body.past-stage #siteHeader span { color: #374151 !important; }
body.past-stage #siteHeader .text-blue-400 { color: #2563eb !important; }
body.past-stage #navToggle { color: #374151 !important; }
body.past-stage #navToggle:hover { background: #eff6ff !important; }

/* Ecofood layer — couvre le canvas fixed après l'animation */
.ecofood-layer {
    position: relative;
    z-index: 20;
    background: #fff;
    min-height: 50vh;
    isolation: isolate;
    cursor: auto !important;
    font-family: Inter, ui-sans-serif, sans-serif !important;
    color: #0f172a !important;
}
.ecofood-layer * { cursor: auto !important; user-select: auto !important; }
.ecofood-layer p, .ecofood-layer h1, .ecofood-layer h2, .ecofood-layer h3,
.ecofood-layer li, .ecofood-layer a { font-family: Inter, ui-sans-serif, sans-serif !important; }
.ecofood-layer h1, .ecofood-layer h2, .ecofood-layer h3 {
    font-family: Outfit, ui-sans-serif, sans-serif !important;
}

/* Footer couvre aussi le canvas */
footer {
    position: relative;
    z-index: 20 !important;
    isolation: isolate;
    cursor: auto !important;
}
footer * { cursor: auto !important; }

/* Comble le gap margin-top:5rem du footer en étendant l'ecofood-layer */
.ecofood-layer { padding-bottom: 5rem; }
