/* Socle commun de la vitrine : page d'accueil et page du Diagnostic.
   Direction A « Verre » (docs/design/direction-visuelle.md § 3) sur les jetons de @bb/ui, copiés
   dans dist/ par construire.mjs. Aucune valeur de couleur, de police ni d'ombre ici : seulement des
   renvois aux jetons et des mélanges de jetons (color-mix). Le thème sombre suit
   prefers-color-scheme ; transparence réduite et contraste renforcé passent aux aplats. */

:root {
  --conteneur: 75rem;
  --gouttiere: clamp(1rem, 3.5vw, 2rem);
  --rayon-plaque: 1.75rem; /* grandes plaques de la vitrine ; le contenu interne garde --radius-md */
  --rayon-fenetre: 1.75rem;
  --corps: 1.0625rem;
  --corps-petit: 0.9375rem;
  --titre-section: clamp(2rem, 1.35rem + 2.6vw, 3.25rem);
  --titre-phare: clamp(2.375rem, 1.5rem + 3.1vw, 3.875rem);
  scroll-padding-top: 5.5rem;
}

@media (prefers-reduced-motion: no-preference) {
  :root { scroll-behavior: smooth; }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  overflow-x: clip;
  background: var(--background);
  color: var(--foreground);
  font: var(--graisse-corps) var(--corps) / 1.55 var(--police);
  font-optical-sizing: auto;
  font-feature-settings: var(--police-reglages);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p, figure, ol, ul, dl, dd { margin: 0; }
ol, ul { padding: 0; list-style: none; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; border-radius: var(--radius-sm); }

.conteneur { width: 100%; max-width: calc(var(--conteneur) + 2 * var(--gouttiere)); margin-inline: auto; padding-inline: var(--gouttiere); }

/* Pictogrammes au trait : une grille de 24, un trait de 1,5, la couleur du texte. */
.picto {
  width: 1.125rem; height: 1.125rem; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
}

/* Marque : une alvéole pleine, trois nœuds reliés à un cœur. */
.marque { width: 1.875rem; height: 1.875rem; flex: none; display: block; }
.marque-petite { width: 1rem; height: 1rem; }
.marque-grande { width: 3.5rem; height: 3.5rem; }
.marque-alveole { fill: var(--primary); stroke: var(--primary); stroke-width: 2; stroke-linejoin: round; }
.marque-liens { fill: none; stroke: var(--primary-foreground); stroke-width: 1.5; stroke-linejoin: round; opacity: 0.72; }
.marque-noeud, .marque-coeur { fill: var(--primary-foreground); }

/* Cachet de provenance : la signature de la page. Sous chaque chiffre, sa source et son heure. */
.cachet {
  display: inline-flex; align-items: center; gap: 0.375rem;
  font-size: var(--texte-xs); line-height: 1.3; letter-spacing: var(--approche-mention);
  font-weight: var(--graisse-libelle); color: var(--muted-foreground);
  font-variant-numeric: tabular-nums;
}
.cachet-alveole { width: 0.625rem; height: 0.625rem; flex: none; fill: var(--positif-vif); }
.mention-ia {
  display: inline-flex; align-items: center; gap: 0.375rem;
  font-size: var(--texte-xs); font-weight: var(--graisse-libelle); letter-spacing: var(--approche-mention);
  color: var(--muted-foreground);
}
.fictif {
  display: inline-flex; align-items: center; min-height: 1.375rem; padding: 0 0.5rem;
  border-radius: var(--radius-capsule); border: 1px solid var(--border); background: var(--muted);
  font-size: var(--texte-xs); font-weight: var(--graisse-libelle); letter-spacing: var(--approche-mention);
  color: var(--muted-foreground); white-space: nowrap;
}

/* Boutons : un seul appel plein (le Diagnostic), une commande secondaire de verre dense. */
.bouton, .bouton-second {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 3rem; padding: 0 1.375rem;
  border-radius: var(--radius-capsule);
  font-size: var(--corps); font-weight: var(--graisse-titre); line-height: 1.2; text-decoration: none;
  transition: transform var(--duree-appui) var(--courbe-sortie), box-shadow var(--duree-rapide) var(--courbe-sortie), background-color var(--duree-rapide) var(--courbe-sortie);
  -webkit-tap-highlight-color: transparent;
}
.bouton {
  background: var(--primary); color: var(--primary-foreground);
  box-shadow: var(--ombre-2), var(--verre-arete);
}
.bouton .picto { transition: transform var(--duree-base) var(--courbe-sortie); }
.bouton-second {
  background: var(--commande-fond); color: var(--foreground);
  border: 1px solid var(--commande-bord); box-shadow: var(--ombre-commande);
}
@media (hover: hover) and (pointer: fine) {
  .bouton:hover { box-shadow: var(--ombre-3), var(--verre-arete); }
  .bouton:hover .picto { transform: translateX(0.1875rem); }
  .bouton-second:hover { background: var(--card-opaque); }
}
.bouton:active, .bouton-second:active { transform: scale(var(--echelle-appui)); }
.bouton-petit { min-height: 2.5rem; padding: 0 1.125rem; font-size: var(--corps-petit); white-space: nowrap; box-shadow: var(--ombre-1), var(--verre-arete); }
@media (pointer: coarse) { .bouton-petit { min-height: var(--cible-tactile); } }

/* Barre du haut : une capsule de verre fin qui flotte au-dessus du contenu. */
.barre { position: sticky; top: var(--marge-coque); z-index: 10; padding-inline: var(--gouttiere); margin-top: var(--marge-coque); }
.barre-plaque {
  max-width: var(--conteneur); margin-inline: auto;
  display: flex; align-items: center; gap: 1rem;
  min-height: 3.5rem; padding: 0.4375rem 0.4375rem 0.4375rem 1rem;
  border-radius: var(--radius-capsule);
  background: var(--voile-nav);
  border: 1px solid var(--verre-bord);
  box-shadow: var(--ombre-1), var(--verre-arete);
}
@supports (backdrop-filter: blur(1px)) {
  .barre-plaque { backdrop-filter: blur(var(--verre-flou-fin)) saturate(var(--verre-saturation)); }
}
.logo {
  display: inline-flex; align-items: center; gap: 0.5rem; min-height: var(--cible-tactile);
  font-size: 1.125rem; font-weight: var(--graisse-titre); letter-spacing: var(--approche-titre);
  color: var(--foreground); text-decoration: none;
}
.barre-nav { margin-left: auto; }
.barre-nav ul { display: flex; gap: 0.125rem; }
.barre-nav a {
  display: inline-flex; align-items: center; min-height: 2.5rem; padding: 0 0.75rem;
  border-radius: var(--radius-capsule);
  font-size: var(--corps-petit); font-weight: var(--graisse-libelle); color: var(--muted-foreground); text-decoration: none;
  transition: background-color var(--duree-rapide) var(--courbe-sortie), color var(--duree-rapide) var(--courbe-sortie);
}
@media (hover: hover) and (pointer: fine) {
  .barre-nav a:hover { background: var(--muted); color: var(--foreground); }
}
.barre-plaque > .bouton { margin-left: auto; }
.barre-nav + .bouton { margin-left: 0; }
@media (max-width: 63.99rem) {
  .barre-nav { display: none; }
  .barre-nav + .bouton { margin-left: auto; }
}
@media (max-width: 23rem) {
  .logo span { font-size: 1rem; }
  .barre-plaque { gap: 0.5rem; padding-left: 0.75rem; }
  .bouton-petit { padding: 0 0.875rem; }
}

/* Pied de page. */
.pied { border-top: 1px solid var(--border); padding-block: 3rem 4rem; color: var(--muted-foreground); font-size: var(--corps-petit); }
.pied-grille { display: grid; gap: 1rem 2rem; }
.pied .logo { color: var(--foreground); min-height: 0; }
.pied-liens { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; }
.pied-liens a { display: inline-flex; min-height: var(--cible-tactile); align-items: center; text-decoration: none; }
.pied-liens a:hover { color: var(--foreground); text-decoration: underline; text-underline-offset: 0.2em; }
.pied-mention { font-size: var(--texte-sm); max-width: var(--mesure-texte); }
@media (min-width: 48rem) {
  .pied-grille { grid-template-columns: auto 1fr; align-items: center; }
  .pied-liens, .pied-mention { grid-column: 2; }
  .pied-ligne { grid-column: 2; grid-row: 1; }
}

/* Replis : sans flou, transparence réduite ou contraste renforcé, les plaques deviennent pleines
   (jetons de contraste.css) ; les halos propres à la vitrine s'effacent avec le fond vivant. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
