/* Le musée des serveurs : un générique de fin. Noir de salle, la lumière se gagne. */

@font-face {
  font-family: "League Gothic";
  src: url("polices/league-gothic-normal-latin.woff2") format("woff2");
  font-weight: 400;
  font-stretch: 75% 100%;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "League Gothic";
  src: url("polices/league-gothic-normal-latin-ext.woff2") format("woff2");
  font-weight: 400;
  font-stretch: 75% 100%;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Archivo";
  src: url("polices/archivo-normal-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Archivo";
  src: url("polices/archivo-normal-latin-ext.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --noir: #050608;
  --blanc: #ecebe6;
  --gris: #8c8a85;
  --trait: #34332f;
  --cellule: #161614;
  --cellule-bord: #2a2926;
  --vert: #59f27a;
  --ambre: #ffb000;
  --titre: "League Gothic", "Archivo", sans-serif;
  --texte: "Archivo", system-ui, sans-serif;
  --axe: 2.75rem;
  --respiration: clamp(7rem, 22vh, 13rem);
  color-scheme: dark;
  scrollbar-color: var(--trait) var(--noir);
  scrollbar-width: thin;
}

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

html { background: var(--noir); -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--noir);
  color: var(--blanc);
  font-family: var(--texte);
  font-size: 1.0625rem;
  line-height: 1.55;
  font-variant-numeric: tabular-nums;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  caret-color: var(--ambre);
}

/* Les bords de l'écran restent dans le noir : le générique sort de l'ombre et y retourne. */
body::before, body::after {
  content: "";
  position: fixed;
  inset-inline: 0;
  pointer-events: none;
  z-index: 5;
}
body::before { top: 0; height: 9rem; background: linear-gradient(var(--noir) 35%, transparent); }
body::after { bottom: 0; height: 16vh; background: linear-gradient(transparent, var(--noir)); }

::selection { background: var(--blanc); color: var(--noir); }

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.22em; }
a:hover { text-decoration-color: var(--gris); }

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

.evitement {
  position: absolute; left: 1rem; top: -4rem; z-index: 20;
  background: var(--blanc); color: var(--noir); padding: 0.6rem 1rem; text-decoration: none;
}
.evitement:focus { top: 1rem; }

/* Le bandeau : discret, au-dessus du fondu. */
.bandeau {
  position: fixed; inset: 0 0 auto; z-index: 10;
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
  padding: 1.1rem clamp(1rem, 4vw, 2.5rem);
  font-stretch: 87.5%; font-size: 0.75rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--gris);
}
.bandeau a { text-decoration: none; }
.bandeau a:hover { color: var(--blanc); }
.bandeau nav { display: flex; gap: clamp(1rem, 3vw, 2rem); }
.bandeau-nom { color: var(--blanc); }

main { padding-inline: 1rem; }

/* Ouverture */
.ouverture {
  min-height: 84svh;
  display: grid; place-content: center; justify-items: center; gap: 1.1rem;
  text-align: center;
  padding-top: 6rem;
}
.ouverture-courte { min-height: 60svh; }
.titre-musee {
  margin: 0;
  font-family: var(--titre); font-weight: 400; font-stretch: 100%;
  font-size: clamp(3.6rem, 13vw, 6rem); line-height: 0.92; letter-spacing: 0.035em;
  text-transform: uppercase; text-wrap: balance;
}
.ouverture-credit {
  margin: 0; max-width: 36rem;
  font-size: 1rem; letter-spacing: 0.01em;
  color: var(--gris); text-wrap: balance;
}
.signature {
  margin: 0;
  font-stretch: 87.5%; font-size: 0.78rem; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--gris);
}
.ouverture-actions { display: flex; flex-wrap: wrap; gap: 1rem 1.4rem; justify-content: center; align-items: center; margin: 1.6rem 0 0; }
.ouverture-actions-salle { margin: 0; padding-top: 6rem; }
.ou { font-size: 0.85rem; color: var(--gris); }
.ou-seul { display: none; }

.lancer {
  font: inherit; font-stretch: 87.5%; font-size: 0.8rem; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--blanc); background: transparent;
  border: 1px solid var(--blanc); border-radius: 0;
  padding: 0.95rem 1.7rem; cursor: pointer;
  transition: background-color 0.25s cubic-bezier(0.16, 1, 0.3, 1), color 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.lancer:hover, .lancer[aria-pressed="true"] { background: var(--blanc); color: var(--noir); }

/* Une salle : son carton-titre, puis quelques lignes de générique. */
.salle { padding-block: clamp(4.5rem, 13vh, 8rem) 1.5rem; text-align: center; }
.salle:first-child { padding-top: 2rem; }

.carton { display: grid; justify-items: center; gap: 0.55rem; margin-bottom: 2.6rem; }
.embleme { width: 5.5rem; height: 5.5rem; color: var(--gris); margin-bottom: 0.9rem; }
.carton-titre {
  margin: 0;
  font-family: var(--titre); font-weight: 400; font-stretch: 100%;
  font-size: clamp(2.9rem, 9vw, 5.25rem); line-height: 0.95; letter-spacing: 0.04em;
  text-transform: uppercase; text-wrap: balance;
}
.carton-titre a { text-decoration: none; }
.carton-titre a:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.12em; }
.carton-sous-titre {
  margin: 0;
  font-stretch: 87.5%; font-size: 0.95rem; letter-spacing: 0.03em;
  color: var(--gris);
}
.carton-periode { margin: 0; font-size: 1.05rem; }

/* Salle ouverte : le seul vert du musée. */
.statut-vivant {
  display: inline-flex; align-items: center; gap: 0.6rem; margin: 0.4rem 0 0;
  font-stretch: 87.5%; font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--vert);
}
.lampe { width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--vert); }
.statut-vivant.hors-ligne { color: var(--gris); }
.statut-vivant.hors-ligne .lampe { background: var(--gris); }

/* Les lignes du générique : le rôle à gauche de l'axe, la valeur à droite, reliés par des points. */
.credits { display: grid; gap: 0.7rem; max-width: 46rem; margin: 0 auto; padding: 0; }
.credit {
  display: grid; grid-template-columns: 1fr var(--axe) 1fr; align-items: baseline;
}
.credit dt {
  grid-column: 1; text-align: right;
  font-stretch: 87.5%; font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--gris);
}
.credit::before {
  content: ""; grid-column: 2; grid-row: 1; align-self: start;
  margin: 0.95em 0.6rem 0; border-bottom: 1px dotted var(--trait);
}
.credit dd { grid-column: 3; grid-row: 1; margin: 0; text-align: left; text-wrap: pretty; }
.credit dd a { text-decoration-color: var(--trait); }
.credit-nom dt { font-family: var(--titre); font-stretch: 100%; font-size: 1.9rem; letter-spacing: 0.05em; color: var(--blanc); }
.credit-nom::before { align-self: end; margin: 0 0.6rem 0.42em; }
.precision { color: var(--gris); }
.noms { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.15rem; }
.chiffres { font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }

/* Donnée manquante : une cellule éteinte. */
.fantome { display: inline-block; width: calc(var(--l, 4) * 1.55ch); height: 0.9em; vertical-align: -0.1em; background: var(--cellule-bord); border-radius: 1px; opacity: 0.75; }

.suite { margin: 2.4rem 0 0; font-size: 0.95rem; }
.suite a { color: var(--gris); }
.suite a:hover { color: var(--blanc); }

/* Page d'une salle */
.salle-page, .page-axe { text-align: center; }
.salle-page > .carton { padding-top: clamp(4rem, 14vh, 8rem); margin-bottom: 0; }
.salle-page > .carton .carton-titre { font-size: clamp(3.4rem, 12vw, 6rem); }
.bloc { padding-block: var(--respiration) 0; }
.titre-section {
  margin: 0 0 2.6rem;
  font-family: var(--texte); font-weight: 600; font-stretch: 87.5%;
  font-size: 0.82rem; letter-spacing: 0.32em; text-transform: uppercase; color: var(--blanc);
}
.titre-section-2 { margin-top: 4.5rem; }

.joueurs { list-style: none; margin: 0 auto; padding: 0; display: grid; gap: clamp(4rem, 12vh, 7rem); max-width: 46rem; }
.joueur-nom {
  margin: 0 0 1.4rem;
  font-family: var(--titre); font-weight: 400; font-stretch: 100%;
  font-size: clamp(2.2rem, 6vw, 3.4rem); line-height: 1; letter-spacing: 0.05em; text-transform: uppercase;
}
.credits-joueur { gap: 0.45rem; }
.joueur-venue { margin: 1.3rem auto 0; max-width: 34rem; font-size: 0.88rem; color: var(--gris); text-wrap: balance; }
.joueur-venue a { color: var(--blanc); text-decoration-color: var(--trait); }

.note { max-width: 34rem; margin: 2rem auto 0; font-size: 0.9rem; color: var(--gris); text-align: center; text-wrap: pretty; }

/* Scène post-générique : l'ambre, ce qu'on emporte. */
.post-generique, .fin { padding-block: var(--respiration) 30vh; text-align: center; }
.actions-emporter { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 1rem; margin: 0; }
.emporter {
  display: inline-flex; align-items: baseline; gap: 0.7rem;
  padding: 1rem 1.6rem; border: 1px solid var(--ambre); color: var(--ambre); text-decoration: none;
  font-stretch: 87.5%; font-size: 0.82rem; letter-spacing: 0.18em; text-transform: uppercase;
  transition: background-color 0.25s cubic-bezier(0.16, 1, 0.3, 1), color 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.emporter:hover { background: var(--ambre); color: var(--noir); }
.emporter-eteint, .emporter-eteint:hover {
  flex-direction: column; align-items: center; gap: 0.3rem;
  border-color: transparent; color: var(--gris); background: transparent; cursor: default;
}
.emporter:focus-visible { outline-color: var(--ambre); }
.poids { font-size: 0.72rem; letter-spacing: 0.1em; opacity: 0.8; }

.mot-fin {
  margin: var(--respiration) 0 0;
  font-family: var(--titre); font-stretch: 100%; font-size: clamp(4rem, 14vw, 6rem); letter-spacing: 0.3em;
  text-transform: uppercase; color: var(--blanc); padding-left: 0.3em;
}

/* Le calendrier : une bande par serveur, les périodes communes se chevauchent. */
.frise { padding-block: var(--respiration) 0; text-align: center; }
.frise .note { margin-top: -1.2rem; margin-bottom: 2.6rem; }
.frise-cadre { max-width: 68rem; margin: 0 auto; padding-inline: 0.5rem; }
.frise-cumul { position: relative; height: 1.1rem; margin-bottom: 1.4rem; }
.frise-cumul span { position: absolute; left: var(--g); width: var(--l); min-width: 0.4rem; top: 0; bottom: 0; background: rgb(236 235 230 / 0.2); }
.frise-cumul span.vivante { background: rgb(89 242 122 / 0.28); }
.frise-bandes { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.bande { position: relative; height: 2.1rem; }
.bande a {
  position: absolute; left: var(--g); width: var(--l); min-width: 0.5rem; top: 0; bottom: 0;
  text-decoration: none;
}
.bande a::before {
  content: ""; position: absolute; inset: 0; background: rgb(236 235 230 / 0.13);
  transition: background-color 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.bande a:hover::before { background: rgb(236 235 230 / 0.26); }
.bande span {
  position: absolute; left: 0.6rem; top: 50%; transform: translateY(-50%); white-space: nowrap;
  font-stretch: 87.5%; font-size: 0.74rem; letter-spacing: 0.12em; text-transform: uppercase;
}
.bande-vivante a::before { background: linear-gradient(90deg, rgb(89 242 122 / 0.16), rgb(89 242 122 / 0.32)); }
.bande-vivante span { color: var(--vert); }
.bande-debut-inconnu a::before { -webkit-mask-image: linear-gradient(90deg, transparent, #000 70%); mask-image: linear-gradient(90deg, transparent, #000 70%); }
.bande-a-droite span { left: auto; right: 0.6rem; }
/* Bande trop courte pour son nom : le nom s'accroche juste après (ou avant, près du bord droit). */
.bande-courte span { left: calc(100% + 0.6rem); right: auto; color: var(--gris); }
.bande-courte.bande-a-droite span { left: auto; right: calc(100% + 0.6rem); }
.bande-courte.bande-vivante span { color: var(--vert); }
.frise-cadre { overflow-x: clip; }
.frise-mois { list-style: none; margin: 0.8rem 0 0; padding: 0.55rem 0 0; position: relative; height: 2rem; border-top: 1px solid var(--trait); }
.frise-mois li {
  position: absolute; left: var(--g); transform: translateX(-50%);
  font-size: 0.72rem; letter-spacing: 0.1em; color: var(--gris); text-transform: uppercase; white-space: nowrap;
}
.frise-mois li.premier { transform: none; }
.frise-mois li.dernier { transform: translateX(-100%); }

/* La lumière se gagne : chaque ligne s'allume en entrant dans l'image. Visible par défaut. */
@supports (animation-timeline: view()) {
  .credit, .carton, .joueur-nom, .actions-emporter {
    animation: allumage linear both;
    animation-timeline: view();
    animation-range: entry 0% cover 32%;
  }
  @keyframes allumage {
    from { opacity: 0.18; filter: blur(2px); }
    to { opacity: 1; filter: blur(0); }
  }
}

@media (prefers-reduced-motion: reduce) {
  .credit, .carton, .joueur-nom, .actions-emporter { animation: none !important; }
  .lancer[data-lancer] { display: none; }
  .ouverture-actions .ou { font-size: 0.95rem; }
  .ou-avec-bouton { display: none; }
  .ou-seul { display: inline; }
}

/* Téléphone : la ligne de générique se replie, rôle au-dessus, valeur dessous. */
@media (max-width: 34rem) {
  body { font-size: 1rem; }
  .bandeau { font-size: 0.72rem; letter-spacing: 0.08em; padding-inline: 1rem; }
  .bandeau-nom { white-space: nowrap; }
  .bandeau nav { gap: 1rem; }
  .bandeau .long { display: none; }
  .credit { grid-template-columns: 1fr; text-align: center; gap: 0.15rem; }
  .credit::before { display: none; }
  .credit dt, .credit dd { grid-column: 1; grid-row: auto; text-align: center; }
  .credits { gap: 1.1rem; }
  .credit-nom dt { font-size: 1.6rem; }
  /* Le calendrier : un mois sur deux, le nom au-dessus, la bande en trait fin dessous. */
  .frise-mois li:nth-child(odd) { display: none; }
  /* Le mois en cours reste au bout de l'axe ; son voisin lui laisse la place. */
  .frise-mois li.dernier { display: block; }
  .frise-mois li:has(+ li.dernier) { display: none; }
  .bande { height: auto; padding-bottom: 0.85rem; }
  .bande a { position: static; display: block; }
  .bande a::before { inset: auto; left: var(--g); width: max(var(--l), 0.5rem); bottom: 0; height: 0.45rem; }
  .bande span, .bande-a-droite span, .bande-courte span, .bande-courte.bande-a-droite span { position: static; transform: none; display: block; text-align: left; font-size: 0.72rem; letter-spacing: 0.08em; }

}
