/* Site de présentation Sapphire 3 — mise en page et micro-interactions.
   Les couleurs viennent de l'application ; aucun code de l'application n'est importé. */
:root {
  --font-sans: Inter, system-ui, sans-serif;
  --font-display: Space, system-ui, sans-serif;
  --font-mono: Mono, ui-monospace, monospace;
  --color-black: #0e0e12;
  --color-anthracite: #19191f;
  --color-anthracite-raised: #24242c;
  --color-yellow: #f5d547;
  --color-yellow-hover: #ffe777;
  --color-yellow-active: #dbba30;
  --color-yellow-soft: #f5d54718;
  --color-violet: #c4b1ff;
  --color-violet-soft: #c4b1ff14;
  --color-violet-border: #c4b1ff77;
  --color-text: #f2f1f6;
  --color-text-muted: #b5b2c2;
  --color-border: #ffffff24;
  --color-border-hover: #ffffff3d;
  --color-hover: #ffffff0a;
  --color-diagnostic: #f3b1a3;
  --color-input: #0d0d13;
  --color-glass-reflection: #ffffff07;
  --color-glass-highlight: #ffffff10;
  --radius-small: 2px;
  --radius-control: 3px;
  --radius-panel: 5px;
  --space-small: 6px;
  --space-control: 8px;
  --space-panel: 16px;
  --shadow-panel: none;
  --shadow-card: none;
  --duration-fast: 120ms;
  --easing-ui: cubic-bezier(.2, .7, .2, 1);
  --content-width: 1240px;
  --node-variable: #6f9ff5;
  --node-type: #5fc9d8;
  --node-function: #b58cf0;
  --node-parameter: #e39ad0;
  --node-condition: #d9a441;
  --node-loop: #e07a3f;
  --node-return: #e05c6e;
  --node-block: #7d8798;
  --node-statement: #7fb069;
  --node-operator: #4fb3a8;
  --node-value: #b5c95a;
  --node-array: #e8d06a;
  --node-incomplete: #d8b184;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 96px; }
body {
  margin: 0;
  background: var(--color-black);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--color-yellow); color: var(--color-black); }

a {
  color: var(--color-yellow);
  text-decoration: none;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
a:hover { color: var(--color-yellow-hover); text-decoration: underline; }
a:focus-visible, button:focus-visible, summary:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--color-yellow);
  outline-offset: 3px;
  border-radius: 6px;
}

code, pre { font-family: var(--font-mono); }
code {
  padding: 1px 6px;
  border: 1px solid #ffffff12;
  border-radius: 5px;
  background: var(--color-yellow-soft);
  color: #f7e9a7;
  font-size: .86em;
}
pre {
  position: relative;
  margin: 0;
  padding: 18px;
  overflow: auto;
  border: 1px solid var(--color-border);
  border-radius: 14px;
  background: #0a0a0f;
  box-shadow: inset 0 1px 0 #ffffff08;
  font-size: 12.5px;
  line-height: 1.6;
}
pre code { padding: 0; border: 0; background: none; color: #d9d6e6; font-size: inherit; white-space: pre; }
img { max-width: 100%; height: auto; }

.skip-link {
  position: fixed;
  top: -70px;
  left: 16px;
  z-index: 200;
  padding: 10px 15px;
  border-radius: 8px;
  background: var(--color-yellow);
  color: var(--color-black);
  font-weight: 700;
  transition: top var(--duration-fast) var(--easing-ui);
}
.skip-link:focus { top: 14px; text-decoration: none; }

/* En-tête */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  min-height: 82px;
  padding: 16px max(22px, calc((100vw - var(--content-width)) / 2));
  border-bottom: 1px solid var(--color-border);
  background: var(--color-black);
  transition: box-shadow var(--duration-fast) var(--easing-ui), background var(--duration-fast) var(--easing-ui);
}
.site-header.is-scrolled { background: var(--color-black); box-shadow: none; }

.reading-progress {
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 0;
  height: 2px;
  background: var(--color-yellow);
  transition: width 80ms linear;
}

.site-header .mark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -.025em;
  white-space: nowrap;
}
.mark-logo {
  display: block;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
}
.mark-word { display: inline-flex; align-items: baseline; }
.site-header .mark-word > span { margin-left: 0.06em; color: var(--color-yellow); }

.header-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 9px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-small);
  color: var(--color-text-muted);
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
}
.header-status > span {
  width: 6px;
  height: 6px;
  border-radius: 0;
  background: var(--color-yellow);
}

.site-header nav {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin-left: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.site-header nav a {
  padding: 10px 13px;
  border-radius: var(--radius-control);
  color: var(--color-text-muted);
  font-size: 12px;
  line-height: 1.3;
  transition: color var(--duration-fast) var(--easing-ui), background var(--duration-fast) var(--easing-ui);
}
.site-header nav a:hover { color: var(--color-text); background: var(--color-hover); text-decoration: none; }
.site-header nav a[aria-current="page"] {
  background: var(--color-yellow-soft);
  color: var(--color-yellow);
  font-weight: 600;
}

/* Structure générale */
main {
  width: min(100%, var(--content-width));
  margin: 0 auto;
  padding: clamp(30px, 5vw, 64px) clamp(18px, 3vw, 32px) 96px;
}
main > section { margin: 0 0 clamp(44px, 6vw, 76px); }
main > section:last-of-type { margin-bottom: 40px; }
h1, h2, h3, h4 {
  font-family: var(--font-display);
  letter-spacing: -.025em;
}
h1 {
  max-width: 18ch;
  margin: 0 0 16px;
  font-size: clamp(2.4rem, 5.1vw, 4.15rem);
  line-height: 1.04;
}
.page-doc h1, .page-ast h1 { max-width: 22ch; font-size: clamp(2.2rem, 4.4vw, 3.55rem); }
h2 { margin: 48px 0 16px; font-size: clamp(1.55rem, 2.5vw, 2.1rem); line-height: 1.2; }
h3 { margin: 26px 0 8px; font-size: 19px; line-height: 1.35; }
h4 {
  margin: 20px 0 6px;
  color: var(--color-violet);
  font-size: 12px;
  letter-spacing: .09em;
  text-transform: uppercase;
}
p { margin: 0 0 14px; }
ul, ol { margin: 0 0 16px; padding-left: 23px; }
li { margin-bottom: 5px; }
strong, b { color: var(--color-text); }
small { color: var(--color-text-muted); }
hr { border: 0; border-top: 1px solid var(--color-border); margin: 30px 0; }

.lede {
  max-width: 74ch;
  color: var(--color-text-muted);
  font-size: clamp(1rem, 1.4vw, 1.12rem);
  line-height: 1.72;
}
.page-intro { padding-bottom: 34px; border-bottom: 1px solid var(--color-border); margin-bottom: 36px; }
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  padding: 5px 11px;
  border: 1px solid var(--color-border);
  border-radius: 0;
  background: transparent;
  color: var(--color-yellow);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.kicker::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 0;
  background: var(--color-yellow);
  box-shadow: none;
}

/* Accueil */
.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(28px, 4.6vw, 58px);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-panel);
  corner-shape: bevel;
  background: var(--color-anthracite);
  box-shadow: var(--shadow-panel);
}
.hero::before,
.hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}
.hero::before {
  top: -320px;
  right: -180px;
  width: 440px;
  height: 440px;
  background: radial-gradient(circle, #f5d5470d 0%, transparent 68%);
}
.hero::after {
  bottom: -320px;
  left: -180px;
  width: 620px;
  height: 620px;
  background: radial-gradient(circle, #c4b1ff16 0%, transparent 64%);
}
.hero-layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(330px, .94fr);
  gap: clamp(28px, 4vw, 54px);
  align-items: center;
}
.hero h1 { max-width: 15ch; }
.hero .lede { max-width: 58ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 26px; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 17px;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  corner-shape: bevel;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.2;
  transition: transform var(--duration-fast) var(--easing-ui), background var(--duration-fast) var(--easing-ui), border-color var(--duration-fast) var(--easing-ui);
}
.button:hover { transform: translateY(-1px); text-decoration: none; }
.button--primary { background: var(--color-yellow); color: var(--color-black); }
.button--primary:hover { background: var(--color-yellow-hover); color: var(--color-black); }
.button--ghost { border-color: var(--color-border); background: #ffffff06; color: var(--color-text); }
.button--ghost:hover { border-color: var(--color-violet-border); background: var(--color-violet-soft); color: var(--color-text); }

.hero-preview {
  display: block;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: 18px;
  background: #0c0c12;
  box-shadow: 0 24px 55px #00000055;
  transition: transform 240ms var(--easing-ui), border-color 240ms var(--easing-ui), box-shadow 240ms var(--easing-ui);
}
.hero-preview:hover {
  transform: translateY(-4px);
  border-color: var(--color-violet-border);
  box-shadow: 0 30px 70px #00000066;
  text-decoration: none;
}
.hero-preview__bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--color-border);
  background: #101017;
}
.hero-preview__bar span { width: 7px; height: 7px; border-radius: 50%; background: #ffffff1c; }
.hero-preview__bar span:first-child { background: #f5d54799; }
.hero-preview__bar span:nth-child(2) { background: #c4b1ff88; }
.hero-preview__bar em {
  margin-left: 7px;
  color: var(--color-text-muted);
  font-size: 10px;
  font-style: normal;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.hero-preview img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; opacity: .94; }
.hero-preview__caption {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 14px;
  padding: 10px 12px;
  border-top: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-size: 11.5px;
}
.hero-preview__caption b { color: var(--color-yellow); font-weight: 600; }

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  margin-top: 17px;
  border: 1px solid var(--color-border);
  border-radius: 18px;
  background: var(--color-border);
}
.stat { padding: 17px 20px; background: #15151c; }
.stat b {
  display: block;
  color: var(--color-yellow);
  font-family: var(--font-display);
  font-size: 28px;
  line-height: 1;
  letter-spacing: -.04em;
}
.stat span { display: block; margin-top: 6px; color: var(--color-text-muted); font-size: 12px; }

/* Cartes et grilles */
.card {
  position: relative;
  overflow: hidden;
  padding: 23px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-panel);
  background: var(--color-anthracite);
  box-shadow: var(--shadow-card);
  transition: transform var(--duration-fast) var(--easing-ui), border-color var(--duration-fast) var(--easing-ui), box-shadow var(--duration-fast) var(--easing-ui);
}
.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 22px;
  width: 46px;
  height: 1px;
  background: linear-gradient(90deg, var(--color-yellow), transparent);
}
.card:hover {
  transform: translateY(-2px);
  border-color: var(--color-border-hover);
  box-shadow: 0 18px 42px #00000044;
}
.card h3 { margin-top: 0; }
.card p { margin-bottom: 0; color: var(--color-text-muted); font-size: 14.5px; }
.grid {
  display: grid;
  gap: 15px;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  margin-top: 16px;
}
.grid .card { padding: 20px; }
.grid h3 { margin-top: 0; }

.chips, .meta-chips { display: flex; flex-wrap: wrap; gap: 7px; margin: 16px 0 0; padding: 0; list-style: none; }
.chips li, .meta-chips li {
  margin: 0;
  padding: 4px 11px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-small);
  background: #ffffff05;
  color: var(--color-text-muted);
  font-size: 12px;
}
.meta-chips li {
  border-color: #ffffff17;
  color: #c8c5d4;
  font-size: 11.5px;
  letter-spacing: .02em;
}
.meta-chips li[data-reading-time] { color: var(--color-violet); border-color: var(--color-violet-border); }

/* Titres de section et blocs de texte */
.section-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  margin: 0 0 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--color-border);
}
.section-title h2 { margin: 0; }
.section-title .tag, .tag {
  padding: 3px 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-small);
  background: #ffffff05;
  color: var(--color-text-muted);
  font-size: 11px;
  letter-spacing: .04em;
  white-space: nowrap;
}
.notes-soft, .notes-warning {
  margin: 18px 0;
  padding: 14px 16px;
  border-left: 3px solid var(--color-violet);
  border-radius: 0 var(--radius-small) var(--radius-small) 0;
  background: var(--color-violet-soft);
  font-size: 14px;
}
.notes-warning { border-left-color: var(--color-diagnostic); background: #f3b1a312; }
.notes-soft p:last-child, .notes-warning p:last-child { margin-bottom: 0; }

/* Sommaire de page */
.toc {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(235px, 1fr));
  gap: 0 24px;
  margin: 25px 0 0;
  padding: 16px 20px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-panel);
  background: var(--color-anthracite);
  box-shadow: var(--shadow-card);
  list-style: none;
  font-size: 13.5px;
}
.toc li { margin: 0; border-bottom: 1px solid #ffffff0a; }
.toc a { display: flex; align-items: center; gap: 7px; padding: 9px 3px; color: var(--color-text-muted); transition: color var(--duration-fast) var(--easing-ui), transform var(--duration-fast) var(--easing-ui); }
.toc a::before { content: "›"; color: var(--color-yellow); opacity: .7; }
.toc a:hover { color: var(--color-text); text-decoration: none; transform: translateX(2px); }

/* Pages documentaires : sommaire latéral */
.doc-layout { display: grid; grid-template-columns: minmax(0, 1fr) 248px; gap: clamp(30px, 4vw, 56px); align-items: start; }
.doc-layout:has(.doc-rail:empty) { grid-template-columns: minmax(0, 1fr); }
.doc-content { grid-column: 1; grid-row: 1; min-width: 0; }
.doc-content > section {
  margin: 0 0 48px;
  padding-top: 38px;
  border-top: 1px solid var(--color-border);
  scroll-margin-top: 0;
}
.doc-content > section:first-child { padding-top: 0; border-top: 0; }
.doc-content > section > h2:first-child { margin-top: 0; }
.doc-rail {
  grid-column: 2;
  grid-row: 1;
  position: sticky;
  top: 92px;
  max-height: calc(100vh - 120px);
  overflow: auto;
  padding: 17px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-panel);
  corner-shape: bevel;
  background: var(--color-anthracite);
  box-shadow: var(--shadow-card);
  scrollbar-width: thin;
}
.doc-rail__title {
  margin: 0 0 12px;
  color: var(--color-text-muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.doc-rail__progress { height: 3px; margin-bottom: 13px; overflow: hidden; border-radius: 999px; background: #ffffff12; }
.doc-rail__progress span { display: block; width: 0; height: 100%; background: linear-gradient(90deg, var(--color-yellow), var(--color-violet)); transition: width 100ms linear; }
.doc-rail ol { display: grid; gap: 1px; margin: 0; padding: 0; list-style: none; }
.doc-rail li { margin: 0; }
.doc-rail a {
  display: block;
  padding: 6px 8px;
  border-left: 2px solid transparent;
  border-radius: 0;
  color: var(--color-text-muted);
  font-size: 12px;
  line-height: 1.35;
  transition: color var(--duration-fast) var(--easing-ui), background var(--duration-fast) var(--easing-ui), border-color var(--duration-fast) var(--easing-ui);
}
.doc-rail a:hover { color: var(--color-text); background: var(--color-hover); text-decoration: none; }
.doc-rail a.is-active { border-left-color: var(--color-yellow); background: var(--color-yellow-soft); color: var(--color-yellow); }

/* Tables */
table {
  width: 100%;
  margin: 16px 0;
  border: 1px solid var(--color-border);
  border-collapse: separate;
  border-spacing: 0;
  border-radius: var(--radius-panel);
  overflow: hidden;
  font-size: 14px;
}
th, td { padding: 11px 14px; border-bottom: 1px solid var(--color-border); text-align: left; vertical-align: top; }
th {
  background: #17171f;
  color: var(--color-yellow);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
}
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #ffffff06; }
td code { white-space: nowrap; }

/* Captures et annotations */
figure.shot { margin: 26px 0 34px; }
.shot-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(250px, 1fr);
  gap: 20px;
  align-items: start;
}
.shot-frame {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: 15px;
  background: var(--color-input);
  box-shadow: var(--shadow-card);
  transition: border-color var(--duration-fast) var(--easing-ui), box-shadow var(--duration-fast) var(--easing-ui);
}
.shot-frame:hover { border-color: var(--color-violet-border); box-shadow: 0 16px 42px #00000044; }
.shot-frame img { display: block; width: 100%; height: auto; cursor: zoom-in; }
.shot figcaption {
  margin-top: 12px;
  padding-left: 13px;
  border-left: 2px solid var(--color-yellow);
  color: var(--color-text-muted);
  font-size: 13px;
}
.shot figcaption b { color: var(--color-text); }
.shot-anchor { scroll-margin-top: 0; }
.shot--compact { max-width: 620px; }
.shot--small { max-width: 470px; }
.shot--medium { max-width: 900px; }
.shot-pair { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(260px, .85fr); gap: 20px; align-items: start; margin: 22px 0 28px; }
.shot-pair .shot { margin: 0; }
@media (max-width: 760px) { .shot-pair { grid-template-columns: minmax(0, 1fr); } }

.notes { margin: 0; padding: 0; list-style: none; counter-reset: note; }
.notes li {
  counter-increment: note;
  position: relative;
  margin: 0 0 9px;
  padding: 10px 12px 10px 40px;
  border: 1px solid var(--color-border);
  border-radius: 11px;
  background: #15151c;
  font-size: 13.5px;
  line-height: 1.55;
  cursor: pointer;
  transition: border-color var(--duration-fast) var(--easing-ui), background var(--duration-fast) var(--easing-ui), transform var(--duration-fast) var(--easing-ui);
}
.notes li::before {
  content: counter(note);
  position: absolute;
  top: 10px;
  left: 12px;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: var(--color-yellow);
  color: var(--color-black);
  font-size: 11px;
  font-weight: 700;
  line-height: 19px;
  text-align: center;
}
.notes li:hover, .notes li.is-active { border-color: var(--color-violet-border); background: var(--color-violet-soft); transform: translateX(2px); }
.notes li.is-missing { border-style: dashed; cursor: default; }
.notes li code { background: #ffffff10; }

.marker {
  position: absolute;
  padding: 0;
  font-family: inherit;
  width: 28px;
  height: 28px;
  margin: -14px 0 0 -14px;
  border: 2px solid var(--color-black);
  border-radius: 50%;
  background: var(--color-yellow);
  color: var(--color-black);
  box-shadow: 0 3px 10px #00000099;
  font-size: 11px;
  font-weight: 800;
  line-height: 24px;
  text-align: center;
  opacity: .94;
  cursor: pointer;
  transition: transform var(--duration-fast) var(--easing-ui), background var(--duration-fast) var(--easing-ui);
}
.marker.is-active { background: var(--color-violet); transform: scale(1.28); opacity: 1; }
.ring {
  position: absolute;
  border: 2px solid var(--color-violet);
  border-radius: 7px;
  box-shadow: 0 0 0 9999px #0b0b0f70;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-fast) var(--easing-ui);
}
.ring.is-active { opacity: 1; }
.shot-frame.no-data .marker, .shot-frame.no-data .ring { display: none; }

/* Galerie */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(245px, 1fr));
  gap: 14px;
  margin-top: 18px;
}
.gallery a {
  display: block;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: 14px;
  background: var(--color-input);
  transition: transform var(--duration-fast) var(--easing-ui), border-color var(--duration-fast) var(--easing-ui);
}
.gallery a:hover { transform: translateY(-2px); border-color: var(--color-violet-border); text-decoration: none; }
.gallery img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.gallery span { display: block; padding: 9px 12px; color: var(--color-text-muted); font-size: 12.5px; }
.figure-wrap { margin-top: 8px; }

/* Dashboards exportés */
.dashboard-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(520px, 1fr));
  gap: 18px;
  margin-top: 18px;
}
.dashboard-card {
  padding: 18px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-panel);
  background: linear-gradient(180deg, #191921, #14141a);
  box-shadow: var(--shadow-card);
}
.dashboard-card__head .kicker { margin: 0; }
.dashboard-card__head h3 { margin: 4px 0 6px; font-size: 21px; }
.dashboard-card__head > p:not(.kicker) { margin: 0; color: var(--color-text-muted); font-size: 14px; }
.dashboard-card .meta-chips { margin-top: 10px; }
.dashboard-frame {
  margin-top: 14px;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: #0e0e12;
}
.dashboard-frame iframe {
  display: block;
  width: 100%;
  height: 460px;
  border: 0;
  background: #0e0e12;
}
.dashboard-card__actions { margin: 12px 0 0; }
.dashboard-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 14px;
  margin-top: 18px;
}
.dashboard-preview-grid iframe {
  width: 100%;
  height: 360px;
  border: 1px solid var(--color-border);
  border-radius: 14px;
  background: #0e0e12;
}

/* Diagrammes et arbres */
.flow { display: flex; flex-wrap: wrap; align-items: stretch; gap: 9px; margin: 16px 0 6px; }
.flow .step {
  flex: 1 1 190px;
  padding: 11px 13px;
  border: 1px solid var(--color-border);
  border-radius: 11px;
  background: var(--color-anthracite-raised);
  font-size: 13.5px;
}
.flow .step b { display: block; margin-bottom: 3px; color: var(--color-yellow); font-size: 14px; }
.flow .step code { display: block; margin-top: 6px; background: #00000040; white-space: pre-wrap; }
.tree { margin: 16px 0 4px; }
.node {
  --node-color: var(--node-block);
  position: relative;
  margin: 0 0 6px 14px;
  padding: 7px 10px;
  border-left: 3px solid var(--node-color);
  border-radius: 0 6px 6px 0;
  background: #1a1a22;
  font-size: 13px;
}
.node b { color: var(--node-color); font-weight: 600; }
.node small { display: block; color: var(--color-text-muted); font-size: 11.5px; }
.node .node { margin-left: 12px; }
.node--variable { --node-color: var(--node-variable); }
.node--type { --node-color: var(--node-type); }
.node--function { --node-color: var(--node-function); }
.node--parameter { --node-color: var(--node-parameter); }
.node--condition { --node-color: var(--node-condition); }
.node--loop { --node-color: var(--node-loop); }
.node--return { --node-color: var(--node-return); }
.node--statement { --node-color: var(--node-statement); }
.node--operator { --node-color: var(--node-operator); }
.node--value { --node-color: var(--node-value); }
.node--array { --node-color: var(--node-array); }
.node--incomplete { --node-color: var(--node-incomplete); }

/* Pied de page */
.site-footer {
  margin-top: 52px;
  padding-top: 26px;
  border-top: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-size: 12.5px;
}
.site-footer .credits { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 18px 26px; padding-bottom: 22px; }
.site-footer b {
  display: block;
  margin-bottom: 4px;
  color: var(--color-text);
  font-size: 10px;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.site-footer p { margin: 0; }
.site-footer > p { padding-top: 16px; border-top: 1px solid var(--color-border); }

/* Bouton de retour en haut */
.back-to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 80;
  display: grid;
  place-items: center;
  width: 43px;
  height: 43px;
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: 50%;
  background: #16161de6;
  color: var(--color-text);
  box-shadow: 0 10px 28px #00000055;
  backdrop-filter: blur(10px);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity var(--duration-fast) var(--easing-ui), transform var(--duration-fast) var(--easing-ui), border-color var(--duration-fast) var(--easing-ui);
}
.back-to-top.is-visible { opacity: 1; pointer-events: auto; transform: none; }
.back-to-top:hover { border-color: var(--color-yellow); color: var(--color-yellow); }

/* Retour visuel : copie de code et notifications */
.code-copy {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 4px 9px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: #17171ee8;
  color: var(--color-text-muted);
  font: inherit;
  font-size: 10px;
  font-family: var(--font-sans);
  letter-spacing: .04em;
  cursor: pointer;
  opacity: 0;
  transition: opacity var(--duration-fast) var(--easing-ui), color var(--duration-fast) var(--easing-ui), border-color var(--duration-fast) var(--easing-ui);
}
pre:hover .code-copy, .code-copy:focus-visible { opacity: 1; }
.code-copy:hover { color: var(--color-text); border-color: var(--color-border-hover); }

.toast-stack {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 300;
  display: grid;
  gap: 8px;
  transform: translateX(-50%);
  pointer-events: none;
}
.toast {
  padding: 9px 15px;
  border: 1px solid var(--color-yellow);
  border-radius: 999px;
  background: #15151ceb;
  color: var(--color-text);
  box-shadow: 0 12px 34px #00000066;
  backdrop-filter: blur(12px);
  font-size: 12.5px;
  animation: toast-in 180ms var(--easing-ui);
}

/* Agrandissement des captures */
.lightbox {
  width: min(96vw, 1480px);
  max-height: 92vh;
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: 16px;
  background: #09090d;
  color: var(--color-text);
  box-shadow: 0 40px 120px #000000aa;
}
.lightbox::backdrop { background: #050508dd; backdrop-filter: blur(7px); }
.lightbox img { display: block; width: 100%; max-height: 82vh; object-fit: contain; background: #050508; }
.lightbox__caption {
  margin: 0;
  padding: 12px 16px;
  border-top: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-size: 12.5px;
}
.lightbox__close {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: 50%;
  background: #16161de8;
  color: var(--color-text);
  cursor: pointer;
}
.lightbox__close:hover { border-color: var(--color-yellow); color: var(--color-yellow); }

/* Apparition douce au défilement */
.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity 520ms var(--easing-ui), transform 520ms var(--easing-ui); }
.js .reveal.is-visible { opacity: 1; transform: none; }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* Même identité que l'accueil, avec une densité adaptée à la lecture. */
.mark-word { text-transform: uppercase; }
.site-header .mark-logo { width: 34px; height: 34px; }
.header-status, .kicker, .doc-rail__title, .tag,
.chips li, .meta-chips li, th, .hero-preview__bar em {
  font-family: var(--font-mono);
}
.page-intro { padding-top: 14px; padding-bottom: 38px; }
.page-intro h1 { font-weight: 500; letter-spacing: -.055em; }
.hero::before, .hero::after, .card::before { display: none; }
.card, .dashboard-card, .toc, .doc-rail, .shot-frame,
.hero-preview, .stats, .gallery a, .lightbox, .dashboard-frame {
  border-radius: var(--radius-panel);
  corner-shape: bevel;
}
.card, .dashboard-card, .toc, .doc-rail, .notes li, .stat {
  background: var(--color-anthracite);
}
.card:hover, .shot-frame:hover, .hero-preview:hover {
  box-shadow: none;
}
pre, code, .notes li, .node, .flow .step, .dashboard-preview-grid iframe,
.back-to-top, .code-copy, .toast, .lightbox__close {
  border-radius: var(--radius-small);
}
.button, .back-to-top, .lightbox__close { corner-shape: bevel; }
.notes li::before { border-radius: var(--radius-small); font-family: var(--font-mono); }
.back-to-top, .code-copy, .toast, .lightbox__close {
  background: var(--color-anthracite);
  box-shadow: none;
  backdrop-filter: none;
}
.code-copy { min-height: 28px; padding-inline: 10px; }
.toast { border-color: var(--color-border); border-left: 3px solid var(--color-yellow); }
.doc-rail__progress { border-radius: 0; }
.doc-rail__progress span { background: var(--color-yellow); }
.toc a::before { content: ''; width: 4px; height: 4px; background: var(--color-yellow); }

/* Adaptation */
@media (max-width: 1000px) {
  .doc-layout { grid-template-columns: minmax(0, 1fr); }
  .doc-rail { display: none; }
}
@media (max-width: 980px) {
  .hero-layout { grid-template-columns: minmax(0, 1fr); }
  .hero-preview { max-width: 760px; }
  .shot-layout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  html { scroll-padding-top: 128px; }
  .site-header { gap: 10px; padding-inline: 18px; }
  .header-status { display: none; }
  .site-header nav { order: 3; width: 100%; margin-left: 0; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  .site-header nav::-webkit-scrollbar { display: none; }
  .site-header nav a { flex: 0 0 auto; }
  main { padding-top: 32px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .toc { grid-template-columns: minmax(0, 1fr); padding: 14px 16px; }
  table { display: block; overflow-x: auto; }
  th, td { min-width: 150px; }
  .card { padding: 18px; }
  .dashboard-gallery { grid-template-columns: 1fr; }
  .dashboard-frame iframe { height: 380px; }
  .dashboard-preview-grid iframe { height: 320px; }
  .shot-layout { gap: 16px; }
  .notes li { font-size: 13px; }
}
@media (max-width: 520px) {
  h1 { max-width: none; }
  .hero { padding: 24px 20px; border-radius: var(--radius-panel); }
  .hero-actions .button { width: 100%; }
  .stat { padding: 14px 16px; }
  .stat b { font-size: 24px; }
  .back-to-top { right: 14px; bottom: 14px; }
}

@media (hover: none) {
  .code-copy { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
  .js .reveal { opacity: 1; transform: none; }
}

@media print {
  .site-header, .doc-rail, .back-to-top, .toast-stack, .code-copy, .skip-link { display: none !important; }
  body { background: #fff; color: #111; }
  a { color: #111; }
  .card, .shot-frame, .toc { box-shadow: none; border-color: #bbb; background: #fff; }
}
