/* Nodlr · maquettes du site public (#62).
   Mêmes tokens que l'application (../tokens.css) : un seul accent, thème sombre unique,
   Bricolage Grotesque. Ce fichier ne définit que la mise en page propre au site ;
   aucune couleur, espacement, rayon, ombre ou durée hors tokens.
   Exceptions assumées (voir PLAN.md) : la mesure de 62 caractères (DESIGN.md §3),
   les traits de 1 à 2 px, et le token --font-mono étendu aux empreintes et commandes. */

/* ---------- Base ---------- */

* { box-sizing: border-box; }

html { scroll-padding-top: calc(var(--top-h) + var(--space-4)); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 var(--fs-body)/var(--lh-body) var(--font-ui);
  -webkit-font-smoothing: antialiased;
  /* Pages courtes (notes, 404, état sans version) : le pied de page reste en bas. */
  min-height: 100vh;
  display: flex; flex-direction: column;
}

::selection { background: var(--selection); }

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

img, svg { display: block; }
.icon { width: var(--icon); height: var(--icon); }
.num { font-variant-numeric: tabular-nums; }

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}

.skip {
  position: fixed; top: -100px; left: var(--space-4); z-index: 20;
  padding: var(--space-2) var(--space-4);
  background: var(--accent); color: var(--accent-ink);
  border-radius: var(--r-sm); font-weight: 600; text-decoration: none;
}
.skip:focus { top: var(--space-2); }

a.lien {
  color: var(--text); text-decoration: underline;
  text-decoration-color: var(--faint); text-underline-offset: 2px;
}

/* ---------- Barre de la maquette (pilotage ; absente du site réel) ---------- */

.proto {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-4); padding: var(--space-2) var(--space-4);
  border-bottom: 1px solid var(--line); background: var(--surface);
  font-size: var(--fs-caption); color: var(--faint);
}
.proto p { margin: 0; display: flex; gap: var(--space-2); align-items: baseline; }
.proto strong { color: var(--muted); font-weight: 600; }
.proto-tabs { display: flex; gap: var(--space-1); }
.proto-tabs button {
  border: 1px solid var(--line-strong); background: transparent; color: var(--muted);
  border-radius: var(--r-pill); padding: var(--space-1) var(--space-3);
  font: inherit; cursor: pointer;
}
.proto-tabs button[aria-pressed="true"] {
  background: var(--surface-3); color: var(--text); border-color: var(--faint);
}

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

.site-header {
  position: sticky; top: 0; z-index: 10;
  background: rgb(var(--bg-rgb) / .92);
  backdrop-filter: blur(var(--top-blur));
  border-bottom: 1px solid var(--line);
}
.site-header-in {
  max-width: var(--state-w); margin: 0 auto; padding: 0 var(--pad);
  min-height: var(--top-h);
  display: flex; align-items: center; gap: var(--space-6); flex-wrap: wrap;
}

.brand {
  display: inline-flex; align-items: center; gap: var(--space-2-5);
  color: var(--text); text-decoration: none; padding: var(--space-2) 0;
}
.brand-mark {
  position: relative; width: var(--brand-mark); height: var(--brand-mark);
  border: 2.5px solid var(--text); border-radius: 50%; flex: none;
}
.brand-mark::after {
  content: ""; position: absolute; left: 50%; bottom: -7.5px;
  width: 6px; height: 6px; margin-left: -3px; border-radius: 50%;
  background: var(--accent);
}
.brand-word { font: 700 var(--fs-brand)/1 var(--font-display); letter-spacing: var(--tracking-brand); }

.site-nav { display: flex; gap: var(--space-1); flex-wrap: wrap; margin-inline-end: auto; }
.site-nav a {
  color: var(--muted); text-decoration: none; font-size: var(--fs-body-lg);
  padding: var(--space-2) var(--space-3); border-radius: var(--r-sm);
}
.site-nav a[aria-current="page"] { color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); }

/* ---------- Boutons (mêmes règles que l'application) ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: var(--space-2); height: var(--btn-h); padding: 0 var(--space-4);
  border: 1px solid transparent; border-radius: var(--r-sm);
  font-size: var(--fs-body); font-weight: 600; text-decoration: none;
  white-space: nowrap; cursor: pointer;
  transition: background-color var(--dur-ui) var(--ease-out),
              border-color var(--dur-ui) var(--ease-out),
              color var(--dur-ui) var(--ease-out);
}
.btn .icon { width: var(--icon-sm); height: var(--icon-sm); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-ghost { border-color: var(--line-strong); background: rgb(var(--bg-rgb) / .4); color: var(--text); }
.btn-lg { height: var(--btn-h-lg); padding: 0 var(--space-6); font-size: var(--fs-body-lg); }
.btn-lg .icon { width: var(--icon-md); height: var(--icon-md); }
.btn-sm { height: var(--btn-h-sm); padding: 0 var(--space-3); font-size: var(--fs-meta); }
.btn-sm .icon { width: var(--icon-xs); height: var(--icon-xs); }
.btn:active { transform: scale(.97); }

@media (hover: hover) and (pointer: fine) {
  .site-nav a:hover { color: var(--text); background: var(--surface-2); }
  .btn-primary:hover { background: var(--accent-hover); }
  .btn-ghost:hover { border-color: var(--faint); background: var(--surface-2); }
  a.lien:hover { color: var(--accent); text-decoration-color: var(--accent); }
}

/* ---------- Mise en page ---------- */

.site-main {
  flex: 1 0 auto; width: 100%;
  max-width: var(--state-w); margin: 0 auto;
  padding: var(--space-16) var(--pad) var(--space-24);
}
.section { margin-top: var(--space-16); }

.page-title {
  font: 750 var(--fs-state)/1.1 var(--font-display); letter-spacing: var(--tracking-title);
  margin: 0 0 var(--space-4);
}
.h2 {
  font: 650 var(--fs-h2)/var(--lh-tight) var(--font-display); letter-spacing: var(--tracking-heading);
  margin: 0 0 var(--space-5);
}
.h3 {
  font: 650 var(--fs-h3)/var(--lh-tight) var(--font-display); letter-spacing: var(--tracking-heading);
  margin: 0 0 var(--space-2);
}
.lede { font-size: var(--fs-lead); color: var(--muted); max-width: 62ch; margin: 0 0 var(--space-6); }
p { margin: 0 0 var(--space-4); }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.caption { font-size: var(--fs-caption); color: var(--faint); }

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

.hero {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: var(--space-10); align-items: center;
}
.hero-copy .lede { margin-bottom: var(--space-6); }
.hero-actions { display: flex; gap: var(--space-3); flex-wrap: wrap; margin: 0 0 var(--space-3); }
.hero-meta { font-size: var(--fs-meta); color: var(--faint); margin: 0; }

.vitrine { margin: 0; }
.vitrine-shot {
  position: relative; aspect-ratio: 16 / 9; border-radius: var(--r-lg);
  background-size: cover; background-position: 68% 40%;
  box-shadow: var(--shadow-cover); overflow: hidden;
}
.vitrine-shot::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top right,
    rgb(var(--scrim-rgb) / .92), rgb(var(--scrim-rgb) / .55) 45%, rgb(var(--scrim-rgb) / 0) 78%);
}
.vitrine-shot::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  box-shadow: inset 0 0 0 1px var(--art-edge);
}
.vitrine-shot--screen { background: var(--surface-2); }
.vitrine-shot--screen::before { display: none; }
.vitrine-screen { width: 100%; height: 100%; object-fit: cover; object-position: top left; }
.vitrine-copy {
  position: absolute; left: var(--space-6); right: var(--space-6); bottom: var(--space-6);
  color: var(--on-image-muted);
}
.vitrine-genre { font-size: var(--fs-meta); margin: 0 0 var(--space-1); }
.vitrine-title {
  font: 700 var(--fs-feature)/1.05 var(--font-display); letter-spacing: var(--tracking-title);
  color: var(--text); margin: 0 0 var(--space-2);
}
.vitrine-meta {
  display: flex; gap: var(--space-3); flex-wrap: wrap;
  font-size: var(--fs-meta); margin: 0 0 var(--space-4);
}
.vitrine-actions { display: flex; gap: var(--space-3); margin: 0; }
.vitrine-actions .btn { pointer-events: none; } /* illustration de l'application, pas de vrais contrôles */
.vitrine figcaption { margin-top: var(--space-3); }

/* ---------- Accueil : captures et jaquettes ---------- */

.screen-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-6); }
.screen-card { margin: 0; }
.screen-card img {
  width: 100%; height: auto; border-radius: var(--r-lg);
  border: 1px solid var(--line); box-shadow: var(--shadow-cover);
  background: var(--surface-2);
}
.screen-card figcaption { margin-top: var(--space-2); font-size: var(--fs-caption); color: var(--faint); }
.screen-note { margin-top: var(--space-4); max-width: 62ch; }

.covers-block { margin-top: var(--space-10); }
.covers-intro { font-size: var(--fs-body-lg); margin: 0 0 var(--space-5); max-width: 62ch; }
.covers-strip {
  list-style: none; margin: 0 0 var(--space-3); padding: 0;
  display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: var(--space-3);
}
.covers-strip li { min-width: 0; }
.covers-strip img {
  width: 100%; height: auto; aspect-ratio: 2 / 3; object-fit: cover;
  border-radius: var(--r-sm); border: 1px solid var(--line);
  background: var(--surface-2); box-shadow: var(--shadow-cover);
}

.status-dot { display: inline-flex; align-items: center; gap: var(--space-1); }
.status-dot::before {
  content: ""; width: var(--status-dot); height: var(--status-dot);
  border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 var(--status-halo) var(--accent-soft);
}

/* ---------- Accueil : fonctions et limites ---------- */

.feature-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 var(--space-10); }
.feature { border-top: 1px solid var(--line); padding: var(--space-5) 0; }
.feature h3 { margin: 0 0 var(--space-2); }
.feature p { color: var(--muted); font-size: var(--fs-body-lg); margin: 0; max-width: 62ch; }

.limites { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.limites li {
  padding: var(--space-3) 0; border-bottom: 1px solid var(--line);
  color: var(--muted); font-size: var(--fs-body-lg); max-width: 62ch;
}
.limites strong { color: var(--text); }

/* ---------- Téléchargement ---------- */

.dl-panel {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: var(--space-6);
}
.dl-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-4); flex-wrap: wrap; margin-bottom: var(--space-5);
}
.dl-version { font: 700 var(--fs-h2)/1 var(--font-display); margin: 0; }
.dl-rows {
  display: grid; grid-template-columns: max-content 1fr;
  gap: var(--space-2) var(--space-6); margin: 0;
  font-size: var(--fs-body-lg);
}
.dl-rows dt { color: var(--faint); }
.dl-rows dd { margin: 0; }

.code {
  font-family: var(--font-mono); font-size: var(--fs-meta);
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: var(--space-3) var(--space-4);
  overflow-x: auto; white-space: nowrap; color: var(--text);
}
/* Texte à taper (aide) : dans la phrase, sans marge de bloc ;
   défilement propre si trop longs, sans faire déborder la page. */
.prose span.code {
  display: inline-block; max-width: 100%; vertical-align: bottom;
  padding: 0 var(--space-1); margin: 0;
}

.steps { list-style: none; counter-reset: step; margin: 0 0 var(--space-6); padding: 0; }
.steps li {
  counter-increment: step;
  display: grid; grid-template-columns: var(--btn-h-sm) 1fr; gap: var(--space-4);
  padding: var(--space-4) 0; border-top: 1px solid var(--line);
}
.steps li::before {
  content: counter(step);
  display: grid; place-items: center;
  width: var(--btn-h-sm); height: var(--btn-h-sm);
  border: 1px solid var(--line-strong); border-radius: 50%;
  color: var(--muted); font-weight: 600; font-size: var(--fs-meta);
}
.steps p { margin: 0; font-size: var(--fs-body-lg); color: var(--muted); max-width: 62ch; }
.steps strong { color: var(--text); }

.callout {
  display: grid; grid-template-columns: var(--icon) 1fr; gap: var(--space-3);
  background: var(--accent-soft); border: 1px solid var(--accent-line);
  border-radius: var(--r-sm); padding: var(--space-3-5);
}
.callout .icon { color: var(--accent); margin-top: 2px; }
.callout p { margin: 0 0 var(--space-1); font-size: var(--fs-body-lg); max-width: 62ch; }
.callout p:last-child { margin-bottom: 0; }

/* ---------- Aide, notes, confidentialité ---------- */

.toc {
  border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--surface); padding: var(--space-5) var(--space-6);
  margin-bottom: var(--space-10);
}
.toc > p { margin: 0 0 var(--space-2); font-weight: 650; }
.toc ul { list-style: none; margin: 0; padding: 0; }
.toc a {
  display: block; padding: var(--space-1-5) 0;
  color: var(--muted); text-decoration: none; font-size: var(--fs-body-lg);
}
@media (hover: hover) and (pointer: fine) {
  .toc a:hover { color: var(--text); }
}

.prose { max-width: 62ch; }
.prose h3 { margin-top: var(--space-8); padding-top: var(--space-5); border-top: 1px solid var(--line); }
.prose h3:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.prose p, .prose ul { color: var(--muted); font-size: var(--fs-body-lg); }
.prose strong { color: var(--text); }
.prose ul { padding-left: var(--space-5); margin: 0 0 var(--space-4); }
.prose li { margin-bottom: var(--space-2); }

.version { border-top: 1px solid var(--line); padding: var(--space-6) 0; }
.version-head {
  display: flex; align-items: baseline; gap: var(--space-3); flex-wrap: wrap;
  margin-bottom: var(--space-3);
}
.version-num { font: 700 var(--fs-h2)/1 var(--font-display); margin: 0; }
.version ul { color: var(--muted); font-size: var(--fs-body-lg); padding-left: var(--space-5); margin: 0; max-width: 62ch; }
.version li { margin-bottom: var(--space-2); }

/* ---------- États sans version ---------- */

.state-empty {
  border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--surface); padding: var(--space-10) var(--space-6);
  max-width: 62ch;
}
.state-empty .h2 { margin-bottom: var(--space-3); }
.state-empty p { font-size: var(--fs-body-lg); color: var(--muted); }

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

.site-footer { border-top: 1px solid var(--line); background: var(--surface); }
.site-footer-in {
  max-width: var(--state-w); margin: 0 auto;
  padding: var(--space-10) var(--pad) var(--space-8);
  display: grid; gap: var(--space-5);
}
.site-footer nav { display: flex; gap: var(--space-2) var(--space-5); flex-wrap: wrap; }
.site-footer a { color: var(--muted); text-decoration: none; font-size: var(--fs-body); }
.site-footer-note { color: var(--faint); font-size: var(--fs-caption); margin: 0; max-width: 62ch; }
@media (hover: hover) and (pointer: fine) {
  .site-footer a:hover { color: var(--text); }
}

/* ---------- Fenêtres plus étroites ---------- */

@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; }
  .covers-strip { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .feature-grid { grid-template-columns: 1fr; }
  .screen-grid { grid-template-columns: 1fr; }
  .site-main { padding-top: var(--space-10); }
  .covers-strip { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .page-title { font-size: var(--fs-feature); }
  .hero-actions .btn { width: 100%; }
  .dl-head .btn { width: 100%; }
  .covers-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ---------- Mouvement (voir README.md : candidats retenus et refusés) ---------- */

/* Arrivée de la page : fondu et montée de 6 px — le motif d'apparition d'un message
   dans l'application — décalé par pas de --dur-press. Seule la zone d'en-tête de
   chaque page s'anime, une fois par chargement ; le contenu à lire ne bouge pas. */
@keyframes site-enter {
  from { opacity: 0; transform: translateY(6px); }
}
.page-title { animation: site-enter var(--dur-enter) var(--ease-out) backwards; }
.site-main > .lede, .hero-copy .lede {
  animation: site-enter var(--dur-enter) var(--ease-out) backwards;
  animation-delay: var(--dur-press);
}
.hero-copy > div, .hero-copy [data-etat], .dl-panel, .state-empty, .toc, .site-main > .hero-actions {
  animation: site-enter var(--dur-enter) var(--ease-out) backwards;
  animation-delay: calc(var(--dur-press) * 2);
}

/* Vitrine : la jaquette arrive et se pose, comme le morph jaquette → fiche de
   l'application. Le mouvement signature du produit, une fois par chargement. */
@keyframes site-cover {
  from { opacity: 0; transform: scale(1.03); }
}
.vitrine-shot { animation: site-cover var(--dur-morph) var(--ease-out) backwards; }

/* Bouton de téléchargement : l'icône descend de 2 px au survol — la direction de
   l'action. Survol souris uniquement, jamais au clavier. */
.btn-primary .icon { transition: transform var(--dur-ui) var(--ease-out); }
@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover .icon { transform: translateY(2px); }
}

/* Apparition au défilement : activée uniquement quand le script a marqué la page
   (reveal-ready), pour rester lisible sans JS. Une fois visible, ne rejoue pas. */
.reveal-ready .reveal {
  opacity: 0; transform: translateY(6px);
  transition: opacity var(--dur-enter) var(--ease-out), transform var(--dur-enter) var(--ease-out);
}
.reveal-ready .reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Réduction des animations (DESIGN.md §8) ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 1ms !important;
    animation-duration: 1ms !important;
    animation-delay: 0ms !important;
  }
}
