@font-face {
  font-family: "Inter Tight";
  src: url("polices/inter-tight.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* fond retenu : bleu de nuit */
:root {
  --g1: #1d3a4d;
  --g2: #14293a;
  --g3: #0d1b28;
  --ink: #eef3f7;
  --puce: rgba(255,255,255,.18);
}

html, body { height: 100%; overflow: hidden; }

body {
  background: radial-gradient(90% 70% at 40% 59%, var(--g1) 0%, var(--g2) 47%, var(--g3) 100%);
  font: 13px/1.5 "Inter Tight", ui-sans-serif, -apple-system, "Helvetica Neue", sans-serif;
  color: var(--ink);
  cursor: default;
  -webkit-font-smoothing: antialiased;
}

#stage {
  position: fixed;
  inset: 0;
  /* la perspective est posée par js/camera.js, pour que le rendu et la
     projection calculée ne puissent pas diverger */
  perspective-origin: 50% 46%;
  overflow: hidden;
}

#world {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
  transform-style: preserve-3d;
  will-change: transform;
}

/* ---- une pochette 33 tours ---- */

.disc {
  position: absolute;
  left: 0;
  top: 0;
  transform-style: preserve-3d;
  /* pas de `will-change` : il forcerait 74 calques permanents en mémoire
     graphique, alors que `preserve-3d` fait déjà promouvoir ce qu'il faut */
}

.disc .face {
  position: absolute;
  left: 0;
  top: 0;
  overflow: hidden;
  backface-visibility: hidden;
}

.disc .front img {
  display: block;
  background: #2b3038;   /* évite le flash blanc avant décodage */
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Le carton ne brille pas comme le plastique : juste un voile de lumière
   rasante, et l'ombre du pli côté dos. */
.disc .front::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(102deg,
      rgba(255,255,255,.10) 0%,
      rgba(255,255,255,0) 26%,
      rgba(0,0,0,.06) 100%),
    linear-gradient(90deg,
      rgba(0,0,0,.22) 0px,
      rgba(0,0,0,.05) 5px,
      rgba(0,0,0,0) 13px);
  pointer-events: none;
}

/* l'arête du carton, et l'ouverture sombre en haut à droite */
.disc .front::before {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid rgba(0,0,0,.30);
  box-shadow: inset -1px 0 0 rgba(255,255,255,.10);
  pointer-events: none;
  z-index: 2;
}

/* Le disque, glissé dans la pochette. Seul le croissant qui dépasse à droite
   est visible : le reste passe derrière la pochette. */
.disc .vinyle {
  border-radius: 50%;
  overflow: visible;
  background:
    repeating-radial-gradient(circle at 50% 50%,
      rgba(255,255,255,.05) 0 1px,
      rgba(255,255,255,0) 1px 3.5px),
    radial-gradient(circle at 34% 30%,
      #46464a 0%, #202024 26%, #121214 58%, #08080a 100%);
  box-shadow: 0 0 0 1px rgba(0,0,0,.55), 0 2px 6px rgba(0,0,0,.35);
}

/* le reflet allongé caractéristique du sillon */
.disc .vinyle::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: linear-gradient(104deg,
    rgba(255,255,255,0) 38%,
    rgba(255,255,255,.16) 47%,
    rgba(255,255,255,.02) 52%,
    rgba(255,255,255,0) 60%);
}

/* la tranche : du carton, pas du plastique */
.disc .spine {
  background: linear-gradient(90deg, #d8d4cd, #b3aea6 55%, #7e7a74);
}

.disc .spine .strip {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: .55;
  filter: saturate(.35) brightness(.78) contrast(.9);
}

.disc .top {
  background: linear-gradient(180deg, #e2ded7, #a9a49c);
  box-shadow: inset 0 -1px 0 rgba(0,0,0,.25);
}

.disc .back {
  background: linear-gradient(160deg, #cdc8c0, #a49f97);
}

/* ---- overlays ---- */

/* ---- l'aide, réduite à une pastille ---- */

#aide {
  position: fixed;
  left: 26px;
  bottom: 26px;
  z-index: 15;
}

#aide-bouton {
  display: grid; place-items: center;
  width: 26px; height: 26px;
  border: 0; padding: 0;
  border-radius: 50%;
  background: var(--puce);
  color: var(--ink);
  font: 600 13px/1 "Inter Tight", ui-sans-serif, sans-serif;
  cursor: help;
  opacity: .55;
  transition: opacity .18s, background .18s;
}
#aide:hover #aide-bouton,
#aide-bouton:focus-visible { opacity: 1; }

#aide-panneau {
  position: absolute;
  left: 0;
  bottom: 34px;
  width: max-content;
  padding: 11px 14px;
  border-radius: 11px;
  background: rgba(28,28,30,.88);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  box-shadow: 0 10px 28px rgba(0,0,0,.26), inset 0 0 0 1px rgba(255,255,255,.09);
  color: #f2f2f4;
  opacity: 0;
  transform: translateY(5px);
  pointer-events: none;
  transition: opacity .18s, transform .18s;
}
#aide:hover #aide-panneau,
#aide.ouvert #aide-panneau,
#aide-bouton:focus-visible + 

#aide-panneau {
  opacity: 1;
  transform: none;
}

#aide-panneau div {
  display: flex;
  gap: 14px;
  align-items: baseline;
  font: 400 11.5px/1.85 "Inter Tight", ui-sans-serif, sans-serif;
}
#aide-panneau b {
  min-width: 104px;
  font: 500 11px/1.85 ui-monospace, monospace;
  opacity: .55;
}

#readout {
  position: fixed;
  left: 30px;
  top: 26px;
  z-index: 10;
  max-width: 420px;   /* en pixels : en `ch`, le bloc rétrécirait avec la police */
  font-family: "Inter Tight", ui-sans-serif, -apple-system, sans-serif;
  color: var(--ink);
}

#readout .sur {
  display: block;
  font: 600 10px/1 "Inter Tight", ui-sans-serif, sans-serif;
  text-transform: uppercase;
  letter-spacing: .17em;
  opacity: .42;
  margin-bottom: 11px;
}

/* deux lignes, jamais plus : au-delà, le bandeau écrase la pile */
#readout .titre {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  /* Une seule taille pour tous les titres. 33 px dans un bloc de 420 :
     mesuré sur les 37 albums, aucun ne dépasse deux lignes.
     L'interligne doit rester à 1,2 : en dessous, la boîte d'une ligne est
     plus courte que les glyphes (36 px contre 38) et `overflow: hidden`
     rogne jambages et accents. */
  font: 600 33px/1.2 "Inter Tight", ui-sans-serif, sans-serif;
  letter-spacing: -.028em;
  text-wrap: balance;
}

#readout .sous {
  display: block;
  width: max-content;
  max-width: 34ch;
  margin-top: 9px;
  font: 400 13.5px/1.35 "Inter Tight", ui-sans-serif, sans-serif;
  opacity: .5;
}

@media (max-width: 520px) {
  #readout { left: 18px; top: 18px; max-width: 62vw; }
  #readout .titre { font-size: 27px; }
}


/* ---- le lecteur ---- */

/* ---- le lecteur ---- */

/* `display: block` l'emporterait sur la règle du navigateur pour [hidden] :
   il faut le dire explicitement. */
#lecteur[hidden] { display: none; }

#lecteur {
  position: fixed;
  right: 26px;
  bottom: 26px;
  z-index: 20;
  /* ferré en bas à droite : la poignée est donc en haut à gauche, et
     tirer vers le haut-gauche agrandit. La taille est mémorisée. */
  width: var(--taille, 208px);
  user-select: none;
  animation: lecteur-entree .44s cubic-bezier(.18, .92, .28, 1) both;
}

/* il est ferré à droite : il entre et sort par ce bord-là */
#lecteur.sort { animation: lecteur-sortie .3s cubic-bezier(.5, 0, .78, .3) both; }

#lecteur-poignee {
  position: absolute;
  left: -3px; top: -3px;
  z-index: 3;
  display: grid; place-items: center;
  width: 26px; height: 26px;
  border-radius: 50%;
  color: #fff;
  background: rgba(50,45,42,.86);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.16);
  cursor: nwse-resize;
  opacity: 0;
  transform: rotate(90deg) scale(.85);
  transition: opacity .18s, transform .18s;
}
#lecteur:hover #lecteur-poignee,
#lecteur-poignee:active { opacity: 1; transform: rotate(90deg) scale(1); }
#lecteur-poignee svg { width: 11px; height: 11px; }

@keyframes lecteur-entree {
  from { opacity: 0; transform: translateX(calc(100% + 34px)); }
  to   { opacity: 1; transform: none; }
}

@keyframes lecteur-sortie {
  from { opacity: 1; transform: none; }
  to   { opacity: 0; transform: translateX(calc(100% + 34px)); }
}

/* le cadre épais et sombre de la référence */
.cadre {
  position: relative;
  aspect-ratio: 1;
  border-radius: 26px;
  overflow: hidden;
  background: #2a2624;
  border: 7px solid #322d2a;
  box-shadow:
    0 26px 60px rgba(0,0,0,.34),
    0 6px 16px rgba(0,0,0,.22),
    inset 0 0 0 1px rgba(255,255,255,.07);
  color: #fff;
}

#lecteur-fond {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}

/* la jaquette est un fond, pas une illustration : on la voile pour que
   les commandes restent lisibles quelle que soit la pochette */
.voile {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(0,0,0,.42) 0%, rgba(0,0,0,0) 26%,
                            rgba(0,0,0,0) 46%, rgba(0,0,0,.62) 100%),
    rgba(0,0,0,.10);
}

.haut, .bas {
  position: absolute;
  left: 12px; right: 12px;
  display: flex;
}
.haut { top: 10px; gap: 6px; align-items: center; }
.bas  { bottom: 14px; flex-direction: column; gap: 9px; }

/* la pastille d'identité */
.pastille {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 4px;
  border-radius: 999px;
  background: rgba(60,58,56,.55);
  backdrop-filter: blur(14px) saturate(1.5);
  -webkit-backdrop-filter: blur(14px) saturate(1.5);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.10);
}

#lecteur-vignette {
  width: 24px; height: 24px;
  border-radius: 50%;
  object-fit: cover;
  flex: none;
  background: #4a4744;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.18);
}
/* le disque tourne pendant la lecture */
#lecteur.joue #lecteur-vignette { animation: tourne 4.5s linear infinite; }
@keyframes tourne { to { transform: rotate(360deg); } }

.pastille span { min-width: 0; }
.pastille b {
  display: block;
  font: 600 11px/1.25 "Inter Tight", ui-sans-serif, sans-serif;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pastille i {
  display: block;
  font: 400 10px/1.25 "Inter Tight", ui-sans-serif, sans-serif;
  font-style: normal;
  opacity: .62;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* les deux boutons ronds en haut à droite */
.rond {
  flex: none;
  display: grid; place-items: center;
  width: 30px; height: 30px;
  border: 0; padding: 0;
  border-radius: 50%;
  background: rgba(60,58,56,.55);
  backdrop-filter: blur(14px) saturate(1.5);
  -webkit-backdrop-filter: blur(14px) saturate(1.5);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.10);
  color: #fff;
  cursor: pointer;
  transition: background .15s, transform .12s;
}
.rond:hover { background: rgba(90,88,86,.68); }
.rond:active { transform: scale(.93); }
.rond svg { width: 14px; height: 14px; }

.temps {
  display: flex;
  justify-content: space-between;
  padding: 0 4px;
  font: 500 10.5px/1 "Inter Tight", ui-sans-serif, sans-serif;
  font-variant-numeric: tabular-nums;
  opacity: .92;
  text-shadow: 0 1px 3px rgba(0,0,0,.5);
}

#lecteur-jauge {
  height: 14px;                 /* zone de clic confortable */
  display: flex; align-items: center;
  cursor: pointer;
}
#lecteur-jauge::before {
  content: "";
  position: absolute;
  left: 4px; right: 4px;
  height: 3px;
  border-radius: 2px;
  background: rgba(255,255,255,.34);
}
#lecteur-jauge i {
  position: relative;
  height: 3px;
  width: 0;
  margin: 0 4px;
  border-radius: 2px;
  background: #fff;
  box-shadow: 0 0 6px rgba(255,255,255,.45);
}

.transport {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 18px;
  margin-top: 2px;
}
.transport button {
  display: grid; place-items: center;
  width: 36px; height: 36px;
  border: 0; padding: 0;
  border-radius: 50%;
  background: rgba(255,255,255,.09);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #fff;
  cursor: pointer;
  transition: background .15s, transform .12s;
}
.transport button:hover { background: rgba(255,255,255,.20); }
.transport button:active { transform: scale(.92); }
.transport button svg { width: 18px; height: 18px; fill: currentColor; }

/* pendant la résolution de l'extrait */
#lecteur.chargement #lecteur-jauge i {
  width: 26%;
  animation: glisse 1.1s ease-in-out infinite;
}
@keyframes glisse {
  0%   { transform: translateX(0); }
  50%  { transform: translateX(260%); }
  100% { transform: translateX(0); }
}

@media (max-width: 520px) {
  #lecteur { right: 14px; bottom: 14px; }
}

/* ---- la vignette embarquée ----

   Aperçu du site dans la grille du studio (`?embed=tile`). Personne n'y lit :
   on retire tout le texte — bandeau, aide, lecteur — et il ne reste que la
   pile, que le curseur du visiteur fouille comme ici. */

.embarque #readout,
.embarque #aide,
.embarque #lecteur { display: none; }

.embarque body { cursor: default; }
