/* ---------- RESET SIMPLE ---------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #05040a;
    color: #f5f5f5;
    line-height: 1.7;
}

a {
    color: inherit;
    text-decoration: none;
}

/* ---------- LAYOUT GLOBAL ---------- */
main {
    padding-top: 72px; /* espace sous le header */
}

section {
    max-width: 960px;
    margin: 0 auto;
    padding: 3.5rem 1.5rem;
}

    section:nth-of-type(odd) {
        background: radial-gradient(circle at top left, #111021, #06040c);
    }

    section:nth-of-type(even) {
        background: radial-gradient(circle at bottom right, #19172d, #05030a);
    }

/* ---------- TYPO / TITRES ---------- */
h1, h2, h3 {
    font-weight: 650;
    letter-spacing: 0.02em;
}

h1 {
    font-size: 2.2rem;
    margin-bottom: 0.8rem;
    color: #f1f4ff;
}

h2 {
    font-size: 1.7rem;
    margin-bottom: 0.8rem;
    color: #c4d8ff;
}

h3 {
    font-size: 1.1rem;
    margin-bottom: 0.3rem;
    color: #d7e6ff;
}

p {
    color: #d5dde9;
    margin-bottom: 0.9rem;
    font-size: 0.97rem;
}

/* ---------- TAGS / PETITS TEXTES ---------- */
.tag {
    display: inline-block;
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: #8ad4ff;
    margin-bottom: 0.45rem;
}

.subtag {
    font-size: 0.8rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #90ffda;
    margin-bottom: 0.6rem;
}

.muted {
    color: #96a0bc;
    font-size: 0.9rem;
}

/* ---------- GRID / COLONNES ---------- */
.two-col {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1.1fr);
    gap: 2.2rem;
    margin-top: 1.3rem;
}

/* ---------- CARDS / BLOCS ---------- */
.card {
    border-radius: 18px;
    padding: 1.6rem 1.5rem;
    background: radial-gradient(circle at top left, rgba(90, 185, 255, 0.18), transparent 55%), rgba(10, 11, 25, 0.96);
    border: 1px solid rgba(144, 194, 255, 0.3);
    box-shadow: 0 0 18px rgba(82, 162, 255, 0.15);
}

    .card h3 {
        margin-bottom: 0.5rem;
    }

/* ---------- PILLS / MOTS-CLÉS ---------- */
.pill-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.6rem;
}

.pill {
    padding: 0.2rem 0.7rem;
    border-radius: 999px;
    border: 1px solid rgba(161, 203, 255, 0.6);
    font-size: 0.78rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #c7e2ff;
    background: radial-gradient(circle at 10% 0%, rgba(140, 200, 255, 0.3), transparent 65%);
}

/* ---------- TABLE OF CONTENTS ---------- */
.toc {
    border-left: 2px solid rgba(148, 214, 255, 0.7);
    padding-left: 1rem;
    margin-top: 1rem;
    font-size: 0.9rem;
    color: #c9d5f0;
}

.toc-item {
    margin-bottom: 0.25rem;
}

.toc a {
    text-decoration: underline;
    text-decoration-style: dotted;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

/* ---------- STRUCTURE PARTIES ---------- */
.part-label {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: #ffcf85;
    margin-bottom: 0.4rem;
}

.subsection {
    margin-top: 1.6rem;
}

.subsection-id {
    font-size: 0.86rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #99ffe8;
    margin-bottom: 0.1rem;
}

/* ---------- CITATIONS / QUOTES ---------- */
.quote-box {
    border-left: 3px solid rgba(154, 205, 255, 0.7);
    padding-left: 0.9rem;
    margin: 0.7rem 0 1rem;
    font-size: 0.9rem;
    color: #c7d3ef;
    font-style: italic;
}

/* ---------- FOOTER ---------- */
footer {
    text-align: center;
    font-size: 0.78rem;
    color: #8b93b4;
    padding: 1.2rem 1.5rem 2rem;
    background: #04030a;
    border-top: 1px solid rgba(129, 154, 222, 0.4);
}

/* ---------- WRAPPER POUR SVG / CANVAS ---------- */
.viz-wrapper {
    margin: 1.8rem auto;
    max-width: 540px;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(148, 205, 255, 0.35);
    box-shadow: 0 0 20px rgba(108, 171, 255, 0.25);
    background: radial-gradient(circle at top left, rgba(143, 199, 255, 0.12), rgba(2, 4, 12, 0.98));
}

    .viz-wrapper canvas,
    .viz-wrapper svg {
        display: block;
        width: 100%;
        height: auto;
    }

.viz-caption {
    font-size: 0.8rem;
    color: #9fb1d6;
    margin-top: 0.5rem;
    text-align: center;
}

/* ======================================================= */
/* ===============   HEADER CYBER  ======================= */
/* ======================================================= */

.cyber-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: radial-gradient(circle at left, #071424, #020712 40%, #02040b);
    padding: 0.7rem 1.8rem;
    border-bottom: 1px solid rgba(139, 189, 255, 0.35);
    backdrop-filter: blur(10px);
}

.cyber-header-inner {
    max-width: 1100px;
    margin: auto;
    display: flex;
    align-items: center;
    gap: 2rem;
    flex-wrap: nowrap;
}

/* ---------- LOGO / BRAND ---------- */
.brand {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-weight: 700;
    letter-spacing: 0.22em;
    font-size: 0.85rem;
    color: #fff;
    white-space: nowrap;
}

.brand-main {
    color: #e5f4ff;
}

.brand-accent {
    color: #4fe8ff;
}

/* ---------- NAV PRINCIPALE ---------- */
.main-nav {
    flex: 1;
}

.nav-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.8rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-item {
    position: relative;
    padding-bottom: 10px; /* agrandit la zone de hover vers le bas */
}

.nav-link {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 0.95rem;
    color: #e4eefc;
    text-decoration: none;
    cursor: pointer;
    opacity: 0.9;
    white-space: nowrap;
    transition: opacity 0.2s ease, color 0.2s ease;
}

    .nav-link:hover {
        color: #fff;
        opacity: 1;
    }

/* ---------- SUBMENU NIVEAU 2 ---------- */
.has-sub .submenu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: -8px; /* chevauche légèrement le <li> */

    min-width: 260px;
    background: radial-gradient(circle at top, #071426, #02040b);
    border-radius: 18px;
    padding: 1rem 1.2rem;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.7), 0 0 20px rgba(0, 200, 255, 0.35);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease;
}

.has-sub:hover .submenu {
    opacity: 1;
    pointer-events: auto;
}

/* contenu submenu */
.submenu-column {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.submenu-title {
    font-size: 0.8rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #7fbfff;
    margin-bottom: 0.2rem;
}

.submenu-item {
    position: relative;
    padding-right: 8px;
}

.submenu-link {
    display: block;
    padding: 0.35rem 0.3rem;
    border-radius: 8px;
    color: #eaf3ff;
    text-decoration: none;
    font-size: 0.85rem;
    opacity: 0.9;
    transition: background 0.18s ease, color 0.18s ease, opacity 0.18s ease;
}

    .submenu-link:hover {
        background: linear-gradient(90deg, rgba(79, 232, 255, 0.16), transparent);
        color: #fff;
        opacity: 1;
    }

/* ---------- SUBMENU NIVEAU 3 ---------- */
.submenu-second {
    position: absolute;
    top: 0;
    left: 100%;
    margin-left: -4px;
    min-width: 230px;
    background: radial-gradient(circle at top, #050e20, #02040b);
    border-radius: 14px;
    padding: 0.5rem 0.7rem;
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.7), 0 0 18px rgba(0, 200, 255, 0.3);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease;
}

.submenu-item.has-sub-2:hover > .submenu-second {
    opacity: 1;
    pointer-events: auto;
}

.submenu-second-link {
    display: block;
    padding: 0.28rem 0.25rem;
    border-radius: 7px;
    color: #dfefff;
    text-decoration: none;
    font-size: 0.8rem;
    opacity: 0.88;
    transition: background 0.18s ease, color 0.18s ease, opacity 0.18s ease;
}

    .submenu-second-link:hover {
        background: linear-gradient(90deg, rgba(120, 230, 255, 0.2), transparent);
        color: #fff;
        opacity: 1;
    }

/* ---------- LANG SWITCH ---------- */
.lang-switch {
    display: flex;
    gap: 0.5rem;
}

.lang-btn {
    border: 1px solid rgba(130, 190, 255, 0.4);
    background: radial-gradient(circle at top left, #041020, #02040a);
    color: #e3f0ff;
    border-radius: 999px;
    padding: 0.25rem 0.9rem;
    font-size: 0.7rem;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    cursor: pointer;
}

.lang-active {
    background: radial-gradient(circle at top left, #4ecbff, #1a5cff);
    color: #02040a;
    font-weight: 700;
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 900px) {
    .two-col {
        grid-template-columns: minmax(0, 1fr);
    }

    .cyber-header-inner {
        flex-wrap: wrap;
        gap: 0.8rem;
    }

    .main-nav {
        order: 2;
        width: 100%;
    }

    .nav-links {
        justify-content: flex-start;
        gap: 1.2rem;
        flex-wrap: wrap; /* au lieu de scroll, on passe sur 2 lignes */
    }

    .lang-switch {
        order: 3;
    }
}

@media (max-width: 600px) {
    .brand {
        font-size: 0.75rem;
        letter-spacing: 0.16em;
    }

    .nav-link {
        font-size: 0.85rem;
    }
}
