/* =======================================================================
   Comportement global
   ======================================================================= */

html {
    scroll-behavior: smooth;
}

body.lightbox-open {
    overflow: hidden;
    height: 100vh;
}

/* Décale légèrement l'ancre pour que le titre ne soit pas collé au haut */
[id] {
    scroll-margin-top: 5rem;
}

/* =======================================================================
   Sections par type
   ======================================================================= */

.section-intro {
    /* Intro plein écran – ambiance un peu différente */
    background:
        radial-gradient(circle at top left, rgba(56, 189, 248, 0.12), transparent 60%),
        radial-gradient(circle at bottom right, rgba(129, 140, 248, 0.12), transparent 60%),
        #020617;
}

.section-methodo {
    background:
        radial-gradient(circle at top right, rgba(129, 140, 248, 0.13), transparent 60%),
        #020617;
}

.section-chapitres {
    background: #020617;
}

.section-demos {
    background:
        radial-gradient(circle at top, rgba(56, 189, 248, 0.09), transparent 55%),
        #020617;
}

.section-interview,
.section-conclusion,
.section-bilan,
.section-biblio,
.section-annexes {
    background: #020617;
}

/* =======================================================================
   Grille & cartes intro
   ======================================================================= */

.intro-card {
    position: relative;
    overflow: hidden;
    transition: transform 0.08s ease-out, box-shadow 0.08s ease-out,
        border-color 0.08s ease-out;
}

.intro-card::before {
    content: "";
    position: absolute;
    inset: -40%;
    opacity: 0;
    background: radial-gradient(circle at top, rgba(56, 189, 248, 0.2), transparent 55%);
    transition: opacity 0.15s ease-out;
    pointer-events: none;
}

.intro-card:hover {
    transform: translateY(-2px);
    border-color: rgba(56, 189, 248, 0.8);
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.95);
}

/* Désactive le soulignement dans les cartes intro */
.intro-card,
.intro-card:hover,
.intro-card h3,
.intro-card p {
    text-decoration: none;
}

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

/* =======================================================================
   Chapitres = vraies sections (fin du mode "card")
   ======================================================================= */

.chapter {
    margin: 3.5rem 0 0;
    padding: 3rem 0 0;
    border-radius: 0;
    border: none;
    box-shadow: none;
    background: transparent;
    position: relative;
}

/* en gros, chaque axe devient une "section" dans la section-chapitres */
.chapter-header {
    margin-bottom: 1.75rem;
}

.chapter-title {
    font-size: 1.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

/* sous-question sous le titre */
.chapter-question {
    font-size: 0.95rem;
    color: var(--text-muted);
}

/* sections internes du chapitre */
.chapter-section {
    position: relative;
    margin-top: 1.2rem;
}

.chapter-section+.chapter-section {
    border-top: 1px solid rgba(148, 163, 184, 0.25);
    padding-top: 1rem;
}

.chapter-section h4 {
    font-size: 1.05rem;
    margin-bottom: 0.35rem;
}

/* légère mise en avant quand on arrive via #chap1, #chap2, #chap3 */
.chapter:target {
    border-top-color: var(--accent);
}

/* =======================================================================
   Chapitres 1
   ======================================================================= */

.footnote-ref {
    font-size: 0.75em;
    text-decoration: none;
    vertical-align: super;
}

.chapter-notes {
    margin-top: 2rem;
    border-top: 1px solid rgba(148, 163, 184, 0.25);
    padding-top: 1rem;
}

.footnotes {
    margin: 0;
    padding-left: 1.4rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.footnotes li {
    margin-bottom: 0.4rem;
}

.footnote-back {
    display: inline-block;
    margin-top: 0.2rem;
    font-size: 0.8rem;
}

/* =======================================================================
   Figure / frise chronologique du chap. 1
   ======================================================================= */

.chapter-figure {
    margin: 1rem 0 1.3rem;
    padding: 0.9rem 1rem;
    border-radius: var(--radius-md);
    border: 1px solid rgba(148, 163, 184, 0.45);
    background: rgba(15, 23, 42, 0.96);
    text-align: center;
}

.chapter-figure img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0 auto 0.6rem;
    border-radius: 0.75rem;
}

.chapter-figure figcaption {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.chapter-figure--zoomable {
    position: relative;
}

.figure-zoom-button {
    all: unset;
    display: block;
    width: 100%;
    cursor: zoom-in;
}

.figure-zoom-button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

.figure-zoom-button img {
    pointer-events: none;
}

.lightbox-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: rgba(2, 6, 23, 0.7);
    backdrop-filter: blur(6px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
    z-index: 1200;
}

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

.lightbox-content {
    max-width: min(1400px, 96vw);
    max-height: 94vh;
    background: rgba(15, 23, 42, 0.96);
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
    padding: 0.75rem;
    animation: pop 180ms ease;
}

.lightbox-content img {
    display: block;
    max-width: 100%;
    max-height: 92vh;
    height: auto;
    border-radius: 0.75rem;
}

.lightbox-caption {
    margin-top: 0.5rem;
    font-size: 0.88rem;
    color: var(--text-muted);
    text-align: center;
}

@keyframes pop {
    from {
        transform: translateY(6px) scale(0.985);
        opacity: 0.92;
    }

    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

/* =======================================================================
   Logos d'outils d'IA (ChatGPT, Copilot, Gemini, DeepSeek, Meta)
   ======================================================================= */

.tools-logos {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: center;
    justify-content: space-between;
    margin-top: 1rem;
}

.tool-logo a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    text-decoration: none;
    color: inherit;
}

.tool-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 80px;
}

.tool-logo img {
    display: block;
    max-width: 120px;
    height: 56px;
    object-fit: contain;
}

/* Fond blanc spécifique pour le logo ChatGPT */
.tool-logo--whitebg img {
    background: #ffffff;
    border-radius: 999px;
    padding: 0.35rem;
}

.tool-logo figcaption {
    margin-top: 0.35rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
}

/* Sur mobile : centrer la rangée */
@media (max-width: 768px) {
    .tools-logos {
        justify-content: center;
    }
}

/* =======================================================================
   Placeholders (démos, interview, annexes)
   ======================================================================= */

.placeholder-demo-large {
    border-style: dashed;
}

.placeholder-interview,
.placeholder-bilan,
.placeholder-annexes {
    border-style: dashed;
}

/* =======================================================================
   Navigation “hero”
   ======================================================================= */

.hero-nav-list li a {
    position: relative;
}

.hero-nav-list li a::after {
    content: "";
    position: absolute;
    inset-inline: 0.9rem;
    bottom: 0.2rem;
    height: 1px;
    border-radius: 999px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: 0;
    transform: scaleX(0.7);
    transform-origin: center;
    transition: opacity 0.12s ease-out, transform 0.12s ease-out;
}

.hero-nav-list li a:hover::after {
    opacity: 1;
    transform: scaleX(1);
}

/* =======================================================================
   Bibliographie
   ======================================================================= */

.section-biblio .section-body {
    display: flex;
    flex-direction: column;
    gap: 1.8rem;
}

.biblio-block {
    padding: 1rem 1rem;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.4);
    background: radial-gradient(circle at top, #020617, #020617 55%, #020617 100%);
}

/* =======================================================================
   Responsif
   ======================================================================= */

@media (max-width: 768px) {
    .hero-nav-list {
        justify-content: center;
    }

    .section-biblio .section-body {
        gap: 1.2rem;
    }

    .biblio-block {
        padding-inline: 0.8rem;
    }

    .chapter {
        margin-top: 2.5rem;
        padding-top: 2.2rem;
    }
}
