/* Pages annuelles : du non-classé à l'album de l'année, le signal monte avec le défilement. */

html { scroll-behavior: smooth; scroll-padding-top: 64px; }

body {
  font-family: "Instrument Sans", "Segoe UI", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

.bar, main { position: relative; z-index: 2; }

h1, h2, h3, p { margin: 0; }

.display {
  font-family: "Anybody", "Arial Narrow", Impact, sans-serif;
}

.mono {
  font-family: "Martian Mono", ui-monospace, Consolas, monospace;
  font-variation-settings: "wdth" 87.5, "wght" 400;
  letter-spacing: .1em;
  text-transform: uppercase;
}

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

em { font-style: italic; }

/* ---------- Barre ---------- */

.bar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  height: 48px;
  background: rgb(6 6 9 / .97);
  border-bottom: 1px solid var(--line);
}

/* Avancée de la lecture */
.bar::after {
  content: "";
  position: absolute;
  inset: auto 0 -1px;
  height: 2px;
  background: var(--ember);
  transform: scaleX(var(--progress, 0));
  transform-origin: left;
}

.brand {
  display: flex;
  align-items: center;
  gap: .6em;
  padding: 0 clamp(12px, 1.2vw, 24px);
  font-size: clamp(14px, 1.25vw, 20px);
  font-variation-settings: "wdth" 104, "wght" 800;
  letter-spacing: -.008em;
  white-space: nowrap;
  transition: color .2s;
}

.brand svg {
  flex: none;
  width: 1em;
  height: 1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 3;
  transition: transform .35s var(--ease);
}

.brand:hover, .brand:focus-visible { color: var(--ember); }
.brand:hover svg, .brand:focus-visible svg { transform: translateX(-.25em); }

.brand-short { display: none; }

/* Sélecteur d'années */
.year-toggle {
  display: flex;
  align-items: center;
  gap: .7em;
  padding: 0 clamp(12px, 1.2vw, 20px);
  border: 0;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  background: none;
  color: inherit;
  font-size: 11px;
  letter-spacing: .04em;
  cursor: pointer;
  transition: background-color .2s, color .2s;
}

.year-toggle svg {
  width: 1em;
  height: 1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 3;
  transition: transform .35s var(--ease);
}

.year-toggle:hover, .year-toggle:focus-visible, .year-toggle[aria-expanded="true"] {
  background: var(--ember);
  color: var(--ink);
}

.year-toggle:focus-visible {
  outline: 2px solid var(--bone);
  outline-offset: -2px;
}

.year-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }

/* Panneau : les bandes de la page de garde, en réduction */
.years {
  position: absolute;
  inset: calc(100% + 1px) 0 auto;
  display: flex;
  height: clamp(190px, 30svh, 320px);
  background: var(--ink);
  border-bottom: 1px solid var(--line);
  animation: years-in .4s var(--ease);
}

.years[hidden] { display: none; }

@keyframes years-in {
  from { clip-path: inset(0 0 100% 0); }
  to { clip-path: inset(0); }
}

.years-band {
  position: relative;
  display: flex;
  flex: 1 1 0;
  align-items: flex-end;
  justify-content: center;
  min-width: 0;
  padding-bottom: 12px;
  overflow: hidden;
  font-size: clamp(22px, 3.3vw, 64px);
  font-variation-settings: "wdth" 84, "wght" 620;
  letter-spacing: -.02em;
  line-height: 1;
  transition: flex-grow .35s var(--ease), background-color .2s, color .2s;
}

.years-band + .years-band { border-left: 1px solid var(--line); }

.years-band span {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  white-space: nowrap;
}

.years-band[href]:hover, .years-band[href]:focus-visible { flex-grow: 2.2; }

.years-band[href]:hover:not(.is-current), .years-band[href]:focus-visible:not(.is-current) {
  background: rgb(239 232 219 / .1);
  color: var(--ember);
}

.years-band.is-current {
  background: var(--ember);
  color: var(--ink);
  font-variation-settings: "wdth" 84, "wght" 860;
}

/* Années dont la page n'existe pas encore */
.years-band.is-pending {
  color: transparent;
  -webkit-text-stroke: 1px rgb(239 232 219 / .42);
}

.jump {
  display: flex;
  margin-left: auto;
}

.jump a {
  display: grid;
  place-items: center;
  min-width: clamp(38px, 4.2vw, 72px);
  padding: 0 10px;
  border-left: 1px solid var(--line);
  font-size: 11px;
  letter-spacing: .04em;
  transition: background-color .2s, color .2s;
}

.jump a:hover, .jump a:focus-visible, .jump a.is-current {
  background: var(--ember);
  color: var(--ink);
}

/* ---------- Ouverture ---------- */

.hero {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 58svh;
  padding: clamp(24px, 3vw, 48px) clamp(12px, 1.2vw, 24px) 0;
  overflow: hidden;
}

.hero .mono {
  display: block;
  font-size: clamp(12px, 1.1vw, 18px);
  margin-bottom: .6em;
}

/* Texte ajusté à la largeur disponible par year.js */
[data-fit] {
  display: block;
  white-space: nowrap;
  overflow: hidden;
}

[data-fit] > span { display: inline-block; }

.hero-year {
  font-size: 36vw;
  font-variation-settings: "wdth" 104, "wght" 800;
  line-height: .78;
  letter-spacing: -.02em;
  padding-bottom: .06em;
}

.is-ready .hero-year > span { animation: type-in 1.5s var(--ease) both; }

@keyframes type-in {
  from { opacity: 0; font-variation-settings: "wdth" 50, "wght" 200; }
}

.ruler {
  height: 7px;
  border-bottom: 1px solid var(--line);
  background:
    repeating-linear-gradient(90deg, rgb(239 232 219 / .5) 0 1px, transparent 1px 50px) 0 100% / 100% 7px no-repeat,
    repeating-linear-gradient(90deg, rgb(239 232 219 / .2) 0 1px, transparent 1px 10px) 0 100% / 100% 3px no-repeat;
}

/* ---------- Pochettes ---------- */

.cover {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  background: #0b0b10;
  overflow: hidden;
}

.cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Album sans pochette dans la collection : vignette de remplacement */
.cover--none {
  background:
    repeating-linear-gradient(135deg, transparent 0 9px, rgb(239 232 219 / .07) 9px 10px),
    #0b0b10;
  box-shadow: inset 0 0 0 1px var(--line);
}

.cover--none span {
  max-width: 80%;
  color: transparent;
  -webkit-text-stroke: 1px rgb(239 232 219 / .7);
  font-size: clamp(30px, 5vw, 76px);
  font-variation-settings: "wdth" 90, "wght" 700;
  line-height: 1;
  text-align: center;
}

/* ---------- Liens d'écoute ---------- */

.links {
  display: flex;
  gap: 1px;
}

.links a {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  gap: .6em;
  min-height: 38px;
  padding: 0 .5em;
  background: rgb(239 232 219 / .07);
  font-size: 10px;
  letter-spacing: .06em;
  transition: background-color .2s, color .2s;
}

.links a:hover, .links a:focus-visible {
  background: var(--ember);
  color: var(--ink);
}

.links svg {
  flex: none;
  width: 15px;
  height: 15px;
  fill: currentColor;
}

/* Sur les petites cartes, les icônes suffisent */
.card .links span { display: none; }

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

/* ---------- Premier niveau : 40 albums non classés ---------- */

.unranked {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: rgb(6 6 9 / .9);
}

.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  z-index: 1;
  height: 3px;
  background: var(--ember);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .45s var(--ease);
}

.card:hover::before, .card:focus-within::before { transform: scaleX(1); }

.card .cover img {
  filter: saturate(.72) brightness(.86);
  transition: filter .35s;
}

.card:hover .cover img, .card:focus-within .cover img { filter: none; }

.card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: .25em;
  padding: 14px 14px 16px;
}

.artist {
  font-size: 19px;
  font-variation-settings: "wdth" 92, "wght" 720;
  line-height: 1.12;
}

.album { font-size: 15px; line-height: 1.3; }

.label-name {
  margin-top: .55em;
  font-size: 10px;
  line-height: 1.5;
  color: rgb(239 232 219 / .72);
}

.tags {
  margin-top: .3em;
  margin-bottom: 14px;
  font-size: 13px;
  line-height: 1.4;
  color: rgb(239 232 219 / .72);
}

.card .links { margin-top: auto; }

/* ---------- Deuxième niveau : 10 à 4 ---------- */

.tier { margin-top: clamp(48px, 7vw, 120px); }

.ranked-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
}

.ranked {
  display: grid;
  grid-template-columns: minmax(0, 38%) minmax(0, 1fr);
  gap: clamp(16px, 1.8vw, 32px);
  padding: clamp(16px, 1.8vw, 32px);
  background: rgb(6 6 9 / .92);
}

.ranked .side {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rank {
  display: block;
  color: var(--ember);
  font-size: clamp(64px, 7.5vw, 132px);
  font-variation-settings: "wdth" 100, "wght" 860;
  line-height: .82;
  letter-spacing: -.03em;
}

.js .rank { opacity: 0; }

.js .is-seen .rank { animation: type-in 1.2s var(--ease) forwards; opacity: 1; }

.ranked .artist { margin-top: 12px; font-size: clamp(22px, 2vw, 32px); }
.ranked .album { font-size: clamp(16px, 1.2vw, 19px); }

.prose {
  font-size: 16px;
  hyphens: auto;
  text-wrap: pretty;
}

.ranked .prose { margin-top: 14px; font-size: 15.5px; line-height: 1.58; }

/* ---------- Troisième niveau : 3 et 2 ---------- */

.feature {
  display: grid;
  grid-template-columns: minmax(0, 36%) minmax(0, 1fr);
  gap: clamp(20px, 3vw, 56px);
  padding: clamp(20px, 3vw, 56px);
  background: rgb(6 6 9 / .93);
}

.feature + .feature { margin-top: 1px; }

.feature .side {
  position: sticky;
  top: 72px;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.feature .rank { font-size: clamp(120px, 15vw, 260px); }

.feature .artist {
  margin-top: 14px;
  font-size: clamp(32px, 4vw, 68px);
  line-height: 1;
}

.feature .album { font-size: clamp(19px, 1.7vw, 28px); line-height: 1.2; margin-top: .25em; }

.feature .label-name { font-size: 11px; }

.feature .prose {
  margin-top: 26px;
  max-width: 66ch;
  font-size: 17px;
  line-height: 1.62;
}

.prose p + p { margin-top: 1em; }

/* ---------- Quatrième niveau : l'album de l'année ---------- */

.crown {
  margin-top: clamp(60px, 10vw, 180px);
}

.crown-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: end;
  gap: clamp(16px, 3vw, 56px);
  padding: 0 clamp(12px, 3vw, 56px);
}

.crown .rank {
  font-size: min(44vw, 86svh);
  line-height: .74;
  font-variation-settings: "wdth" 80, "wght" 900;
  margin-left: -.04em;
}

.crown .cover {
  width: min(100%, 76svh);
  margin-left: auto;
  box-shadow: 0 0 0 1px rgb(239 232 219 / .2), 0 0 120px rgb(255 90 31 / .35);
  box-shadow: 0 0 0 1px rgb(239 232 219 / .2), 0 0 120px color-mix(in srgb, var(--ember) 35%, transparent);
}

.crown-title {
  padding: clamp(24px, 3vw, 48px) clamp(12px, 3vw, 56px) clamp(20px, 2.4vw, 40px);
  background: linear-gradient(rgb(6 6 9 / 0), rgb(6 6 9 / .82) 45%, rgb(6 6 9 / .95));
}

.crown .artist {
  font-size: 9vw;
  font-variation-settings: "wdth" 104, "wght" 860;
  line-height: .96;
  letter-spacing: -.02em;
}

.crown .album {
  margin-top: .4em;
  font-size: clamp(22px, 3.2vw, 56px);
  font-variation-settings: "wdth" 96, "wght" 500;
  line-height: 1.05;
}

.crown-body {
  display: grid;
  grid-template-columns: minmax(0, 300px) minmax(0, 72ch);
  justify-content: center;
  gap: clamp(24px, 5vw, 96px);
  padding: clamp(28px, 4vw, 72px) clamp(16px, 3vw, 56px) clamp(64px, 8vw, 140px);
  background: rgb(6 6 9 / .95);
}

.crown-side {
  position: sticky;
  top: 72px;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.crown-side .label-name { margin-top: 0; font-size: 11px; }

.crown-side .links { flex-direction: column; }

.crown .prose { font-size: 18px; line-height: 1.68; }

/* ---------- Écrans moyens ---------- */

@media (max-width: 1400px) {
  .unranked { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 1100px) {
  .ranked-grid { grid-template-columns: minmax(0, 1fr); }
  .feature .rank { font-size: clamp(100px, 18vw, 200px); }
}

/* ---------- Petits écrans ---------- */

@media (max-width: 760px) {
  body { font-size: 16px; }

  .hero { min-height: 34svh; }

  .brand { padding: 0 10px; }
  .brand-full { display: none; }
  .brand-short { display: inline; }

  .year-toggle { padding: 0 8px; font-size: 10px; }

  .years {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    grid-auto-rows: 56px;
    height: auto;
    gap: 1px;
  }

  .years-band {
    align-items: center;
    padding: 0;
    font-size: 22px;
  }

  .years-band + .years-band { border-left: 0; }

  .years-band span {
    writing-mode: horizontal-tb;
    transform: none;
  }

  .jump a { min-width: 32px; padding: 0 5px; font-size: 10px; }

  .unranked { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .card-body { padding: 10px 10px 12px; }
  .artist { font-size: 17px; }
  .album { font-size: 14px; }
  .tags { font-size: 12px; }

  .ranked { grid-template-columns: minmax(0, 1fr); }
  .ranked .side { max-width: 240px; }

  .feature { grid-template-columns: minmax(0, 1fr); }
  .feature .side { position: static; }

  .crown-head { grid-template-columns: minmax(0, 1fr); }
  .crown .rank { font-size: 62vw; }
  .crown .cover { width: 100%; }

  .crown-body { grid-template-columns: minmax(0, 1fr); }
  .crown-side { position: static; }
  .crown-side .links { flex-direction: row; }
  .crown .prose { font-size: 17px; }
}

/* ---------- Mouvement réduit ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .years { animation: none; }
  .years-band, .brand svg, .year-toggle svg { transition: none; }
  .is-ready .hero-year > span { animation: none; }
  .js .rank, .js .is-seen .rank { animation: none; opacity: 1; }
  .card::before, .card .cover img { transition: none; }
}
