/* ergo. explique : feuille de style partagée par toutes les pages.
   Aucune ressource externe : polices auto-hébergées dans /assets, aucun JavaScript. */

@font-face {
  font-family: "Space Grotesk";
  src: url("/assets/SpaceGrotesk-latin.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "JetBrains Mono";
  src: url("/assets/JetBrainsMono-latin.woff2") format("woff2");
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #0a0d12;
  --panel: #151c27;
  --panel-2: #1a2330;
  --line: #253042;
  --text: #eef2f6;
  --muted: #7d8a99;
  --soft: #b9c3ce;
  --accent: #1fd39a;
  --font-display: "Space Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-long: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --radius: 16px;
  --gutter: 1.25rem;
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.0625rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  text-decoration-thickness: 2px;
}

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

strong {
  font-weight: 700;
}

code {
  font-family: var(--font-mono);
  font-size: 0.82em;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.05em 0.35em;
  overflow-wrap: anywhere;
}

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

.skip {
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  z-index: 10;
  padding: 0.6rem 1rem;
  border-radius: 10px;
  background: var(--accent);
  color: var(--bg);
  font-weight: 700;
  text-decoration: none;
}

.skip:focus {
  top: 1rem;
}

.wrap {
  width: min(100% - 2 * var(--gutter), 36rem);
  margin-inline: auto;
}

.wrap-wide {
  width: min(100% - 2 * var(--gutter), 38rem);
  margin-inline: auto;
}

/* ---------- Étiquettes mono ---------- */

.kicker {
  margin: 0 0 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

/* ---------- Accueil ---------- */

.home {
  background:
    radial-gradient(42rem 26rem at 50% -8rem, rgba(31, 211, 154, 0.09), transparent 70%),
    var(--bg);
}

.hero {
  padding: 2.75rem 0 0;
  text-align: center;
}

.hero-title {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  font-weight: 700;
}

.hero-logo {
  width: min(13rem, 62vw);
  height: auto;
  margin-bottom: -0.9rem;
}

.hero-suffix {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--soft);
  padding-left: 0.32em;
}

.tagline {
  margin: 1.5rem auto 0.5rem;
  max-width: 20ch;
  font-size: clamp(1.625rem, 7vw, 2.25rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.subline {
  margin: 0;
  color: var(--soft);
  font-size: 1.0625rem;
}

.subline.app-line {
  margin: 0.75rem auto 0;
  max-width: 30rem;
  text-wrap: balance;
}

.subline.app-line a {
  font-weight: 700;
}

.social {
  list-style: none;
  margin: 1.75rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.social li {
  display: flex;
}

.social a {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 4.5rem;
  padding: 0.875rem 1rem 0.875rem 1.25rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.social a:hover {
  border-color: var(--accent);
  background: var(--panel-2);
}

.social a:active {
  background: #1b2533;
}

.social .label {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.social .name {
  font-size: 1.1875rem;
  font-weight: 700;
  line-height: 1.2;
}

.social .meta {
  font-size: 0.9375rem;
  color: var(--soft);
}

.social .go {
  flex: none;
  margin-left: auto;
  width: 1.25rem;
  height: 1.25rem;
  color: var(--muted);
}

.social a:hover .go {
  color: var(--accent);
}

.ico {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.rhythm {
  display: flex;
  justify-content: center;
  margin: 1.25rem 0 0;
}

.rhythm span {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
  text-align: left;
}

.rhythm span::before {
  content: "";
  flex: none;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(31, 211, 154, 0.18);
}

.stack {
  margin-top: 2.5rem;
  display: grid;
  gap: 1rem;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem 1.25rem;
  scroll-margin-top: 1rem;
}

.card h2 {
  margin: 0 0 0.75rem;
  font-size: 1.375rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
  font-weight: 700;
}

.card h3 {
  margin: 1.5rem 0 0.5rem;
  font-size: 1.0625rem;
  line-height: 1.3;
  font-weight: 700;
}

.card p {
  margin: 0 0 0.875rem;
  color: var(--soft);
}

.card p:last-child {
  margin-bottom: 0;
}

.card strong {
  color: var(--text);
}

.made {
  margin: 0;
  display: grid;
  gap: 0.875rem;
}

.made div {
  display: grid;
  gap: 0.15rem;
  padding-top: 0.875rem;
  border-top: 1px solid var(--line);
}

.made div:first-child {
  padding-top: 0;
  border-top: 0;
}

.made dt {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--soft);
}

.made dd {
  margin: 0;
  color: var(--text);
}

.made dd span {
  color: var(--soft);
}

.app-head {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  margin-bottom: 1rem;
}

.app-head .kicker {
  margin-bottom: 0.2rem;
}

.app-head h2 {
  margin: 0;
}

.app-icon {
  flex: none;
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 14px;
  border: 1px solid var(--line);
}

.integrations {
  margin: 0.25rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.5rem;
}

.integrations li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.1rem 0.75rem;
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--soft);
  font-size: 1rem;
  line-height: 1.45;
}

.integrations b {
  flex: none;
  width: 5.5rem;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
}

.ticks {
  margin: 0 0 0.875rem;
  padding: 0;
  list-style: none;
  color: var(--soft);
}

.ticks li {
  position: relative;
  padding-left: 1.25rem;
}

.ticks li + li {
  margin-top: 0.3rem;
}

.ticks li::before {
  content: "";
  position: absolute;
  left: 0.1rem;
  top: 0.62em;
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--accent);
}

.how {
  margin: 0;
  padding-left: 1.25rem;
  color: var(--soft);
}

.how li + li {
  margin-top: 0.35rem;
}

.how li::marker {
  font-family: var(--font-mono);
  color: var(--accent);
}

.doc-links {
  margin: 1.25rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.5rem;
}

.doc-links a {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
}

.doc-links a:hover {
  border-color: var(--accent);
}

.doc-links small {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--soft);
  overflow-wrap: anywhere;
}

.card .note {
  margin-top: 1rem;
  font-size: 0.9375rem;
  color: var(--soft);
}

.mail-big {
  display: inline-block;
  margin-top: 0.25rem;
  font-size: clamp(1.125rem, 5.2vw, 1.375rem);
  font-weight: 700;
  overflow-wrap: anywhere;
}

/* ---------- Pages de texte (confidentialité, CGU, mentions légales, 404) ---------- */

.topbar {
  border-bottom: 1px solid var(--line);
}

.topbar .wrap-wide {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4rem;
}

.topbar .brand {
  display: block;
  padding: 0.25rem 0;
  border-radius: 8px;
}

.topbar .brand img {
  width: auto;
  height: 2.25rem;
  /* le viewBox du logo a une marge interne à gauche : on l'aligne sur la colonne de texte */
  margin-left: -0.35rem;
}

.topbar .back {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--soft);
  text-decoration: none;
  padding: 0.75rem 0;
}

.topbar .back:hover {
  color: var(--accent);
  text-decoration: underline;
}

.page-head {
  padding: 2.25rem 0 0.5rem;
}

.page-head h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(2rem, 9vw, 3rem);
  line-height: 1.04;
  letter-spacing: -0.025em;
  font-weight: 700;
  text-wrap: balance;
}

.updated {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--soft);
}

.lede {
  margin: 1.25rem 0 0;
  font-size: 1.125rem;
  color: var(--soft);
}

.prose {
  font-family: var(--font-long);
  font-weight: 400;
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--text);
}

.prose h2,
.prose h3 {
  font-family: var(--font-display);
  font-weight: 700;
  scroll-margin-top: 1rem;
}

.prose h2 {
  margin: 3rem 0 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  font-size: 1.5rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.prose h3 {
  margin: 2rem 0 0.6rem;
  font-size: 1.1875rem;
  line-height: 1.3;
}

.prose p,
.prose ul,
.prose ol {
  margin: 0 0 1rem;
}

.prose ul,
.prose ol {
  padding-left: 1.35rem;
}

.prose li + li {
  margin-top: 0.4rem;
}

.prose li::marker {
  color: var(--muted);
}

.prose a {
  overflow-wrap: anywhere;
}

.prose section {
  scroll-margin-top: 1rem;
}

.prose .num {
  font-family: var(--font-mono);
  font-size: 0.85em;
  color: var(--accent);
  margin-right: 0.15rem;
}

/* 42 : retour au sommaire en fin de section */
.prose .to-toc {
  margin: 1.25rem 0 0;
  font-family: var(--font-mono);
  font-size: 0.875rem;
}

.prose .to-toc a {
  display: inline-block;
  padding: 0.6rem 0;
  color: var(--soft);
}

.prose .to-toc a:hover {
  color: var(--accent);
}

.box > .to-toc {
  margin-bottom: 0.75rem;
}

.box {
  margin: 1.5rem 0;
  padding: 1.25rem 1.25rem 0.5rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  scroll-margin-top: 1rem;
}

.box > h2,
.box > h3 {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.box-accent {
  border-left: 4px solid var(--accent);
}

.toc h2 {
  font-size: 1.1875rem;
}

.toc ol {
  margin: 0 0 0.75rem;
  padding-left: 1.6rem;
}

.toc li + li {
  margin-top: 0.25rem;
}

.toc a {
  color: var(--text);
}

.toc a:hover {
  color: var(--accent);
}

.facts {
  margin: 1rem 0 1.25rem;
  border-top: 1px solid var(--line);
}

.facts div {
  display: grid;
  gap: 0.2rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--line);
}

.facts dt {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--soft);
  line-height: 1.5;
}

.facts dt code {
  text-transform: none;
  letter-spacing: 0;
  color: var(--text);
  font-size: 0.8rem;
}

.facts dd {
  margin: 0;
}

.facts dd p {
  margin: 0 0 0.5rem;
}

.facts dd p:last-child {
  margin-bottom: 0;
}

.steps {
  counter-reset: step;
  list-style: none;
  padding-left: 0 !important;
}

.steps > li {
  counter-increment: step;
  position: relative;
  padding-left: 2.75rem;
  min-height: 2rem;
}

.steps > li + li {
  margin-top: 1.1rem;
}

.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--accent);
  color: var(--bg);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.9rem;
}

.steps ul {
  margin-top: 0.5rem;
}

@media (max-width: 39.99rem) {
  .steps > li {
    padding-left: 2.25rem;
  }

  .steps > li::before {
    width: 1.75rem;
    height: 1.75rem;
  }

  .steps ul {
    padding-left: 1rem;
  }
}

.en {
  margin-top: 3.5rem;
}

.en > h2 {
  border-top: 0;
  padding-top: 0;
  margin-top: 0;
}

/* ---------- Pied de page (identique sur toutes les pages) ---------- */

.site-footer {
  margin-top: 3.5rem;
  border-top: 1px solid var(--line);
  padding: 2rem 0 2.75rem;
  font-size: 1rem;
  color: var(--soft);
}

.footer-links {
  list-style: none;
  margin: 0 0 1.25rem;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.25rem;
}

.footer-links a {
  display: inline-block;
  padding: 0.65rem 0;
  color: var(--text);
  font-weight: 600;
}

.footer-links a:hover {
  color: var(--accent);
}

.footer-links a[aria-current="page"] {
  color: var(--accent);
}

.site-footer p {
  margin: 0 0 0.6rem;
}

.site-footer .fine {
  margin-top: 1rem;
  font-size: 0.9375rem;
  color: var(--soft);
}

.site-footer .mono {
  font-family: var(--font-mono);
  font-size: 0.875rem;
}

/* ---------- Page 404 ---------- */

.lost {
  padding: 3rem 0 0;
}

.lost .page-head {
  padding-top: 0.25rem;
}

.lost .code {
  margin: 0 0 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--accent);
}

.button {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 0.75rem 1.25rem;
  border-radius: 12px;
  background: var(--accent);
  color: var(--bg);
  font-weight: 700;
  text-decoration: none;
}

.button:hover {
  background: #4fe0b1;
}

/* ---------- Écrans plus larges ---------- */

@media (min-width: 40rem) {
  :root {
    --gutter: 2rem;
  }

  .hero {
    padding-top: 4rem;
  }

  .card {
    padding: 2rem;
  }

  .facts div {
    grid-template-columns: 11rem 1fr;
    gap: 1.25rem;
  }

  .facts dt {
    padding-top: 0.2rem;
  }

  .toc ol {
    columns: 2;
    column-gap: 2.5rem;
  }

  .toc li {
    break-inside: avoid;
  }

  .box {
    padding: 1.5rem 1.75rem 0.75rem;
  }

  .prose {
    font-size: 1.125rem;
  }
}

@media (min-width: 64rem) {
  .home .wrap {
    width: min(100% - 2 * var(--gutter), 40rem);
  }

  .social {
    grid-template-columns: 1fr 1fr;
  }
}

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

  * {
    transition: none !important;
  }
}

@media print {
  body,
  .home {
    background: #fff;
    color: #000;
  }

  .skip,
  .topbar .back {
    display: none;
  }

  a,
  .prose,
  .card p,
  .site-footer {
    color: #000;
  }

  .card,
  .box {
    background: #fff;
    border-color: #999;
  }
}
