/* Appermittent : site vitrine. Couleurs et polices reprises de l'app (appermittent/theme.ts, jeu `dark`,
   memes noms de jetons). Polices Cormorant Garamond et Sora : feuille du CDN du parc (cdn.appermittent.fr), chargee par la page.
   Contrastes mesures (WCAG 2.2 AA) : text sur bg 15,8:1, textMuted sur bg 4,8:1 et sur surface 4,54:1,
   accent sur bg 8,95:1, bg sur accent 8,95:1. textMuted n'est JAMAIS pose sur surface2 ou surface3 (4,13:1 et
   3,56:1, sous le seuil). Aucun attribut style dans les pages : la CSP n'autorise pas 'unsafe-inline'. */


:root {
  --bg: #0d0e14;
  --surface: #13151e;
  --surface2: #1b1e2b;
  --accent: #f0a020;
  --accent-dim: rgba(240, 160, 32, 0.12);
  --text: #ede8e0;
  --text-muted: #7b7d99;
  --border: rgba(255, 255, 255, 0.055);
  --rule: #252a3a;

  --display: "Cormorant Garamond", Georgia, serif;
  --ui: "Sora", system-ui, sans-serif;
  --page: 1120px;
}

*, *::before, *::after { box-sizing: border-box; }
html { overflow-x: hidden; color-scheme: dark; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--ui); font-size: 1rem; line-height: 1.65; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-underline-offset: 0.22em; }
h1, h2, h3, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
strong { font-weight: 600; color: var(--text); }

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
.evitement { position: absolute; left: -999px; top: 0; background: var(--accent); color: var(--bg); padding: 0.7rem 1rem; z-index: 30; font-weight: 600; }
.evitement:focus { left: 0; }
.accent { color: var(--accent); }

/* En-tete */
.entete { max-width: var(--page); margin: 0 auto; padding: 1.2rem 1.5rem; display: flex; justify-content: space-between; align-items: center; gap: 1.5rem; }
.marque { display: inline-flex; align-items: center; gap: 0.6rem; text-decoration: none; min-height: 44px; }
.marque img { width: 32px; height: 32px; }
/* Meme mot-symbole que l'app (AppBrand : Cormorant regulier, couleur accent, lettres espacees) */
.marque-nom { font-family: var(--display); font-weight: 400; font-size: 1.3rem; letter-spacing: 0.12em; color: var(--accent); }
.navigation { display: flex; align-items: center; gap: 1.4rem; font-size: 0.88rem; font-weight: 500; }
.navigation a { color: var(--text-muted); text-decoration: none; padding: 0.6rem 0; }
.navigation a:hover { color: var(--text); text-decoration: underline; }
.navigation a[aria-current="page"] { color: var(--text); text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; }
.navigation .lien-app { color: var(--accent); border: 1px solid var(--accent); border-radius: 999px; padding: 0.45rem 1rem; }
.navigation .lien-app:hover { background: var(--accent); color: var(--bg); text-decoration: none; }

/* Fil d'Ariane */
.fil { max-width: var(--page); margin: 0 auto; padding: 0.5rem 1.5rem 0; font-size: 0.85rem; color: var(--text-muted); }
.fil ol { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.fil li + li::before { content: "/"; margin-right: 0.4rem; color: var(--text-muted); }
.fil a { color: var(--text); display: inline-flex; align-items: center; min-height: 24px; }

/* Titres : Cormorant pour l'affichage (titre d'ecran de l'app en 300, valeurs en 600), Sora pour le reste */
.surtitre { font-size: 0.78rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); }
h1 { font-family: var(--display); font-weight: 300; font-size: clamp(2.4rem, 6vw, 4.2rem); line-height: 1.05; letter-spacing: -0.01em; margin-top: 1rem; }
h2 { font-family: var(--display); font-weight: 400; font-size: clamp(1.9rem, 4vw, 2.7rem); line-height: 1.12; margin-top: 0.7rem; }
h3 { font-family: var(--ui); font-weight: 600; font-size: 1.02rem; line-height: 1.4; }
.chapeau { font-size: 1.12rem; color: var(--text); opacity: 1; max-width: 40rem; margin-top: 1.4rem; }
.intro { color: var(--text); max-width: 40rem; margin-top: 1rem; }

/* Boutons */
.actions { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 2rem; }
.bouton { display: inline-flex; align-items: center; min-height: 48px; padding: 0.7rem 1.3rem; border-radius: 12px; border: 1px solid var(--text-muted); color: var(--text); text-decoration: none; font-weight: 500; font-size: 0.95rem; }
.bouton:hover { border-color: var(--text); background: var(--surface); }
.bouton--principal { background: var(--accent); border-color: var(--accent); color: var(--bg); font-weight: 600; }
.bouton--principal:hover { background: var(--text); border-color: var(--text); color: var(--bg); }
.lien-web { margin-top: 0.9rem; color: var(--text-muted); font-size: 0.92rem; }
.lien-web a { color: var(--accent); }

/* Accueil */
.hero { max-width: var(--page); margin: 0 auto; padding: 3rem 1.5rem 4.5rem; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3rem; align-items: center; }
.hero-visuel { justify-self: center; position: relative; }
.hero-visuel::before { content: ""; position: absolute; inset: -30%; background: radial-gradient(circle, rgba(240, 160, 32, 0.18), transparent 65%); }
.hero-visuel img { position: relative; width: 240px; }

/* Sections */
.bloc { max-width: var(--page); margin: 0 auto; padding: 3.8rem 1.5rem; border-top: 1px solid var(--rule); }
.texte { max-width: 44rem; margin-top: 1.3rem; display: grid; gap: 1rem; font-size: 1.05rem; }
.texte a, .reponse a, .juridique a, .liste-points a { color: var(--accent); }
.grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr)); gap: 1.1rem; margin-top: 2.2rem; }
.grille--deux { grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr)); }
.carte { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 1.4rem; }
.carte p { margin-top: 0.6rem; color: var(--text-muted); font-size: 0.95rem; }
.carte--lien { position: relative; }
.carte--lien h3 a { text-decoration: none; color: var(--text); }
.carte--lien h3 a::after { content: ""; position: absolute; inset: 0; border-radius: 16px; }
.carte--lien:hover, .carte--lien:focus-within { border-color: var(--accent); }
.carte--lien h3::after { content: " \2192"; color: var(--accent); }
.etapes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.1rem; margin-top: 2.2rem; counter-reset: etape; }
.etapes li { counter-increment: etape; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 1.4rem; }
.etapes h3::before { content: counter(etape) ". "; color: var(--accent); font-family: var(--display); font-weight: 600; font-size: 1.3rem; }
/* Liste deja nommee par ses titres (A, B, C) : pas de numero en plus. */
.etapes--lettres h3::before { content: none; }
.etapes p { margin-top: 0.6rem; color: var(--text-muted); font-size: 0.95rem; }
.etapes + .texte { margin-top: 2rem; }
.liste-points { margin-top: 1.6rem; display: grid; gap: 0.9rem; max-width: 46rem; }
.liste-points li { position: relative; padding-left: 1.6rem; }
.liste-points > li > a:only-child { display: inline-flex; align-items: center; min-height: 24px; }
.liste-points li::before { content: ""; position: absolute; left: 0; top: 0.62em; width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--accent); }

/* Pages de contenu */
.article { display: block; }
.article-tete { max-width: var(--page); margin: 0 auto; padding: 2rem 1.5rem 3.5rem; }
.article-tete h1 { max-width: 52rem; }
.article--court { max-width: var(--page); margin: 0 auto; padding-bottom: 4rem; }
.article--court .liste-points { padding: 0 1.5rem; }
.article--court .actions { padding: 0 1.5rem; }
.titre-sobre { font-size: clamp(2.2rem, 5vw, 3.2rem); }
.note { margin-top: 0.8rem; font-size: 0.88rem; color: var(--text-muted); }

/* Appel a l'action */
.appel { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2rem; align-items: start; }
.appel > div { max-width: 46rem; }
.appel-logo { width: 72px; height: 72px; margin-top: 0.8rem; }

/* FAQ */
.faq { margin-top: 1.8rem; display: grid; gap: 0.7rem; max-width: 52rem; }
.question { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.question summary { cursor: pointer; padding: 1rem 3rem 1rem 1.2rem; font-weight: 600; list-style: none; position: relative; min-height: 44px; }
.question summary::-webkit-details-marker { display: none; }
.question summary::after { content: "+"; position: absolute; right: 1.2rem; top: 0.9rem; font-size: 1.2rem; line-height: 1.2; color: var(--accent); }
.question[open] summary::after { content: "\2212"; }
.reponse { padding: 0 1.2rem 1.2rem; color: var(--text-muted); }
.reponse p { color: var(--text-muted); }

/* Pages juridiques */
.juridique { max-width: var(--page); margin: 0 auto; padding: 0 1.5rem 4rem; }
.juridique > * { max-width: 46rem; }
.juridique h2 { font-size: clamp(1.4rem, 3vw, 1.8rem); margin-top: 2.2rem; }
.juridique p, .juridique ul { margin-top: 0.8rem; }
.juridique ul { list-style: disc; padding-left: 1.3rem; display: grid; gap: 0.7rem; }
.juridique li::marker { color: var(--accent); }
/* Une adresse web n'a pas d'espace : sans cela elle deborde a 320 px (WCAG 1.4.10). */
.juridique { overflow-wrap: anywhere; }
.juridique a { display: inline-block; padding: 0.2rem 0; }
.juridique .resume { font-size: 1.08rem; border-left: 3px solid var(--accent); padding-left: 1.1rem; }

/* Pied de page */
.pied { max-width: var(--page); margin: 0 auto; padding: 3rem 1.5rem 3.5rem; border-top: 1px solid var(--rule); font-size: 0.9rem; }
.pied-colonnes { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); gap: 2rem; }
.pied-titre { font-weight: 600; color: var(--accent); font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase; }
.pied ul { margin-top: 0.6rem; display: grid; gap: 0.2rem; }
.pied ul a { color: var(--text); display: inline-flex; align-items: center; min-height: 36px; }
.pied-note { margin-top: 2.2rem; color: var(--text-muted); max-width: 46rem; }

/* Tableaux : texte en retour a la ligne, jamais de defilement horizontal (WCAG 1.4.10). Texte en `text` sur
   `surface` (14,93:1), en-tetes en accent sur surface (8,45:1). */
.tableau { margin-top: 2rem; max-width: 56rem; border: 1px solid var(--border); border-radius: 16px; overflow: hidden; }
table { border-collapse: collapse; width: 100%; font-size: 0.95rem; background: var(--surface); }
caption { text-align: left; padding: 1rem 1.2rem 0.6rem; font-weight: 600; color: var(--text); background: var(--surface); }
th, td { text-align: left; vertical-align: top; padding: 0.75rem 1.2rem; border-top: 1px solid var(--rule); overflow-wrap: break-word; }
thead th { font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); font-weight: 600; }
tbody th { font-weight: 600; color: var(--text); }
td { color: var(--text); }
/* Petit ecran : chaque ligne devient une fiche, chaque cellule precedee du nom de sa colonne (data-label, ecrit par
   build.py). L'en-tete reste dans le DOM pour les lecteurs d'ecran, mais sort de l'ecran. */
@media (max-width: 720px) {
  table, thead, tbody, tr, th, td, caption { display: block; }
  thead { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
  tbody tr { border-top: 1px solid var(--rule); padding: 0.6rem 0; }
  tbody th { border: 0; padding: 0.4rem 1.1rem 0.2rem; font-size: 1rem; }
  tbody td { border: 0; padding: 0.35rem 1.1rem; }
  tbody td::before { content: attr(data-label); display: block; font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); font-weight: 600; }
}

/* Formules de calcul et sources */
.formules { display: grid; gap: 0.5rem; padding: 1rem 1.2rem; background: var(--surface); border-radius: 12px; border: 1px solid var(--border); font-size: 0.95rem; }
.sources .verifie { margin-top: 1rem; font-weight: 600; }
.liste-sources { margin-top: 1rem; display: grid; gap: 0.4rem; max-width: 52rem; list-style: disc; padding-left: 1.3rem; }
.liste-sources li::marker { color: var(--accent); }
.liste-sources a { color: var(--accent); display: inline-block; padding: 0.25rem 0; overflow-wrap: anywhere; }

/* Burger : un <details> natif. Il marche sans JavaScript ; menu.js ne fait que le refermer apres un clic. */
.menu { display: none; position: relative; }
.burger { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; cursor: pointer; list-style: none; border: 1px solid var(--text-muted); border-radius: 12px; background: var(--surface); }
.burger::-webkit-details-marker { display: none; }
.burger-barres, .burger-barres::before, .burger-barres::after { display: block; width: 20px; height: 2px; background: var(--text); content: ""; transition: transform 0.15s ease, opacity 0.15s ease; }
.burger-barres { position: relative; }
.burger-barres::before { position: absolute; top: -6px; }
.burger-barres::after { position: absolute; top: 6px; }
.menu[open] .burger-barres { background: transparent; }
.menu[open] .burger-barres::before { top: 0; transform: rotate(45deg); }
.menu[open] .burger-barres::after { top: 0; transform: rotate(-45deg); }
.menu-panneau { position: absolute; right: 0; top: calc(100% + 0.6rem); z-index: 20; width: min(20rem, calc(100vw - 3rem)); background: var(--surface); border: 1px solid var(--rule); border-radius: 16px; box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55); padding: 0.4rem 1.2rem 1rem; }
.navigation--burger { flex-direction: column; align-items: stretch; gap: 0; font-size: 1rem; }
.navigation--burger a { padding: 0.9rem 0; border-bottom: 1px solid var(--rule); min-height: 44px; display: flex; align-items: center; color: var(--text); }
.navigation--burger .lien-app { margin-top: 1rem; justify-content: center; border-bottom: 1px solid var(--accent); }

/* Pas de mouvement si l'utilisateur l'a demande. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* En dessous de 880 px : le menu du bureau cede la place au burger. `display: none` le retire aussi de l'arbre
   d'accessibilite, donc un lecteur d'ecran ne lit jamais les liens en double. Meme seuil que menu.js (881 px). */
@media (max-width: 880px) {
  .entete { padding: 1rem 1.5rem; }
  .entete > .navigation { display: none; }
  .menu { display: block; flex: none; }
  .hero { grid-template-columns: 1fr; padding-top: 1.5rem; gap: 2rem; }
  .hero-visuel { display: none; }
  .etapes { grid-template-columns: 1fr; }
  .appel { grid-template-columns: 1fr; gap: 1rem; }
}
@media (max-width: 380px) {
  .hero, .bloc, .entete, .pied, .article-tete, .fil, .juridique { padding-left: 1.1rem; padding-right: 1.1rem; }
  .bouton { width: 100%; justify-content: center; }
}
@media (forced-colors: active) {
  .bouton--principal, .navigation .lien-app { border: 1px solid ButtonText; }
  .liste-points li::before { background: CanvasText; }
}
