/* ══════════════════════════════════════════════════════════════════════════════
   Thème Syst Web — style.css
   Design sombre high-tech : néon violet / cyan, verre dépoli, animations douces.
   ══════════════════════════════════════════════════════════════════════════════ */

:root {
    /* Palette */
    --bg:            #070a17;
    --bg-2:          #0b0f22;
    --surface:       #101530;
    --surface-2:     #151b3d;
    --border:        rgba(148, 163, 255, .14);
    --border-strong: rgba(148, 163, 255, .28);
    --text:          #e5e9ff;
    --text-soft:     #b7c0e8;
    --text-muted:    #8b94c4;
    --violet:        #8b5cf6;
    --violet-2:      #a78bfa;
    --cyan:          #22d3ee;
    --magenta:       #f472b6;
    --lime:          #a3e635;
    --grad:          linear-gradient(115deg, var(--violet) 0%, var(--cyan) 100%);
    --grad-warm:     linear-gradient(115deg, var(--magenta) 0%, var(--violet) 100%);
    /* Typo */
    --font-body:     var(--qc-font-body, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);
    --font-heading:  var(--qc-font-heading, var(--font-body));
    --font-mono:     ui-monospace, "Cascadia Code", "JetBrains Mono", Menlo, Consolas, monospace;
    /* Layout */
    --content-w:     780px;
    --wide-w:        1180px;
    --header-h:      74px;
    --radius:        16px;
    --radius-sm:     10px;
    --shadow-neon:   0 0 24px rgba(139, 92, 246, .35), 0 0 64px rgba(34, 211, 238, .12);
}

/* ── Base ──────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--font-body);
    font-size: 1.0625rem;
    line-height: 1.75;
    color: var(--text);
    background: var(--bg);
    background-image:
        radial-gradient(1100px 500px at 85% -10%, rgba(139, 92, 246, .14), transparent 60%),
        radial-gradient(900px 460px at -10% 30%, rgba(34, 211, 238, .09), transparent 55%);
    background-attachment: fixed;
    overflow-x: hidden;
}
img { max-width: 100%; height: auto; }
a { color: var(--cyan); text-decoration: none; transition: color .2s; }
a:hover { color: var(--violet-2); }
::selection { background: rgba(139, 92, 246, .5); color: #fff; }

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    line-height: 1.25;
    color: #fff;
    letter-spacing: -.015em;
}

/* Accessibilité : réduire les animations si demandé */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
    html { scroll-behavior: auto; }
}

/* ── Barre de progression de lecture (articles) ────────────────────────────── */
.reading-progress {
    position: fixed; top: 0; left: 0; height: 3px; width: 0;
    background: var(--grad); z-index: 3000;
    box-shadow: 0 0 12px rgba(34, 211, 238, .8);
}

/* ── Halo curseur ──────────────────────────────────────────────────────────── */
.cursor-glow {
    position: fixed; width: 520px; height: 520px; border-radius: 50%;
    pointer-events: none; z-index: 0; opacity: 0;
    background: radial-gradient(circle, rgba(139, 92, 246, .10) 0%, transparent 65%);
    transform: translate(-50%, -50%);
    transition: opacity .6s;
}
body.glow-on .cursor-glow { opacity: 1; }
@media (max-width: 900px), (hover: none) { .cursor-glow { display: none; } }

/* ── Header ────────────────────────────────────────────────────────────────── */
.site-header {
    position: sticky; top: 0; z-index: 1296;
    background: rgba(7, 10, 23, .82);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
}
.header-inner {
    max-width: var(--wide-w); margin: 0 auto;
    display: flex; align-items: center; gap: 1.4rem;
    height: var(--header-h); padding: 0 1.4rem;
}
.header-beam {
    height: 1px; width: 100%;
    background: linear-gradient(90deg, transparent, var(--violet), var(--cyan), transparent);
    background-size: 220% 100%;
    animation: beam-slide 7s linear infinite;
    opacity: .8;
}
@keyframes beam-slide { from { background-position: 0% 0; } to { background-position: 220% 0; } }

.site-logo { display: inline-flex; align-items: center; gap: .55rem; color: #fff; font-weight: 800; font-size: 1.25rem; letter-spacing: -.02em; }
.site-logo:hover { color: #fff; }
.logo-img { display: block; width: auto; max-height: 42px; height: auto; }
.logo-mark {
    font-family: var(--font-mono); font-weight: 700; font-size: 1.05rem;
    background: var(--grad); color: #fff;
    padding: .28rem .5rem; border-radius: 9px;
    box-shadow: 0 0 18px rgba(139, 92, 246, .55);
}
.logo-text { position: relative; }
.site-logo:hover .logo-text::after {
    content: attr(data-glitch);
    position: absolute; inset: 0; color: var(--cyan);
    clip-path: inset(38% 0 30% 0);
    transform: translate(2px, -1px); opacity: .8;
    animation: glitch .45s steps(2) infinite;
}
@keyframes glitch {
    0%   { clip-path: inset(20% 0 60% 0); transform: translate(-2px, 1px); }
    50%  { clip-path: inset(60% 0 15% 0); transform: translate(2px, -1px); }
    100% { clip-path: inset(35% 0 40% 0); transform: translate(-1px, 2px); }
}

/* ── Navigation desktop ────────────────────────────────────────────────────── */
.site-nav-wrap { margin-left: auto; }
.site-nav { display: flex; align-items: center; gap: .25rem; list-style: none; margin: 0; padding: 0; }
.site-nav li { position: relative; }
.site-nav > li > a {
    display: block; padding: .55rem .85rem; border-radius: 10px;
    color: var(--text-soft); font-weight: 600; font-size: .96rem;
    transition: color .2s, background .2s;
}
.site-nav > li > a:hover { color: #fff; background: rgba(139, 92, 246, .14); }
.site-nav > li.active > a {
    color: #fff;
    background: linear-gradient(rgba(139,92,246,.16), rgba(34,211,238,.10));
    box-shadow: inset 0 -2px 0 var(--cyan);
}
.site-nav .sub-toggle { display: none; }
.site-nav .sub-menu {
    position: absolute; top: calc(100% + 10px); left: 0; min-width: 230px;
    list-style: none; margin: 0; padding: .5rem;
    background: rgba(16, 21, 48, .97); border: 1px solid var(--border-strong);
    border-radius: 14px; box-shadow: 0 24px 60px rgba(0, 0, 0, .5);
    opacity: 0; visibility: hidden; transform: translateY(8px);
    transition: opacity .2s, transform .2s, visibility .2s;
    z-index: 1250;
}
.site-nav li:hover > .sub-menu, .site-nav li:focus-within > .sub-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.site-nav .sub-menu a { display: block; padding: .5rem .8rem; border-radius: 9px; color: var(--text-soft); font-size: .92rem; }
.site-nav .sub-menu a:hover { background: rgba(34, 211, 238, .12); color: #fff; }

/* ── Recherche ─────────────────────────────────────────────────────────────── */
.header-actions { display: flex; align-items: center; gap: .4rem; }
.nav-search { position: relative; display: flex; align-items: center; }
.nav-search-btn {
    background: none; border: 1px solid transparent; color: var(--text-soft);
    cursor: pointer; padding: .48rem; display: flex; border-radius: 10px; transition: .2s;
}
.nav-search-btn:hover { color: #fff; border-color: var(--border-strong); background: rgba(139, 92, 246, .12); }
.nav-search-btn svg { width: 20px; height: 20px; }
.nav-search-form {
    position: absolute; top: calc(100% + 14px); right: 0;
    display: none; align-items: center; gap: .45rem;
    background: var(--surface); border: 1px solid var(--border-strong);
    border-radius: 12px; padding: .5rem; box-shadow: 0 18px 50px rgba(0, 0, 0, .55); z-index: 1300;
}
.nav-search.open .nav-search-form { display: flex; }
.nav-search-form input {
    background: var(--bg-2); border: 1px solid var(--border); border-radius: 9px;
    padding: .55rem .8rem; font-size: .95rem; width: 230px; max-width: 60vw;
    color: var(--text); font-family: inherit;
}
.nav-search-form input:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(34, 211, 238, .18); }
.nav-search-form button {
    background: var(--grad); color: #fff; border: none; border-radius: 9px;
    padding: .55rem .8rem; cursor: pointer; font-weight: 700; font-size: .85rem;
}

/* ── Burger / drawer mobile ────────────────────────────────────────────────── */
.nav-toggle { display: none; background: none; border: 1px solid var(--border-strong); border-radius: 10px; padding: .55rem .6rem; cursor: pointer; flex-direction: column; gap: 4.5px; }
.nav-toggle span { display: block; width: 20px; height: 2px; background: var(--text); border-radius: 2px; transition: .25s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }
.nav-overlay { position: fixed; inset: 0; background: rgba(4, 6, 14, .7); backdrop-filter: blur(3px); opacity: 0; visibility: hidden; transition: .25s; z-index: 1290; }
.nav-overlay.open { opacity: 1; visibility: visible; }

@media (max-width: 980px) {
    .nav-toggle { display: flex; }
    .site-nav-wrap { margin-left: 0; }
    /* NB : le header (backdrop-filter) devient bloc conteneur des descendants
       fixed → on ancre le tiroir en absolute sous le header. */
    .site-nav {
        position: absolute; top: 100%; right: 0; width: min(84vw, 340px);
        height: calc(100vh - var(--header-h)); height: calc(100dvh - var(--header-h));
        flex-direction: column; align-items: stretch; gap: .15rem;
        background: var(--bg-2); border-left: 1px solid var(--border-strong);
        padding: 1.2rem 1rem 2rem;
        transform: translateX(102%); transition: transform .3s cubic-bezier(.2, .8, .2, 1);
        overflow-y: auto; z-index: 1295;
    }
    .site-nav.open { transform: translateX(0); }
    .site-nav > li > a { padding: .8rem .9rem; font-size: 1.02rem; }
    .site-nav li { display: flex; flex-wrap: wrap; }
    .site-nav li > a { flex: 1; }
    .site-nav .sub-toggle {
        display: inline-flex; align-items: center; justify-content: center;
        width: 42px; background: none; border: none; color: var(--text-muted);
        font-size: 1rem; cursor: pointer;
    }
    .site-nav .sub-menu {
        position: static; width: 100%; min-width: 0; display: none;
        opacity: 1; visibility: visible; transform: none;
        background: rgba(255, 255, 255, .03); border: none; box-shadow: none;
        margin: .2rem 0 .4rem; padding: .2rem .4rem .2rem 1rem;
    }
    .site-nav .sub-menu.open { display: block; }
    .header-inner { gap: .8rem; }
}

/* ── Fil d'Ariane ──────────────────────────────────────────────────────────── */
.breadcrumb-wrap { max-width: var(--wide-w); margin: 0 auto; padding: 1rem 1.4rem 0; position: relative; z-index: 2; }
.breadcrumb-wrap nav ol { display: flex; flex-wrap: wrap; gap: .45rem; list-style: none; margin: 0; padding: 0; font-size: .85rem; }
.breadcrumb-wrap nav li { color: var(--text-muted); }
.breadcrumb-wrap nav a { color: var(--text-soft); }
.breadcrumb-wrap nav a:hover { color: var(--cyan); }
.breadcrumb-wrap .breadcrumb-sep { opacity: .5; }

/* ── Conteneurs ────────────────────────────────────────────────────────────── */
.site-main { max-width: var(--wide-w); margin: 0 auto; padding: 2.2rem 1.4rem 4rem; position: relative; z-index: 2; }
.site-main.with-sidebar { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 2.4rem; align-items: start; }
@media (max-width: 1020px) { .site-main.with-sidebar { grid-template-columns: 1fr; } }
.narrow { max-width: var(--content-w); margin-left: auto; margin-right: auto; }

.card {
    background: linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,.015));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    backdrop-filter: blur(6px);
}
.card-padded { padding: 2.4rem clamp(1.2rem, 4vw, 3rem); }

/* ── Boutons ───────────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; gap: .5rem;
    padding: .85rem 1.7rem; border-radius: 12px;
    font-weight: 700; font-size: 1rem; cursor: pointer; border: none;
    transition: transform .2s, box-shadow .2s, filter .2s;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--grad); color: #fff !important; box-shadow: var(--shadow-neon); }
.btn-primary:hover { filter: brightness(1.12); transform: translateY(-2px); }
.btn-ghost { background: transparent; color: var(--text) !important; border: 1px solid var(--border-strong); }
.btn-ghost:hover { border-color: var(--cyan); color: var(--cyan) !important; box-shadow: 0 0 16px rgba(34, 211, 238, .25); }

/* ── Hero (accueil) ────────────────────────────────────────────────────────── */
.hero {
    position: relative; overflow: hidden;
    padding: clamp(4rem, 9vw, 7.5rem) 1.4rem clamp(3rem, 6vw, 5rem);
    text-align: center;
}
.hero-particles { position: absolute; inset: 0; z-index: 0; }
.hero-inner { position: relative; z-index: 2; max-width: 900px; margin: 0 auto; }
.hero-kicker {
    display: inline-flex; align-items: center; gap: .5rem;
    font-family: var(--font-mono); font-size: .82rem; letter-spacing: .08em;
    color: var(--cyan); border: 1px solid rgba(34, 211, 238, .35);
    background: rgba(34, 211, 238, .07);
    padding: .4rem .9rem; border-radius: 999px; margin-bottom: 1.4rem;
}
.hero-kicker .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 10px var(--lime); animation: pulse-dot 1.8s infinite; }
@keyframes pulse-dot { 50% { opacity: .35; } }
.hero h1 {
    font-size: clamp(2.2rem, 5.4vw, 3.9rem);
    font-weight: 850; margin: 0 0 1.1rem;
}
.grad-text {
    background: var(--grad); -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent; color: transparent;
}
.hero-sub { font-size: clamp(1.05rem, 2vw, 1.28rem); color: var(--text-soft); max-width: 640px; margin: 0 auto 1.2rem; }
.hero-typed { font-family: var(--font-mono); color: var(--cyan); min-height: 1.6em; display: block; font-size: 1.02rem; margin-bottom: 2rem; }
.hero-typed .caret { display: inline-block; width: .55em; animation: caret-blink 1s steps(1) infinite; color: var(--violet-2); }
@keyframes caret-blink { 50% { opacity: 0; } }
.hero-ctas { display: flex; gap: .9rem; justify-content: center; flex-wrap: wrap; }

/* Terminal animé */
.terminal {
    text-align: left; max-width: 660px; margin: 3rem auto 0;
    background: rgba(5, 7, 16, .92); border: 1px solid var(--border-strong);
    border-radius: 14px; overflow: hidden;
    box-shadow: 0 30px 80px rgba(0, 0, 0, .55), 0 0 40px rgba(139, 92, 246, .18);
}
.terminal-bar { display: flex; align-items: center; gap: .45rem; padding: .65rem .9rem; background: rgba(255, 255, 255, .04); border-bottom: 1px solid var(--border); }
.terminal-bar i { width: 11px; height: 11px; border-radius: 50%; }
.terminal-bar i:nth-child(1) { background: #ff5f57; }
.terminal-bar i:nth-child(2) { background: #febc2e; }
.terminal-bar i:nth-child(3) { background: #28c840; }
.terminal-bar em { font-style: normal; font-family: var(--font-mono); font-size: .75rem; color: var(--text-muted); margin-left: .5rem; }
.terminal-body { padding: 1.1rem 1.2rem 1.3rem; font-family: var(--font-mono); font-size: .88rem; line-height: 1.75; min-height: 150px; }
.terminal-body .t-line { display: block; white-space: pre-wrap; word-break: break-word; }
.terminal-body .t-prompt { color: var(--lime); }
.terminal-body .t-cmd { color: var(--text); }
.terminal-body .t-ok { color: var(--cyan); }
.terminal-body .t-info { color: var(--text-muted); }

/* ── Bandeau statistiques (compteurs) ──────────────────────────────────────── */
.stats-band { max-width: var(--wide-w); margin: 0 auto; padding: 0 1.4rem; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1rem; }
.stat-card { text-align: center; padding: 1.6rem 1rem; position: relative; overflow: hidden; }
.stat-card::after {
    content: ""; position: absolute; inset: auto 20% -1px 20%; height: 2px;
    background: var(--grad); opacity: .75; border-radius: 2px;
}
.stat-num { font-size: 2.3rem; font-weight: 850; font-family: var(--font-mono); color: #fff; }
.stat-num .unit { font-size: 1.2rem; color: var(--cyan); }
.stat-label { color: var(--text-muted); font-size: .9rem; margin-top: .25rem; }

/* ── Sections génériques ───────────────────────────────────────────────────── */
.section { padding: clamp(3rem, 6vw, 5rem) 1.4rem; position: relative; z-index: 2; }
.section-inner { max-width: var(--wide-w); margin: 0 auto; }
.section-head { text-align: center; max-width: 700px; margin: 0 auto 2.6rem; }
.section-head .eyebrow { font-family: var(--font-mono); font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; color: var(--violet-2); }
.section-head h2 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); margin: .5rem 0 .8rem; }
.section-head p { color: var(--text-soft); margin: 0; }

/* ── Grille de services ────────────────────────────────────────────────────── */
.services-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 1.2rem; }
.service-card {
    position: relative; display: block; padding: 1.8rem 1.6rem;
    color: var(--text); overflow: hidden;
    transition: transform .3s cubic-bezier(.2, .8, .2, 1), box-shadow .3s, border-color .3s;
}
.service-card:hover { transform: translateY(-6px); border-color: var(--border-strong); box-shadow: 0 24px 60px rgba(0, 0, 0, .4), 0 0 34px rgba(139, 92, 246, .18); color: var(--text); }
.service-card::before {
    content: ""; position: absolute; inset: 0;
    background: radial-gradient(420px 200px at var(--mx, 50%) var(--my, 0%), rgba(139, 92, 246, .16), transparent 65%);
    opacity: 0; transition: opacity .3s;
}
.service-card:hover::before { opacity: 1; }
.service-icon {
    width: 52px; height: 52px; border-radius: 14px; display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; margin-bottom: 1.1rem;
    background: linear-gradient(140deg, rgba(139, 92, 246, .22), rgba(34, 211, 238, .16));
    border: 1px solid var(--border-strong);
}
.service-card h3 { font-size: 1.22rem; margin: 0 0 .55rem; }
.service-card p { color: var(--text-soft); font-size: .95rem; margin: 0 0 1rem; }
.service-more { font-family: var(--font-mono); font-size: .82rem; color: var(--cyan); }
.service-card:hover .service-more::after { content: " →"; }

/* ── Zone mini-jeu ─────────────────────────────────────────────────────────── */
.game-zone { position: relative; }
.game-board {
    position: relative; height: 300px; border-radius: var(--radius); overflow: hidden;
    background:
        linear-gradient(rgba(34, 211, 238, .05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(34, 211, 238, .05) 1px, transparent 1px),
        var(--bg-2);
    background-size: 34px 34px, 34px 34px, auto;
    border: 1px solid var(--border-strong);
    cursor: crosshair;
    user-select: none; -webkit-user-select: none;
}
.game-hud { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .8rem; margin-bottom: 1rem; }
.game-hud .game-score { font-family: var(--font-mono); font-size: 1.05rem; color: var(--lime); }
.game-hud .game-timer { font-family: var(--font-mono); color: var(--cyan); }
.game-bug {
    position: absolute; font-size: 1.7rem; line-height: 1; cursor: crosshair;
    transition: transform .1s; will-change: transform;
    filter: drop-shadow(0 0 8px rgba(163, 230, 53, .5));
}
.game-bug:hover { transform: scale(1.25); }
.game-splat { position: absolute; font-size: 1.5rem; pointer-events: none; animation: splat .5s forwards; }
@keyframes splat { to { transform: scale(2.2); opacity: 0; } }
.game-msg {
    position: absolute; inset: 0; display: flex; flex-direction: column; gap: 1rem;
    align-items: center; justify-content: center; text-align: center; padding: 1rem;
    background: rgba(7, 10, 23, .55); backdrop-filter: blur(2px);
}
.game-msg p { margin: 0; color: var(--text-soft); max-width: 420px; }
.game-msg strong { color: #fff; font-size: 1.25rem; }

/* ── Blog : cartes d'articles ──────────────────────────────────────────────── */
.posts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.4rem; }
.post-card { display: flex; flex-direction: column; overflow: hidden; transition: transform .3s, box-shadow .3s, border-color .3s; }
.post-card:hover { transform: translateY(-6px); border-color: var(--border-strong); box-shadow: 0 22px 54px rgba(0, 0, 0, .45), 0 0 30px rgba(34, 211, 238, .12); }
.post-card-thumb { aspect-ratio: 16 / 9; overflow: hidden; background: var(--surface-2); position: relative; }
.post-card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s; }
.post-card:hover .post-card-thumb img { transform: scale(1.06); }
.post-card-body { padding: 1.35rem 1.4rem 1.5rem; display: flex; flex-direction: column; flex: 1; }
.post-card-meta { display: flex; align-items: center; gap: .7rem; font-size: .8rem; color: var(--text-muted); font-family: var(--font-mono); margin-bottom: .6rem; }
.post-card-cat { color: var(--violet-2); border: 1px solid rgba(139, 92, 246, .4); border-radius: 999px; padding: .1rem .6rem; }
.post-card h3, .post-card h2 { font-size: 1.18rem; margin: 0 0 .55rem; }
.post-card h3 a, .post-card h2 a { color: #fff; }
.post-card h3 a:hover, .post-card h2 a:hover { color: var(--cyan); }
.post-card p { color: var(--text-soft); font-size: .93rem; margin: 0 0 1rem; flex: 1; }
.post-card .read-more { font-family: var(--font-mono); font-size: .82rem; color: var(--cyan); }

/* ── En-tête de page/listing ───────────────────────────────────────────────── */
.page-hero { text-align: center; padding: clamp(2.6rem, 5vw, 4rem) 1.4rem 1rem; position: relative; z-index: 2; }
.page-hero h1 { font-size: clamp(1.9rem, 4vw, 3rem); max-width: 860px; margin: 0 auto .8rem; }
.page-hero .page-hero-desc { color: var(--text-soft); max-width: 660px; margin: 0 auto; }
.hero-divider { width: 90px; height: 3px; margin: 1.3rem auto 0; border-radius: 3px; background: var(--grad); box-shadow: 0 0 14px rgba(139, 92, 246, .6); }

/* ── Corps d'article / de page ─────────────────────────────────────────────── */
.article-body { font-size: 1.09rem; line-height: 1.85; color: var(--text-soft); overflow-wrap: break-word; }
.article-body h2 {
    font-size: 1.65rem; margin: 2.6rem 0 1rem; padding-top: .4rem; position: relative;
}
.article-body h2::before {
    content: "#"; font-family: var(--font-mono); color: var(--violet);
    margin-right: .55rem; opacity: .85;
}
.article-body h3 { font-size: 1.28rem; margin: 2rem 0 .8rem; color: #f1f3ff; }
.article-body h3::before { content: "//"; font-family: var(--font-mono); color: var(--cyan); margin-right: .5rem; opacity: .7; font-size: .95em; }
.article-body p { margin: 0 0 1.25rem; }
.article-body strong { color: #fff; font-weight: 700; }
.article-body em { color: var(--cyan); font-style: italic; }
.article-body a { text-decoration: underline; text-decoration-color: rgba(34, 211, 238, .4); text-underline-offset: 3px; }
.article-body ul, .article-body ol { margin: 0 0 1.25rem; padding-left: 1.4rem; }
.article-body li { margin-bottom: .5rem; }
.article-body li::marker { color: var(--violet-2); }
.article-body blockquote {
    margin: 1.8rem 0; padding: 1.1rem 1.4rem;
    border-left: 3px solid var(--violet); border-radius: 0 12px 12px 0;
    background: rgba(139, 92, 246, .07); color: var(--text);
}
.article-body code {
    font-family: var(--font-mono); font-size: .88em;
    background: rgba(34, 211, 238, .1); border: 1px solid rgba(34, 211, 238, .18);
    color: var(--cyan); padding: .12em .4em; border-radius: 6px;
}
.article-body pre {
    background: #05070f; border: 1px solid var(--border-strong); border-radius: 12px;
    padding: 1.1rem 1.3rem; overflow-x: auto; line-height: 1.6;
}
.article-body pre code { background: none; border: none; color: var(--text); padding: 0; }
.article-body img { border-radius: 12px; border: 1px solid var(--border); }
.article-body table { width: 100%; border-collapse: collapse; margin: 1.6rem 0; font-size: .95rem; }
.article-body th, .article-body td { padding: .7rem .9rem; border: 1px solid var(--border); text-align: left; }
.article-body th { background: rgba(139, 92, 246, .12); color: #fff; }
.article-body tr:nth-child(even) td { background: rgba(255, 255, 255, .02); }
.article-body hr { border: none; height: 1px; background: var(--border-strong); margin: 2.4rem 0; }
.article-body figure { margin: 1.8rem 0; }
.article-body figcaption { text-align: center; font-size: .85rem; color: var(--text-muted); margin-top: .5rem; }

/* ── Article (post.php) ────────────────────────────────────────────────────── */
.post-header { max-width: var(--content-w); margin: 0 auto; padding: 2.2rem 1.4rem 0; text-align: center; position: relative; z-index: 2; }
.post-header h1 { font-size: clamp(1.8rem, 3.8vw, 2.7rem); margin: .6rem 0 1rem; }
.post-meta { display: flex; justify-content: center; flex-wrap: wrap; gap: 1rem; color: var(--text-muted); font-size: .87rem; font-family: var(--font-mono); }
.post-meta a { color: var(--violet-2); }
.post-featured { max-width: 960px; margin: 2rem auto 0; padding: 0 1.4rem; }
.post-featured img { width: 100%; border-radius: var(--radius); border: 1px solid var(--border-strong); box-shadow: 0 28px 70px rgba(0, 0, 0, .5); }

/* ── Sidebar ───────────────────────────────────────────────────────────────── */
.sidebar { position: sticky; top: calc(var(--header-h) + 1.4rem); display: flex; flex-direction: column; gap: 1.2rem; }
.sidebar-widget { padding: 1.4rem 1.4rem 1.5rem; }
.sidebar-widget h4, .sidebar-widget h3 { font-size: 1rem; margin: 0 0 .9rem; color: #fff; letter-spacing: .01em; }
.sidebar-widget ul { list-style: none; margin: 0; padding: 0; }
.sidebar-widget li { padding: .42rem 0; border-bottom: 1px dashed var(--border); font-size: .92rem; }
.sidebar-widget li:last-child { border-bottom: none; }
.sidebar-widget a { color: var(--text-soft); }
.sidebar-widget a:hover { color: var(--cyan); }
.after-content-widgets { max-width: var(--content-w); margin: 2rem auto 0; padding: 0 1.4rem; }

/* ── Widgets rendus par SidebarManager ─────────────────────────────────────── */
.sidebar .sidebar-widget {
    background: linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,.015));
    border: 1px solid var(--border); border-radius: var(--radius);
}
.sidebar-widget-title { font-weight: 800; color: #fff; margin-bottom: .9rem; font-size: 1rem; }
.sidebar-list { list-style: none; margin: 0; padding: 0; }
.sidebar-list li { padding: .42rem 0; border-bottom: 1px dashed var(--border); font-size: .92rem; }
.sidebar-list li:last-child { border-bottom: none; }
.sidebar-list a { color: var(--text-soft); }
.sidebar-list a:hover { color: var(--cyan); }
.sidebar-search { display: flex; gap: .45rem; }
.sidebar-search input {
    flex: 1; min-width: 0; background: var(--bg-2); border: 1px solid var(--border);
    border-radius: 9px; padding: .55rem .8rem; color: var(--text); font-family: inherit; font-size: .93rem;
}
.sidebar-search input:focus { outline: none; border-color: var(--cyan); }
.sidebar-search button { background: var(--grad); border: none; border-radius: 9px; padding: .5rem .7rem; cursor: pointer; }

/* ── Quiz (plugin quiz-quietcms) : adaptation au thème sombre ──────────────── */
.qcms-quiz { --q-navy: #e5e9ff; --q-gold: #22d3ee; --q-bd: rgba(148, 163, 255, .25); }
.qcms-quiz .qz-card { background: var(--bg-2) !important; box-shadow: none !important; border-left-color: var(--cyan) !important; }
.qcms-quiz .qz-q { font-family: inherit !important; color: #fff !important; }
.qcms-quiz .qz-tag { background: var(--violet) !important; }
.qcms-quiz .qz-btn { background: rgba(255, 255, 255, .05) !important; color: var(--text) !important; }
.qcms-quiz .qz-btn:hover:not(:disabled) { background: rgba(139, 92, 246, .16) !important; border-color: var(--violet) !important; }
.qcms-quiz .qz-btn.is-correct { background: rgba(34, 197, 94, .14) !important; color: #86efac !important; }
.qcms-quiz .qz-btn.is-wrong { background: rgba(220, 38, 38, .14) !important; color: #fca5a5 !important; }
.qcms-quiz .qz-feedback.ok { background: rgba(34, 197, 94, .1) !important; border-color: rgba(34, 197, 94, .35) !important; color: #bbf7d0 !important; }
.qcms-quiz .qz-feedback.ko { background: rgba(220, 38, 38, .1) !important; border-color: rgba(220, 38, 38, .35) !important; color: #fecaca !important; }
.qcms-quiz .qz-exp { color: var(--text-soft) !important; }
.qcms-quiz .qz-next { background: var(--grad) !important; }

/* ── Pagination ────────────────────────────────────────────────────────────── */
.pagination { display: flex; justify-content: center; align-items: center; gap: .45rem; margin-top: 2.6rem; flex-wrap: wrap; }
.pagination a, .pagination span {
    min-width: 42px; height: 42px; display: inline-flex; align-items: center; justify-content: center;
    padding: 0 .8rem; border-radius: 11px; font-family: var(--font-mono); font-size: .92rem;
    border: 1px solid var(--border); color: var(--text-soft);
}
.pagination a:hover { border-color: var(--cyan); color: var(--cyan); }
.pagination .current { background: var(--grad); border: none; color: #fff; font-weight: 700; box-shadow: 0 0 18px rgba(139, 92, 246, .4); }
.pagination .dots { border: none; }

/* ── Commentaires (composant cœur QuietCMS : variables adaptées au sombre) ──── */
#comments {
    --border: rgba(148, 163, 255, .16);
    --card-bg: #10152e;
    --text: #e5e9ff;
    --muted: #8b94c4;
    max-width: var(--content-w); margin-left: auto; margin-right: auto;
}
#comments input, #comments textarea {
    background: var(--bg-2) !important; color: var(--text) !important;
    border-color: rgba(148, 163, 255, .25) !important;
}
#comments button[type="submit"] { background: var(--grad) !important; border: none !important; }

/* ── 404 ───────────────────────────────────────────────────────────────────── */
.error-hero { text-align: center; padding: clamp(3rem, 7vw, 5rem) 1.4rem 1rem; position: relative; z-index: 2; }
.error-code {
    font-family: var(--font-mono); font-size: clamp(4.5rem, 14vw, 9rem); font-weight: 800;
    line-height: 1; background: var(--grad); -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent; color: transparent;
    filter: drop-shadow(0 0 26px rgba(139, 92, 246, .45));
}
.error-hero h1 { font-size: clamp(1.4rem, 3vw, 2rem); margin: .8rem 0; }
.error-hero p { color: var(--text-soft); max-width: 520px; margin: 0 auto 1.6rem; }
#pong-canvas { width: 100%; max-width: 560px; border-radius: var(--radius); border: 1px solid var(--border-strong); background: #05070f; display: block; margin: 0 auto; touch-action: none; }

/* ── Footer ────────────────────────────────────────────────────────────────── */
.site-footer { position: relative; border-top: 1px solid var(--border); margin-top: 2rem; background: rgba(5, 7, 16, .7); overflow: hidden; }
.footer-grid-bg {
    position: absolute; inset: 0; opacity: .5; pointer-events: none;
    background:
        linear-gradient(rgba(139, 92, 246, .05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(139, 92, 246, .05) 1px, transparent 1px);
    background-size: 40px 40px;
    mask-image: linear-gradient(180deg, transparent, #000 60%);
    -webkit-mask-image: linear-gradient(180deg, transparent, #000 60%);
}
.footer-inner { position: relative; max-width: var(--wide-w); margin: 0 auto; padding: 3rem 1.4rem 1.6rem; }
.footer-top { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 2.4rem; padding-bottom: 2.2rem; }
@media (max-width: 820px) { .footer-top { grid-template-columns: 1fr; gap: 1.8rem; } }
.footer-about { color: var(--text-muted); font-size: .93rem; max-width: 380px; margin: 1rem 0; }
.footer-terminal { font-family: var(--font-mono); font-size: .82rem; color: var(--text-muted); }
.footer-terminal .prompt { color: var(--lime); }
.footer-terminal .cmd { color: var(--cyan); }
.cursor-blink { animation: caret-blink 1.1s steps(1) infinite; color: var(--violet-2); }
.footer-col h4 { font-size: .95rem; text-transform: uppercase; letter-spacing: .1em; color: var(--text-muted); margin: 0 0 1rem; }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin-bottom: .55rem; }
.footer-col a { color: var(--text-soft); font-size: .93rem; }
.footer-col a:hover { color: var(--cyan); }
.footer-bottom {
    border-top: 1px solid var(--border); padding-top: 1.4rem;
    display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
    color: var(--text-muted); font-size: .84rem;
}

/* ── Retour en haut ────────────────────────────────────────────────────────── */
.back-to-top {
    position: fixed; right: 1.2rem; bottom: 1.2rem; z-index: 1400;
    width: 48px; height: 48px; border-radius: 14px; border: 1px solid var(--border-strong);
    background: rgba(16, 21, 48, .9); color: var(--cyan); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; visibility: hidden; transform: translateY(10px); transition: .25s;
}
.back-to-top.show { opacity: 1; visibility: visible; transform: none; }
.back-to-top:hover { box-shadow: 0 0 18px rgba(34, 211, 238, .35); }
.back-to-top svg { width: 20px; height: 20px; }

/* ── Animations d'apparition au défilement ─────────────────────────────────── */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s cubic-bezier(.2, .8, .2, 1), transform .7s cubic-bezier(.2, .8, .2, 1); }
.reveal.visible { opacity: 1; transform: none; }
.reveal-delay-1 { transition-delay: .1s; }
.reveal-delay-2 { transition-delay: .2s; }
.reveal-delay-3 { transition-delay: .3s; }

/* ── Pluie Matrix (easter egg Konami) ──────────────────────────────────────── */
#matrix-rain { position: fixed; inset: 0; z-index: 4000; pointer-events: none; }

/* ── Formulaire de contact (composant natif QuietCMS, adapté au sombre) ────── */
.contact-card .qcms-label { color: var(--text-soft); }
.contact-card .qcms-input {
    background: var(--bg-2); border-color: rgba(148, 163, 255, .25);
    color: var(--text); border-radius: 10px; padding: .7rem .85rem;
}
.contact-card .qcms-input:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(34, 211, 238, .16); }
.contact-card .qcms-input::placeholder { color: var(--text-muted); }
.contact-card select.qcms-input option { background: var(--bg-2); color: var(--text); }
.contact-card .qcms-checkbox-label, .contact-card .qcms-radio-label { color: var(--text-soft); font-size: .87rem; }
.contact-card .qcms-field-help { color: var(--text-muted); }
.contact-card .qcms-req { color: var(--magenta); }
.contact-card .qcms-submit {
    background: var(--grad); border-radius: 12px; padding: .85rem 1.8rem;
    font-size: 1rem; font-weight: 700; box-shadow: var(--shadow-neon);
    transition: transform .2s, filter .2s;
}
.contact-card .qcms-submit:hover { background: var(--grad); filter: brightness(1.12); transform: translateY(-2px); }
.contact-card .qcms-alert-success { background: rgba(34, 197, 94, .12); border-color: rgba(34, 197, 94, .4); color: #bbf7d0; }
.contact-card .qcms-alert-error { background: rgba(220, 38, 38, .12); border-color: rgba(220, 38, 38, .4); color: #fecaca; }
.contact-card .qcms-section { border-top-color: var(--border); }
.contact-alt { text-align: center; color: var(--text-muted); font-size: .9rem; margin: 1.2rem 0 0; }
#contact { scroll-margin-top: calc(var(--header-h) + 10px); }

/* ── FAQ (plugin faq-quietcms + balisage natif) ────────────────────────────── */
.article-body details, details.faq-item {
    border: 1px solid var(--border); border-radius: 12px;
    margin-bottom: .8rem; background: rgba(255, 255, 255, .02);
}
.article-body summary, details.faq-item summary {
    cursor: pointer; padding: 1rem 1.2rem; font-weight: 700; color: #fff; list-style: none;
    display: flex; justify-content: space-between; align-items: center; gap: 1rem;
}
.article-body summary::after, details.faq-item summary::after {
    content: "+"; font-family: var(--font-mono); color: var(--cyan); font-size: 1.2rem; transition: transform .25s;
}
.article-body details[open] summary::after { transform: rotate(45deg); }
.article-body details > *:not(summary) { padding: 0 1.2rem; }
.article-body details > p:last-child { padding-bottom: 1.1rem; }

/* ── Impression ────────────────────────────────────────────────────────────── */
@media print {
    body { background: #fff; color: #000; }
    .site-header, .site-footer, .back-to-top, .cursor-glow, .nav-overlay, .sidebar, #comments, .game-zone { display: none !important; }
    .article-body { color: #000; }
    .article-body strong { color: #000; }
    a { color: #000; }
}
