/* site/style.css
 *
 * Une page statique, sans ressource externe : aucune police distante, aucune
 * image distante, rien qui parte ailleurs quand quelqu un la lit. Elle doit
 * se lire pareil sur un telephone et sur un bureau, en clair et en sombre.
 * Les couleurs sont des jetons sur :root ; les composants n utilisent que
 * les jetons, jamais une couleur en dur.
 */

:root {
  --bg: #f7f7f5;
  --ink: #14171a;
  --muted: #5c666d;
  --line: #dcdfdd;
  --panel: #ffffff;
  --accent: #10635a;
  --accent-ink: #ffffff;
  --accent-faint: #e6f1ee;
  --code-bg: #eceeec;
  --ok: #10635a;
  --ko: #9a3412;
  --ko-faint: #fdf0e8;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121618;
    --ink: #e8ecea;
    --muted: #97a3a6;
    --line: #293033;
    --panel: #181e21;
    --accent: #4fc3ac;
    --accent-ink: #0b1614;
    --accent-faint: #16292a;
    --code-bg: #212a2d;
    --ok: #4fc3ac;
    --ko: #f0a882;
    --ko-faint: #2a1f1a;
  }
}
:root[data-theme="dark"] {
  --bg: #121618;
  --ink: #e8ecea;
  --muted: #97a3a6;
  --line: #293033;
  --panel: #181e21;
  --accent: #4fc3ac;
  --accent-ink: #0b1614;
  --accent-faint: #16292a;
  --code-bg: #212a2d;
  --ok: #4fc3ac;
  --ko: #f0a882;
  --ko-faint: #2a1f1a;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  line-height: 1.55;
}

.hero, main, footer {
  max-width: 46rem;
  margin: 0 auto;
  padding: 0 16px;
}

.hero { padding-top: 3rem; padding-bottom: 0.5rem; }

.wordmark {
  margin: 0 0 1.5rem;
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--ink);
}
.wordmark .dot { color: var(--accent); }

h1 {
  margin: 0 0 1.1rem;
  font-size: clamp(1.8rem, 5.2vw, 2.9rem);
  line-height: 1.12;
  font-weight: 700;
  text-wrap: balance;
}

.lede { font-size: 1.12rem; margin: 0 0 1rem; }
.lede-sub { color: var(--muted); margin: 0; }

section { padding: 2.5rem 0 0.5rem; }

h2 {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 1rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--line);
}

h3 { margin: 1.4rem 0 0.35rem; font-size: 1.1rem; }
.steps h3, .two h3 { margin-top: 0; }
p { margin: 0 0 1rem; }

a { color: var(--accent); }

code {
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 0.9em;
  background: var(--code-bg);
  padding: 0.1em 0.35em;
  border-radius: 3px;
  overflow-wrap: anywhere;
}

pre {
  background: var(--code-bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.9rem 1rem;
  overflow-x: auto;
  margin: 0 0 1rem;
}
pre code { background: none; padding: 0; font-size: 0.85rem; line-height: 1.5; }

/* ── le formulaire ─────────────────────────────────────────────────────── */

.tool {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.5rem 16px 1.25rem;
  margin-top: 2.5rem;
}
.tool h2 { margin-top: 0; }

.rows { display: grid; gap: 1rem; }
@media (min-width: 560px) { .rows { grid-template-columns: 1fr 1fr; } }

.field { display: block; margin-bottom: 1rem; }
.field > span {
  display: block;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.35rem;
}
.field select, .field input {
  width: 100%;
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.6rem 0.7rem;
}
.field input { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 0.92rem; }
.field select:focus-visible, .field input:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

button {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent-ink);
  background: var(--accent);
  border: 0;
  border-radius: 6px;
  padding: 0.7rem 1.4rem;
  cursor: pointer;
}
button[disabled] { opacity: 0.55; cursor: default; }

.hint { color: var(--muted); font-size: 0.88rem; margin: 0.6rem 0 0; }

output { display: block; }

.result {
  margin-top: 1.25rem;
  border: 1px solid var(--line);
  border-left: 3px solid var(--ok);
  border-radius: 6px;
  background: var(--accent-faint);
  padding: 1rem;
}
.result.ko { border-left-color: var(--ko); background: var(--ko-faint); }
.result-title { font-weight: 700; margin: 0 0 0.6rem; }
.addr {
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 1rem;
  overflow-wrap: anywhere;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 0.6rem;
  margin: 0 0 0.8rem;
}
.code-line { font-family: ui-monospace, Consolas, monospace; font-size: 0.85rem; color: var(--muted); margin: 0 0 0.5rem; }
.kv {
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
  padding: 0.3rem 0;
  border-top: 1px solid var(--line);
  font-size: 0.92rem;
}
.kv .k { color: var(--muted); white-space: nowrap; }
.kv .v { font-family: ui-monospace, Consolas, monospace; font-size: 0.85rem; text-align: right; overflow-wrap: anywhere; }
.result .note { margin: 0.8rem 0 0; }

/* ── le reste ──────────────────────────────────────────────────────────── */

.steps { list-style: none; counter-reset: step; margin: 0; padding: 0; display: grid; gap: 1.25rem; }
.steps li { counter-increment: step; position: relative; padding-left: 3rem; }
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0.05rem;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.promise {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.5rem 16px 0.5rem;
  margin-top: 2.5rem;
}
.two { display: grid; gap: 1.25rem; }
@media (min-width: 640px) { .two { grid-template-columns: 1fr 1fr; } }
.what-we-do { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--line); }

.checks { margin: 0 0 1rem; padding-left: 1.2rem; display: grid; gap: 0.7rem; }

.warn {
  border-left: 3px solid var(--accent);
  background: var(--accent-faint);
  padding: 0.8rem 1rem;
  border-radius: 0 6px 6px 0;
}

.note { color: var(--muted); font-size: 0.95rem; }
.muted { color: var(--muted); }

table { width: 100%; border-collapse: collapse; margin-bottom: 1rem; font-size: 0.95rem; }
th, td { text-align: left; padding: 0.45rem 0.5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
.chains-table { overflow-x: auto; }
.chains-table td:nth-child(2), .chains-table td:nth-child(3) { font-variant-numeric: tabular-nums; }
.chains-table .yes { color: var(--ok); }
.chains-table .no { color: var(--muted); }
.status td:first-child { font-variant-numeric: tabular-nums; width: 3.5rem; }
.errors td:first-child { white-space: nowrap; width: 1%; }

footer {
  margin-top: 3.5rem;
  padding-top: 1.5rem;
  padding-bottom: 3rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.92rem;
}

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
