/* =========================================================================
   Kaï Consulting — Design System v2 — PATTERNS SIGNATURE
   Patterns différenciants qui font l'identité visuelle :
   - Hero éditorial asymétrique (anti-générique)
   - Bento grid services (style Apple/Vercel)
   - Monogrammes premium (cadre + serif + détails éditoriaux)
   - Diagramme stack SAP (SVG inline)
   - Magazine layout (TOC sticky + corps + sidenotes)
   - Reading progress bar
   ========================================================================= */

/* =========================================================================
   1. HERO ÉDITORIAL ASYMÉTRIQUE
   Sortir du "tout centré + gradient diagonal" générique 2018-2022
   ========================================================================= */

.hero-editorial {
    padding-block: var(--sp-12) var(--sp-13);
    position: relative;
    overflow: hidden;
    background: var(--bg);
}

.hero-editorial::before {
    /* Mark watermark — un "K" géant en fond, presque invisible */
    content: 'K';
    position: absolute;
    inset-block-start: -10%;
    inset-inline-end: -5%;
    font-family: var(--font-display);
    font-size: clamp(20rem, 50vw, 48rem);
    font-weight: var(--weight-regular);
    color: color-mix(in oklch, var(--brand) 4%, transparent);
    line-height: 0.8;
    z-index: 0;
    pointer-events: none;
    user-select: none;
}

/* Watermark plus visible en dark mode — fond sombre absorbe l'opacité */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .hero-editorial::before {
        color: color-mix(in oklch, var(--kai-400) 11%, transparent);
    }
}
[data-theme="dark"] .hero-editorial::before {
    color: color-mix(in oklch, var(--kai-400) 11%, transparent);
}

.hero-editorial-inner {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: var(--sp-10);
    align-items: end;
}

@media (max-width: 1000px) {
    .hero-editorial-inner {
        /* minmax(0, 1fr) crucial : sans le min:0, la grid track se laisse
           grandir par le contenu intrinsèque du h1 et déborde sur mobile */
        grid-template-columns: minmax(0, 1fr);
        gap: var(--sp-9);
    }
}

.hero-editorial .hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-3);
    margin-bottom: var(--sp-6);
    font-family: var(--font-ui);
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
    letter-spacing: var(--tracking-wide);
    color: var(--brand);
}

.hero-editorial .hero-eyebrow::before {
    content: '';
    width: 32px;
    height: 1px;
    background: var(--brand);
}

.hero-editorial h1 {
    font-size: var(--text-6xl);
    line-height: 0.95;
    letter-spacing: var(--tracking-tighter);
    font-weight: var(--weight-regular);
    margin-bottom: var(--sp-6);
    text-wrap: balance;
    /* Garde-fou mobile : autorise les retours forcés sur mots longs comme "S/4HANA" */
    overflow-wrap: break-word;
    hyphens: auto;
}

.hero-editorial h1 em {
    font-style: italic;
    color: var(--brand);
    font-family: var(--font-display);
    font-weight: var(--weight-regular);
}

.hero-editorial .hero-lead {
    font-family: var(--font-ui);
    font-size: var(--text-lg);
    line-height: var(--leading-relaxed);
    color: var(--fg-muted);
    max-width: 56ch;
    margin-bottom: var(--sp-7);
}

.hero-editorial .hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-4);
    align-items: center;
}

/* Bloc latéral (aside) — code snippet ou diagramme */
.hero-aside {
    position: relative;
    align-self: stretch;
    display: flex;
    align-items: flex-end;
}

.hero-code-card {
    background: var(--code-bg);
    color: var(--code-fg);
    border-radius: var(--r-lg);
    padding: var(--sp-6);
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    line-height: var(--leading-relaxed);
    overflow: hidden;
    box-shadow: var(--s-xl);
    border: 1px solid color-mix(in oklch, var(--code-fg) 20%, transparent);
    width: 100%;
    position: relative;
}

/* Bordure renforcée + glow subtil en dark mode pour distinguer la card
   du fond très sombre. */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .hero-code-card {
        border-color: color-mix(in oklch, var(--code-fg) 28%, transparent);
        box-shadow: var(--s-xl),
                    0 0 0 1px color-mix(in oklch, var(--brand) 15%, transparent);
    }
}
[data-theme="dark"] .hero-code-card {
    border-color: color-mix(in oklch, var(--code-fg) 28%, transparent);
    box-shadow: var(--s-xl),
                0 0 0 1px color-mix(in oklch, var(--brand) 15%, transparent);
}

.hero-code-card::before {
    /* macOS-style window dots — signal "code réel" */
    content: '';
    display: block;
    width: 12px;
    height: 12px;
    background: #ff5f57;
    border-radius: 50%;
    box-shadow: 18px 0 0 #febc2e, 36px 0 0 #28c840;
    margin-bottom: var(--sp-5);
}

.hero-code-card .hero-code-lang {
    display: inline-block;
    margin-bottom: var(--sp-3);
    padding: 2px var(--sp-2);
    background: color-mix(in oklch, var(--code-fg) 10%, transparent);
    color: color-mix(in oklch, var(--code-fg) 70%, transparent);
    border-radius: var(--r-xs);
    font-size: 10px;
    letter-spacing: var(--tracking-wider);
    text-transform: uppercase;
}

.hero-code-card pre {
    margin: 0;
    background: transparent;
    padding: 0;
    color: inherit;
    font-size: inherit;
    border: none;
}

.hero-code-card .tk-keyword { color: oklch(70% 0.18 290); }    /* purple */
.hero-code-card .tk-type    { color: oklch(75% 0.15 200); }    /* cyan */
.hero-code-card .tk-string  { color: oklch(80% 0.15 130); }    /* green */
.hero-code-card .tk-comment { color: oklch(55% 0.02 30); font-style: italic; }
.hero-code-card .tk-fn      { color: oklch(80% 0.18 60); }     /* yellow */

/* =========================================================================
   2. BENTO SERVICES — style Apple/Vercel 2024+
   Une card "feature" qui domine, plusieurs satellites
   ========================================================================= */

.bento-services {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--sp-5);
}

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

.bento-card {
    container-type: inline-size;
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-xl);
    padding: var(--sp-7);
    overflow: hidden;
    isolation: isolate;
    transition: var(--transition-fluid);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 280px;
}

.bento-card:hover {
    border-color: var(--border-strong);
    transform: translateY(-3px);
    box-shadow: var(--s-lg);
}

.bento-card > * { position: relative; z-index: 1; }

/* Card "feature" — accent visuel (gradient subtil) — même taille que les autres */
.bento-card-feature {
    background: linear-gradient(135deg,
        var(--surface) 0%,
        color-mix(in oklch, var(--brand) 6%, var(--surface)) 100%);
    border-color: var(--border-brand);
}

.bento-card-feature::before {
    /* Halo subtil en fond */
    content: '';
    position: absolute;
    top: -40%;
    right: -25%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle at center,
        color-mix(in oklch, var(--brand) 10%, transparent) 0%,
        transparent 65%);
    z-index: 0;
    pointer-events: none;
}

.bento-card-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--r-md);
    background: var(--brand-soft);
    color: var(--brand);
    display: grid;
    place-items: center;
    margin-bottom: var(--sp-5);
    transition: var(--transition-snappy);
}

.bento-card:hover .bento-card-icon {
    background: var(--brand);
    color: var(--brand-contrast);
    transform: scale(1.05);
}

.bento-card h3 {
    font-family: var(--font-display);
    font-size: var(--text-2xl);
    font-weight: var(--weight-medium);
    line-height: var(--leading-tight);
    letter-spacing: var(--tracking-tight);
    margin-bottom: var(--sp-3);
    color: var(--fg);
}

.bento-card p {
    font-size: var(--text-sm);
    color: var(--fg-muted);
    line-height: var(--leading-normal);
    margin-bottom: var(--sp-4);
}

.bento-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-2);
    margin-top: auto;
}

.bento-card-arrow {
    position: absolute;
    bottom: var(--sp-5);
    right: var(--sp-5);
    width: 36px;
    height: 36px;
    border-radius: var(--r-full);
    background: var(--surface-muted);
    color: var(--fg-muted);
    display: grid;
    place-items: center;
    transition: var(--transition-snappy);
}

.bento-card:hover .bento-card-arrow {
    background: var(--brand);
    color: var(--brand-contrast);
    transform: translate(2px, -2px);
}

/* Lien overlay couvrant toute la card — pattern "card-link" accessible.
   La card est cliquable dans son ensemble, pas seulement la flèche. */
.bento-card-link {
    position: absolute;
    inset: 0;
    z-index: 2;
    border-radius: inherit;
    overflow: hidden;
    text-indent: 200%;
    white-space: nowrap;
}

.bento-card-link:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 4px;
}

/* =========================================================================
   3. MONOGRAMMES PREMIUM
   Cadre circulaire + initiales serif + détails éditoriaux
   3 tailles : sm (avatar list), md (card), lg (page hero)
   ========================================================================= */

.monogram {
    --monogram-size: 80px;
    --monogram-ring: 1.5px;
    width: var(--monogram-size);
    height: var(--monogram-size);
    position: relative;
    flex-shrink: 0;
    display: inline-block;
}

.monogram-sm { --monogram-size: 56px; --monogram-ring: 1px; }
.monogram-md { --monogram-size: 80px; }
.monogram-lg { --monogram-size: 140px; --monogram-ring: 2px; }
.monogram-xl { --monogram-size: 200px; --monogram-ring: 2.5px; }

.monogram svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* Variantes — couleurs */
.monogram-brand .monogram-bg     { fill: var(--brand-soft); }
.monogram-brand .monogram-ring   { stroke: var(--brand); }
.monogram-brand .monogram-letter { fill: var(--brand); }
.monogram-brand .monogram-rule   { stroke: var(--brand); }
.monogram-brand .monogram-dot    { fill: var(--brand); }

.monogram-ink .monogram-bg     { fill: var(--surface); }
.monogram-ink .monogram-ring   { stroke: var(--fg); }
.monogram-ink .monogram-letter { fill: var(--fg); }
.monogram-ink .monogram-rule   { stroke: var(--fg); }
.monogram-ink .monogram-dot    { fill: var(--fg); }

.monogram-inverse .monogram-bg     { fill: var(--brand); }
.monogram-inverse .monogram-ring   { stroke: var(--brand-contrast); }
.monogram-inverse .monogram-letter { fill: var(--brand-contrast); }
.monogram-inverse .monogram-rule   { stroke: var(--brand-contrast); }
.monogram-inverse .monogram-dot    { fill: var(--brand-contrast); }

/* Status dot — petit indicateur en bas à droite (optionnel) */
.monogram[data-status]::after {
    content: '';
    position: absolute;
    bottom: calc(var(--monogram-size) * 0.04);
    right: calc(var(--monogram-size) * 0.04);
    width: calc(var(--monogram-size) * 0.16);
    height: calc(var(--monogram-size) * 0.16);
    border-radius: 50%;
    background: var(--success);
    border: 2px solid var(--surface);
}

.monogram[data-status="busy"]::after { background: var(--warning); }
.monogram[data-status="off"]::after  { background: var(--fg-faint); }

/* =========================================================================
   4. DIAGRAMME STACK SAP — pour competences-sap.html
   ========================================================================= */

.sap-stack {
    display: flex;
    flex-direction: column;
    gap: var(--sp-3);
    max-width: 720px;
    margin-inline: auto;
    padding: var(--sp-7) 0;
}

.sap-stack-layer {
    display: grid;
    grid-template-columns: 100px 1fr auto;
    gap: var(--sp-5);
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: var(--sp-5) var(--sp-6);
    transition: var(--transition-snappy);
    position: relative;
}

.sap-stack-layer:hover {
    border-color: var(--brand);
    box-shadow: var(--s-md);
    transform: translateX(4px);
}

.sap-stack-layer-label {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
    color: var(--fg-subtle);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wider);
}

.sap-stack-layer-name {
    font-family: var(--font-display);
    font-size: var(--text-xl);
    font-weight: var(--weight-medium);
    color: var(--fg);
    margin-bottom: 2px;
    letter-spacing: var(--tracking-tight);
}

.sap-stack-layer-desc {
    font-size: var(--text-sm);
    color: var(--fg-muted);
}

.sap-stack-layer-techs {
    display: flex;
    gap: var(--sp-2);
}

/* Connecteur vertical entre les couches */
.sap-stack-connector {
    width: 2px;
    height: 24px;
    background: linear-gradient(to bottom, var(--border-strong), transparent);
    margin-inline-start: 50px;
}

/* Layer transverse (AMDP, vers HANA) */
.sap-stack-transverse {
    margin-top: var(--sp-5);
    padding-top: var(--sp-5);
    border-top: 1px dashed var(--border);
    position: relative;
}

.sap-stack-transverse::before {
    content: 'transverse';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg);
    padding-inline: var(--sp-3);
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--fg-faint);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wider);
}

@media (max-width: 600px) {
    .sap-stack-layer {
        grid-template-columns: 1fr;
        gap: var(--sp-3);
    }
    .sap-stack-layer-techs {
        flex-wrap: wrap;
    }
}

/* =========================================================================
   5. MAGAZINE LAYOUT — articles éditoriaux
   ========================================================================= */

.magazine-article {
    display: grid;
    grid-template-columns: 220px minmax(0, 68ch) 220px;
    gap: var(--sp-9);
    align-items: start;
    padding-block: var(--sp-9);
}

.magazine-toc {
    position: sticky;
    top: var(--sp-12);
    align-self: start;
    font-size: var(--text-sm);
}

.magazine-toc-title {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
    color: var(--fg-subtle);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wider);
    margin-bottom: var(--sp-4);
    padding-bottom: var(--sp-3);
    border-bottom: 1px solid var(--border);
}

.magazine-toc-list {
    display: flex;
    flex-direction: column;
    gap: var(--sp-2);
    list-style: none;
    padding: 0;
    margin: 0;
}

.magazine-toc-link {
    display: block;
    padding: var(--sp-2) 0 var(--sp-2) var(--sp-3);
    color: var(--fg-muted);
    text-decoration: none;
    font-size: var(--text-sm);
    line-height: var(--leading-snug);
    border-inline-start: 2px solid var(--border);
    transition: var(--transition-snappy);
}

.magazine-toc-link:hover {
    color: var(--brand);
    border-inline-start-color: var(--brand);
}

.magazine-toc-link[aria-current="true"] {
    color: var(--brand);
    font-weight: var(--weight-semibold);
    border-inline-start-color: var(--brand);
}

.magazine-body {
    min-width: 0;
    font-size: var(--text-base);
    line-height: var(--leading-relaxed);
}

.magazine-body > * + * { margin-block-start: var(--sp-5); }

.magazine-body h2 {
    font-size: var(--text-3xl);
    margin-block-start: var(--sp-10);
    margin-block-end: var(--sp-5);
}

.magazine-body h3 {
    font-size: var(--text-xl);
    margin-block-start: var(--sp-7);
    margin-block-end: var(--sp-3);
}

.magazine-aside {
    position: sticky;
    top: var(--sp-12);
    align-self: start;
}

/* Pull quote — citation décorative au milieu de l'article */
.pull-quote {
    font-family: var(--font-display);
    font-size: var(--text-2xl);
    font-style: italic;
    line-height: var(--leading-snug);
    color: var(--brand);
    text-align: center;
    padding: var(--sp-7) var(--sp-6);
    margin-block: var(--sp-9);
    position: relative;
    border-block: 1px solid var(--border);
}

.pull-quote::before,
.pull-quote::after {
    font-family: var(--font-display);
    font-size: var(--text-4xl);
    color: var(--brand);
    opacity: 0.3;
    line-height: 1;
}

.pull-quote::before { content: '“'; position: absolute; top: var(--sp-3); left: var(--sp-4); }
.pull-quote::after  { content: '”'; position: absolute; bottom: -var(--sp-4); right: var(--sp-4); }

@media (max-width: 1200px) {
    .magazine-article {
        grid-template-columns: 220px minmax(0, 1fr);
    }
    .magazine-aside { display: none; }
}

@media (max-width: 900px) {
    .magazine-article {
        grid-template-columns: 1fr;
    }
    .magazine-toc {
        position: static;
        margin-bottom: var(--sp-7);
    }
}

/* =========================================================================
   6. READING PROGRESS BAR — top of article pages
   ========================================================================= */

.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(to right,
        var(--brand) 0%,
        color-mix(in oklch, var(--brand) 70%, white) 100%);
    z-index: var(--z-sticky);
    width: 0%;
    will-change: width;
    box-shadow: 0 0 8px color-mix(in oklch, var(--brand) 40%, transparent);
}

/* Animation native via scroll-driven (CSS pur, sans JS) */
@supports (animation-timeline: scroll()) {
    .reading-progress {
        animation: reading-grow auto linear;
        animation-timeline: scroll(root);
    }
}

@keyframes reading-grow {
    from { width: 0%; }
    to   { width: 100%; }
}

/* =========================================================================
   7. CLIENT LOGOS STRIP — pour la home
   Représentation typographique premium en lieu et place de simple texte
   ========================================================================= */

.clients-strip {
    padding-block: var(--sp-7);
    background: var(--surface-muted);
    border-block: 1px solid var(--border);
}

.clients-strip-label {
    text-align: center;
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--fg-subtle);
    text-transform: uppercase;
    letter-spacing: var(--tracking-widest);
    margin-bottom: var(--sp-6);
}

.clients-strip-grid {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: var(--sp-3) var(--sp-9);
}

.client-mark {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
    font-family: var(--font-display);
    font-size: var(--text-lg);
    font-weight: var(--weight-medium);
    color: var(--fg-muted);
    opacity: 0.75;
    transition: var(--transition-snappy);
    letter-spacing: var(--tracking-tight);
    cursor: default;
    user-select: none;
}

.client-mark::before {
    content: '';
    width: 4px;
    height: 4px;
    background: var(--brand);
    border-radius: 50%;
    opacity: 0.5;
    transition: var(--transition-snappy);
}

.client-mark:hover {
    color: var(--fg);
    opacity: 1;
}

.client-mark:hover::before {
    opacity: 1;
    transform: scale(1.5);
}

/* =========================================================================
   8. ARTICLE CTA (fin d'article)
   ========================================================================= */

.article-cta {
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: var(--r-xl);
    padding: var(--sp-9);
    margin-block: var(--sp-10);
    text-align: center;
}

.article-cta h3 {
    font-family: var(--font-display);
    font-size: var(--text-2xl);
    font-weight: var(--weight-medium);
    margin-bottom: var(--sp-4);
    letter-spacing: var(--tracking-tight);
}

.article-cta p {
    color: var(--fg-muted);
    max-width: 56ch;
    margin-inline: auto;
    margin-bottom: var(--sp-6);
}

/* Mobile : éviter le débordement des boutons longs (ex: "Discuter
   d'une formation RAP pour vos équipes" = 47 caractères).
   Le padding sp-9 (56px) du bloc rend les btn-lg trop larges sur
   les écrans étroits. On rétrécit padding du bloc et du bouton. */
@media (max-width: 600px) {
    .article-cta {
        padding: var(--sp-6) var(--sp-5);
        margin-block: var(--sp-8);
    }
    .article-cta .btn,
    .article-cta .btn-lg,
    .article-cta .btn-xl {
        max-width: 100%;
        padding-inline: var(--sp-4);
        font-size: var(--text-sm);
        min-height: 44px;
        line-height: 1.3;
        white-space: normal;
        word-break: break-word;
        overflow-wrap: anywhere;
        text-align: center;
    }
    .article-cta h3 {
        font-size: var(--text-xl);
    }
}

/* =========================================================================
   9. BREADCRUMB
   ========================================================================= */

.breadcrumb {
    margin-block: var(--sp-6) var(--sp-7);
    font-size: var(--text-sm);
    color: var(--fg-muted);
}

.breadcrumb ol {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-2);
    align-items: center;
}

.breadcrumb li {
    display: inline-flex;
    align-items: center;
}

.breadcrumb li + li::before {
    content: '/';
    margin-inline-end: var(--sp-2);
    color: var(--fg-faint);
}

.breadcrumb a {
    color: var(--fg-muted);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: var(--transition-snappy);
}

.breadcrumb a:hover {
    color: var(--brand);
    border-bottom-color: currentColor;
}

.breadcrumb [aria-current="page"] {
    color: var(--fg);
}

/* =========================================================================
   10. ARTICLE PAGE — magazine layout, lecture longue
   ========================================================================= */

.article-page {
    padding-block: var(--sp-8) var(--sp-12);
}

.article-page > .container {
    max-width: 80ch;
}

/* Quand on a un TOC sticky : élargir le container pour laisser la place au sidebar */
.article-page:has(.article-with-toc) > .container {
    max-width: 1180px;
}

/* Layout 2 colonnes : TOC sticky | article content */
.article-with-toc {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: var(--sp-10);
    align-items: start;
}

.article-with-toc > .article-content {
    max-width: 75ch;
    min-width: 0;
}

@media (max-width: 1000px) {
    .article-page:has(.article-with-toc) > .container {
        max-width: 80ch;
    }
    .article-with-toc {
        grid-template-columns: 1fr;
        gap: var(--sp-7);
    }
}

/* TOC sticky — pattern magazine/documentation */
.article-toc {
    position: sticky;
    top: var(--sp-9);
    align-self: start;
    max-height: calc(100vh - var(--sp-12));
    overflow-y: auto;
    padding-inline-end: var(--sp-3);
    /* Scrollbar discrète */
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.article-toc::-webkit-scrollbar { width: 4px; }
.article-toc::-webkit-scrollbar-track { background: transparent; }
.article-toc::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.article-toc-title {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
    color: var(--fg-subtle);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wider);
    margin: 0 0 var(--sp-4) 0;
    padding-bottom: var(--sp-3);
    border-bottom: 1px solid var(--border);
}

.article-toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.article-toc-list li { margin: 0; padding: 0; }

.article-toc-link {
    display: block;
    padding: var(--sp-2) var(--sp-3) var(--sp-2) var(--sp-4);
    color: var(--fg-muted);
    text-decoration: none;
    font-size: var(--text-sm);
    line-height: 1.4;
    border-inline-start: 2px solid var(--border);
    transition: color var(--duration-snappy) var(--ease-out),
                border-color var(--duration-snappy) var(--ease-out),
                background-color var(--duration-snappy) var(--ease-out);
}

.article-toc-link:hover {
    color: var(--fg);
    border-inline-start-color: var(--fg-muted);
}

.article-toc-link[aria-current="true"] {
    color: var(--brand);
    font-weight: var(--weight-semibold);
    border-inline-start-color: var(--brand);
    background: var(--brand-soft);
}

@media (max-width: 1000px) {
    .article-toc {
        position: static;
        max-height: none;
        overflow: visible;
        padding: var(--sp-5);
        background: var(--surface-muted);
        border-radius: var(--r-md);
        border: 1px solid var(--border);
    }
}

.article-header {
    margin-bottom: var(--sp-10);
    padding-bottom: var(--sp-8);
    border-bottom: 1px solid var(--border);
}

.article-header h1 {
    font-family: var(--font-display);
    font-weight: var(--weight-light);
    font-size: clamp(2.25rem, 4.5vw, 3.75rem);
    line-height: 1.05;
    letter-spacing: var(--tracking-tighter);
    text-wrap: balance;
    margin-bottom: var(--sp-5);
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--sp-3);
    color: var(--fg-muted);
    font-size: var(--text-sm);
}

/* TL;DR pull-quote */
.article-tldr {
    border-inline-start: 3px solid var(--brand);
    padding: var(--sp-5) var(--sp-7);
    background: var(--brand-soft);
    border-radius: 0 var(--r-md) var(--r-md) 0;
    margin-block: var(--sp-8);
}

.article-tldr h2 {
    font-family: var(--font-sans);
    font-size: var(--text-xs);
    font-weight: var(--weight-bold);
    letter-spacing: var(--tracking-wider);
    text-transform: uppercase;
    color: var(--brand);
    margin-bottom: var(--sp-3);
}

.article-tldr p {
    font-family: var(--font-display);
    font-size: var(--text-lg);
    line-height: var(--leading-relaxed);
    color: var(--fg);
    text-wrap: pretty;
    margin: 0;
}

/* Article typography */
.article-content {
    font-size: var(--text-base);
    line-height: var(--leading-relaxed);
    color: var(--fg);
}

.article-content h2 {
    font-family: var(--font-display);
    font-weight: var(--weight-medium);
    font-size: var(--text-3xl);
    line-height: 1.2;
    letter-spacing: var(--tracking-tight);
    margin-block: var(--sp-10) var(--sp-5);
    scroll-margin-top: var(--sp-10);
    text-wrap: balance;
}

.article-content h3 {
    font-family: var(--font-display);
    font-weight: var(--weight-medium);
    font-size: var(--text-xl);
    margin-block: var(--sp-7) var(--sp-3);
    color: var(--fg);
    text-wrap: balance;
}

.article-content p {
    margin-block: var(--sp-4);
    text-wrap: pretty;
}

.article-content ul,
.article-content ol {
    margin-block: var(--sp-4);
    padding-inline-start: var(--sp-6);
}

.article-content li {
    margin-block: var(--sp-2);
}

.article-content code {
    font-family: var(--font-mono);
    font-size: 0.9em;
    background: var(--code-inline-bg);
    color: var(--code-inline-fg);
    padding: 2px 6px;
    border-radius: var(--r-sm);
}

.article-content pre {
    background: var(--code-bg);
    color: var(--code-fg);
    padding: var(--sp-6);
    border-radius: var(--r-lg);
    border: 1px solid var(--border);
    overflow-x: auto;
    margin-block: var(--sp-6);
    font-size: var(--text-sm);
    line-height: 1.6;
}

.article-content pre code {
    background: transparent;
    color: inherit;
    padding: 0;
    font-size: inherit;
}

.article-content .table-wrap {
    overflow-x: auto;
    margin-block: var(--sp-6);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
}

.article-content table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-sm);
}

.article-content th,
.article-content td {
    padding: var(--sp-3) var(--sp-4);
    text-align: start;
    border-bottom: 1px solid var(--border);
}

.article-content th {
    background: var(--surface-muted);
    font-weight: var(--weight-medium);
    color: var(--fg);
}

.article-content tbody tr:last-child td {
    border-bottom: none;
}

.article-content a:not(.btn) {
    color: var(--brand);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
}

.article-content a:not(.btn):hover {
    color: var(--brand-hover);
}

/* Article FAQ */
.article-faq {
    margin-block: var(--sp-10);
}

.article-faq details {
    border-bottom: 1px solid var(--border);
    padding-block: var(--sp-4);
}

.article-faq summary {
    cursor: pointer;
    font-family: var(--font-display);
    font-weight: var(--weight-medium);
    font-size: var(--text-lg);
    color: var(--fg);
    padding-inline-end: var(--sp-7);
    position: relative;
    list-style: none;
}

.article-faq summary::-webkit-details-marker { display: none; }

.article-faq summary::after {
    content: '+';
    position: absolute;
    inset-inline-end: 0;
    inset-block-start: -2px;
    font-size: 1.4em;
    line-height: 1;
    color: var(--brand);
    transition: transform var(--duration-snappy) var(--ease-out);
}

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

.article-faq details > p {
    margin-block: var(--sp-4) 0;
    color: var(--fg-muted);
}

/* Article related */
.article-related {
    margin-block: var(--sp-10);
    padding-block-start: var(--sp-8);
    border-block-start: 1px solid var(--border);
}

.article-related h2 {
    font-family: var(--font-display);
    font-size: var(--text-xl);
    font-weight: var(--weight-medium);
    margin-bottom: var(--sp-5);
}

.article-related ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 0;
}

.article-related li {
    margin: 0;
}

.article-related a {
    color: var(--fg);
    text-decoration: none;
    border-bottom: 1px solid var(--border);
    padding-block: var(--sp-3);
    display: block;
    transition: var(--transition-snappy);
}

.article-related a:hover {
    color: var(--brand);
    padding-inline-start: var(--sp-2);
}

/* =========================================================================
   11. PROFILE PAGE
   ========================================================================= */

.profile-page {
    padding-block: var(--sp-8) var(--sp-12);
}

.profile-hero {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: var(--sp-8);
    align-items: center;
    padding-block-end: var(--sp-9);
    border-block-end: 1px solid var(--border);
    margin-block-end: var(--sp-10);
}

@media (max-width: 720px) {
    .profile-hero {
        grid-template-columns: 1fr;
        gap: var(--sp-5);
        text-align: center;
        justify-items: center;
    }
}

.profile-hero h1 {
    font-family: var(--font-display);
    font-weight: var(--weight-light);
    font-size: clamp(2.25rem, 4.5vw, 3.75rem);
    line-height: 1.05;
    letter-spacing: var(--tracking-tighter);
    margin-bottom: var(--sp-2);
}

.profile-hero .profile-role {
    font-size: var(--text-lg);
    color: var(--fg-muted);
    margin-bottom: var(--sp-5);
}

.profile-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-2);
    list-style: none;
    padding: 0;
    margin: 0 0 var(--sp-6);
}

.profile-tags li {
    padding: 4px var(--sp-3);
    background: var(--surface-muted);
    color: var(--fg-muted);
    border-radius: var(--r-pill);
    font-size: var(--text-xs);
    font-weight: var(--weight-medium);
    margin: 0;
}

.profile-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-3);
}

@media (max-width: 720px) {
    .profile-actions,
    .profile-tags {
        justify-content: center;
    }
}

/* Layout main + sidebar */
.profile-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: var(--sp-10);
}

@media (max-width: 900px) {
    .profile-layout {
        grid-template-columns: 1fr;
    }
}

.profile-section {
    margin-block: var(--sp-8);
}

.profile-section:first-child {
    margin-block-start: 0;
}

.profile-section > h2 {
    font-family: var(--font-display);
    font-weight: var(--weight-medium);
    font-size: var(--text-2xl);
    letter-spacing: var(--tracking-tight);
    margin-block: 0 var(--sp-4);
    padding-block-end: var(--sp-3);
    border-block-end: 1px solid var(--border);
}

.profile-section > p {
    margin-block: var(--sp-3);
    color: var(--fg);
    text-wrap: pretty;
    line-height: var(--leading-relaxed);
}

/* Reference item — projet marquant */
.reference-item {
    padding: var(--sp-5);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    background: var(--surface);
    margin-block: var(--sp-4);
    transition: var(--transition-snappy);
}

.reference-item:hover {
    border-color: var(--brand);
    transform: translateY(-1px);
}

.reference-header {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: start;
    gap: var(--sp-4);
    margin-bottom: var(--sp-3);
}

/* Sur mobile : tag empilé sous le titre */
@media (max-width: 600px) {
    .reference-header {
        grid-template-columns: 1fr;
    }
}

.reference-header h3 {
    font-family: var(--font-display);
    font-size: var(--text-lg);
    font-weight: var(--weight-medium);
    margin: 0 0 var(--sp-1);
    color: var(--fg);
}

.reference-meta {
    font-size: var(--text-sm);
    color: var(--fg-muted);
    margin: 0;
}

.reference-tag {
    display: inline-flex;
    align-items: center;
    padding: 4px var(--sp-3);
    background: var(--brand-soft);
    color: var(--brand);
    border-radius: var(--r-pill);
    font-size: var(--text-xs);
    font-weight: var(--weight-medium);
    white-space: nowrap;
}

.reference-desc {
    color: var(--fg-muted);
    margin-block: var(--sp-3);
    line-height: var(--leading-relaxed);
}

.reference-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-2);
    list-style: none;
    padding: 0;
    margin: 0;
}

.reference-tags li {
    padding: 3px var(--sp-2);
    background: var(--surface-muted);
    color: var(--fg-muted);
    border-radius: var(--r-sm);
    font-size: 0.75rem;
    font-weight: var(--weight-medium);
    margin: 0;
}

/* Profile sidebar */
.profile-sidebar {
    display: grid;
    gap: var(--sp-5);
    align-content: start;
}

@media (min-width: 901px) {
    .profile-sidebar {
        position: sticky;
        top: var(--sp-9);
    }
}

.profile-side-card {
    padding: var(--sp-5);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    background: var(--surface);
}

.profile-side-card h3 {
    font-family: var(--font-display);
    font-size: var(--text-base);
    font-weight: var(--weight-medium);
    margin: 0 0 var(--sp-4);
    padding-block-end: var(--sp-3);
    border-block-end: 1px solid var(--border);
    color: var(--fg);
}

.profile-side-card ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: var(--sp-2);
}

.profile-side-card li {
    font-size: var(--text-sm);
    color: var(--fg-muted);
    margin: 0;
}

.profile-side-card .btn-stack {
    display: grid;
    gap: var(--sp-3);
}

.profile-side-card .btn-stack .btn {
    justify-content: center;
}

.profile-side-card .links-list a {
    display: block;
    padding-block: var(--sp-2);
    color: var(--fg);
    font-size: var(--text-sm);
    text-decoration: none;
    border-bottom: 1px solid var(--border);
    transition: var(--transition-snappy);
}

.profile-side-card .links-list a:last-child {
    border-bottom: none;
}

.profile-side-card .links-list a:hover {
    color: var(--brand);
    padding-inline-start: var(--sp-2);
}

/* =========================================================================
   12. STACK DIAGRAM — SVG des couches SAP S/4HANA
   ========================================================================= */

.stack-diagram {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-xl);
    padding: var(--sp-7);
    margin-block: var(--sp-7);
}

.stack-diagram svg {
    width: 100%;
    height: auto;
    display: block;
}

.stack-diagram-layer {
    fill: var(--surface-muted);
    stroke: var(--border);
    stroke-width: 1;
    transition: fill var(--duration-snappy) var(--ease-out);
}

.stack-diagram-layer.is-brand {
    fill: var(--brand-soft);
    stroke: color-mix(in oklch, var(--brand) 50%, transparent);
}

.stack-diagram-label {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 500;
    fill: var(--fg);
}

.stack-diagram-sublabel {
    font-family: var(--font-mono);
    font-size: 11px;
    fill: var(--fg-muted);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.stack-diagram-connector {
    stroke: var(--border);
    stroke-width: 1.5;
    stroke-dasharray: 4 4;
    fill: none;
}
