/* Mystalibi : un formulaire d'alibi rempli à l'encre bleue. Charte : DESIGN.md. */

@font-face { font-family: "Archivo"; src: url("/polices/archivo.woff2") format("woff2"); font-weight: 100 900; font-stretch: 62% 125%; font-style: normal; font-display: swap; }
@font-face { font-family: "Literata"; src: url("/polices/literata.woff2") format("woff2"); font-weight: 200 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Literata"; src: url("/polices/literata-italique.woff2") format("woff2"); font-weight: 200 900; font-style: italic; font-display: swap; }

:root {
  --encre: #1F2A6B;
  --encre-pale: #5A63A0;
  --papier: #FFFFFF;
  --papier-bleute: #EEF0F7;
  --surligneur: #F6D44A;
  --surligneur-fonce: #EDC22C;
  --rose: #F5CDD6;
  --trait: 2px;
  --coin: 3px;
  --largeur: 70rem;
  --gouttiere: 1rem;
  --titre: "Archivo", "Arial Narrow", Arial, sans-serif;
  --texte: "Literata", Georgia, serif;
  --coche: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M2.6 8.6c1.3.9 2.4 2.1 3.3 3.4C7.7 8.7 10.2 5.7 13.7 3.3' fill='none' stroke='%231F2A6B' stroke-width='2.3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  color-scheme: light;
}
@media (min-width: 48rem) { :root { --gouttiere: 2rem; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--papier);
  color: var(--encre);
  font-family: var(--texte);
  font-size: 1.125rem;
  line-height: 1.6;
  overflow-x: hidden;
}
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--encre); outline-offset: 3px; }
h1, h2, h3 { font-family: var(--titre); line-height: 1.05; margin: 0 0 .5em; font-weight: 750; text-wrap: balance; }
h1 { font-size: clamp(2.3rem, 1.3rem + 3.8vw, 4.2rem); font-stretch: 88%; letter-spacing: -.015em; }
h2 { font-size: clamp(1.75rem, 1.25rem + 1.6vw, 2.5rem); font-stretch: 94%; letter-spacing: -.01em; }
h3 { font-size: 1.25rem; font-weight: 700; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
b { font-weight: 700; }

.cadre { width: min(var(--largeur), 100% - 2 * var(--gouttiere)); margin-inline: auto; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.evitement { position: absolute; left: 1rem; top: -5rem; z-index: 10; padding: .5rem 1rem; background: var(--surligneur); border: var(--trait) solid var(--encre); font-family: var(--titre); }
.evitement:focus { top: 1rem; }
.bandeau-test { margin: 0; padding: .4rem 1rem; background: var(--surligneur); border-bottom: var(--trait) solid var(--encre); font-family: var(--titre); font-size: .9rem; text-align: center; }
.note { font-style: italic; color: var(--encre-pale); font-size: 1rem; }

/* Marque : une case cochée, comme sur le formulaire */
.marque {
  display: inline-flex; align-items: center; gap: .45em;
  font-family: var(--titre); font-weight: 850; font-stretch: 125%; font-size: 1.3rem; letter-spacing: -.01em;
  text-decoration: none;
}
.marque::before {
  content: ""; width: .85em; height: .85em; flex: none;
  border: var(--trait) solid var(--encre); border-radius: var(--coin);
  background: var(--surligneur) var(--coche) center / 90% no-repeat;
}
.marque:hover { text-decoration: none; }

/* Tête */
.tete { border-bottom: var(--trait) solid var(--encre); background: var(--papier); }
.tete__ligne { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4.25rem; }
.menu { display: flex; gap: 1.25rem; font-family: var(--titre); font-size: 1rem; font-weight: 550; }
.menu a { text-decoration: none; padding-block: .6rem; }
.menu a:hover { text-decoration: underline; }
.menu__large { display: none; }
@media (min-width: 52rem) { .menu__large { display: inline; } }

/* Boutons */
.bouton {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 3rem; padding: .7rem 1.3rem;
  font-family: var(--titre); font-weight: 700; font-stretch: 105%; font-size: 1.05rem; line-height: 1.2; text-align: center;
  color: var(--encre); background: var(--surligneur);
  border: var(--trait) solid var(--encre); border-radius: var(--coin);
  text-decoration: none; cursor: pointer;
}
.bouton:hover { background: var(--surligneur-fonce); text-decoration: none; }
.bouton:active { transform: translateY(1px); }
.bouton--clair { background: var(--papier); }
.bouton--clair:hover { background: var(--papier-bleute); }
.bouton--grand { min-height: 3.5rem; padding-inline: 1.6rem; font-size: 1.15rem; }

/* Cases à cocher */
.cases { list-style: none; margin: 1.25rem 0; padding: 0; display: grid; gap: .5rem; font-family: var(--titre); font-weight: 550; font-size: 1.02rem; line-height: 1.3; }
.cases li { display: flex; align-items: center; gap: .65rem; }
.cases li::before {
  content: ""; flex: none; width: 1.2rem; height: 1.2rem;
  border: var(--trait) solid var(--encre); border-radius: var(--coin); background: var(--papier);
}
.cases li.coche::before { background: var(--papier) var(--coche) center / 92% no-repeat; }

/* Premier écran */
.une { display: grid; gap: 2.5rem; padding-block: 2.5rem 3.5rem; }
@media (min-width: 62rem) {
  .une { grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); align-items: start; gap: 4.5rem; padding-block: 4.5rem 5.5rem; }
}
.une__question { font-style: italic; font-size: clamp(1.2rem, 1rem + .8vw, 1.5rem); color: var(--encre-pale); margin-bottom: .75rem; }
.une__question::after { content: ""; display: inline-block; width: 4.5em; margin-left: .4em; border-bottom: var(--trait) dotted var(--encre-pale); }
.une__chapeau { font-size: 1.2rem; max-width: 34em; }
.une__cadre { font-style: italic; font-size: 1.2rem; color: var(--encre-pale); }
.une__action { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.25rem; margin-top: 2rem; }
.une__prix { font-family: var(--titre); font-size: 1rem; color: var(--encre-pale); }
.une--jeu h1 { font-size: clamp(2.1rem, 1.3rem + 2.9vw, 3.5rem); }

.onglet-page { background: var(--bandeau, var(--encre)); color: #fff; font-family: var(--titre); font-size: .95rem; }
.onglet-page .cadre { display: flex; gap: .75rem; padding-block: .55rem; }
.onglet-page a { color: #fff; }
.onglet-page span::before { content: "/"; margin-right: .75rem; opacity: .75; }

.achat { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.75rem; margin-top: 1.75rem; padding-top: 1.5rem; border-top: var(--trait) solid var(--encre); }
.achat__prix { display: grid; margin: 0; }
.achat__note { font-family: var(--titre); font-size: .9rem; color: var(--encre-pale); }
.prix { font-family: var(--titre); font-weight: 800; font-stretch: 112%; font-size: 1.6rem; line-height: 1.1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.prix--grand { font-size: 2.6rem; }
.bientot { margin: 0; padding: .75rem 1rem; border: var(--trait) dashed var(--encre-pale); border-radius: var(--coin); font-family: var(--titre); font-weight: 600; color: var(--encre-pale); }

/* La frise horaire */
.frise { margin: 0; border: var(--trait) solid var(--encre); border-radius: var(--coin); background: var(--papier); overflow: hidden; }
.frise__titre {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: .25rem 1rem;
  padding: .7rem 1rem; background: var(--bandeau, var(--encre)); color: #fff;
  font-family: var(--titre); font-weight: 700; font-stretch: 110%; font-size: 1rem;
}
.frise__date { font-weight: 500; }
.frise__lignes { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: max-content 1fr; }
.frise__ligne { grid-column: 1 / -1; display: grid; grid-template-columns: subgrid; column-gap: 1.1rem; align-items: baseline; padding: .75rem 1rem; }
.frise__ligne + .frise__ligne { border-top: var(--trait) solid var(--encre); }
.frise__heure {
  font-family: var(--titre); font-weight: 800; font-stretch: 118%; font-variant-numeric: tabular-nums;
  font-size: clamp(1.55rem, 1.15rem + 1.5vw, 2.3rem); line-height: 1; letter-spacing: -.01em; white-space: nowrap;
}
.frise__heure small { font-size: .45em; font-weight: 700; margin-left: .25em; }
.frise__texte { font-size: 1.02rem; line-height: 1.4; }
.frise__ligne--crime .frise__heure > span {
  background: linear-gradient(var(--surligneur), var(--surligneur)) 0 70% / 100% 72% no-repeat;
  padding-inline: .1em; margin-inline: -.1em;
}
.frise__legende { margin: 0; padding: .65rem 1rem; border-top: var(--trait) solid var(--encre); font-size: .92rem; font-style: italic; color: var(--encre-pale); }

/* Sections */
.section > .cadre { padding-block: 3.5rem; }
@media (min-width: 48rem) { .section > .cadre { padding-block: 5rem; } }
.section:not(.section--bleute) + .section:not(.section--bleute) > .cadre,
.une-zone + .section:not(.section--bleute) > .cadre { border-top: var(--trait) solid var(--encre); }
.section--bleute { background: var(--papier-bleute); border-block: var(--trait) solid var(--encre); }
.section__tete { max-width: 44rem; margin-bottom: 2.25rem; }
.deux-cols { display: grid; gap: 1.5rem 4rem; }
@media (min-width: 62rem) { .deux-cols { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); } }
.prose p { max-width: 36em; }
.prose p:first-child { font-size: 1.2rem; }

/* Les jeux : un dossier par scénario */
.dossiers { display: grid; gap: 2rem; }
@media (min-width: 48rem) { .dossiers { grid-template-columns: repeat(auto-fill, minmax(min(100%, 30rem), 1fr)); } }
.dossier { display: flex; flex-direction: column; }
.dossier__onglet {
  align-self: flex-start; margin: 0; padding: .4rem 1rem .3rem;
  background: var(--bandeau); color: #fff; border-radius: var(--coin) var(--coin) 0 0;
  font-family: var(--titre); font-weight: 700; font-stretch: 112%; font-size: .95rem;
}
.dossier__corps {
  flex: 1; display: flex; flex-direction: column; padding: 1.5rem;
  border: var(--trait) solid var(--encre); border-top: .45rem solid var(--bandeau); border-radius: 0 var(--coin) var(--coin) var(--coin);
}
.dossier__titre { font-size: clamp(1.6rem, 1.3rem + 1vw, 2.1rem); font-stretch: 90%; margin-bottom: .3rem; }
.dossier__titre a { text-decoration: none; }
.dossier__titre a:hover { text-decoration: underline; }
.dossier__cadre { font-style: italic; color: var(--encre-pale); }
.dossier__pied { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1rem; margin-top: auto; padding-top: 1.25rem; border-top: var(--trait) dotted var(--encre-pale); }
.dossier__bientot { flex: 1 1 8rem; font-family: var(--titre); font-size: .95rem; line-height: 1.3; color: var(--encre-pale); }
.dossier__pied .bouton { margin-left: auto; }

/* Ce que contient le PDF : le feuillet rose */
.feuillet { background: var(--rose); border: var(--trait) solid var(--encre); border-radius: var(--coin); padding: 1.25rem 1.5rem 1.5rem; }
.inventaire { list-style: none; margin: 0; padding: 0; }
.inventaire li { display: grid; grid-template-columns: 2.4rem 1fr; gap: 1rem; align-items: baseline; padding-block: .85rem; border-bottom: var(--trait) solid var(--encre); }
.inventaire li:first-child { padding-top: .25rem; }
.inventaire__n { font-family: var(--titre); font-weight: 800; font-stretch: 118%; font-size: 2.1rem; line-height: 1; font-variant-numeric: tabular-nums; }
.inventaire b { display: block; font-family: var(--titre); font-weight: 700; font-size: 1.1rem; line-height: 1.25; }
.inventaire__desc { display: block; font-size: 1rem; line-height: 1.45; }
.feuillet__note { margin-top: 1.1rem; font-size: .95rem; font-style: italic; }

/* La barre des actes, proportionnelle à leur durée */
.actes { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.1rem; }
.acte__barre {
  display: flex; align-items: center; height: 2.6rem; padding-inline: .65rem;
  width: max(4.6rem, calc(var(--m) / var(--max) * 100%));
  background: var(--papier); border: var(--trait) solid var(--encre); border-radius: var(--coin);
  font-family: var(--titre); font-weight: 700; font-size: .95rem; white-space: nowrap;
}
.acte--jeu .acte__barre { background: var(--encre); color: #fff; }
.acte__nom { display: block; margin-top: .45rem; font-family: var(--titre); font-weight: 700; font-size: 1.05rem; line-height: 1.25; }
.acte__desc { display: block; font-size: .95rem; line-height: 1.4; color: var(--encre-pale); }
@media (min-width: 62rem) {
  .actes { grid-template-columns: var(--cols); gap: 0; }
  .acte__barre { width: auto; border-radius: 0; border-right-width: 0; }
  .acte:first-child .acte__barre { border-radius: var(--coin) 0 0 var(--coin); }
  .acte:last-child .acte__barre { border-right-width: var(--trait); border-radius: 0 var(--coin) var(--coin) 0; }
  .acte__nom, .acte__desc { padding-right: .75rem; }
}

/* Sans maître du jeu : la question du formulaire */
.formulaire { max-width: 22rem; margin-top: 1.75rem; padding: 1.1rem 1.25rem; border: var(--trait) solid var(--encre); border-radius: var(--coin); }
.formulaire__q { margin-bottom: .25rem; font-family: var(--titre); font-weight: 700; font-size: 1.05rem; }
.formulaire .cases { margin: .5rem 0 0; }
.formulaire .coche > span:last-child { background: linear-gradient(var(--surligneur), var(--surligneur)) 0 75% / 100% 70% no-repeat; padding-inline: .1em; margin-inline: -.1em; }

/* Questions */
.faq { border-top: var(--trait) solid var(--encre); }
.faq__item { border-bottom: var(--trait) solid var(--encre); }
.faq__item summary {
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding-block: 1rem;
  font-family: var(--titre); font-weight: 650; font-size: 1.15rem; line-height: 1.3; cursor: pointer; list-style: none;
}
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary::after { content: "+"; flex: none; font-size: 1.5rem; font-weight: 500; line-height: 1; }
.faq__item[open] summary::after { content: "\2212"; }
.faq__item p { max-width: 38em; margin: 0 0 1.25rem; }

/* Fiche d'un jeu */
.prologue { max-width: 36em; padding-left: 1.5rem; border-left: .3rem solid var(--bandeau, var(--encre)); font-size: 1.2rem; line-height: 1.65; }
.programme { list-style: none; margin: 0; padding: 0; border-top: var(--trait) solid var(--encre); }
.programme li { display: grid; padding-block: .85rem; border-bottom: var(--trait) solid var(--encre); }
.programme__nom { font-family: var(--titre); font-weight: 750; font-stretch: 108%; font-size: 1.2rem; line-height: 1.25; }
.programme__points { display: none; }
.programme__role { font-style: italic; line-height: 1.45; }
.programme__victime .programme__nom { text-decoration: line-through; text-decoration-thickness: 2px; text-decoration-color: var(--bandeau, var(--encre)); }
@media (min-width: 40rem) {
  .programme li { display: flex; align-items: baseline; gap: .65rem; }
  .programme__nom { flex: none; }
  .programme__points { display: block; flex: 1 1 1.5rem; min-width: 1.5rem; border-bottom: var(--trait) dotted var(--encre-pale); transform: translateY(-.3em); }
  .programme__role { flex: 0 1 auto; max-width: 58%; text-align: right; }
}
.paiement { min-height: 3.5rem; }
.paiement[aria-busy="true"] { opacity: .55; }
.paiement__erreur { margin-top: 1rem; padding: .75rem 1rem; background: var(--rose); border: var(--trait) solid var(--encre); border-radius: var(--coin); }

/* Pages simples */
.legal { max-width: 46rem; }
.legal h2 { margin-top: 2.25rem; font-size: 1.35rem; }
.merci { max-width: 46rem; }
.telechargements { list-style: none; margin: 1.5rem 0 2.5rem; padding: 0; display: grid; gap: .75rem; }
.telechargements .bouton { width: 100%; justify-content: space-between; }
.etapes { padding-left: 1.4rem; }
.etapes li + li { margin-top: .4rem; }

/* Pied */
.pied { background: var(--encre); color: #fff; }
.pied .cadre { display: grid; gap: 1.5rem; padding-block: 2.75rem; }
@media (min-width: 48rem) { .pied .cadre { grid-template-columns: 1fr auto; align-items: start; } }
.pied .marque { color: #fff; margin-bottom: .6rem; }
.pied__marque p { font-size: .95rem; }
.pied__liens { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; font-family: var(--titre); font-size: .95rem; }
.pied__liens a { display: inline-block; padding-block: .3rem; }

/* La seule animation : la frise s'imprime ligne à ligne, puis l'heure du crime se surligne */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  .frise__ligne { animation: imprime .5s cubic-bezier(.2, .7, .2, 1) both; animation-delay: calc(var(--i) * 110ms + 150ms); }
  .frise__ligne--crime .frise__heure > span { animation: surligne .55s ease-out both; animation-delay: calc(var(--i) * 110ms + 600ms); }
  @keyframes imprime { from { opacity: 0; transform: translateY(.45rem); } }
  @keyframes surligne { from { background-size: 0% 72%; } }
}

/* Aperçu : vraies pages du PDF (visuels.py) */
.apercu { margin: 0; }
.apercu img { display: block; width: 100%; height: auto; border: var(--trait) solid var(--encre); border-radius: var(--coin); }
.apercu figcaption { margin-top: .6rem; font-size: .95rem; color: var(--encre-pale); }
