/* ==========================================================================
   Ads Data Bridge — feuille de style unique
   Tokens : docs/site/charte_graphique.md §2. Mise en page : §5. Mouvement : §7.
   ========================================================================== */

/* --- Tokens ------------------------------------------------------------- */
:root {
  --ink: #0E1A24;
  --slate: #5A6B78;
  --line: #E3E8EC;
  --paper: #FFFFFF;
  --paper-alt: #F5F8FA;
  --primary: #14485C;
  --primary-hover: #0E3546;
  --accent: #C2703D;
  --accent-text: #91501F;
  /* Texte posé sur --primary (boutons, bulle). Blanc en clair, encre en sombre :
     le blanc sur #6FB5CE ne tiendrait pas le contraste. */
  --sur-primaire: #FFFFFF;
  --hauteur-en-tete: 76px;
  /* Icône du bouton de thème : lune en clair, soleil en sombre */
  --icone-lune: block;
  --icone-soleil: none;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #E6EDF1;
    --slate: #9AAAB6;
    --line: #1E2C36;
    --paper: #0C1418;
    --paper-alt: #111D24;
    --primary: #6FB5CE;
    --primary-hover: #8FC9DE;
    --accent: #E0996A;
    --accent-text: #E0996A;
    --sur-primaire: #0C1418;
    --icone-lune: none;
    --icone-soleil: block;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --icone-lune: none;
  --icone-soleil: block;
  --ink: #E6EDF1;
  --slate: #9AAAB6;
  --line: #1E2C36;
  --paper: #0C1418;
  --paper-alt: #111D24;
  --primary: #6FB5CE;
  --primary-hover: #8FC9DE;
  --accent: #E0996A;
  --accent-text: #E0996A;
  --sur-primaire: #0C1418;
  color-scheme: dark;
}

/* --- Police -------------------------------------------------------------- */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("/fonts/inter-latin.woff2") format("woff2");
}

/* Police de repli aux métriques alignées sur Inter : pas de saut de mise en page au chargement */
@font-face {
  font-family: "Inter Fallback";
  src: local("Arial");
  ascent-override: 90.49%;
  descent-override: 22.56%;
  line-gap-override: 0%;
  size-adjust: 107.06%;
}

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

html {
  font-family: "Inter", "Inter Fallback", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding-top: var(--hauteur-en-tete);
  background: var(--paper);
  color: var(--ink);
  overflow-x: clip;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(46px, 3.2vw + 30px, 76px);
  line-height: 1.05;
}

h2 {
  font-size: clamp(32px, 1.5vw + 26px, 44px);
  line-height: 1.1;
}

h3 {
  font-size: 20px;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

p {
  margin: 0;
}

a {
  color: var(--primary);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
  transition: color 150ms ease;
}

a:hover {
  color: var(--primary-hover);
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

strong {
  font-weight: 600;
}

[id] {
  scroll-margin-top: calc(var(--hauteur-en-tete) + 24px);
}

.liste-nue {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* --- Mise en page --------------------------------------------------------- */
.conteneur {
  width: 100%;
  max-width: 1144px; /* 1080 px de contenu + gouttières */
  margin-inline: auto;
  padding-inline: 16px;
}

.section {
  margin-top: 56px;
}

.deux-colonnes {
  display: grid;
  gap: 24px;
}

.grille {
  display: grid;
  gap: 24px;
  margin-top: 32px;
}

.grille-points {
  gap: 24px 56px;
}

@media (min-width: 720px) {
  .conteneur {
    padding-inline: 32px;
  }

  .section {
    margin-top: 96px;
  }

  .grille {
    margin-top: 40px;
  }

  .grille-2,
  .grille-points {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grille-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 900px) {
  .deux-colonnes {
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 72px;
  }
}

/* --- Boutons -------------------------------------------------------------- */
.bouton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 20px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--primary);
  color: var(--sur-primaire);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.5;
  text-decoration: none;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}

.bouton:hover {
  background: var(--primary-hover);
  color: var(--sur-primaire);
}

.bouton-secondaire {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}

.bouton-secondaire:hover {
  background: transparent;
  border-color: var(--slate);
  color: var(--ink);
}

.bouton-petit {
  min-height: 40px;
  padding: 8px 16px;
  font-size: 15px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* --- Lien d'évitement --------------------------------------------------- */
.aller-contenu {
  position: absolute;
  top: 12px;
  left: 16px;
  z-index: 20;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--primary);
  font-weight: 500;
  transform: translateY(-200%);
}

.aller-contenu:focus {
  transform: none;
}

/* --- Logo ------------------------------------------------------------------ */
.logo-lien {
  display: inline-flex;
  text-decoration: none;
  color: inherit;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--primary);
}

.logo-mot {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
  white-space: nowrap;
}

.logo-mot-fin {
  color: var(--primary);
}

.pied .logo-mot {
  font-size: 15px;
}

/* --- En-tête ----------------------------------------------------------------- */
.en-tete {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 10;
  height: var(--hauteur-en-tete);
  background: var(--paper);
  border-bottom: 1px solid transparent;
  transition: height 150ms ease, border-color 150ms ease;
}

.en-tete.condense {
  height: 60px;
  border-bottom-color: var(--line);
}

.en-tete-interieur {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 100%;
}

.navigation {
  display: none;
  flex: 1;
  gap: 28px;
}

.navigation a {
  color: var(--slate);
  font-size: 16px;
  text-decoration: none;
}

.navigation a:hover {
  color: var(--ink);
}

.en-tete-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.lien-langue {
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}

.lien-langue:hover {
  color: var(--primary);
}

.theme {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 150ms ease, color 150ms ease;
}

.theme:hover {
  border-color: var(--slate);
  color: var(--primary);
}

.theme-lune {
  display: var(--icone-lune);
}

.theme-soleil {
  display: var(--icone-soleil);
}

html:not(.js) .theme {
  display: none;
}

/* Sous 480 px, le CTA de l'en-tête cède la place : le hero porte le même bouton */
@media (max-width: 479px) {
  .en-tete .bouton-petit {
    display: none;
  }
}

@media (min-width: 900px) {
  .navigation {
    display: flex;
  }
}

/* --- Hero ------------------------------------------------------------------- */
.hero {
  display: grid;
  gap: 40px;
  padding-top: 56px;
}

.hero-texte {
  display: grid;
  gap: 24px;
  align-content: start;
}

.hero-sous-titre {
  font-size: 20px;
  line-height: 1.6;
  color: var(--slate);
}

@media (min-width: 960px) {
  .hero {
    grid-template-columns: minmax(0, 520px) minmax(0, 1fr);
    align-items: center;
    gap: 72px;
    padding-top: 96px;
  }

  .hero-texte {
    gap: 28px;
  }
}

/* --- Conversation simulée ------------------------------------------------- */
.conversation {
  margin: 0;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  overflow: hidden;
}

.conversation-barre {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  background: var(--paper-alt);
}

.conversation-point {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.conversation-barre code {
  font-size: 13px;
  color: var(--ink);
}

.conversation-corps {
  display: grid;
  gap: 20px;
  padding: 20px;
}

.bulle {
  display: grid;
  justify-self: end;
  max-width: 400px;
  padding: 12px 16px;
  border-radius: 10px;
  background: var(--primary);
  color: var(--sur-primaire);
  font-size: 16px;
  line-height: 1.5;
}

.bulle > span {
  grid-area: 1 / 1;
}

.bulle-frappe {
  display: none;
}

.reponse {
  display: grid;
  gap: 14px;
  font-size: 16px;
  line-height: 1.6;
}

.tableau {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.tableau table {
  width: 100%;
  border-collapse: collapse;
}

.tableau th,
.tableau td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

.tableau th {
  background: var(--paper-alt);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.tableau td {
  font-size: 15px;
}

.tableau tbody tr:last-child td {
  border-bottom: 0;
}

.tableau .delta {
  color: var(--accent-text);
  font-variant-numeric: tabular-nums;
}

.conversation figcaption {
  font-size: 15px;
  color: var(--ink);
}

@media (min-width: 720px) {
  .conversation-corps {
    padding: 24px;
  }
}

/* --- Sections de contenu --------------------------------------------------- */
.texte-large {
  max-width: 620px;
  font-size: 20px;
  line-height: 1.6;
}

.titre-etroit {
  max-width: 620px;
}

.carte {
  display: grid;
  gap: 14px;
  align-content: start;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.carte p {
  font-size: 16px;
  line-height: 1.6;
  color: var(--slate);
}

.carte-numero {
  font-size: 34px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--accent);
}

.carte-pleine {
  padding: 32px;
  border-color: transparent;
  background: var(--paper-alt);
}

.carte-pleine p {
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
}

.url-connecteur {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding: 8px 8px 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-alt);
}

.url-connecteur code {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  line-height: 1.4;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.copier {
  flex-shrink: 0;
  min-height: 36px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 150ms ease, color 150ms ease;
}

.copier:hover {
  border-color: var(--slate);
}

.copier.fait {
  border-color: var(--primary);
  color: var(--primary);
}

html:not(.js) .copier {
  display: none;
}

.lecture-seule {
  max-width: 780px;
  margin-top: 32px;
  color: var(--slate);
}

.point-confiance {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.point-confiance svg {
  flex-shrink: 0;
  margin-top: 3px;
  color: var(--primary);
}

.point-confiance p {
  line-height: 1.6;
}

.faq-liste {
  margin: 0;
  border-top: 1px solid var(--line);
}

.faq-item {
  display: grid;
  gap: 10px;
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
}

.faq-item dt {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.faq-item dd {
  margin: 0;
  color: var(--slate);
}

.actions-fin {
  margin-top: 40px;
}

/* --- Pages de prose (confidentialité, conditions, contact) ----------------- */
.page {
  max-width: 784px; /* 720 px de lecture + gouttières */
  padding-top: 56px;
}

.page h1 {
  font-size: clamp(38px, 1.5vw + 26px, 44px);
  line-height: 1.1;
}

.page .meta {
  margin-top: 16px;
  color: var(--slate);
}

.prose {
  margin-top: 40px;
}

.prose h2 {
  margin-top: 48px;
  margin-bottom: 12px;
  font-size: 32px;
  line-height: 1.15;
}

.prose p,
.prose ul,
.prose ol {
  margin: 0 0 16px;
}

.prose ul,
.prose ol {
  padding-left: 24px;
}

.prose li {
  margin-bottom: 8px;
}

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

@media (min-width: 720px) {
  .page {
    padding-top: 96px;
  }

  .prose {
    margin-top: 48px;
  }
}

/* --- Pied de page ------------------------------------------------------------- */
.pied {
  margin-top: 56px;
  padding: 40px 0 48px;
  border-top: 1px solid var(--line);
}

.pied-interieur {
  display: grid;
  gap: 20px;
}

.pied-ligne {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 28px;
}

.pied-ligne .logo-lien {
  margin-right: auto;
}

.pied-ligne a:not(.logo-lien) {
  color: var(--slate);
  font-size: 16px;
  text-decoration: none;
}

.pied-ligne a:not(.logo-lien):hover {
  color: var(--ink);
}

.mention {
  max-width: 820px;
  font-size: 16px;
  line-height: 1.6;
  color: var(--slate);
}

@media (min-width: 720px) {
  .pied {
    margin-top: 96px;
  }
}

/* ==========================================================================
   Mouvement — charte §7. Tout part d'un état final visible ; les classes
   html.anim / html.logo-anim sont posées par le script d'en-tête, jamais
   sous prefers-reduced-motion.
   ========================================================================== */

/* 3. Révélation au scroll et cascade du hero */
html.anim .reveler,
html.anim .cascade {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 400ms ease, transform 400ms ease;
  transition-delay: var(--d, 0ms);
}

html.anim .cascade {
  transform: translateY(6px);
  transition-duration: 300ms;
}

html.anim tr.cascade {
  transform: none;
}

html.anim .reveler.vu,
html.anim .cascade.vu {
  opacity: 1;
  transform: none;
}

/* 1. Frappe de la question : le texte réel garde la place, la copie tapée se superpose */
html.anim .conversation:not(.tapee) .bulle-texte {
  opacity: 0;
}

html.anim .conversation:not(.tapee) .bulle-frappe {
  display: block;
}

.bulle-frappe.curseur::after {
  content: "";
  display: inline-block;
  width: 2px;
  height: 1em;
  margin-left: 2px;
  vertical-align: -0.15em;
  background: currentColor;
  animation: clignote 1s steps(2, start) infinite;
}

@keyframes clignote {
  to {
    visibility: hidden;
  }
}

/* 2. Tracé du symbole au chargement, une fois par session (en-tête uniquement) */
html.logo-anim .en-tete .logo-arc {
  stroke-dasharray: 36;
  stroke-dashoffset: 36;
  animation: logo-tracer 500ms ease-out forwards;
}

html.logo-anim .en-tete .logo-point {
  transform: scale(0);
  transform-box: fill-box;
  transform-origin: center;
  animation: logo-point 200ms ease-out 420ms forwards;
}

@keyframes logo-tracer {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes logo-point {
  to {
    transform: scale(1);
  }
}

/* Ceinture et bretelles : si l'OS demande moins de mouvement, rien ne bouge */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  html.anim .reveler,
  html.anim .cascade,
  html.anim .conversation .bulle-texte {
    opacity: 1;
    transform: none;
    transition: none;
  }

  html.logo-anim .en-tete .logo-arc,
  html.logo-anim .en-tete .logo-point {
    animation: none;
    stroke-dashoffset: 0;
    transform: none;
  }

  .en-tete {
    transition: none;
  }
}
