/* =====================================================
   COURS MEMO - STYLESHEET
   Créé par Antigravity - 2025
   ===================================================== */

:root {
    /* Identite Automation : violet de marque, cyan en accent secondaire. */
    --primary: #6c5ce7;
    --primary-bright: #a29bfe;
    --primary-rgb: 108, 92, 231;
    --accent-2: #00cec9;
    --secondary: #303030;
    --accent: #ffffff;
    --bg: #0f0f13;
    --bg2: #1a1a2e;
    --card: #17171f;
    --text: #f0f0f0;
    --muted: #a0a0a0;
    --border: #2a2a38;

    /* Syntax Highlighting */
    --kw: #c792ea;
    --fn: #82aaff;
    --str: #c3e88d;
    --num: #f78c6c;
    --c: #546e7a;
    --var: #ffcb6b;

    /* Technical Modules Colors */
    --tech-data: #3ECF8E;
    --tech-api: #4aa8ff;
    --tech-ux: #e17055;
    --tech-code: #fd79a8;
}

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

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
    outline: 2px solid var(--primary-bright);
    outline-offset: 3px;
}

[data-scrollable]:focus-visible {
    outline: 2px solid var(--primary-bright);
    outline-offset: -2px;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 95px;
    overflow-x: clip;
}

body {
    font-family: 'Outfit', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    overflow-x: clip;
    min-width: 0;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

/* === HEADER === */
header {
    position: sticky;
    top: 0;
    background: rgba(15, 15, 19, 0.92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    z-index: 100;
    padding: 16px 0;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-bright);
    text-decoration: none;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: transparent;
    color: var(--primary-bright);
    border: 2px solid var(--primary-bright);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 700;
}

nav {
    display: flex;
    gap: 4px;
    align-items: center;
}

.nav-links {
    display: flex;
    gap: 2px;
}

.nav-links a {
    color: var(--muted);
    text-decoration: none;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 0.8rem;
    transition: all 0.2s;
    font-weight: 500;
}

.nav-links a:hover {
    background: var(--bg2);
    color: var(--primary-bright);
}

.nav-links a[aria-current="page"] {
    background: var(--bg2);
    color: #ffffff;
    font-weight: 600;
    box-shadow: inset 0 -2px 0 var(--primary-bright);
}

/* === MOBILE MENU BTN === */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 110;
}

.mobile-menu-btn span {
    display: block;
    width: 25px;
    height: 2px;
    background: var(--primary-bright);
    transition: 0.3s;
}

.mobile-menu-btn.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.close-menu-btn {
    display: none;
    position: absolute;
    top: 20px;
    right: 20px;
    background: transparent;
    border: none;
    color: var(--primary-bright);
    font-size: 2rem;
    cursor: pointer;
}

/* === HERO === */
.hero {
    padding: 70px 0 50px;
    text-align: center;
    border-bottom: 1px solid var(--border);
    background: radial-gradient(circle at center, rgba(var(--primary-rgb), 0.10) 0%, transparent 60%);
}

main:focus {
    outline: none;
}

.hero h1 {
    font-size: 2.8rem;
    font-weight: 700;
    color: var(--primary-bright);
    margin-bottom: 16px;
    text-shadow: 0 0 20px rgba(var(--primary-rgb), 0.30);
}

.hero p {
    color: var(--muted);
    max-width: 600px;
    margin: 0 auto;
    font-size: 1.05rem;
}

.hero-lede {
    max-width: 780px;
    margin: 0 auto;
    text-align: left;
}

.hero-lede p {
    max-width: none;
    margin: 0;
    color: #c9cdd6;
    font-size: 1rem;
    line-height: 1.7;
}

.hero-lede p+p {
    margin-top: 12px;
}

.hero-note {
    max-width: 720px;
    margin: 22px auto 0;
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.55;
    text-align: center;
}

/* Trois parcours de lecture, poses sous le motif de workflow. */
.hero-paths {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    max-width: 980px;
    margin: 38px auto 0;
    text-align: left;
}

.hero-path {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
    color: inherit;
    text-decoration: none;
    transition: transform 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

.hero-path:hover,
.hero-path:focus-visible {
    transform: translateY(-3px);
    border-color: rgba(162, 155, 254, 0.45);
    background: rgba(108, 92, 231, 0.08);
}

.hero-path-kicker {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent-2);
}

.hero-path strong {
    font-size: 1.1rem;
    color: #fff;
}

.hero-path-desc {
    font-size: 0.85rem;
    line-height: 1.55;
    color: var(--muted);
}

.hero-path-go {
    margin-top: auto;
    padding-top: 4px;
    font-size: 0.82rem;
    color: var(--primary-bright);
}

@media (max-width: 760px) {
    .hero-paths {
        grid-template-columns: 1fr;
        max-width: 520px;
    }
}

/* === INFO BOXES === */
.intro-box {
    background: var(--card);
    border-bottom: 1px solid var(--border);
    padding: 30px 0;
}

.intro-box h3 {
    margin-top: 0;
    color: var(--primary-bright);
}

/* === TOC === */
.toc {
    padding: 35px 0;
    border-bottom: 1px solid var(--border);
}

.toc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
}

.toc-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    text-decoration: none;
    color: var(--text);
    font-size: 0.88rem;
    transition: all 0.2s;
}

.toc-item:hover {
    border-color: var(--primary);
    transform: translateX(4px);
    background: rgba(var(--primary-rgb), 0.10);
}

.toc-num {
    width: 26px;
    height: 26px;
    background: rgba(var(--primary-rgb), 0.15);
    color: var(--primary-bright);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    font-weight: 600;
    flex-shrink: 0;
    border: 1px solid rgba(var(--primary-rgb), 0.30);
}

/* === SECTIONS === */
section {
    padding: 55px 0;
    border-bottom: 1px solid var(--border);
}

.sec-header {
    display: flex;
    align-items: flex-start;
    gap: 18px;
    margin-bottom: 30px;
}

.sec-num {
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, var(--primary), #4c3fbf);
    color: #fff;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.2rem;
    font-weight: 600;
    flex-shrink: 0;
    box-shadow: 0 4px 15px rgba(var(--primary-rgb), 0.25);
}

.sec-title {
    font-size: 1.7rem;
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--primary-bright);
}

.sec-sub {
    color: var(--muted);
    font-size: 0.95rem;
}

/* === DETAILS === */
details {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin: 14px 0;
    overflow: hidden;
}

summary {
    padding: 12px 16px;
    cursor: pointer;
    font-weight: 600;
    color: var(--primary-bright);
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background 0.2s;
}

summary:hover {
    background: rgba(131, 205, 41, 0.05);
}

summary::after {
    content: '+';
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--muted);
    transition: transform 0.2s;
}

details[open] summary::after {
    transform: rotate(45deg);
}

.details-content {
    padding: 16px;
    color: var(--muted);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* === CODE === */
.code {
    background: #1e1e1e;
    border: 1px solid var(--border);
    border-radius: 10px;
    margin: 14px 0;
    overflow: hidden;
}

.code-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: #252526;
    border-bottom: 1px solid var(--border);
    font-size: 0.78rem;
    color: var(--muted);
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.dot.r {
    background: #ff5f56;
}

.dot.y {
    background: #ffbd2e;
}

.dot.g {
    background: #27ca40;
}

pre {
    padding: 16px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    line-height: 1.55;
    overflow-x: auto;
    color: #abb2bf;
}

.kw {
    color: var(--kw);
}

.fn {
    color: var(--fn);
}

.str {
    color: var(--str);
}

.num {
    color: var(--num);
}

.c {
    color: var(--c);
    font-style: italic;
}

.var {
    color: var(--var);
}

/* === UTILS === */
.grid2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.tip,
.info,
.warning {
    padding: 14px 18px;
    border-radius: 0 10px 10px 0;
    margin: 14px 0;
    font-size: 0.95rem;
}

.tip {
    background: rgba(var(--primary-rgb), 0.10);
    border-left: 3px solid var(--primary);
}

.warning {
    background: rgba(247, 140, 108, 0.1);
    border-left: 3px solid var(--num);
}

.tip strong,
.warning strong {
    color: var(--primary-bright);
}

/* === FOOTER === */
footer {
    padding: 40px 0;
    text-align: center;
    color: var(--dim);
    font-size: 0.85rem;
    border-top: 1px solid var(--border);
}

/* === COMPOSANTS DE LA PAGE AUTOMATION === */
:root {
    --accent-glow: 0 0 20px rgba(108, 92, 231, 0.4);
    --card-bg: rgba(255, 255, 255, 0.03);
    --border-light: rgba(255, 255, 255, 0.08);
    --mcp-color: #e056fd;
    --nocode-color: #ff9f43;
}

body {
    background-color: #0f0f13;
    background-image: radial-gradient(circle at 50% 0%, #1a1a2e 0%, #0f0f13 100%);
}

.module-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 16px;
    border-radius: 30px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
}

.badge-1 {
    background: rgba(108, 92, 231, 0.15);
    color: #a29bfe;
    border-color: rgba(108, 92, 231, 0.3);
}

.hero h1 {
    font-size: 3.5rem;
    background: linear-gradient(135deg, #fff 0%, #a29bfe 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 20px;
}

/* Motif de workflow : une impulsion traverse la chaine d'automatisation. */
.hero-flow {
    max-width: 880px;
    margin: 46px auto 0;
}

.hero-flow svg {
    display: block;
    width: 100%;
    height: auto;
}

.flow-track {
    fill: none;
    stroke: rgba(255, 255, 255, 0.10);
    stroke-width: 2;
}

.flow-pulse {
    fill: none;
    stroke: url(#heroFlowGradient);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-dasharray: 46 754;
    animation: flow-travel 7s linear infinite;
}

@keyframes flow-travel {
    from {
        stroke-dashoffset: 800;
    }

    to {
        stroke-dashoffset: 0;
    }
}

.flow-node circle {
    fill: var(--bg);
    stroke: var(--primary-bright);
    stroke-width: 2;
}

.flow-node-end circle {
    stroke: var(--accent-2);
}

.flow-node text {
    fill: var(--muted);
    font-family: 'Outfit', sans-serif;
    font-size: 15px;
    letter-spacing: 0.02em;
}

@media (max-width: 640px) {
    .flow-node text {
        display: none;
    }
}

.concept-box {
    background: var(--card-bg);
    border: 1px solid var(--border-light);
    border-left: 4px solid var(--accent);
    padding: 20px;
    margin: 25px 0;
    border-radius: 12px;
    position: relative;
    overflow: hidden;
}

.concept-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.02) 100%);
    pointer-events: none;
}

.vocab-list dt {
    font-weight: 700;
    color: #fff;
    margin-top: 15px;
    font-family: 'Outfit', sans-serif;
    font-size: 1.1rem;
}

.vocab-list dd {
    color: #b2bec3;
    margin-left: 0;
    margin-bottom: 10px;
    line-height: 1.6;
}

.scenario-card {
    background: linear-gradient(145deg, rgba(45, 52, 54, 0.4), rgba(30, 39, 46, 0.4));
    padding: 25px;
    border-radius: 16px;
    border: 1px solid var(--border-light);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
}

.scenario-card:hover {
    transform: translateY(-5px);
    border-color: rgba(108, 92, 231, 0.4);
}

.section-banner {
    margin: 34px 0 44px;
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid var(--border-light);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
    background: #0b0b11;
}

.section-banner img {
    display: block;
    width: 100%;
    height: auto;
}

/* Phrase d'entree de module, posee juste apres la banniere. */
.module-intro {
    max-width: 780px;
    margin: 0 auto 34px;
    padding: 14px 18px;
    border-left: 3px solid var(--primary-bright);
    border-radius: 0 10px 10px 0;
    background: rgba(108, 92, 231, 0.07);
    color: #d5d8dc;
    font-size: 0.95rem;
    line-height: 1.6;
}

.module-intro p {
    margin: 0;
}

.module-intro p+p {
    margin-top: 10px;
}

.module-intro p:first-child {
    color: #e6e8ee;
}

/* Objectifs observables, poses juste apres la mise en situation. */
.module-goals {
    max-width: 780px;
    margin: -16px auto 34px;
    padding: 18px 20px;
    border: 1px solid rgba(162, 155, 254, 0.20);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.025);
}

.goals-title {
    margin-bottom: 9px;
    color: var(--primary-bright);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.goals-list {
    display: grid;
    gap: 6px;
    list-style: none;
}

.goals-list li {
    position: relative;
    padding-left: 18px;
    color: #c9cdd6;
    font-size: 0.9rem;
    line-height: 1.55;
}

.goals-list li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--primary-bright);
}

.goals-check {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px dashed rgba(255, 255, 255, 0.12);
    color: var(--muted);
    font-size: 0.85rem;
    line-height: 1.55;
}

.goals-check strong {
    color: #e6e8ee;
}

/* Fiches memo imprimables. */
.memo-tools {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    margin: 0 0 22px;
}

.memo-hint {
    max-width: 540px;
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.5;
}

.memo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
    gap: 18px;
    align-items: start;
}

.memo-card {
    padding: 20px 20px 16px;
    border: 1px solid var(--border-light);
    border-radius: 14px;
    background: linear-gradient(145deg, rgba(45, 52, 54, 0.35), rgba(30, 39, 46, 0.35));
    break-inside: avoid;
}

.memo-kicker {
    margin-bottom: 2px;
    color: var(--primary-bright);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.memo-card h3 {
    margin-bottom: 12px;
    color: #fff;
    font-size: 1.05rem;
}

.memo-card h4 {
    margin: 14px 0 6px;
    color: #b2bec3;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.memo-card ul {
    display: grid;
    gap: 5px;
    list-style: none;
}

.memo-card li {
    position: relative;
    padding-left: 14px;
    color: #c9cdd6;
    font-size: 0.84rem;
    line-height: 1.5;
}

.memo-card li::before {
    content: '·';
    position: absolute;
    left: 2px;
    color: var(--primary-bright);
    font-weight: 700;
}

.memo-check li::before {
    content: '☐';
    top: -1px;
    color: #fdcb6e;
    font-size: 0.9rem;
}

.memo-check li {
    padding-left: 22px;
}

.memo-back {
    margin-top: 12px;
    font-size: 0.8rem;
}

.memo-back a {
    color: var(--primary-bright);
}

/* Glossaire filtrable. */
.gloss-controls {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin: 0 0 8px;
}

.gloss-search {
    flex: 1 1 280px;
    min-width: 0;
    padding: 11px 14px;
    border: 1px solid var(--border-light);
    border-radius: 10px;
    background: var(--bg2);
    color: var(--text);
    font: inherit;
    font-size: 0.92rem;
}

.gloss-search::placeholder {
    color: #7d828c;
}

.gloss-count {
    color: var(--muted);
    font-size: 0.82rem;
    white-space: nowrap;
}

.gloss-empty {
    margin: 8px 0 20px;
    padding: 14px 16px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--muted);
    font-size: 0.9rem;
}

.gloss-group {
    margin-top: 28px;
}

.gloss-group h3 {
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
    color: #fff;
    font-size: 1.05rem;
}

.gloss-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 0 28px;
}

.gloss-entry {
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    break-inside: avoid;
}

.gloss-entry dt {
    color: #e6e8ee;
    font-size: 0.92rem;
    font-weight: 600;
}

.gloss-entry dd {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: 0.86rem;
    line-height: 1.55;
}

/* Tableaux de l'etude de cas. */
/* Etude de cas : le reset global supprime les marges des paragraphes,
   on les rend ici pour aerer les blocs de texte. */
#etude-de-cas .container > p {
    margin: 0 0 14px;
    color: #c9cdd6;
}

#etude-de-cas .sec-title-small {
    margin: 34px 0 12px;
    color: #fff;
    font-size: 1.12rem;
    line-height: 1.35;
}

.data-table-wrap {
    margin: 18px 0 24px;
    overflow-x: auto;
    border: 1px solid var(--border-light);
    border-radius: 12px;
}

.data-table {
    width: 100%;
    min-width: 560px;
    border-collapse: collapse;
    font-size: 0.87rem;
}

.data-table th,
.data-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
}

.data-table thead th {
    background: rgba(255, 255, 255, 0.04);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.data-table tbody tr:last-child td {
    border-bottom: 0;
}

.data-table td {
    color: #c9cdd6;
}

.data-table code {
    white-space: nowrap;
}

.case-quote {
    max-width: 760px;
    margin: 18px 0 22px;
    padding: 16px 18px;
    border-left: 3px solid #fdcb6e;
    border-radius: 0 10px 10px 0;
    background: rgba(253, 203, 110, 0.06);
    color: #d5d8dc;
    font-size: 0.92rem;
}

.case-quote p {
    margin: 0;
}

.case-quote p+p {
    margin-top: 6px;
}

[hidden] {
    display: none !important;
}

@media print {
    @page {
        margin: 14mm;
    }

    body.print-memos {
        background: #fff !important;
        color: #111 !important;
    }

    body.print-memos header,
    body.print-memos .hero,
    body.print-memos section:not(#fiches),
    body.print-memos footer,
    body.print-memos dialog,
    body.print-memos .memo-tools,
    body.print-memos .skip-link {
        display: none !important;
    }

    body.print-memos main,
    body.print-memos #fiches {
        display: block !important;
        padding: 0;
        border: 0;
        background: #fff !important;
    }

    body.print-memos #fiches .sec-header {
        display: block;
        margin-bottom: 16px;
    }

    body.print-memos #fiches .sec-num,
    body.print-memos #fiches .module-intro,
    body.print-memos #fiches .memo-back {
        display: none !important;
    }

    body.print-memos #fiches .sec-title {
        color: #111 !important;
        font-size: 20pt;
    }

    body.print-memos #fiches .sec-sub {
        color: #444 !important;
    }

    body.print-memos #fiches .memo-grid {
        display: block;
    }

    body.print-memos #fiches .memo-card {
        margin: 0 0 12px;
        padding: 14px;
        break-inside: avoid;
        page-break-inside: avoid;
        border: 1px solid #bbb;
        background: #fff !important;
        color: #111;
    }

    body.print-memos #fiches .memo-card h3,
    body.print-memos #fiches .memo-card h4,
    body.print-memos #fiches .memo-card .memo-kicker {
        color: #111 !important;
    }

    body.print-memos #fiches .memo-card li,
    body.print-memos #fiches .memo-card p {
        color: #222 !important;
    }

    body.print-memos #fiches a {
        color: #111 !important;
        text-decoration: none;
    }
}

.banner-zoom {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: none;
    cursor: zoom-in;
}

.banner-zoom:focus-visible {
    outline: 3px solid var(--primary-bright);
    outline-offset: -3px;
}

@media (max-width: 768px) {
    .section-banner::after {
        content: "Toucher le schéma pour l'agrandir";
        display: block;
        padding: 10px 14px;
        font-size: 0.75rem;
        color: var(--muted);
        border-top: 1px solid rgba(255, 255, 255, 0.06);
    }
}

/* Visionneuse plein écran des schémas */
.viewer-open {
    overflow: hidden;
}

.banner-viewer {
    width: 100vw;
    height: 100vh;
    max-width: 100vw;
    max-height: 100vh;
    margin: 0;
    padding: 0;
    border: 0;
    background: #06060a;
    color: var(--text);
}

.banner-viewer::backdrop {
    background: rgba(4, 4, 8, 0.94);
}

.banner-viewer-scroll {
    width: 100%;
    height: 100%;
    overflow: auto;
    padding: 64px 16px 24px;
}

.banner-viewer-scroll img {
    display: block;
    width: min(1400px, 96vw);
    min-width: 760px;
    height: auto;
    margin: 0 auto;
}

.banner-viewer-close {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 2;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: #14141e;
    color: var(--text);
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
}

.banner-viewer-close:hover {
    background: var(--primary);
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

/* === ATELIERS INTERACTIFS === */
.widget {
    margin: 32px 0;
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: linear-gradient(145deg, rgba(108, 92, 231, 0.08), rgba(15, 15, 19, 0.6));
}

.widget h4 {
    margin-bottom: 6px;
    color: #fff;
    font-size: 1.05rem;
}

.widget-help {
    margin-bottom: 14px;
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.55;
}

.widget label {
    display: block;
    margin: 14px 0 6px;
    color: var(--primary-bright);
    font-size: 0.8rem;
    font-weight: 600;
}

.widget input,
.widget select,
.widget textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #0b0b11;
    color: var(--text);
    font: inherit;
    font-size: 0.85rem;
}

.widget textarea {
    font-family: 'JetBrains Mono', monospace;
    line-height: 1.55;
    resize: vertical;
}

.widget-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.widget-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 14px;
}

.widget-btn {
    padding: 9px 16px;
    border: 0;
    border-radius: 8px;
    background: var(--primary);
    color: #fff;
    font: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
}

.widget-btn:hover {
    background: var(--primary-bright);
    color: #14141e;
}

.widget-btn.ghost {
    border: 1px solid var(--border);
    background: transparent;
    color: var(--muted);
}

.widget-btn.ghost:hover {
    border-color: var(--primary-bright);
    color: var(--primary-bright);
    background: transparent;
}

.widget-output {
    margin-top: 16px;
}

.widget-output:empty {
    display: none;
}

.widget-table-wrap {
    overflow-x: auto;
}

.widget-table {
    width: 100%;
    margin-top: 6px;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.widget-table th,
.widget-table td {
    padding: 7px 10px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
}

.widget-table th {
    color: var(--primary-bright);
    font-weight: 600;
}

.widget-null {
    color: #7f8c8d;
    font-style: italic;
}

.widget-note {
    margin-top: 10px;
    color: var(--muted);
    font-size: 0.8rem;
    line-height: 1.5;
}

.widget-error {
    margin-top: 10px;
    color: #ff7675;
    font-size: 0.85rem;
}

.widget-pre {
    margin: 0;
    padding: 15px;
    border: 1px solid #333;
    border-radius: 8px;
    background: #000;
    color: #dcdde1;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    line-height: 1.55;
    overflow-x: auto;
    white-space: pre-wrap;
}

@media (max-width: 700px) {
    .widget-grid {
        grid-template-columns: 1fr;
    }
}

.tool-chip {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 10px;
    border-radius: 6px;
    margin-right: 8px;
    margin-bottom: 8px;
    font-size: 0.85rem;
    color: #dfe6e9;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.code-block {
    background: #000;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 15px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    color: #dcdde1;
    overflow-x: auto;
}

.tutorial-step {
    border-left: 2px solid rgba(255, 255, 255, 0.1);
    padding-left: 20px;
    margin-bottom: 30px;
    position: relative;
}

.tutorial-step::before {
    content: '';
    position: absolute;
    left: -6px;
    top: 0;
    width: 10px;
    height: 10px;
    background: var(--accent);
    border-radius: 50%;
}

.tutorial-step h4 {
    color: #fff;
    margin-bottom: 10px;
}

.keyword {
    color: #e1b12c;
}

.string {
    color: #44bd32;
}

/* Roadmap Styles */
.roadmap-step {
    display: flex;
    align-items: flex-start;
    margin-bottom: 25px;
    padding: 20px;
    background: rgba(255, 159, 67, 0.05);
    border: 1px solid rgba(255, 159, 67, 0.2);
    border-radius: 12px;
}

.roadmap-num {
    font-size: 2rem;
    font-weight: 800;
    color: var(--nocode-color);
    margin-right: 20px;
    line-height: 1;
}

@media (max-width: 1024px) {
    body.menu-open {
        overflow: hidden;
    }

    /* Le backdrop-filter du header en ferait le bloc conteneur du menu
       fixe : le panneau se placerait alors en haut du document et non de
       la fenetre. On garde un fond opaque, sans flou, pour que le menu
       reste ancre a l'ecran. */
    header {
        background: rgba(15, 15, 19, 0.98);
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: 0;
        width: 100%;
        height: 100vh;
        height: 100dvh;
        background: #0f0f13;
        flex-direction: column;
        justify-content: flex-start;
        align-items: stretch;
        gap: 2px;
        padding: 78px 20px 28px;
        transform: translateX(100%);
        visibility: hidden;
        transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
        overflow-y: auto;
        overscroll-behavior: contain;
        z-index: 105;
    }

    .nav-links.active {
        transform: none;
        visibility: visible;
    }

    .nav-links a {
        flex: 0 0 auto;
        width: 100%;
        text-align: center;
        font-size: 1rem;
        padding: 11px 12px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }

    /* Le bouton hamburger se transforme deja en croix quand le menu est
       ouvert : le second bouton de fermeture faisait doublon par-dessus. */
    .close-menu-btn {
        display: none;
    }

    .hero h1 {
        font-size: 2.2rem;
    }
}

@media (max-width: 768px) {
    .hero h1 {
        font-size: 1.8rem;
    }

    .sec-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .sec-num {
        margin-bottom: 10px;
    }
}

/* === INTERACTIVE VOCAB === */
.vocab-chip {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 20px;
    margin-right: 8px;
    margin-bottom: 8px;
    font-size: 0.85rem;
    color: var(--text);
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.vocab-chip:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.vocab-chip::after {
    content: '?';
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 16px;
    height: 16px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    margin-left: 8px;
    font-size: 0.7rem;
    font-weight: bold;
}

/* === TOAST NOTIFICATION === */
.toast-container {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(20, 20, 23, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-left: 4px solid var(--primary-bright);
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    max-width: 90%;
    width: 400px;
    pointer-events: none;
}

.toast-container.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.toast-title {
    color: var(--primary-bright);
    font-weight: 700;
    margin-bottom: 6px;
    font-size: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.toast-body {
    color: #dfe6e9;
    font-size: 0.9rem;
    line-height: 1.5;
}

.toast-close {
    border: 0;
    background: transparent;
    color: var(--primary-bright);
    font: inherit;
    font-size: 1.1rem;
    line-height: 1;
    padding: 2px 4px;
    cursor: pointer;
}

/* === SKIP LINK === */
.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 200;
    background: var(--primary-bright);
    color: #000;
    font-weight: 700;
    padding: 10px 16px;
    border-radius: 0 0 8px 0;
    text-decoration: none;
}

.skip-link:focus {
    left: 0;
}

/* === REDUCED MOTION === */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        transition: none !important;
        animation: none !important;
    }
}

/* Accent du quiz partage, aligne sur l'identite violette du memo. */
#quiz-app {
    --quiz-accent: var(--primary-bright);
}

#quiz-app .quiz-btn.primary {
    background: var(--primary);
}

#quiz-app .quiz-btn.primary:hover {
    background: var(--primary-bright);
    color: #14141e;
}

/* =====================================================
   COMPOSANTS MULTI-PAGES & HUB (20261111)
   ===================================================== */

/* === VISUALLY HIDDEN (A11Y) === */
.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* === BREADCRUMB === */
.breadcrumb {
    margin-top: 20px;
    margin-bottom: 12px;
    font-size: 0.85rem;
}

.breadcrumb ol {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 0;
    margin: 0;
}

.breadcrumb li {
    display: inline-flex;
    align-items: center;
    color: var(--muted);
}

.breadcrumb li+li::before {
    content: "›";
    margin-right: 8px;
    color: var(--muted);
    opacity: 0.6;
}

.breadcrumb a {
    color: var(--primary-bright);
    text-decoration: none;
    transition: color 0.15s;
}

.breadcrumb a:hover {
    color: #ffffff;
    text-decoration: underline;
}

.breadcrumb [aria-current="page"] {
    color: var(--text);
    font-weight: 500;
}

/* === PAGE META & ACTIONS === */
.page-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 0.82rem;
    color: var(--muted);
    margin-top: 10px;
    margin-bottom: 14px;
}

.page-meta span+span::before {
    content: "•";
    margin-right: 16px;
    opacity: 0.4;
}

.page-actions {
    margin-bottom: 24px;
}

/* === PAGE TOC (SOMMAIRE INTERNE) === */
.page-toc {
    display: block;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px 24px;
    margin: 24px 0 32px;
}

.page-toc h2 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary-bright);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 14px;
}

.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px 24px;
}

@media (min-width: 860px) {
    .toc-list {
        grid-template-columns: 1fr 1fr;
    }
}

.toc-item a {
    color: var(--text);
    text-decoration: none;
    font-size: 0.9rem;
    display: inline-block;
    padding: 3px 0;
    transition: color 0.15s;
}

.toc-item a:hover {
    color: var(--primary-bright);
    text-decoration: underline;
}

.toc-item.toc-h2 a {
    font-weight: 600;
}

.toc-item.toc-h3 a {
    padding-left: 14px;
    color: var(--muted);
    font-size: 0.85rem;
}

.toc-item.toc-h3 a:hover {
    color: #ffffff;
}

/* === PAGE NAVIGATION (PREV / NEXT) === */
.page-nav-wrap {
    margin: 48px auto 32px;
}

.page-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    border-top: 1px solid var(--border);
    padding-top: 24px;
}

.page-nav-link {
    display: flex;
    flex-direction: column;
    padding: 16px 20px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    text-decoration: none;
    transition: border-color 0.2s, background 0.2s, transform 0.15s;
}

.page-nav-link:hover {
    background: var(--bg2);
    border-color: var(--primary);
    transform: translateY(-2px);
}

.page-nav-link span {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    margin-bottom: 4px;
}

.page-nav-link strong {
    font-size: 0.95rem;
    color: var(--text);
    font-weight: 600;
}

.page-nav-link.next {
    text-align: right;
    align-items: flex-end;
}

@media (max-width: 640px) {
    .page-nav {
        grid-template-columns: 1fr;
    }
    .page-nav-link.next {
        text-align: left;
        align-items: flex-start;
    }
}

/* === HUB SOMMAIRE & CARDS === */
.hub-section {
    padding: 40px 0 60px;
}

.hub-group {
    margin: 36px 0;
}

.hub-group h3 {
    font-size: 1.15rem;
    color: var(--primary-bright);
    margin-bottom: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.hub-group h3::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border);
}

.hub-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

@media (max-width: 760px) {
    .hub-grid {
        grid-template-columns: 1fr;
    }
}

.hub-card {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px 18px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    text-decoration: none;
    color: var(--text);
    transition: border-color 0.2s, background 0.2s, transform 0.15s;
}

.hub-card:hover {
    background: var(--bg2);
    border-color: var(--primary);
    transform: translateY(-2px);
}

.hub-card-num {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    border-radius: 8px;
    background: rgba(108, 92, 231, 0.15);
    color: var(--primary-bright);
    font-weight: 700;
    font-size: 0.95rem;
    border: 1px solid rgba(162, 155, 254, 0.3);
}

.hub-card-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 0;
}

.hub-card-body h4 {
    font-size: 1rem;
    color: #ffffff;
    font-weight: 600;
}

.hub-card-sub {
    font-size: 0.82rem;
    color: var(--muted);
    line-height: 1.35;
}

.hub-card-meta {
    font-size: 0.74rem;
    color: var(--primary-bright);
    margin-top: 4px;
    font-weight: 500;
}

.hub-integral-callout {
    margin: 40px 0 20px;
    padding: 16px 20px;
    background: rgba(108, 92, 231, 0.08);
    border: 1px solid rgba(108, 92, 231, 0.25);
    border-radius: 10px;
    font-size: 0.9rem;
    color: var(--text);
}

.hub-integral-callout a {
    color: var(--primary-bright);
    font-weight: 600;
    text-decoration: underline;
}

.integral-notice {
    margin: 24px auto 16px;
    padding: 16px 20px;
    background: rgba(108, 92, 231, 0.08);
    border: 1px solid rgba(108, 92, 231, 0.25);
    border-radius: 10px;
    font-size: 0.9rem;
    color: var(--text);
}

.integral-notice a {
    color: var(--primary-bright);
    font-weight: 600;
    text-decoration: underline;
}

/* === HUB RECHERCHE === */
.hub-search {
    margin: 24px 0 28px;
    position: relative;
}

.search-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.hub-search input[type="search"] {
    width: 100%;
    padding: 14px 44px 14px 18px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.hub-search input[type="search"]:focus {
    border-color: var(--primary-bright);
    box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.25);
}

.search-clear-btn {
    position: absolute;
    right: 12px;
    background: transparent;
    border: none;
    color: var(--muted);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.search-clear-btn:hover {
    color: #ffffff;
}

.search-count {
    font-size: 0.8rem;
    color: var(--muted);
    margin-top: 8px;
    min-height: 1.2em;
}

.search-results {
    list-style: none;
    padding: 0;
    margin: 16px 0 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.search-result {
    padding: 16px 18px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    transition: border-color 0.2s, background 0.2s;
}

.search-result:hover {
    background: var(--bg2);
    border-color: var(--primary);
}

.search-result a {
    text-decoration: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.search-result-kicker {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--primary-bright);
    font-weight: 600;
}

.search-result-title {
    font-size: 1rem;
    color: #ffffff;
    font-weight: 600;
}

.search-result-heading {
    font-size: 0.85rem;
    color: var(--accent-2);
}

.search-result-excerpt {
    font-size: 0.85rem;
    color: var(--muted);
    line-height: 1.4;
    margin-top: 4px;
}

.search-empty {
    font-size: 0.9rem;
    color: var(--muted);
    padding: 16px 0;
    font-style: italic;
}

/* === GENERAL PRINT STYLES === */
@media print {
    body {
        background: #ffffff !important;
        color: #111111 !important;
    }

    header,
    .breadcrumb,
    .page-meta,
    .page-actions,
    .page-toc,
    .page-nav-wrap,
    footer,
    .skip-link,
    dialog,
    .hub-search,
    .mobile-menu-btn,
    .close-menu-btn {
        display: none !important;
    }

    main {
        display: block !important;
        padding: 0 !important;
        border: none !important;
    }

    a {
        color: #111111 !important;
        text-decoration: underline !important;
    }

    .container {
        max-width: 100% !important;
        padding: 0 !important;
    }

    .sec-title,
    h1, h2, h3, h4 {
        color: #111111 !important;
    }

    .concept-box,
    .tip,
    .scenario-card,
    .tool-card,
    .code-block {
        border: 1px solid #cccccc !important;
        background: #f8f8f8 !important;
        color: #111111 !important;
        break-inside: avoid;
        page-break-inside: avoid;
    }
}