/* Kalibrant — site et pages légales. Aucune police, image ou script externe (CSP : style-src 'self'). */

:root {
  --paper: #ffffff;
  --lilac: #f3f1fd;
  --lilac-strong: #e8e5fb;
  --mint: #00c897;
  --mint-soft: #e3f7f0;
  --action: #5847d6;
  --action-text: #5847d6;
  --ink-strong: #2b2160;
  --ink: #37474f;
  --ink-soft: #5b6770;
  --safe: #00775a;
  --warning: #8a5300;
  --danger: #c62828;
  --red-soft: #fdecec;
  --amber-soft: #fff3d6;
  --hairline: #eef0f5;
  --card: #ffffff;
  --shadow: 0 2px 10px rgb(43 33 96 / 0.08);

  --rounded: ui-rounded, "SF Pro Rounded", "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --gutter: clamp(16px, 5vw, 48px);
  --measure: 68ch;
  color-scheme: light;
}

/* Clair par défaut (identité Safety White) ; sombre sur demande, retenu par assets/theme.js. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #0f0e1a;
  --lilac: #1f1c38;
  --lilac-strong: #2c2750;
  --mint-soft: #12302a;
  --action: #6e5ff0;
  --action-text: #a99fff;
  --ink-strong: #eceafb;
  --ink: #d5dae0;
  --ink-soft: #9aa5ae;
  --safe: #4fd8ae;
  --warning: #ffc870;
  --danger: #ff8a80;
  --red-soft: #3a1a1c;
  --amber-soft: #33280f;
  --hairline: #2a2840;
  --card: #1a1830;
  --shadow: 0 2px 10px rgb(0 0 0 / 0.35);
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--sans);
  overflow-x: hidden;
}

a { color: var(--action-text); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--action-text); outline-offset: 3px; border-radius: 6px; }

h1, h2, h3 { font-family: var(--rounded); color: var(--ink-strong); line-height: 1.15; margin: 0; }

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 10;
  background: var(--action); color: #fff; padding: 10px 16px; border-radius: 12px;
}
.skip:focus { top: 12px; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- En-tête ---------- */

.top {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding-top: 20px; padding-bottom: 20px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font: 800 1.25rem/1 var(--rounded); color: var(--ink-strong); text-decoration: none;
}
.brand svg { width: 34px; height: 37px; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.lang, .theme {
  font: 600 0.9375rem/1 var(--rounded); color: var(--ink-strong); text-decoration: none;
  padding: 10px 14px; border-radius: 999px; background: var(--card); box-shadow: var(--shadow);
}
.theme { border: 0; cursor: pointer; padding: 8px; width: 40px; height: 40px; display: inline-grid; place-items: center; }
.theme[hidden] { display: none; }
.theme svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.theme .sun, .theme[aria-pressed="true"] .moon { display: none; }
.theme[aria-pressed="true"] .sun { display: block; }

/* ---------- Mascotte ---------- */

.m-handle { stroke: var(--action); }
.m-lens { fill: var(--card); stroke: var(--ink-strong); }
.m-ink { fill: var(--ink-strong); }
.m-line { stroke: var(--ink-strong); fill: none; }
.m-cheek { fill: var(--mint); opacity: 0.5; }

/* ---------- Accueil : héros ---------- */

.hero-top { background: var(--lilac); }
.hero {
  margin-top: -1px;
  background: var(--lilac);
  border-radius: 0 0 40px 40px;
  padding-bottom: clamp(48px, 8vw, 96px);
}
.hero-grid {
  display: grid; gap: clamp(36px, 6vw, 72px); align-items: center;
  grid-template-columns: minmax(0, 1fr);
  padding-top: clamp(24px, 5vw, 56px);
}
@media (min-width: 880px) { .hero-grid { grid-template-columns: 1.05fr 1fr; } }

.hero h1 {
  font-size: clamp(2.5rem, 6.4vw, 4.75rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.02;
}
.hero h1 span { display: block; white-space: nowrap; }
.lede { font-size: clamp(1.125rem, 2.2vw, 1.3125rem); line-height: 1.5; max-width: 34ch; margin: 24px 0 0; }
.status {
  display: inline-block; margin-top: 28px;
  font: 600 1rem/1.3 var(--rounded); color: var(--ink-strong);
  padding: 12px 18px; border-radius: 16px; background: var(--card); box-shadow: var(--shadow);
}

/* La scène : un SMS d'arnaque inspecté par la loupe. */
.scene { position: relative; max-width: 480px; width: 100%; justify-self: center; }
.sms-from { font: 600 0.875rem/1 var(--sans); color: var(--ink-soft); margin: 0 0 8px 18px; }
.sms {
  margin: 0; padding: 18px 20px;
  background: var(--card); color: var(--ink-strong);
  border-radius: 26px 26px 26px 8px; box-shadow: var(--shadow);
  font-size: clamp(1.125rem, 2vw, 1.25rem); line-height: 1.6;
}
.bait { position: relative; white-space: nowrap; color: var(--action-text); text-decoration: underline; }
.bait-mark {
  position: absolute; inset: -4px -6px; border-radius: 8px; z-index: -1;
  background: var(--red-soft);
  opacity: 0; animation: mark 0.5s ease-out 2.1s forwards;
}
.sms { position: relative; z-index: 0; isolation: isolate; }

.loupe {
  position: absolute; left: 50%; top: 50%;
  width: 120px; height: 120px; margin: -50px 0 0 -50px;
  pointer-events: none;
  animation: inspect 2s cubic-bezier(.45, .05, .25, 1) 0.4s both;
}
.loupe .glass { fill: var(--lilac-strong); fill-opacity: 0.25; stroke: var(--ink-strong); }

.verdict {
  display: flex; align-items: flex-end; gap: 10px; margin-top: 22px;
  opacity: 0; animation: rise 0.5s ease-out 2.5s forwards;
}
.verdict svg { flex: none; width: 64px; height: 69px; }
.verdict p {
  margin: 0 0 22px; padding: 12px 16px;
  background: var(--card); box-shadow: var(--shadow);
  border-radius: 22px 22px 22px 6px;
  color: var(--ink-strong); font-size: 1rem; line-height: 1.45;
}
.verdict strong { color: var(--danger); }

@keyframes inspect {
  0%   { transform: translate(-150px, 70px) rotate(-12deg); opacity: 0; }
  20%  { opacity: 1; }
  55%  { transform: translate(-60px, -30px) rotate(4deg); }
  100% { transform: translate(0, 0) rotate(0); opacity: 1; }
}
@keyframes mark { to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .loupe, .bait-mark, .verdict { animation: none; opacity: 1; }
}

/* ---------- Accueil : sections ---------- */

.section { padding: clamp(56px, 9vw, 112px) 0 0; }
.section > .wrap > h2 { font-size: clamp(1.75rem, 3.6vw, 2.5rem); letter-spacing: -0.015em; max-width: 22ch; }

.features { list-style: none; margin: 40px 0 0; padding: 0; }
.features li {
  display: grid; gap: 8px 48px; grid-template-columns: minmax(0, 1fr);
  padding: 28px 0; border-top: 1px solid var(--hairline);
}
.features li:last-child { border-bottom: 1px solid var(--hairline); }
@media (min-width: 760px) { .features li { grid-template-columns: 18rem 1fr; } }
.features h3 { font-size: 1.375rem; }
.features p { margin: 0; max-width: 60ch; }
.features .aside { margin-top: 10px; font-size: 0.9375rem; color: var(--ink-soft); }

.promise { background: var(--mint-soft); border-radius: 40px; margin-top: clamp(56px, 9vw, 112px); padding: clamp(40px, 7vw, 80px) 0; }
.promise .short { font: 800 clamp(1.5rem, 3.4vw, 2.25rem)/1.2 var(--rounded); color: var(--ink-strong); margin: 0; max-width: 24ch; letter-spacing: -0.01em; }
.pledges { display: grid; gap: 32px; margin-top: 40px; grid-template-columns: minmax(0, 1fr); }
.pledges > div { max-width: 62ch; }
.pledges h3 { font-size: 1.1875rem; margin-bottom: 10px; }
.pledges p { margin: 0; }
.promise .more { margin: 36px 0 0; font-weight: 600; }

.plans { width: 100%; border-collapse: collapse; margin-top: 36px; font-size: 1rem; }
.plans th, .plans td { text-align: left; padding: 16px 12px; border-bottom: 1px solid var(--hairline); vertical-align: top; }
.plans thead th { font: 800 1.1875rem/1.2 var(--rounded); color: var(--ink-strong); }
.plans thead th small { display: block; font: 400 0.9375rem/1.4 var(--sans); color: var(--ink-soft); margin-top: 4px; }
.plans tbody th { font-weight: 600; color: var(--ink-strong); width: 30%; }
.plans-scroll { overflow-x: auto; }
.plans-note { margin: 20px 0 0; color: var(--ink-soft); font-size: 0.9375rem; max-width: 70ch; }

.disclaimer { margin: 0; padding: 18px 20px; border-radius: 18px; background: var(--amber-soft); color: var(--ink-strong); max-width: 70ch; }

/* ---------- Pages légales ---------- */

.doc-head, .doc-top { background: var(--lilac); }
.doc-head { border-radius: 0 0 40px 40px; padding-bottom: clamp(32px, 5vw, 56px); }
.doc-intro { display: flex; align-items: flex-end; gap: 12px; padding-top: clamp(12px, 3vw, 32px); }
.doc-intro svg { flex: none; width: 72px; height: 78px; }
.doc-intro h1 { font-size: clamp(2rem, 5vw, 3rem); letter-spacing: -0.02em; }
.doc-intro p { margin: 8px 0 0; color: var(--ink-soft); font-size: 0.9375rem; }

.doc { display: grid; gap: 48px; grid-template-columns: minmax(0, 1fr); padding-top: clamp(32px, 5vw, 56px); padding-bottom: 32px; }
@media (min-width: 1000px) { .doc { grid-template-columns: 15rem minmax(0, 1fr); } }

.toc { font-size: 0.9375rem; }
.toc h2 { font-size: 1rem; margin-bottom: 10px; }
.toc ol { margin: 0; padding-left: 1.4em; }
.toc li { margin: 6px 0; }
@media (min-width: 1000px) { .toc nav { position: sticky; top: 24px; } }

.prose { max-width: var(--measure); }
.prose h2 { font-size: 1.5rem; margin: 48px 0 12px; scroll-margin-top: 24px; }
.prose h3 { font-size: 1.125rem; margin: 28px 0 8px; }
.prose p, .prose ul, .prose ol { margin: 0 0 14px; }
.prose li { margin: 6px 0; }
.prose table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; margin: 8px 0 20px; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 10px 8px; border-bottom: 1px solid var(--hairline); }
.prose thead th { color: var(--ink-strong); font-weight: 700; }
.table-scroll { overflow-x: auto; }

.essentials { background: var(--mint-soft); border-radius: 24px; padding: 24px 28px; margin-bottom: 8px; }
.essentials h2 { margin-top: 0; font-size: 1.25rem; }
.essentials ul { margin: 0; padding-left: 1.2em; }

.todo { background: var(--amber-soft); color: var(--ink-strong); padding: 0 4px; border-radius: 4px; font-weight: 600; }

/* ---------- Pied de page ---------- */

.foot { margin-top: clamp(64px, 10vw, 120px); border-top: 1px solid var(--hairline); padding: 32px 0 48px; font-size: 0.9375rem; color: var(--ink-soft); }
.foot-grid { display: flex; flex-wrap: wrap; gap: 16px 32px; justify-content: space-between; align-items: baseline; }
.foot ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 24px; }
.foot a { color: var(--ink-strong); }
.foot p { margin: 0; }

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

.lost { text-align: center; padding: 64px 0; }
.lost svg { width: 120px; height: 130px; }
.lost h1 { font-size: clamp(2rem, 5vw, 3rem); margin-top: 16px; }
.lost p { max-width: 40ch; margin: 16px auto 0; }

@media (max-width: 640px) {
  .prose table.stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .prose table.stack tr { display: block; padding: 12px 0; border-bottom: 1px solid var(--hairline); }
  .prose table.stack td { display: block; border: 0; padding: 2px 0; }
  .prose table.stack td:first-child { font-weight: 700; color: var(--ink-strong); }
  .prose table.stack td:not(:first-child)::before { content: attr(data-label) "\00a0: "; color: var(--ink-soft); }
}

/* ---------- La mascotte qui accompagne chaque section ---------- */

.guided { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
.guide { display: flex; align-items: flex-end; gap: 8px; }
.guide svg { flex: none; width: 64px; height: 69px; }
.guide-bubble {
  margin: 0 0 22px; padding: 10px 14px; max-width: 30ch;
  background: var(--card); box-shadow: var(--shadow); border-radius: 22px 22px 22px 6px;
  color: var(--ink-strong); font: 600 0.9375rem/1.4 var(--rounded);
}
@media (min-width: 960px) {
  .guided { grid-template-columns: 12.5rem minmax(0, 1fr); gap: 56px; }
  .guide { position: sticky; top: 32px; align-self: start; flex-direction: column; align-items: flex-start; gap: 6px; }
  .guide-bubble { margin: 0 0 0 28px; border-radius: 6px 22px 22px 22px; }
  .guide svg { width: 84px; height: 91px; }
}
.promise .guide-bubble { background: var(--paper); }

/* Défilement : la mascotte arrive avec sa section, puis ses yeux parcourent le contenu. */
.with-guide { view-timeline: --section block; }
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .guide { animation: arrive linear both; animation-timeline: --section; animation-range: entry 10% entry 60%; }
    .guide .eyes { animation: read linear both; animation-timeline: --section; animation-range: contain; }
  }
}
@keyframes arrive { from { opacity: 0; transform: translateY(24px) rotate(-6deg); } to { opacity: 1; transform: none; } }
@keyframes read {
  0%   { transform: translate(-2px, -2px); }
  35%  { transform: translate(3px, 0); }
  70%  { transform: translate(-3px, 2px); }
  100% { transform: translate(2px, 3px); }
}

.section-lede { margin: 16px 0 0; max-width: 56ch; font-size: 1.125rem; }

/* ---------- Arnaque ou pas ? ---------- */

.quiz { display: grid; gap: 20px; margin-top: 32px; }
.q { margin: 0; padding: 22px 24px 24px; border: 0; border-radius: 28px; background: var(--lilac); }
.q legend { float: left; width: 100%; padding: 0; }
.q-kind { display: block; font: 600 0.875rem/1.3 var(--sans); color: var(--ink-soft); margin-bottom: 10px; }
.q-msg {
  display: block; padding: 14px 18px; background: var(--card); color: var(--ink-strong);
  border-radius: 22px 22px 22px 6px; box-shadow: var(--shadow); font-size: 1.0625rem; line-height: 1.55;
}
.q-choices { clear: both; display: flex; flex-wrap: wrap; gap: 10px; padding-top: 16px; }
.q-choices input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.q-choices label {
  cursor: pointer; padding: 10px 18px; border-radius: 999px; background: var(--card);
  border: 2px solid var(--lilac-strong); color: var(--ink-strong); font: 600 1rem/1.2 var(--rounded);
}
.q-choices label:hover { border-color: var(--action-text); }
.q-choices input:focus-visible + label { outline: 3px solid var(--action-text); outline-offset: 3px; }
.q-choices input:checked + label { background: var(--action); border-color: var(--action); color: #fff; }

.q-answer { display: none; margin-top: 16px; padding: 16px 18px; border-radius: 20px; background: var(--card); }
.q:has(input:checked) .q-answer { display: block; animation: rise 0.35s ease-out; }
.q-answer p { margin: 0; }
.q-answer p + p { margin-top: 6px; }
.q-feedback { font: 700 1rem/1.3 var(--rounded); color: var(--ink-strong); }
.q-feedback span { display: none; }
.q:has(input.right:checked) .q-feedback .ok,
.q:has(input:not(.right):checked) .q-feedback .ko { display: inline; }
.is-safe strong { color: var(--safe); }
.is-warning strong { color: var(--warning); }
.is-danger strong { color: var(--danger); }
.is-safe .q-answer { box-shadow: inset 4px 0 0 var(--safe); }
.is-warning .q-answer { box-shadow: inset 4px 0 0 var(--warning); }
.is-danger .q-answer { box-shadow: inset 4px 0 0 var(--danger); }
@media (prefers-reduced-motion: reduce) { .q:has(input:checked) .q-answer { animation: none; } }
/* Une fois la réponse donnée, le bon verdict est entouré de sa couleur. */
.is-safe:has(input:checked) input.right + label { border-color: var(--safe); }
.is-warning:has(input:checked) input.right + label { border-color: var(--warning); }
.is-danger:has(input:checked) input.right + label { border-color: var(--danger); }
