/* Nimoria Apocalypse · nimoria.fr/apocalypse/
   Béton sale, rouille, rubalise jaune et un vert d'infection gardé pour
   les signes de vie (copie réussie). Polices du site, servies en local. */

@font-face {
  font-family: "Big Shoulders Display";
  src: url("/site/polices/big-shoulders-display-var.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Public Sans";
  src: url("/site/polices/public-sans-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Public Sans";
  src: url("/site/polices/public-sans-italique-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}

:root {
  --beton: #26241f;
  --beton-2: #2f2c26;
  --beton-3: #3a372f;
  --trait: rgba(236, 228, 210, 0.14);
  --os: #ece4d2;
  --cendre: #bbb3a2;
  --rouille: #c8612d;
  --rouille-claire: #e8874f;
  --rubalise: #f2c21b;
  --rubalise-vive: #ffd43d;
  --goudron: #17150f;
  --toxique: #a8d83c;

  --titre: "Big Shoulders Display", "Arial Narrow", "Roboto Condensed", sans-serif;
  --corps: "Public Sans", "Segoe UI", system-ui, sans-serif;

  --gouttiere: clamp(1rem, 4vw, 3rem);
  --largeur: 72rem;

  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background-color: var(--beton);
  /* taches d'humidité sur la dalle */
  background-image:
    radial-gradient(60rem 40rem at 85% 8%, rgba(200, 97, 45, 0.10), transparent 70%),
    radial-gradient(50rem 50rem at 5% 55%, rgba(168, 216, 60, 0.035), transparent 70%),
    radial-gradient(40rem 30rem at 70% 95%, rgba(0, 0, 0, 0.25), transparent 70%);
  color: var(--os);
  font-family: var(--corps);
  font-size: 1.0625rem;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
@supports (overflow: clip) {
  body { overflow-x: clip; }
}

/* le grain du béton, par-dessus tout, sans capter les clics */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  opacity: 0.09;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1.1 0'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23g)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

img { max-width: 100%; display: block; }

a { color: var(--rubalise); text-underline-offset: 0.2em; }
a:hover { color: var(--os); }

:focus-visible {
  outline: 3px solid var(--rubalise);
  outline-offset: 3px;
  border-radius: 2px;
}

h1, h2, h3 {
  font-family: var(--titre);
  font-weight: 800;
  line-height: 1;
  margin: 0;
  text-wrap: balance;
}
h2 { font-size: clamp(2.5rem, 5.5vw, 4.25rem); letter-spacing: 0.005em; }
h3 { font-size: clamp(1.5rem, 2.2vw, 1.875rem); font-weight: 700; }

p { margin: 0; text-wrap: pretty; }
p + p { margin-top: 1em; }

kbd {
  display: inline-block;
  min-width: 1.9em;
  padding: 0.05em 0.45em;
  border-radius: 4px;
  background: var(--os);
  color: var(--goudron);
  font-family: var(--corps);
  font-weight: 700;
  font-size: 0.85em;
  text-align: center;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.3);
  white-space: nowrap;
}

.visuellement-cache {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.evitement {
  position: absolute;
  left: var(--gouttiere);
  top: -4rem;
  z-index: 60;
  padding: 0.6rem 1rem;
  background: var(--os);
  color: var(--goudron);
  font-weight: 700;
  border-radius: 4px;
}
.evitement:focus { top: 0.75rem; }

/* case d'inventaire Minecraft : l'écrin des icônes pixel */
.case {
  flex: none;
  display: grid;
  place-items: center;
  width: 4.25rem;
  height: 4.25rem;
  background: #8b8b8b;
  border: 3px solid;
  border-color: #373737 #ffffff #ffffff #373737;
}
.case img {
  width: 3rem;
  height: 3rem;
  image-rendering: pixelated;
}
.case-petite { width: 3.25rem; height: 3.25rem; border-width: 2px; }
.case-petite img { width: 2.25rem; height: 2.25rem; }

/* ---------------------------------------------------------------- bouton --- */

.bouton {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 0.1rem;
  min-height: 3.5rem;
  padding: 0.7rem 1.6rem 0.75rem;
  background: var(--rubalise);
  color: var(--goudron);
  text-decoration: none;
  border-radius: 3px;
  box-shadow: 0 0 0 2px var(--goudron), 6px 6px 0 0 var(--goudron);
  transition: background-color 0.15s ease, transform 0.12s ease, box-shadow 0.12s ease;
}
.bouton:hover { background: var(--rubalise-vive); color: var(--goudron); }
.bouton:active { transform: translate(3px, 3px); box-shadow: 0 0 0 2px var(--goudron), 3px 3px 0 0 var(--goudron); }
.bouton-libelle {
  font-family: var(--titre);
  font-weight: 800;
  font-size: 1.625rem;
  line-height: 1.05;
}
.bouton-detail {
  font-size: 0.875rem;
  font-weight: 600;
}

.bouton-discret {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0.5rem 1.1rem;
  border: 2px solid var(--trait);
  border-radius: 3px;
  color: var(--os);
  font-weight: 600;
  text-decoration: none;
}
.bouton-discret:hover { border-color: var(--rubalise); color: var(--os); }

/* --------------------------------------------------------------- bandeau --- */

.bandeau {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  max-width: calc(var(--largeur) + 2 * var(--gouttiere));
  margin: 0 auto;
  padding: 1rem var(--gouttiere) 0;
}
.retour {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--cendre);
  font-weight: 600;
  font-size: 0.9375rem;
  text-decoration: none;
  min-height: 2.75rem;
}
.retour img { width: 24px; height: 24px; }
.retour:hover { color: var(--os); }

.navigation {
  display: flex;
  gap: 0.25rem;
  margin-left: auto;
}
.navigation a {
  padding: 0.5rem 0.7rem;
  color: var(--os);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9375rem;
}
.navigation a:hover { color: var(--rubalise); }
@media (max-width: 860px) {
  .navigation { display: none; }
}

/* --------------------------------------------------------------- affiche --- */

/* le cadre plein écran rogne la rubalise qui déborde des deux côtés */
.affiche-cadre { overflow: hidden; padding-bottom: 2.5rem; }

.affiche {
  position: relative;
  max-width: calc(var(--largeur) + 2 * var(--gouttiere));
  margin: 0 auto;
  padding: clamp(2.5rem, 7vw, 5rem) var(--gouttiere) 0;
}

.affiche-grille {
  display: grid;
  grid-template-columns: minmax(0, 31rem) minmax(0, 1fr);
  gap: 2rem;
  align-items: end;
}

.affiche-texte { position: relative; z-index: 2; padding-bottom: clamp(3.5rem, 6vw, 4.5rem); }

.titre {
  display: flex;
  flex-direction: column;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}
.titre-nimoria {
  font-weight: 600;
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  letter-spacing: 0.32em;
  color: var(--cendre);
  margin-bottom: 0.1em;
}
.titre-apocalypse {
  font-weight: 900;
  font-size: clamp(4rem, 12.5vw, 9.5rem);
  line-height: 0.82;
  letter-spacing: -0.01em;
  color: var(--os);
  /* lettres rongées : le grain mord dans le titre */
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='m'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' seed='4'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -9 7.2'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23m)'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='m'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' seed='4'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -9 7.2'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23m)'/%3E%3C/svg%3E");
}

.chapeau {
  max-width: 30rem;
  font-size: 1.1875rem;
  color: var(--os);
}
.chapeau-note {
  margin-top: 0.6rem;
  max-width: 30rem;
  color: var(--cendre);
  font-size: 0.9375rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 1.5rem 2rem;
  margin-top: 2rem;
}

/* la plaque d'adresse, vissée dans le mur */
.adresse {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.adresse-etiquette {
  font-size: 0.875rem;
  color: var(--cendre);
  font-weight: 600;
}
.adresse-plaque {
  display: flex;
  align-items: stretch;
  border: 2px solid var(--trait);
  border-radius: 3px;
  background: rgba(23, 21, 15, 0.55);
}
.adresse-valeur {
  display: flex;
  align-items: center;
  padding: 0.35rem 0.9rem;
  font-family: var(--titre);
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: 0.02em;
  user-select: all;
  -webkit-user-select: all;
  white-space: nowrap;
}
.copier {
  min-height: 2.75rem;
  padding: 0 1rem;
  border: 0;
  border-left: 2px solid var(--trait);
  background: transparent;
  color: var(--rubalise);
  font: 700 0.9375rem var(--corps);
  cursor: pointer;
}
.copier:hover { background: rgba(242, 194, 27, 0.1); }
.copier[data-etat="ok"] { color: var(--toxique); }
.adresse-aide {
  min-height: 1.4em;
  font-size: 0.875rem;
  color: var(--toxique);
}

.affiche-horde {
  position: relative;
  z-index: 1;
  align-self: end;
  margin: 0 calc(-1 * var(--gouttiere)) 0 -3rem;
}
/* la horde sort du brouillard : le haut s'efface dans le béton */
.affiche-horde img {
  width: 100%;
  height: auto;
  image-rendering: pixelated;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 38%);
  mask-image: linear-gradient(to bottom, transparent 0%, #000 38%);
}

/* la rubalise, en travers de la rue : le seul geste de la page */
.rubalise {
  position: relative;
  z-index: 3;
  width: calc(100vw + 8rem);
  margin: -2.2rem 0 0 calc(50% - 50vw - 4rem);
  transform: rotate(-2.2deg);
  background: var(--rubalise);
  color: var(--goudron);
  border-block: 5px solid var(--goudron);
  box-shadow: 0 14px 30px -12px rgba(0, 0, 0, 0.7);
  overflow: hidden;
  white-space: nowrap;
}
.rubalise-texte {
  display: inline-block;
  padding: 0.5rem 0;
  font-family: var(--titre);
  font-weight: 900;
  font-size: clamp(1.1rem, 2.2vw, 1.5rem);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  animation: deroule 1.1s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
@keyframes deroule {
  from { transform: translateX(-18%); }
  to   { transform: translateX(0); }
}
@media (prefers-reduced-motion: reduce) {
  .rubalise-texte { animation: none; }
}
.rubalise-texte span { padding: 0 1.4rem; }
.rubalise-texte span::before {
  content: "";
  display: inline-block;
  width: 0.55em;
  height: 0.55em;
  margin-right: 1.4rem;
  background: var(--goudron);
  transform: rotate(45deg) translateY(-0.12em);
}

@media (max-width: 820px) {
  .affiche-grille { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .affiche-texte { padding-bottom: 2rem; }
  .affiche-horde { margin: 0 calc(-1 * var(--gouttiere)) 1.5rem; order: -1; }
  .rubalise { margin-top: -1.2rem; }
}
@media (max-width: 420px) {
  .adresse-valeur { font-size: 1.25rem; padding-inline: 0.7rem; }
  .actions .bouton { width: 100%; }
}

/* -------------------------------------------------------------- sections --- */

.section {
  max-width: calc(var(--largeur) + 2 * var(--gouttiere));
  margin: 0 auto;
  padding: clamp(4rem, 10vw, 7rem) var(--gouttiere) 0;
}
.section:last-of-type { padding-bottom: clamp(4rem, 10vw, 7rem); }
.section > h2 { max-width: 40rem; }

.introduction {
  margin-top: 1rem;
  color: var(--cendre);
  font-size: 1.1875rem;
  max-width: 36rem;
}

/* ---------------------------------------------------------------- étapes --- */

.etapes {
  list-style: none;
  counter-reset: etape;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.5rem, 4vw, 3rem);
  margin: clamp(2rem, 5vw, 3.5rem) 0 0;
  padding: 0;
}
@media (max-width: 900px) {
  .etapes { grid-template-columns: minmax(0, 1fr); }
}
.etape {
  counter-increment: etape;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.8rem;
  padding-top: 1.25rem;
  border-top: 2px solid var(--trait);
}
.etape::before {
  content: counter(etape);
  font-family: var(--titre);
  font-weight: 900;
  font-size: clamp(4.5rem, 8vw, 6rem);
  line-height: 0.8;
  color: var(--rouille);
}
.etape p { color: var(--cendre); }
.etape p strong { color: var(--os); font-weight: 600; }
.etape .bouton-discret { margin-top: 0.3rem; }

/* --------------------------------------------------------------- classes --- */

.classes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
  margin-top: clamp(2rem, 5vw, 3.5rem);
}
@media (max-width: 980px) {
  .classes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .classes { grid-template-columns: minmax(0, 1fr); }
}

/* une fiche de recensement de survivant, punaisée au mur */
.classe {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.4rem 1.4rem 1.5rem;
  background: var(--beton-2);
  border: 1px solid var(--trait);
  border-top: 4px solid var(--rouille);
}
.classe-tete {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.classe h3 { font-size: clamp(1.75rem, 2.6vw, 2.125rem); }
.classe-citation {
  color: var(--os);
  font-style: italic;
}
.classe dl { margin: 0; display: grid; gap: 0.7rem; }
.classe dt {
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--rouille-claire);
}
.classe dd {
  margin: 0.1rem 0 0;
  color: var(--cendre);
  font-size: 0.975rem;
}
.note-classes {
  margin-top: 1.5rem;
  color: var(--cendre);
  max-width: 44rem;
}

/* ---------------------------------------------------------------- menaces --- */

.menaces {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: clamp(1.5rem, 5vw, 4rem);
  margin-top: clamp(2rem, 5vw, 3.5rem);
}
@media (max-width: 760px) {
  .menaces { grid-template-columns: minmax(0, 1fr); }
}
.menace {
  display: flex;
  gap: 1.1rem;
  padding: 1.5rem 0;
  border-top: 1px solid var(--trait);
}
.menace h3 { margin-bottom: 0.45rem; }
.menace p { color: var(--cendre); }

/* --------------------------------------------------------- configuration --- */

.colonnes {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: start;
}
@media (max-width: 880px) {
  .colonnes { grid-template-columns: minmax(0, 1fr); }
}
.texte h2 { margin-bottom: 1.5rem; }
.texte p { color: var(--cendre); max-width: 34rem; }

.tableau-conteneur { overflow-x: auto; }
.tableau {
  width: 100%;
  border-collapse: collapse;
  font-size: 1rem;
}
.tableau th, .tableau td {
  text-align: left;
  vertical-align: top;
  padding: 0.85rem 1rem 0.85rem 0;
  border-bottom: 1px solid var(--trait);
}
.tableau thead th {
  font-family: var(--titre);
  font-weight: 700;
  font-size: 1.375rem;
  padding-top: 0;
}
.tableau tbody th { color: var(--cendre); font-weight: 400; white-space: nowrap; }
.tableau td { font-weight: 600; }
@media (max-width: 520px) {
  .tableau { font-size: 0.9375rem; }
  .tableau tbody th { white-space: normal; }
}

.touches {
  margin: 2.5rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, max-content);
  gap: 0.7rem 2rem;
}
@media (max-width: 520px) {
  .touches { grid-template-columns: minmax(0, 1fr); }
}
.touches li { display: flex; align-items: baseline; gap: 0.75rem; color: var(--cendre); }
.touches kbd { flex: none; min-width: 4.4rem; }
.touches-titre { margin-top: 3rem; font-size: 1.75rem; }

/* ------------------------------------------------------------- questions --- */

.questions {
  margin-top: clamp(2rem, 5vw, 3rem);
  max-width: 48rem;
  border-top: 1px solid var(--trait);
}
.questions details { border-bottom: 1px solid var(--trait); }
.questions summary {
  position: relative;
  display: block;
  cursor: pointer;
  list-style: none;
  padding: 1.15rem 2.5rem 1.15rem 0;
  font-weight: 600;
  font-size: 1.125rem;
}
.questions summary::-webkit-details-marker { display: none; }
.questions summary::after {
  content: "";
  position: absolute;
  right: 0.35rem;
  top: 50%;
  width: 0.65rem;
  height: 0.65rem;
  border-right: 2px solid var(--rubalise);
  border-bottom: 2px solid var(--rubalise);
  transform: translateY(-70%) rotate(45deg);
  transition: transform 0.2s ease;
}
.questions details[open] summary::after { transform: translateY(-30%) rotate(-135deg); }
.questions summary:hover { color: var(--rubalise); }
.questions details > p {
  color: var(--cendre);
  padding: 0 0 1.4rem;
  max-width: 42rem;
}
.questions details > p + p { margin-top: -0.6rem; }
@media (prefers-reduced-motion: reduce) {
  .questions summary::after { transition: none; }
}

/* ------------------------------------------------------------------ pied --- */

.pied {
  border-top: 1px solid var(--trait);
  background: var(--goudron);
}
.pied-interieur {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
  max-width: calc(var(--largeur) + 2 * var(--gouttiere));
  margin: 0 auto;
  padding: 2rem var(--gouttiere) calc(2rem + env(safe-area-inset-bottom, 0px));
  color: var(--cendre);
  font-size: 0.875rem;
}
.pied .retour { color: var(--os); }
