:root {
  --quartz: #e4e6e9;      /* fond : granit gris poli */
  --quartz-deep: #d5d9de;
  --slate: #1e2329;       /* encre */
  --slate-soft: #4c5560;
  --mica: #2e4fbf;        /* accent */
  --mica-soft: #dfe5f7;
  --deny: #a53a2c;
  --allow: #2a6a4a;
  --paper: #f4f5f6;
  --wide: 125;            /* largeur Archivo des titres, effet gravé */
  --measure: 66ch;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--quartz);
  color: var(--slate);
  font-family: 'Archivo', system-ui, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
  font-variation-settings: 'wdth' 100;
}

h1, h2, h3 {
  font-variation-settings: 'wdth' var(--wide);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.01em;
  margin: 0;
  text-wrap: balance;
}

h1 { font-size: clamp(2.3rem, 4.4vw, 4rem); font-weight: 800; }
h2 { font-size: clamp(1.7rem, 2.8vw, 2.5rem); }
h3 { font-size: 1.2rem; }

p { margin: 0 0 1rem; max-width: var(--measure); }

code { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 0.88em; }

a { color: var(--mica); text-underline-offset: 0.2em; }

:focus-visible { outline: 3px solid var(--mica); outline-offset: 3px; border-radius: 4px; }

.skip {
  position: absolute; left: 1rem; top: -3rem; padding: 0.5rem 1rem;
  background: var(--slate); color: var(--paper); z-index: 100;
}
.skip:focus { top: 1rem; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-block;
  padding: 0.85rem 1.4rem;
  border-radius: 6px;
  background: var(--mica);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  border: 2px solid var(--mica);
}
.btn:hover { background: #2443a6; border-color: #2443a6; }
.btn-ghost { background: transparent; color: var(--slate); border-color: var(--slate); }
.btn-ghost:hover { background: var(--slate); color: var(--paper); border-color: var(--slate); }
.btn-small { padding: 0.5rem 1rem; font-size: 0.95rem; }

/* ---------- Navigation ---------- */
.nav {
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 1.1rem clamp(1.25rem, 5vw, 4rem);
  max-width: 1360px;
  margin: 0 auto;
}
.logo {
  display: flex; align-items: center; gap: 0.6rem;
  color: var(--slate); text-decoration: none;
  font-weight: 800; font-size: 1.3rem;
  font-variation-settings: 'wdth' var(--wide);
}
.logo svg { width: 30px; height: 30px; color: var(--mica); }
.nav nav { display: flex; gap: 1.5rem; margin-left: auto; }
.nav nav a { color: var(--slate-soft); text-decoration: none; font-size: 0.97rem; }
.nav nav a:hover { color: var(--slate); text-decoration: underline; }
.lang {
  color: var(--slate); font-weight: 700; font-size: 0.9rem; text-decoration: none;
  padding: 0.3rem 0.55rem; border: 1.5px solid var(--slate-soft); border-radius: 6px;
}
.lang:hover { background: var(--slate); color: var(--paper); border-color: var(--slate); }

/* ---------- Sections ---------- */
main > section {
  max-width: 1360px;
  margin: 0 auto;
  padding: clamp(3.5rem, 8vw, 6.5rem) clamp(1.25rem, 5vw, 4rem);
}

/* ---------- Accueil ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
  padding-top: clamp(2.5rem, 6vw, 5rem);
}
.lede { font-size: 1.2rem; color: var(--slate-soft); margin: 1.5rem 0 2rem; max-width: 34em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.8rem; }

/* La dalle : l'élément fort de la page. */
.slab {
  position: relative;
  border-radius: 14px;
  background: #9aa1a9;
  overflow: hidden;
  box-shadow: 0 1px 0 rgb(255 255 255 / 0.4) inset, 0 30px 60px -30px rgb(20 26 33 / 0.55);
  isolation: isolate;
}
.slab-texture {
  position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(135deg, #a9b0b7, #8a929b);
}
.slab-texture::after {
  content: '';
  position: absolute; inset: 0;
  filter: url(#granite);
  background: #000;
  opacity: 0.6;
}
.demo {
  margin: clamp(1rem, 2.5vw, 1.75rem);
  background: rgb(244 245 246 / 0.94);
  backdrop-filter: blur(2px);
  border-radius: 10px;
  padding: clamp(1.1rem, 2.5vw, 1.6rem);
}
.demo-title { font-weight: 600; margin-bottom: 0.8rem; }

.roles { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.1rem; }
.roles button {
  font: inherit; font-size: 0.9rem; font-weight: 600;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  border: 1.5px solid var(--slate);
  background: transparent; color: var(--slate);
  cursor: pointer;
}
.roles button[aria-checked='true'] { background: var(--slate); color: var(--paper); }

.perms {
  border-top: 1px solid var(--quartz-deep);
  border-bottom: 1px solid var(--quartz-deep);
  padding: 0.8rem 0;
  margin-bottom: 0.9rem;
}
.perms-label { display: block; font-size: 0.85rem; color: var(--slate-soft); margin-bottom: 0.4rem; }
.perms ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.35rem; }
.perms li {
  font-family: 'JetBrains Mono', monospace; font-size: 0.8rem;
  padding: 0.15rem 0.5rem; border-radius: 4px;
  background: var(--mica-soft); color: var(--mica);
}

.calls { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.45rem; }
.calls li {
  display: grid;
  grid-template-columns: 3.2rem 1fr;
  grid-template-areas: 'status req' 'status why';
  column-gap: 0.8rem;
  align-items: center;
  padding: 0.55rem 0.7rem;
  border-radius: 8px;
  background: #fff;
  border-left: 4px solid var(--allow);
  animation: settle 0.28s ease-out;
}
.calls li.denied { border-left-color: var(--deny); }
.status {
  grid-area: status;
  font-family: 'JetBrains Mono', monospace; font-weight: 600; font-size: 1.05rem;
  color: var(--allow);
}
.denied .status { color: var(--deny); }
.req { grid-area: req; font-family: 'JetBrains Mono', monospace; font-size: 0.82rem; overflow-wrap: anywhere; }
.req small { font-family: 'Archivo', sans-serif; color: var(--slate-soft); margin-left: 0.5rem; font-size: 0.8rem; }
.why { grid-area: why; font-size: 0.8rem; color: var(--slate-soft); }
.denied .why { color: var(--deny); }

@keyframes settle { from { opacity: 0.35; transform: translateX(-4px); } }
@media (prefers-reduced-motion: reduce) { .calls li { animation: none; } }

/* ---------- Problème ---------- */
.problem {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: clamp(2rem, 5vw, 5rem);
  border-top: 2px solid var(--slate);
}

/* ---------- Fonctionnement : une vraie séquence, donc numérotée ---------- */
.flow { background: var(--paper); max-width: none !important; }
.flow > * { max-width: 1232px; margin-inline: auto; }
.steps {
  list-style: none; padding: 0; margin-top: 2.5rem;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(1.5rem, 3vw, 3rem);
  counter-reset: step;
}
.steps li { counter-increment: step; border-top: 2px solid var(--slate); padding-top: 1.2rem; }
.steps li::before {
  content: counter(step);
  display: block;
  font-variation-settings: 'wdth' var(--wide);
  font-weight: 800; font-size: 3rem; line-height: 1;
  color: var(--mica);
  margin-bottom: 0.8rem;
}
.steps h3 { margin-bottom: 0.6rem; }
.steps p { color: var(--slate-soft); }

/* ---------- Code ---------- */
.code-section, .console-section, .deploy {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}
.code-copy h2, .console-copy h2, .deploy h2 { margin-bottom: 1.2rem; }

.code {
  margin: 0;
  background: var(--slate);
  color: #d9dee4;
  border-radius: 10px;
  padding: 1.5rem 1.6rem;
  overflow-x: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.86rem;
  line-height: 1.65;
}
.code code { font-size: inherit; }
.code .k { color: #9fb4f5; }
.code .t { color: #e8c88f; }
.code .s { color: #a8d5b5; }
.code .c { color: #8a949f; font-style: italic; }
.code-short { font-size: 0.92rem; }

.code-stack { display: grid; gap: 1.2rem; min-width: 0; }
.code-stack figure { margin: 0; min-width: 0; }
.code-stack figcaption { font-size: 0.85rem; font-weight: 600; color: var(--slate-soft); margin-bottom: 0.45rem; }

/* ---------- Console ---------- */
.console-section { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.note { color: var(--slate-soft); font-size: 0.95rem; }
.matrix { margin: 0; background: #fff; border-radius: 10px; padding: 1.2rem; box-shadow: 0 20px 40px -28px rgb(20 26 33 / 0.5); overflow-x: auto; }
.matrix table { border-collapse: collapse; width: 100%; font-size: 0.9rem; }
.matrix th, .matrix td { padding: 0.55rem 0.6rem; border-bottom: 1px solid var(--quartz); text-align: center; }
.matrix thead th { font-weight: 600; color: var(--slate-soft); font-size: 0.85rem; }
.matrix tbody th { text-align: left; font-weight: 400; white-space: nowrap; }
.matrix td.on { color: #fff; background: var(--mica); background-clip: content-box; font-weight: 700; }
.matrix td.cov { color: var(--mica); }
.matrix figcaption { font-size: 0.82rem; color: var(--slate-soft); margin-top: 0.8rem; }

/* ---------- Sécurité ---------- */
.security { border-top: 2px solid var(--slate); }
.facts {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2.2rem clamp(1.5rem, 3vw, 3rem);
  margin: 2.5rem 0 0;
}
.facts dt { font-weight: 700; font-size: 1.08rem; margin-bottom: 0.35rem; }
.facts dd { margin: 0; color: var(--slate-soft); }

/* ---------- Déploiement ---------- */
.deploy { background: var(--slate); color: var(--paper); max-width: none !important; }
.deploy > * { max-width: 600px; }
.deploy > div { justify-self: end; }
.deploy p { color: #b9c1ca; }
.deploy .code { background: #2a3139; justify-self: start; width: 100%; }

/* ---------- FAQ ---------- */
.faq { max-width: 900px !important; }
.faq h2 { margin-bottom: 1.5rem; }
.faq details { border-top: 1px solid var(--slate-soft); padding: 1rem 0; }
.faq details:last-of-type { border-bottom: 1px solid var(--slate-soft); }
.faq summary { cursor: pointer; font-weight: 600; font-size: 1.1rem; list-style-position: outside; }
.faq details p { margin: 0.8rem 0 0; color: var(--slate-soft); }

/* ---------- Pied de page ---------- */
/* Bande pleine largeur, un ton plus foncé que la page : se détache nettement de la dernière section. */
.footer {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem;
  background: var(--quartz-deep);
  border-top: 1px solid #c3c8ce;
  padding: 1.75rem max(clamp(1.25rem, 5vw, 4rem), calc((100% - 1360px) / 2 + clamp(1.25rem, 5vw, 4rem)));
  color: var(--slate-soft); font-size: 0.92rem;
}

.footer a { color: var(--slate-soft); }
.footer a:hover { color: var(--mica); }
.credit a { font-weight: 600; color: var(--slate); }

/* ---------- Petits écrans ---------- */
@media (max-width: 960px) {
  .hero, .problem, .code-section, .console-section, .deploy { grid-template-columns: 1fr; }
  .steps, .facts { grid-template-columns: 1fr; }
  .deploy > div { justify-self: start; }
  .nav nav { display: none; }
  .nav .lang { margin-left: auto; }
}
.defs { position: absolute; }

/* ---------- Contact ---------- */
.contact {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: start;
  border-top: 2px solid var(--slate);
}
.contact-copy h2 { margin-bottom: 1.2rem; }
.contact-copy p { color: var(--slate-soft); }

.contact-form {
  background: #fff;
  border-radius: 12px;
  padding: clamp(1.25rem, 3vw, 2rem);
  box-shadow: 0 20px 40px -28px rgb(20 26 33 / 0.5);
  display: grid;
  gap: 1rem;
}
.field { display: grid; gap: 0.35rem; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.field label { font-weight: 600; font-size: 0.95rem; }
.optional { font-weight: 400; color: var(--slate-soft); }
.field input,
.field select,
.field textarea {
  font: inherit;
  color: var(--slate);
  background: var(--paper);
  border: 1.5px solid var(--quartz-deep);
  border-radius: 8px;
  padding: 0.65rem 0.8rem;
  width: 100%;
}
.field textarea { resize: vertical; min-height: 8rem; }
.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible { border-color: var(--mica); outline: 3px solid var(--mica-soft); outline-offset: 0; }
.field input:user-invalid,
.field textarea:user-invalid { border-color: var(--deny); }

.form-actions { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.form-actions .btn { font: inherit; font-weight: 600; cursor: pointer; }
.form-actions .btn:disabled { opacity: 0.6; cursor: progress; }
.form-status { margin: 0; font-size: 0.95rem; }
.form-status.ok { color: var(--allow); font-weight: 600; }
.form-status.error { color: var(--deny); }

/* Champ piège anti-robots : hors de l'écran, invisible aux humains. */
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

@media (max-width: 960px) {
  .contact { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .field-row { grid-template-columns: 1fr; }
}
