/* ═══════════════════════════════════════════════════════════════════════════
   Twixem AI — site vitrine
   ═══════════════════════════════════════════════════════════════════════════

   ⚠️ AUCUN theme sombre, et c'est un choix. Un site vitrine s'engage sur
   UNE lumiere : suivre `prefers-color-scheme` faisait qu'un visiteur en
   mode sombre ne voyait jamais le site tel qu'il a ete dessine.

   Principe de design : le blanc porte la page, pas la couleur. Le violet
   apparaît sur environ 8 % de la surface — dans le fil conducteur, les
   boutons et l'animation du héros. Un site où l'accent est partout n'a plus
   d'accent.

   Zéro requête vers un tiers. Les deux polices sont auto-hébergées : Google
   Fonts servi depuis fonts.gstatic.com transmettrait l'IP de chaque visiteur
   à Google, ce qui a été condamné en Allemagne, et coûterait une résolution
   DNS plus une poignée de main TLS avant le premier texte visible.
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Polices ─────────────────────────────────────────────────────────────
   Deux variables, sous-ensemble latin uniquement. Les jeux cyrillique, grec
   et vietnamien tripleraient le poids pour des glyphes que ce site n'affiche
   pas — le contenu est en anglais.

   ⚠️ L'axe optique (`opsz`) de Bricolage a été écarté : il coûtait 35 Ko
   supplémentaires pour un réglage que cette maquette n'exploite pas. */
@font-face {
  font-family: 'Bricolage Grotesque';
  src: url('/assets/fonts/bricolage-latin.woff2') format('woff2');
  font-weight: 400 800;
  font-style: normal;
  /* `swap` : le texte s'affiche immédiatement dans la police système, puis
     bascule. `block` laisserait le titre invisible jusqu'au chargement —
     un écran vide pendant 300 ms est pire qu'une substitution visible. */
  font-display: swap;
}
@font-face {
  font-family: 'InterVar';
  src: url('/assets/fonts/inter-latin.woff2') format('woff2');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

/* ── Jetons ──────────────────────────────────────────────────────────────
   Le thème clair est défini sur `:root` nu, jamais dans une media query :
   une couleur dont l'unique définition vivrait dans un bloc conditionnel
   disparaîtrait pour tous ceux que la condition ne couvre pas. */
:root {
  /* Identité, reprise telle quelle de AppColors */
  --violet:      #6C47FF;   /* brand      */
  --violet-ink:  #5433D6;   /* brandDark  — 6,2:1 sur blanc, donc lisible */
  --violet-veil: #EDE7FF;   /* brandSoft  */
  --ink:         #17151F;   /* lightTextPrimary   */
  --grey:        #6B6880;   /* lightTextSecondary */
  --offwhite:    #FAFAFC;   /* blanc casse a peine teinte */

  --bg:      #FFFFFF;
  --surface: #FFFFFF;
  --border:  #EAE8F2;

  /* Accents de catégorie — pastilles de 40 px uniquement, jamais en aplat */
  --teal:   #00A3A3;
  --orange: #E8741A;
  --blue:   #0093D4;
  --green:  #00A878;

  --radius:    14px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(23,21,31,.05);
  --shadow:    0 2px 4px rgba(23,21,31,.04), 0 12px 32px rgba(23,21,31,.07);
  --shadow-lift: 0 4px 8px rgba(23,21,31,.05), 0 24px 60px rgba(108,71,255,.14);

  --wrap:  1120px;
  --prose: 700px;

  --font-display: 'Bricolage Grotesque', -apple-system, BlinkMacSystemFont,
                  'Segoe UI', Roboto, sans-serif;
  --font-body:    'InterVar', -apple-system, BlinkMacSystemFont,
                  'Segoe UI', Roboto, sans-serif;
}



/* ── Base ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

/* Le mouvement ne doit jamais être imposé : il déclenche des nausées chez
   les personnes sujettes aux troubles vestibulaires. L'animation du héros
   a un état de repli explicite, elle ne se contente pas de s'arrêter. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation: none !important;
    transition-duration: .001ms !important;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--grey);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { max-width: 100%; height: auto; display: block; }
a { color: var(--violet-ink); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--violet); }

/* Contour visible AU CLAVIER uniquement : le supprimer rendrait le site
   inutilisable sans souris, l'afficher à la souris agace tout le monde. */
:focus-visible { outline: 3px solid var(--violet); outline-offset: 3px; border-radius: 6px; }

h1, h2, h3, .display {
  font-family: var(--font-display);
  color: var(--ink);
  line-height: 1.06;
  letter-spacing: -0.03em;
  margin: 0 0 .45em;
  font-weight: 700;
}
h1 { font-size: clamp(2.6rem, 6vw, 4.5rem); font-weight: 800; }
h2 { font-size: clamp(1.85rem, 4vw, 2.9rem); }
h3 { font-size: 1.22rem; letter-spacing: -0.015em; line-height: 1.25; }
p  { margin: 0 0 1.1em; }
strong { color: var(--ink); font-weight: 650; }

/* Gouttieres progressives, alignees sur l'accueil. Une valeur unique de
   24 px laissait le texte presque colle au bord sur grand ecran. */
.wrap  { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
@media (min-width: 640px)  { .wrap { padding: 0 32px; } }
@media (min-width: 1024px) { .wrap { padding: 0 48px; } }
.prose { max-width: var(--prose); }

/* Une adresse e-mail ou une URL longue ne se coupe pas naturellement et
   deborde de son conteneur, ce qui fait defiler toute la page en
   largeur sur telephone. */
.prose, .card, .post-card, details.faq { overflow-wrap: anywhere; }

.skip {
  position: absolute; left: -9999px; z-index: 200;
  background: var(--violet); color: #fff; padding: 12px 20px;
  border-radius: 0 0 var(--radius) 0; text-decoration: none;
}
.skip:focus { left: 0; top: 0; }

/* ── En-tête ───────────────────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; gap: 28px; height: 70px; }
.brand {
  display: flex; align-items: center; gap: 10px; text-decoration: none;
  font-family: var(--font-display); font-weight: 700; font-size: 1.12rem;
  color: var(--ink); letter-spacing: -0.02em;
}
.brand-mark { width: 30px; height: 30px; flex: none; }
.nav-links { display: flex; gap: 26px; margin-left: auto; align-items: center; }
.nav-links a {
  color: var(--grey); text-decoration: none; font-size: .95rem; font-weight: 500;
}
.nav-links a:hover, .nav-links a[aria-current] { color: var(--ink); }
@media (max-width: 800px) { .nav-secondary { display: none !important; } }

/* ── Boutons ───────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  /* 48 px : au-dessus du minimum de 44 px pour une cible tactile. */
  min-height: 48px; padding: 13px 24px;
  border-radius: var(--radius); border: 1px solid transparent;
  font-family: var(--font-body); font-size: .98rem; font-weight: 600;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: transform .13s ease, background-color .13s ease, box-shadow .13s ease;
}
.btn:active { transform: translateY(1px); }
.btn--primary {
  background: var(--violet); color: #fff;
  box-shadow: 0 4px 14px rgba(108,71,255,.28);
}
.btn--primary:hover { background: var(--violet-ink); color: #fff; box-shadow: 0 6px 20px rgba(108,71,255,.36); }
.btn--ghost { background: var(--surface); color: var(--ink); border-color: var(--border); }
.btn--ghost:hover { background: var(--offwhite); color: var(--ink); border-color: var(--violet); }
.btn--store { gap: 11px; font-weight: 550; }
.btn--store svg { width: 20px; height: 20px; flex: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* ── Le fil conducteur ───────────────────────────────────────────────────
   Le document de l'utilisateur traverse la page : le fil et ses nœuds
   reprennent le vocabulaire graphique du circuit du logo. Purement
   décoratif, donc masqué aux lecteurs d'écran et retiré sous 1000 px, où il
   n'y a plus de marge pour l'accueillir. */
.thread { position: relative; }
@media (min-width: 1000px) {
  .thread::before {
    content: ""; position: absolute;
    left: max(24px, calc((100vw - var(--wrap)) / 2 - 34px));
    top: 0; bottom: 0; width: 2px;
    background: linear-gradient(180deg,
      transparent, var(--violet-veil) 8%, var(--violet-veil) 92%, transparent);
  }
  .node-marker::before {
    content: ""; position: absolute;
    left: max(19px, calc((100vw - var(--wrap)) / 2 - 39px));
    top: var(--node-top, 96px);
    width: 12px; height: 12px; border-radius: 50%;
    background: var(--bg); border: 2px solid var(--violet);
  }
}

/* ── Sections ──────────────────────────────────────────────────────────── */
/* Même précaution que `.hero` ci-dessous : `.section` peut être combinée à
   `.wrap`, et le raccourci effacerait ses marges latérales. */
.section { padding-block: clamp(64px, 9vw, 116px); position: relative; }
.section--alt { background: var(--offwhite); }
.eyebrow {
  display: inline-block; margin-bottom: 16px;
  font-family: var(--font-body); font-size: .78rem; font-weight: 650;
  letter-spacing: .12em; text-transform: uppercase; color: var(--violet-ink);
}
.lead { font-size: clamp(1.08rem, 2vw, 1.3rem); max-width: 560px; }

/* ── Héros ─────────────────────────────────────────────────────────────── */
/* ⚠️ `padding-block` et surtout PAS le raccourci `padding`.
   `.hero` s'emploie toujours avec `.wrap`, qui pose les marges latérales.
   Le raccourci écrit les QUATRE côtés : `padding: 48px 0 56px` remettait
   donc la marge horizontale à zéro, et le titre venait coller le bord de
   l'écran sur la FAQ, les tarifs et l'index du blog. Les deux règles ont la
   même spécificité, donc c'est l'ordre du fichier qui tranchait — un piège
   silencieux qui reviendrait à la moindre réorganisation.
   `padding-block` ne peut pas atteindre l'horizontale. */
.hero { padding-block: clamp(48px, 7vw, 88px) clamp(56px, 8vw, 100px); }
.hero-grid {
  display: grid; gap: clamp(40px, 5vw, 64px); align-items: center;
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 980px) { .hero-grid { grid-template-columns: 1.05fr .95fr; } }
.hero h1 .accent {
  /* Le dégradé est réservé à ces trois mots. Employé plus largement, il
     deviendrait un fond et cesserait d'être un accent. */
  background: linear-gradient(135deg, #6C47FF, #9B7DFF);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-note { font-size: .9rem; color: var(--grey); margin-top: 18px; }

/* ── ÉLÉMENT SIGNATURE : le PDF qui devient un quiz ─────────────────────── */
.demo {
  position: relative; background: var(--surface);
  border: 1px solid var(--border); border-radius: 26px;
  padding: 22px; box-shadow: var(--shadow-lift);
  /* Hauteur FIXE : les deux états se superposent, et sans hauteur imposée
     la carte se redimensionnerait à chaque boucle — la page entière
     sauterait toutes les quatre secondes. */
  min-height: 400px;
}
.demo-chrome {
  display: flex; align-items: center; gap: 7px;
  padding-bottom: 16px; margin-bottom: 18px; border-bottom: 1px solid var(--border);
}
.demo-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--border); }
.demo-label {
  margin-left: auto; font-size: .76rem; color: var(--grey);
  letter-spacing: .04em; text-transform: uppercase; font-weight: 600;
}

.demo-stage { position: relative; }

/* Page de PDF : des barres figurent les lignes de texte. Trois d'entre
   elles s'illuminent, puis la carte de quiz prend le relais. */
.pdf-line {
  height: 10px; border-radius: 5px; background: var(--offwhite);
  margin-bottom: 13px;
}
.pdf-line.short { width: 58%; }
.pdf-line.mid   { width: 82%; }
.pdf-line.title { height: 15px; width: 46%; background: var(--border); margin-bottom: 22px; }

.pdf-line.key {
  background: var(--violet-veil);
  animation: highlight 8s cubic-bezier(.4,0,.2,1) infinite;
}
.pdf-line.key:nth-of-type(3) { animation-delay: .12s; }
.pdf-line.key:nth-of-type(5) { animation-delay: .24s; }

@keyframes highlight {
  0%, 12%   { background: var(--offwhite); transform: translateX(0); opacity: 1; }
  22%, 34%  { background: var(--violet-veil); transform: translateX(0); opacity: 1; }
  46%       { background: var(--violet-veil); transform: translateX(14px); opacity: 0; }
  84%       { background: var(--offwhite); transform: translateX(0); opacity: 0; }
  92%, 100% { background: var(--offwhite); transform: translateX(0); opacity: 1; }
}

.quiz-card {
  position: absolute; inset: 0;
  background: var(--surface); border: 1px solid var(--violet);
  border-radius: 18px; padding: 22px;
  box-shadow: 0 10px 30px rgba(108,71,255,.16);
  opacity: 0; transform: translateY(16px) scale(.97);
  animation: reveal 8s cubic-bezier(.4,0,.2,1) infinite;
}
@keyframes reveal {
  0%, 44%   { opacity: 0; transform: translateY(16px) scale(.97); }
  54%, 82%  { opacity: 1; transform: translateY(0) scale(1); }
  90%, 100% { opacity: 0; transform: translateY(-10px) scale(.99); }
}

.quiz-q {
  font-family: var(--font-display); font-weight: 700; color: var(--ink);
  font-size: 1.04rem; line-height: 1.3; margin-bottom: 18px;
}
.quiz-opt {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 14px; margin-bottom: 9px;
  border: 1px solid var(--border); border-radius: 11px;
  font-size: .93rem; color: var(--grey);
}
.quiz-opt i {
  width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid var(--border); flex: none;
}
.quiz-opt.right {
  border-color: var(--green); color: var(--ink); font-weight: 600;
  animation: pick 8s ease infinite;
}
.quiz-opt.right i { border-color: var(--green); background: var(--green); }
@keyframes pick {
  0%, 64%   { background: transparent; }
  72%, 100% { background: color-mix(in srgb, var(--green) 10%, transparent); }
}

/* Repli sans animation : les deux états côte à côte, reliés par une flèche.
   Un visiteur qui a désactivé le mouvement doit VOIR la promesse, pas un
   cadre figé sur son premier état. */
.demo-static { display: none; }
@media (prefers-reduced-motion: reduce) {
  .demo-stage { display: none; }
  .demo-static { display: block; }
  .demo { min-height: 0; }
}

/* ── Grilles et cartes ─────────────────────────────────────────────────── */
.grid { display: grid; gap: 18px; }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(268px, 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(232px, 1fr)); }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 28px;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.card--hover:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--violet); }
.card h3 { margin-bottom: .35em; }
.card p:last-child { margin-bottom: 0; }
.card p { font-size: .96rem; }

.pill {
  width: 42px; height: 42px; border-radius: 13px; margin-bottom: 18px;
  display: grid; place-items: center; flex: none;
}
.pill svg { width: 21px; height: 21px; }
.pill--violet { background: var(--violet-veil); color: var(--violet-ink); }
.pill--teal   { background: color-mix(in srgb, var(--teal) 14%, transparent);   color: var(--teal); }
.pill--orange { background: color-mix(in srgb, var(--orange) 14%, transparent); color: var(--orange); }
.pill--blue   { background: color-mix(in srgb, var(--blue) 14%, transparent);   color: var(--blue); }

/* ── Duos texte / visuel ───────────────────────────────────────────────── */
.duo { display: grid; gap: clamp(32px, 4vw, 56px); align-items: center; }
@media (min-width: 900px) { .duo { grid-template-columns: 1fr 1fr; } }
.duo--flip > :first-child { order: 2; }
@media (max-width: 899px) { .duo--flip > :first-child { order: 0; } }

/* Aperçu de conversation du tuteur */
.chat { display: flex; flex-direction: column; gap: 12px; }
.bubble {
  max-width: 84%; padding: 13px 17px; border-radius: 18px;
  font-size: .95rem; line-height: 1.5;
}
.bubble--me {
  align-self: flex-end; background: var(--violet); color: #fff;
  border-bottom-right-radius: 5px;
}
.bubble--ai {
  align-self: flex-start; background: var(--offwhite); color: var(--ink);
  border-bottom-left-radius: 5px; border: 1px solid var(--border);
}
.bubble--src {
  align-self: flex-start; font-size: .8rem; color: var(--grey);
  display: flex; align-items: center; gap: 7px; padding-left: 4px;
}

/* Barres de progression du coach */
.bars { display: flex; flex-direction: column; gap: 15px; }
.bar-row { display: grid; grid-template-columns: 1fr auto; gap: 9px 12px; align-items: center; }
.bar-row span { font-size: .9rem; color: var(--ink); font-weight: 550; }
.bar-row b { font-size: .85rem; color: var(--grey); font-weight: 600; font-variant-numeric: tabular-nums; }
.bar { grid-column: 1 / -1; height: 7px; border-radius: 4px; background: var(--offwhite); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 4px; background: var(--violet); }
.bar i.weak { background: var(--orange); }

/* ── Langues ───────────────────────────────────────────────────────────── */
.langs { display: flex; flex-wrap: wrap; gap: 10px; }
.lang {
  padding: 9px 17px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface);
  font-size: .94rem; color: var(--ink); font-weight: 500;
}
.lang:first-child { border-color: var(--violet); background: var(--violet-veil); color: var(--violet-ink); }

/* ── Tarifs ────────────────────────────────────────────────────────────── */
.plan { display: flex; flex-direction: column; position: relative; }
.plan--best {
  border-color: var(--violet); border-width: 2px;
  box-shadow: var(--shadow-lift);
}
@media (min-width: 900px) { .plan--best { transform: scale(1.03); } }
.plan-badge {
  position: absolute; top: -13px; left: 50%; transform: translateX(-50%);
  background: var(--violet); color: #fff; white-space: nowrap;
  font-size: .72rem; font-weight: 700; letter-spacing: .09em;
  padding: 5px 15px; border-radius: 999px; text-transform: uppercase;
}
.price {
  font-family: var(--font-display); font-size: 3rem; font-weight: 800;
  color: var(--ink); line-height: 1; letter-spacing: -0.04em;
}
.price small { font-family: var(--font-body); font-size: .95rem; font-weight: 500; color: var(--grey); letter-spacing: 0; }
.plan ul { list-style: none; padding: 0; margin: 22px 0 26px; flex: 1; }
.plan li { padding-left: 27px; position: relative; margin-bottom: 11px; font-size: .95rem; }
.plan li::before {
  content: ""; position: absolute; left: 0; top: .55em;
  width: 15px; height: 8px; border-left: 2px solid var(--green);
  border-bottom: 2px solid var(--green); transform: rotate(-45deg);
}
/* « Contains ads » est un fait du plan gratuit, pas une fonction en moins.
   Sa coche grise au milieu de coches vertes ne se lisait pas comme une
   nuance : elle se lisait comme une icône cassée. Même vert que les
   autres ; seul le texte reste légèrement en retrait. */
.plan li.off { color: var(--grey); }

/* ── Pied de page ──────────────────────────────────────────────────────── */
.site-footer { border-top: 1px solid var(--border); padding: 60px 0 44px; background: var(--offwhite); }
.footer-grid { display: grid; gap: 34px; grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)); }
.footer-grid h4 {
  font-family: var(--font-body); font-size: .78rem; text-transform: uppercase;
  letter-spacing: .1em; color: var(--grey); margin: 0 0 15px; font-weight: 650;
}
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin-bottom: 10px; }
.footer-grid a { color: var(--grey); text-decoration: none; font-size: .93rem; }
.footer-grid a:hover { color: var(--violet); }
.footer-bottom {
  margin-top: 44px; padding-top: 24px; border-top: 1px solid var(--border);
  color: var(--grey); font-size: .87rem;
  display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between;
}

/* ── Contenu éditorial (blog, CGU, FAQ) ────────────────────────────────── */
.post-meta { color: var(--grey); font-size: .9rem; margin-bottom: 26px; }
.post-body h2 { margin-top: 1.7em; }
.post-body h3 { margin-top: 1.4em; }
.post-body ul, .post-body ol { padding-left: 22px; }
.post-body li { margin-bottom: .5em; }
.post-body blockquote {
  margin: 1.7em 0; padding: 4px 0 4px 22px;
  border-left: 3px solid var(--violet); color: var(--ink);
  font-size: 1.08rem; font-weight: 500;
}
.post-card {
  display: block; text-decoration: none; color: inherit;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 28px;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.post-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--violet); color: inherit; }
.post-card h3 { color: var(--ink); }
.post-card p:last-child { margin-bottom: 0; }

details.faq {
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 17px 21px; margin-bottom: 11px; background: var(--surface);
}
details.faq summary {
  cursor: pointer; font-weight: 600; color: var(--ink);
  list-style: none; display: flex; justify-content: space-between; gap: 16px;
}
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after { content: "+"; color: var(--violet); font-size: 1.35rem; line-height: 1; }
details.faq[open] summary::after { content: "\2212"; }
details.faq p { margin: 14px 0 2px; font-size: .96rem; }

/* Emplacement publicitaire : hauteur RÉSERVÉE. Sans elle, l'annonce pousse
   le texte en s'affichant — du décalage de mise en page, pénalisé au
   classement et détestable en pleine lecture. */
.ad-slot { min-height: 280px; margin: 44px 0; display: grid; place-items: center; }
