/* Kohinos — documentation HTML
 * Design system éditorial, inspiré thariqs/html-effectiveness.
 * Palette de marque : bleu Kohinos #1560be, sans dépendance externe.
 * Aucun framework, aucune Google Font : polices système uniquement.
 */

:root {
  /* Palette neutre */
  --fg: #16181d;
  --fg-soft: #4d525c;
  --fg-faint: #868c97;
  --bg: #ffffff;
  --bg-soft: #f7f6f3;
  --bg-soft-2: #efece5;
  --bg-code: #f1efe9;
  --border: #e3dfd5;
  --border-strong: #c8c2b1;

  /* Couleurs de marque Kohinos */
  --brand: #1560be;
  --brand-strong: #0e4690;
  --brand-tint: #e6effa;
  --brand-soft: rgba(21, 96, 190, 0.08);
  --accent: var(--brand);
  --accent-warm: #d97706;
  --accent-warm-soft: rgba(217, 119, 6, 0.1);

  /* Liens */
  --link: var(--brand);
  --link-hover: var(--brand-strong);

  /* États / callouts */
  --warn-bg: #fff7e0;
  --warn-border: #d4a72c;
  --danger-bg: #fdecea;
  --danger-border: #c0392b;
  --info-bg: var(--brand-tint);
  --info-border: var(--brand);
  --ok-bg: #ecf7ee;
  --ok-border: #3c8c4c;

  /* Typographie */
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Iowan Old Style", Charter, "Source Serif Pro", "DM Serif Display", Cambria, Georgia, serif;

  /* Layout */
  --max-width: 1020px;
  --max-width-wide: 1280px;
  --aside-width: 280px;

  /* Élévation & rayon */
  --radius-sm: 4px;
  --radius: 8px;
  --radius-lg: 14px;
  --shadow-card: 0 1px 2px rgba(20, 30, 50, 0.04), 0 4px 12px rgba(20, 30, 50, 0.04);
  --shadow-card-hover: 0 4px 8px rgba(20, 30, 50, 0.06), 0 18px 36px rgba(21, 96, 190, 0.12);

  /* Transitions */
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --t-fast: 140ms var(--ease);
  --t: 280ms var(--ease);
}

* { box-sizing: border-box; }

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--fg);
  background: var(--bg);
  line-height: 1.55;
}

/* Layout containers */
.page {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4rem;
}
.page--wide { max-width: var(--max-width-wide); }

/* Header / top bar */
.topbar {
  border-bottom: 1px solid var(--border);
  padding: 0.85rem 1.25rem;
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(140%) blur(8px);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
}
.topbar.is-scrolled {
  box-shadow: 0 1px 0 var(--border), 0 4px 18px rgba(20, 30, 50, 0.04);
}
.topbar__inner {
  max-width: var(--max-width-wide);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.topbar__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--fg);
  line-height: 1;
}
.topbar__logo {
  display: block;
  height: 28px;
  width: auto;
  max-width: 140px;
  object-fit: contain;
  transition: transform var(--t-fast);
}
.topbar__brand:hover .topbar__logo { transform: translateY(-1px); }
.topbar__brand span {
  color: var(--fg-faint);
  font-weight: 400;
  font-size: 0.85rem;
  padding-left: 0.65rem;
  border-left: 1px solid var(--border);
}
.topbar__nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.9rem;
  margin-left: auto;
}
.topbar__nav a {
  color: var(--fg-soft);
  text-decoration: none;
  padding: 0.45rem 0.7rem;
  border-radius: var(--radius-sm);
  transition: color var(--t-fast), background var(--t-fast);
  position: relative;
}
.topbar__nav a:hover { color: var(--brand); background: var(--brand-soft); text-decoration: none; }
.topbar__nav a.is-active { color: var(--brand); font-weight: 600; }
.topbar__nav a.is-active::after {
  content: "";
  position: absolute;
  left: 0.7rem; right: 0.7rem;
  bottom: -0.85rem;
  height: 2px;
  background: var(--brand);
  border-radius: 1px;
}

/* Breadcrumb */
.crumb {
  font-size: 0.85rem;
  color: var(--fg-faint);
  margin-bottom: 1.5rem;
}
.crumb a { color: var(--fg-soft); text-decoration: none; }
.crumb a:hover { text-decoration: underline; }
.crumb span { margin: 0 0.4rem; }

/* Typography */
h1, h2, h3, h4 {
  font-family: var(--serif);
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin: 0 0 0.6em;
}
h1 { font-size: 2.25rem; margin-top: 0; }
h2 {
  font-size: 1.55rem;
  margin-top: 2.5rem;
  padding-bottom: 0.3em;
  border-bottom: 1px solid var(--border);
}
h3 { font-size: 1.2rem; margin-top: 1.8rem; }
h4 { font-size: 1rem; margin-top: 1.4rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--fg-soft); }
p { margin: 0 0 1rem; }
.lede { font-size: 1.15rem; color: var(--fg-soft); line-height: 1.5; }

a { color: var(--link); text-decoration: underline; text-underline-offset: 2px; }
a:hover { color: var(--link-hover); }

/* Lists */
ul, ol { padding-left: 1.4rem; margin: 0 0 1rem; }
li { margin-bottom: 0.25rem; }
li > ul, li > ol { margin-top: 0.25rem; margin-bottom: 0.5rem; }

/* Code */
code, pre, kbd, samp { font-family: var(--mono); font-size: 0.9em; }
:not(pre) > code {
  background: var(--bg-code);
  padding: 0.1em 0.35em;
  border-radius: 3px;
  font-size: 0.88em;
}
pre {
  background: var(--bg-code);
  border: 1px solid var(--border);
  padding: 0.85rem 1rem;
  border-radius: 4px;
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.45;
}
pre code { background: transparent; padding: 0; font-size: inherit; }

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  margin: 1rem 0 1.5rem;
}
th, td {
  text-align: left;
  padding: 0.55rem 0.7rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
th {
  font-weight: 600;
  background: var(--bg-soft);
  border-bottom-color: var(--border-strong);
}
tbody tr:hover { background: var(--bg-soft); }

/* Cards (landing) */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  margin: 2rem 0;
}
.card {
  position: relative;
  display: block;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem 1.4rem 1.5rem;
  text-decoration: none;
  color: var(--fg);
  background: var(--bg);
  overflow: hidden;
  transition: border-color var(--t-fast), transform var(--t), box-shadow var(--t);
}
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, transparent 60%, var(--brand-soft) 100%);
  opacity: 0;
  transition: opacity var(--t);
  pointer-events: none;
}
.card::after {
  content: "→";
  position: absolute;
  top: 1.1rem;
  right: 1.1rem;
  font-size: 1.05rem;
  color: var(--fg-faint);
  transition: transform var(--t), color var(--t);
}
.card:hover {
  border-color: var(--brand);
  transform: translateY(-3px);
  box-shadow: var(--shadow-card-hover);
  text-decoration: none;
}
.card:hover::before { opacity: 1; }
.card:hover::after { color: var(--brand); transform: translate(3px, -2px); }
.card__num {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--brand);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
}
.card__title {
  font-family: var(--serif);
  font-size: 1.35rem;
  margin: 0.4rem 0 0.55rem;
  line-height: 1.2;
  padding-right: 1.5rem;
}
.card__desc { color: var(--fg-soft); font-size: 0.95rem; margin: 0; }
.card__meta {
  margin-top: 0.95rem;
  font-size: 0.78rem;
  color: var(--fg-faint);
  font-family: var(--mono);
  letter-spacing: 0.03em;
}

/* Card variants — accent colors */
.card--warm { --brand: var(--accent-warm); --brand-soft: var(--accent-warm-soft); }
.card--neutral { --brand: var(--fg); --brand-soft: var(--bg-soft); }

/* Callouts */
/* Sans GAFAM */
.nogafam {
  position: relative;
  margin: 1rem 0 1.6rem;
  padding: 1.4rem 1.5rem 1.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(120% 140% at 100% 0%, var(--danger-bg) 0%, transparent 55%),
    var(--bg-soft);
  overflow: hidden;
}
.nogafam__lead {
  max-width: 62ch;
  margin: 0 0 1.2rem;
  color: var(--fg-soft);
  font-size: 0.97rem;
  line-height: 1.55;
}
.nogafam__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 0.55rem 1.2rem;
}
.nogafam__item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
}
.nogafam__banned {
  flex: 0 0 auto;
  min-width: 6.5rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--fg-faint);
}
.nogafam__strike {
  position: relative;
  white-space: nowrap;
}
.nogafam__strike::after {
  content: "";
  position: absolute;
  left: -2px;
  right: -2px;
  top: 50%;
  height: 3px;
  background: var(--danger-border);
  border-radius: 2px;
  transform: rotate(-7deg);
  box-shadow: 0 0 0 1px var(--bg-soft);
}
.nogafam__arrow {
  flex: 0 0 auto;
  color: var(--ok-border);
  font-weight: 700;
}
.nogafam__instead {
  color: var(--fg);
}
.nogafam__stamp {
  margin: 1.3rem 0 0;
  display: inline-block;
  padding: 0.35rem 0.9rem;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.18em;
  color: var(--danger-border);
  border: 2.5px solid var(--danger-border);
  border-radius: var(--radius);
  transform: rotate(-3deg);
  opacity: 0.9;
}
@media (max-width: 640px) {
  .nogafam__list { grid-template-columns: 1fr; }
}

.callout {
  border-left: 3px solid var(--info-border);
  background: var(--info-bg);
  padding: 0.75rem 1rem;
  border-radius: 0 4px 4px 0;
  margin: 1rem 0 1.4rem;
  font-size: 0.95rem;
}
.callout p:last-child { margin-bottom: 0; }
.callout--warn   { border-left-color: var(--warn-border); background: var(--warn-bg); }
.callout--danger { border-left-color: var(--danger-border); background: var(--danger-bg); }
.callout--ok     { border-left-color: var(--ok-border); background: var(--ok-bg); }
.callout__title {
  display: block;
  font-weight: 600;
  margin-bottom: 0.25rem;
  font-family: var(--sans);
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Key-value spec strip (used in landing) */
.spec {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.5rem 1.5rem;
  padding: 1rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-soft);
  font-size: 0.9rem;
  margin: 1.5rem 0;
}
.spec dt {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--fg-faint);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.15rem;
}
.spec dd { margin: 0 0 0.25rem; font-weight: 500; }

/* Diagram container */
.diagram {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem;
  margin: 1.5rem 0 1.8rem;
  overflow-x: auto;
  text-align: center;
}
.diagram__caption {
  display: block;
  margin-top: 0.6rem;
  font-size: 0.82rem;
  color: var(--fg-faint);
  font-style: italic;
}
.mermaid { text-align: center; }

/* TOC list (index dans une sous-page) */
.toc {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0;
  border-top: 1px solid var(--border);
}
.toc li {
  border-bottom: 1px solid var(--border);
  margin: 0;
}
.toc a {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.8rem 0.25rem;
  text-decoration: none;
  color: var(--fg);
  gap: 1rem;
}
.toc a:hover { background: var(--bg-soft); }
.toc__num {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--fg-faint);
  min-width: 2.5rem;
}
.toc__title { flex: 1; }
.toc__title small { display: block; color: var(--fg-faint); font-weight: 400; font-size: 0.85rem; margin-top: 0.15rem; }

/* Footer */
.footer {
  margin-top: 4rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.82rem;
  color: var(--fg-faint);
}
.footer a { color: var(--fg-soft); }

/* Utility */
.muted { color: var(--fg-faint); }
.mono { font-family: var(--mono); }
.small { font-size: 0.85rem; }
hr { border: 0; border-top: 1px solid var(--border); margin: 2rem 0; }

/* Print */
@media print {
  .topbar, .footer { border-color: #000; }
  .card { break-inside: avoid; }
  a { color: var(--fg); text-decoration: none; }
  pre, .diagram { break-inside: avoid; }
}

/* =========================================================================
 * Layout 2 colonnes — contenu principal + sidebar "Résumé"
 * Activé via <main class="page page--with-aside">
 * ========================================================================= */
.page--with-aside {
  max-width: var(--max-width-wide);
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--aside-width);
  gap: 3rem;
  align-items: start;
}
.page--with-aside > .page__main { min-width: 0; }
.page--with-aside > .page__aside { min-width: 0; }
@media (max-width: 960px) {
  .page--with-aside {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

/* Résumé — sidebar éditoriale (clé de lecture rapide) */
.summary {
  position: sticky;
  top: 5.5rem;
  padding: 1.25rem 1.25rem 1.4rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-soft);
  font-size: 0.92rem;
  line-height: 1.5;
}
.summary::before {
  content: "";
  display: block;
  width: 28px;
  height: 3px;
  border-radius: 2px;
  background: var(--brand);
  margin-bottom: 0.85rem;
}
.summary__title {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--brand);
  margin: 0 0 0.75rem;
}
.summary__title small {
  display: block;
  margin-top: 0.2rem;
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.92rem;
  letter-spacing: 0;
  font-weight: 400;
  color: var(--fg-soft);
  text-transform: none;
}
.summary ul {
  list-style: none;
  padding: 0;
  margin: 0 0 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.summary li {
  position: relative;
  padding-left: 1.3rem;
  color: var(--fg);
  margin: 0;
}
.summary li::before {
  content: "";
  position: absolute;
  left: 0.1rem;
  top: 0.55rem;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
.summary li strong { color: var(--brand-strong); }
.summary__meta {
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px dashed var(--border);
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--fg-faint);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.summary__meta a { color: var(--fg-soft); text-decoration: none; border-bottom: 1px dotted var(--border); }
.summary__meta a:hover { color: var(--brand); border-bottom-color: var(--brand); }
@media (max-width: 960px) {
  .summary { position: static; }
}

/* =========================================================================
 * Hero — page d'accueil
 * ========================================================================= */
.hero {
  position: relative;
  margin: 1rem 0 3rem;
  padding: 3rem 2rem 3.2rem;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(1200px 400px at 80% -10%, var(--brand-soft), transparent 60%),
    linear-gradient(180deg, var(--bg-soft) 0%, var(--bg) 100%);
  border: 1px solid var(--border);
  overflow: hidden;
  isolation: isolate;
}
.hero::before {
  /* Motif décoratif subtil de quadrillage */
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--brand-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--brand-soft) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: radial-gradient(800px 320px at 100% 0, #000, transparent 70%);
  -webkit-mask-image: radial-gradient(800px 320px at 100% 0, #000, transparent 70%);
  opacity: 0.6;
  z-index: -1;
}
.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand);
  background: var(--brand-tint);
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--brand-soft);
}
.hero__eyebrow::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
  animation: pulse 2.4s var(--ease) infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.5; transform: scale(1.4); }
}
.hero__title {
  font-family: var(--serif);
  font-size: clamp(2rem, 4vw + 1rem, 3.2rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 1rem 0 0.9rem;
  max-width: 22ch;
}
.hero__title em {
  font-style: italic;
  color: var(--brand);
  font-weight: 500;
}
.hero__sub {
  font-size: 1.12rem;
  color: var(--fg-soft);
  max-width: 60ch;
  line-height: 1.55;
  margin: 0 0 1.6rem;
}
.hero__actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* Hero pleine largeur (index uniquement) : titre et sous-titre non bridés. */
.hero--full .hero__title,
.hero--full .hero__sub {
  max-width: none;
}

/* Mention « maintenu par la Fédération Kohinos » mise en évidence */
.hero__maintainer {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0 0 1.6rem;
  padding: 0.6rem 1rem;
  font-size: 0.98rem;
  color: var(--fg);
  background: var(--brand-tint);
  border: 1px solid var(--brand-soft);
  border-left: 4px solid var(--brand);
  border-radius: var(--radius-sm);
  line-height: 1.4;
}
.hero__maintainer strong { color: var(--brand); }
.hero__maintainer-icon {
  flex: none;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: var(--brand);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Boutons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.6rem 1rem;
  font-size: 0.92rem;
  font-weight: 500;
  text-decoration: none;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast), transform var(--t-fast);
  cursor: pointer;
}
.btn--primary {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}
.btn--primary:hover { background: var(--brand-strong); border-color: var(--brand-strong); color: #fff; transform: translateY(-1px); }
.btn--ghost {
  background: transparent;
  color: var(--fg);
  border-color: var(--border-strong);
}
.btn--ghost:hover { background: var(--bg-soft); border-color: var(--brand); color: var(--brand); }
.btn__arrow {
  display: inline-block;
  transition: transform var(--t-fast);
}
.btn:hover .btn__arrow { transform: translateX(3px); }

/* =========================================================================
 * Stats — chiffres clés animés
 * ========================================================================= */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  margin: 2rem 0 2.5rem;
  overflow: hidden;
}
.stat {
  padding: 1.25rem 1.4rem;
  position: relative;
}
.stat + .stat { border-left: 1px solid var(--border); }
.stat__num {
  font-family: var(--serif);
  font-size: 2.2rem;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--brand);
  display: block;
  margin-bottom: 0.35rem;
}
.stat__num small {
  font-size: 0.55em;
  color: var(--fg-faint);
  margin-left: 0.2em;
  font-weight: 400;
}
.stat__label {
  font-family: var(--mono);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-faint);
  display: block;
}
@media (max-width: 640px) {
  .stat + .stat { border-left: 0; border-top: 1px solid var(--border); }
}

/* =========================================================================
 * Sections & dividers — éditorial
 * ========================================================================= */
.section-eyebrow {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-faint);
  margin: 2.5rem 0 0.5rem;
}
.section-eyebrow::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}
.section-eyebrow__num {
  color: var(--brand);
  font-weight: 600;
}

/* =========================================================================
 * Badges & pills
 * ========================================================================= */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.15rem 0.55rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--brand);
  background: var(--brand-tint);
  border-radius: 999px;
  border: 1px solid var(--brand-soft);
}
.badge--warm   { color: var(--accent-warm); background: var(--accent-warm-soft); border-color: transparent; }
.badge--ok     { color: var(--ok-border); background: var(--ok-bg); border-color: transparent; }
.badge--danger { color: var(--danger-border); background: var(--danger-bg); border-color: transparent; }
.badge--neutral{ color: var(--fg-soft); background: var(--bg-soft); border-color: var(--border); }

/* =========================================================================
 * Feature rows (liste fonctionnalités avec icône)
 * ========================================================================= */
.feature-list {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0 2rem;
  display: grid;
  gap: 1rem;
}
.feature {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 1rem;
  align-items: flex-start;
  padding: 1rem 0;
  border-top: 1px solid var(--border);
}
.feature:last-child { border-bottom: 1px solid var(--border); }
.feature__icon {
  width: 44px; height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--brand-tint);
  color: var(--brand);
  flex-shrink: 0;
}
.feature__icon svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.feature__title {
  font-family: var(--serif);
  font-size: 1.1rem;
  margin: 0 0 0.25rem;
  font-weight: 600;
}
.feature__desc { color: var(--fg-soft); font-size: 0.95rem; margin: 0; }

/* =========================================================================
 * Reveal-on-scroll animations
 * ========================================================================= */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 600ms var(--ease), transform 600ms var(--ease);
  transition-delay: var(--reveal-delay, 0ms);
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .reveal, .hero__eyebrow::before, .card, .btn { transition: none !important; animation: none !important; }
  .reveal { opacity: 1; transform: none; }
}

/* =========================================================================
 * Decorative orb (utilisé en hero/section) — SVG-like via CSS
 * ========================================================================= */
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.45;
  pointer-events: none;
}
.orb--brand { background: var(--brand); }
.orb--warm  { background: var(--accent-warm); }

/* =========================================================================
 * Dark mode — Kohinos
 * Vanilla : variables centralisées + override via [data-theme="dark"]
 * et @media (prefers-color-scheme: dark) en fallback auto.
 * ========================================================================= */

/* Variables additionnelles consommées par le bouton + topbar */
:root {
  --bg-alt: var(--bg-soft);
  --fg-muted: var(--fg-faint);
  --code-bg: var(--bg-code);
  --callout-bg: var(--info-bg);
  --callout-warn-bg: var(--warn-bg);
  --callout-danger-bg: var(--danger-bg);
  --topbar-bg: var(--bg);
}

/* Palette sombre — bleu nuit + orange chaleureux MLCC */
[data-theme="dark"] {
  --fg: #e9e7e1;
  --fg-soft: #b8b5ad;
  --fg-faint: #8a8a8a;
  --fg-muted: #8a8a8a;
  --bg: #14171c;
  --bg-soft: #1c1f25;
  --bg-soft-2: #232730;
  --bg-alt: #1c1f25;
  --bg-code: #232730;
  --code-bg: #232730;
  --border: #2a2e36;
  --border-strong: #3b4049;
  --brand: #6aa6ee;
  --brand-strong: #9bc1f4;
  --brand-tint: rgba(106, 166, 238, 0.12);
  --brand-soft: rgba(106, 166, 238, 0.18);
  --accent: #ffb86c;
  --accent-warm: #ffb86c;
  --accent-warm-soft: rgba(255, 184, 108, 0.16);
  --link: #ffb86c;
  --link-hover: #ffcf99;
  --warn-bg: #3a2f15;
  --warn-border: #d4a72c;
  --danger-bg: #3a1f1c;
  --danger-border: #e07b6e;
  --info-bg: #1d2a36;
  --info-border: #6ab0e6;
  --ok-bg: #1d2e22;
  --ok-border: #6ec27e;
  --callout-bg: #1d2a36;
  --callout-warn-bg: #3a2f15;
  --callout-danger-bg: #3a1f1c;
  --topbar-bg: #161616;
}

/* Auto via OS quand l'utilisateur n'a rien forcé */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --fg: #e9e7e1;
    --fg-soft: #b8b5ad;
    --fg-faint: #8a8a8a;
    --fg-muted: #8a8a8a;
    --bg: #14171c;
    --bg-soft: #1c1f25;
    --bg-soft-2: #232730;
    --bg-alt: #1c1f25;
    --bg-code: #232730;
    --code-bg: #232730;
    --border: #2a2e36;
    --border-strong: #3b4049;
    --brand: #6aa6ee;
    --brand-strong: #9bc1f4;
    --brand-tint: rgba(106, 166, 238, 0.12);
    --brand-soft: rgba(106, 166, 238, 0.18);
    --accent: #ffb86c;
    --accent-warm: #ffb86c;
    --accent-warm-soft: rgba(255, 184, 108, 0.16);
    --link: #ffb86c;
    --link-hover: #ffcf99;
    --warn-bg: #3a2f15;
    --warn-border: #d4a72c;
    --danger-bg: #3a1f1c;
    --danger-border: #e07b6e;
    --info-bg: #1d2a36;
    --info-border: #6ab0e6;
    --ok-bg: #1d2e22;
    --ok-border: #6ec27e;
    --callout-bg: #1d2a36;
    --callout-warn-bg: #3a2f15;
    --callout-danger-bg: #3a1f1c;
    --topbar-bg: #161616;
  }
}

/* Topbar suit la variable dédiée */
.topbar { background: var(--topbar-bg); }

/* Le logo a deux variantes : light (texte noir) et dark (texte blanc).
 * On utilise la version dark en mode sombre, sans filtre destructeur de couleur. */
[data-theme="dark"] .topbar__logo {
  content: url("logo-kohinos-dark.png");
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .topbar__logo {
    content: url("logo-kohinos-dark.png");
  }
}

/* Diagrammes Mermaid : conserver un fond clair lisible même en dark mode,
 * car la lib mermaid utilise un thème "default" non remappé.
 * On force la classe .diagram à garder un fond clair en dark. */
[data-theme="dark"] .diagram,
[data-theme="dark"] .mermaid {
  background: #f7f7f7;
  color: #1a1a1a;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .diagram,
  :root:not([data-theme]) .mermaid {
    background: #f7f7f7;
    color: #1a1a1a;
  }
}

/* Bouton de bascule de thème dans la topbar */
.theme-toggle {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin-left: 0.5rem;
  background: transparent;
  color: var(--fg-soft);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: border-color 120ms ease, color 120ms ease, background 120ms ease;
}
.theme-toggle:hover,
.theme-toggle:focus-visible {
  color: var(--fg);
  border-color: var(--accent);
  background: var(--bg-alt);
  outline: none;
}
.theme-toggle svg {
  width: 18px;
  height: 18px;
  display: block;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
/* Affichage conditionnel des icônes selon le thème actif */
.theme-toggle .theme-toggle__icon--sun  { display: none; }
.theme-toggle .theme-toggle__icon--moon { display: block; }
[data-theme="dark"] .theme-toggle .theme-toggle__icon--sun  { display: block; }
[data-theme="dark"] .theme-toggle .theme-toggle__icon--moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .theme-toggle .theme-toggle__icon--sun  { display: block; }
  :root:not([data-theme]) .theme-toggle .theme-toggle__icon--moon { display: none; }
}
/* Indicateur mode auto : petit point sur le bouton */
[data-theme-mode="auto"] .theme-toggle::after {
  content: "";
  position: absolute;
  margin-top: 22px;
  margin-left: 22px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}
.theme-toggle { position: relative; }

/* Doc version banner */
.doc-version {
  font-size: 0.78rem;
  font-style: italic;
  color: var(--fg-faint);
  margin: 0.25rem 0 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 0.4rem 0.6rem;
  border-left: 2px solid var(--border);
  background: var(--bg-soft);
}
.doc-version__app { color: var(--fg-soft); }
.doc-version__app strong { font-style: normal; font-weight: 600; }
.doc-version__date time { font-family: var(--mono); font-style: normal; }
.doc-version__git { font-family: var(--mono); }
.doc-version__git a {
  color: var(--fg-faint);
  text-decoration: none;
  border-bottom: 1px dotted var(--border);
}
.doc-version__git a:hover { color: var(--fg-soft); }

/* ============================================================
 * Recherche full-text (Lunr.js) — doc-search.js
 * UI minimaliste cohérente avec la topbar.
 * ============================================================ */
.doc-search {
  margin: 2rem 0 2.5rem;
}
.doc-search__input,
input#doc-search {
  width: 100%;
  max-width: 100%;
  padding: 0.65rem 0.85rem;
  font-family: var(--sans);
  font-size: 1rem;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  outline: none;
  transition: border-color 0.15s ease;
}
input#doc-search::placeholder {
  color: var(--fg-faint);
}
input#doc-search:focus {
  border-color: var(--link);
  box-shadow: 0 0 0 2px rgba(10, 88, 202, 0.12);
}
.doc-search__results,
ul#doc-search-results {
  list-style: none;
  padding: 0;
  margin: 0.75rem 0 0;
  border-top: 1px solid var(--border);
}
ul#doc-search-results:empty {
  border-top: 0;
  margin-top: 0;
}
ul#doc-search-results.is-active:empty {
  border-top: 1px solid var(--border);
}
.doc-search__result {
  display: block;
  padding: 0.75rem 0.25rem;
  border-bottom: 1px solid var(--border);
}
.doc-search__link {
  display: inline-block;
  font-weight: 600;
  color: var(--link);
  text-decoration: none;
  font-size: 1rem;
}
.doc-search__link:hover { text-decoration: underline; color: var(--link-hover); }
.doc-search__meta {
  display: block;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--fg-faint);
  margin-top: 0.15rem;
}
.doc-search__extract {
  margin: 0.35rem 0 0;
  font-size: 0.9rem;
  color: var(--fg-soft);
  line-height: 1.45;
}
.doc-search__extract mark,
.doc-search__link mark {
  background: var(--warn-bg);
  color: var(--fg);
  padding: 0 0.1em;
  border-radius: 2px;
}
.doc-search__empty {
  padding: 0.75rem 0.25rem;
  color: var(--fg-faint);
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border);
}

/* =========================================================================
 * Doc scope badges — indique si une page concerne MLC, SSA ou les deux
 * ========================================================================= */
.doc-scope {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin: 0.5rem 0 1.25rem;
  padding: 0.7rem 1rem;
  border: 1px solid var(--border);
  border-left: 3px solid var(--brand);
  border-radius: var(--radius);
  background: var(--bg-soft);
}
.doc-scope__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.7rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
}
.doc-scope__badge--mlc {
  color: var(--brand);
  background: var(--brand-tint);
  border-color: var(--brand-soft);
}
.doc-scope__badge--ssa {
  color: var(--accent-warm);
  background: var(--accent-warm-soft);
}
.doc-scope__badge--both {
  color: #5b21b6;
  background: #ede9fe;
}
.doc-scope__badge--common {
  color: var(--fg-soft);
  background: var(--bg-soft);
  border-color: var(--border);
}
.doc-scope__hint {
  color: var(--fg-soft);
  font-size: 0.9rem;
  line-height: 1.4;
}
@media (prefers-color-scheme: dark) {
  .doc-scope__badge--both { color: #8c8ddd; background: rgba(91, 33, 182, 0.25); }
}
:root[data-theme="dark"] .doc-scope__badge--both { color: #8c8ddd; background: rgba(91, 33, 182, 0.25); }

/* =========================================================================
 * Cards statiques — sans hover ni flèche (utilisé pour comparaisons)
 * ========================================================================= */
.cards--static { margin: 1.25rem 0 2rem; }
.card--static { cursor: default; }
.card--static::after { content: none; }
.card--static:hover {
  border-color: var(--border);
  transform: none;
  box-shadow: none;
}
.card--static:hover::before { opacity: 0; }

/* =========================================================================
 * Table comparative MLC vs SSA
 * ========================================================================= */
.table--compare {
  width: 100%;
  margin: 1.5rem 0 2rem;
  border-collapse: collapse;
  font-size: 0.95rem;
}
.table--compare th,
.table--compare td {
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  vertical-align: top;
  text-align: left;
  line-height: 1.45;
}
.table--compare thead th {
  background: var(--bg-soft);
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-soft);
}
.table--compare thead th:nth-child(2) { color: var(--brand); }
.table--compare thead th:nth-child(3) { color: var(--accent-warm); }
.table--compare tbody th {
  background: var(--bg-soft);
  font-weight: 600;
  width: 18%;
  white-space: nowrap;
}
.table--compare tbody tr:nth-child(odd) td { background: rgba(0,0,0,0.01); }

/* =========================================================================
 * Figure (image + légende) — utilisée pour schémas SVG
 * ========================================================================= */
.figure {
  margin: 1.75rem 0 2rem;
  padding: 1rem;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
}
.figure img,
.figure svg {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}
.figure figcaption {
  margin-top: 0.7rem;
  font-size: 0.85rem;
  color: var(--fg-soft);
  font-style: italic;
  line-height: 1.45;
}

/* =========================================================================
 * Section heading inside TOC — Démarrage / MLC / SSA / Transversal
 * ========================================================================= */
.toc-section {
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand);
  margin: 2.25rem 0 0.4rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px dashed var(--border);
}
.toc-section:first-of-type { margin-top: 1rem; }

/* Inline scope badge inside TOC items */
.toc__title .doc-scope__badge {
  display: inline-block;
  margin-left: 0.4rem;
  vertical-align: middle;
  font-size: 0.65rem;
  padding: 0.1rem 0.45rem;
  letter-spacing: 0.04em;
}
