/* Base commune aux pages du site : couleurs, typo, grain et barre de navigation.
   css/style.css (les CD) et css/artiste.css (page artistes) s'appuient dessus. */

/* ─── Base ─────────────────────────────────────────────────── */

/* teinte du CD inséré ; déclarée pour pouvoir glisser d'une couleur à l'autre */
@property --accent {
  syntax: "<color>";
  inherits: true;
  initial-value: #ecebe6;
}

:root {
  /* noir-gris : fond, surfaces, texte, nuances */
  --bg: #141414;
  --bg-raised: #1c1c1c;
  --text: #ecebe6;
  --muted: rgba(236, 235, 230, 0.5);
  --faint: rgba(236, 235, 230, 0.14);
  --hover: rgba(236, 235, 230, 0.07);
  --font-heading: "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif;
  --font-label: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --font-body: "Geist", "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(0.32, 0.72, 0, 1);
  --pad: 0.75em;
  --accent: #ecebe6;
  color-scheme: dark;
  transition: --accent 1.4s var(--ease);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  height: 100%;
  scrollbar-width: none;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 450;
  line-height: 1.45;
  letter-spacing: -0.01em;
  /* 1em = 12px sur un écran de 1440px ; jamais en dessous de 12px pour rester lisible */
  font-size: clamp(12px, 100vw / 120, 17px);
  -webkit-font-smoothing: antialiased;
}

@media (max-width: 767px) {
  body { font-size: clamp(12px, 3.4vw, 15px); }
}

p { margin: 0; }

button {
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

a { color: inherit; text-decoration: none; }

:focus-visible {
  outline: 1px solid var(--text);
  outline-offset: 3px;
}

::selection {
  background: var(--text);
  color: var(--bg);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ─── Typo ─────────────────────────────────────────────────── */

.heading-s {
  font-family: var(--font-heading);
  font-stretch: 78%;
  font-weight: 650;
  font-size: 3em;
  line-height: 0.95;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  text-wrap: balance;
}

.heading-xs {
  font-family: var(--font-heading);
  font-stretch: 78%;
  font-weight: 600;
  font-size: 1.75em;
  line-height: 1;
  letter-spacing: -0.015em;
  text-transform: uppercase;
}

/* libellés et compteurs en chasse fixe */
.subheading-xs {
  font-family: var(--font-label);
  font-weight: 400;
  font-size: 0.75em;
  line-height: 1.3;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.paragraph-m {
  font-size: 1.125em;
  line-height: 1.4;
  letter-spacing: -0.02em;
}

.right { text-align: right; }
.center { text-align: center; }

/* Masque des transitions de texte */
.mask {
  display: block;
  overflow: hidden;
  padding-bottom: 0.08em;
  margin-bottom: -0.08em;
}

.mask > * {
  display: block;
  will-change: transform;
}

html:not(.is-ready) .mask > * {
  transform: translateY(110%);
}

/* ─── Grain ────────────────────────────────────────────────── */

.grain {
  position: fixed;
  inset: -1em;
  z-index: 99;
  pointer-events: none;
  opacity: 0.35;
  background-size: 7.8125em;
  background-position: 50%;
  animation: grain 0.6s step-end infinite;
  will-change: transform;
}

@keyframes grain {
  0% { transform: translate(0, 0); }
  20% { transform: translate(-0.5em, 0.3em); }
  40% { transform: translate(0.4em, -0.2em); }
  60% { transform: translate(-0.3em, -0.4em); }
  80% { transform: translate(0.2em, 0.5em); }
}

/* ─── Égaliseur (lecture en cours) ─────────────────────────── */

.eq {
  display: inline-flex;
  align-items: flex-end;
  gap: 0.14em;
  width: 1em;
  height: 0.9em;
}

.eq i {
  flex: 1;
  height: 25%;
  background: var(--accent);
  border-radius: 1px;
}

html.is-playing .eq i { animation: eq 0.9s ease-in-out infinite alternate; }
html.is-playing .eq i:nth-child(2) { animation-delay: -0.45s; animation-duration: 0.7s; }
html.is-playing .eq i:nth-child(3) { animation-delay: -0.2s; animation-duration: 1.1s; }
html.is-playing .eq i:nth-child(4) { animation-delay: -0.6s; animation-duration: 0.8s; }

@keyframes eq {
  from { height: 20%; }
  to { height: 100%; }
}

/* ─── Navigation ───────────────────────────────────────────── */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 130;
  display: flex;
  justify-content: center;
  padding-top: 0.35em;
  pointer-events: none;
}

.nav__list {
  display: flex;
  align-items: center;
  gap: 0.25em;
  margin: 0;
  padding: 0.25em;
  list-style: none;
  border-radius: 999px;
  pointer-events: auto;
}

.nav__item { position: relative; }

/* Entrée au chargement : les éléments descendent un à un, la signature se dévoile, le point se pose */
.nav__list > li { animation: nav-in 0.9s var(--ease) both; }
.nav__list > li:nth-child(2) { animation-delay: 0.22s; }
.nav__list > li:nth-child(3) { animation-delay: 0.29s; }
.nav__list > li:nth-child(4) { animation-delay: 0.36s; }
.nav__list > li:nth-child(5) { animation-delay: 0.43s; }
.nav__list > li:nth-child(6) { animation-delay: 0.5s; }
.nav__list > li:first-child { animation-delay: 0.15s; }
.nav__by { animation: nav-by-in 1.1s var(--ease) 0.6s both; }
.nav__dot { animation: nav-dot-in 0.7s cubic-bezier(0.2, 1.6, 0.4, 1) 0.85s both; }

@keyframes nav-in { from { opacity: 0; translate: 0 -0.9em; } }
@keyframes nav-in-up { from { opacity: 0; translate: 0 0.9em; } }
@keyframes nav-by-in { from { opacity: 0; clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes nav-dot-in { from { scale: 0; } }

.nav__logo {
  display: flex;
  align-items: baseline;
  gap: 0.45em;
  padding: 0.5em 0.9em;
  font-family: var(--font-heading);
  font-stretch: 78%;
  font-weight: 750;
  font-size: 1.35em;
  line-height: 1;
  letter-spacing: -0.02em;
}

/* signature discrète à côté du logo */
.nav__by {
  font-family: var(--font-label);
  font-stretch: normal;
  font-weight: 400;
  font-size: max(10px, 0.42em);
  letter-spacing: 0.04em;
  color: var(--muted);
  transition: color 0.3s var(--ease);
}

.nav__logo:hover .nav__by { color: var(--text); }

.nav__link {
  position: relative;
  display: flex;
  align-items: center;
  padding: 0.55em 0.9em;
  font-size: 1.05em;
  line-height: 1;
  color: var(--muted);
  transition: color 0.3s var(--ease);
}

.nav__link:hover,
.nav__link.is-current,
.nav__link[aria-expanded="true"] {
  color: var(--text);
}

/* trait qui se dessine sous le lien survolé */
.nav__link::after {
  content: "";
  position: absolute;
  left: 0.9em;
  right: 0.9em;
  bottom: 0.25em;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: 100% 50%;
  transition: transform 0.5s var(--ease);
}

.nav__link:not(.is-current):hover::after,
.nav__link[aria-expanded="true"]::after {
  transform: scaleX(1);
  transform-origin: 0 50%;
}

.nav__count {
  margin-left: 0.25em;
  font-size: 0.62em;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.nav__dot {
  position: absolute;
  left: 50%;
  bottom: -0.1em;
  width: 0.3em;
  height: 0.3em;
  margin-left: -0.15em;
  border-radius: 50%;
  background: var(--text);
}

/* ─── Étiquette qui suit la souris (survol d'un CD) ──────────────────────────── */

/* positionnée par le JS (transform) ; « scale » reste libre pour l'apparition */
.cursor {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 140;
  pointer-events: none;
  will-change: transform;
  display: flex;
  align-items: center;
  gap: 0.6em;
  padding: 0.35em 1em 0.35em 0.35em;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  box-shadow: 0 0.6em 1.8em -0.4em rgba(0, 0, 0, 0.6);
  opacity: 0;
  scale: 0.85;
  transform-origin: 0 0;
  transition: opacity 0.25s var(--ease), scale 0.4s var(--ease);
}

.cursor.is-visible {
  opacity: 1;
  scale: 1;
}

.cursor__icon {
  display: grid;
  place-items: center;
  width: 2em;
  height: 2em;
  border-radius: 50%;
  background: var(--bg);
  color: var(--text);
}

.cursor__icon svg { width: 0.8em; height: 0.8em; fill: currentColor; }
.cursor .icon-pause { display: none; }
.cursor.is-pause .icon-pause { display: block; }
.cursor.is-pause .icon-play { display: none; }

.cursor__text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.cursor__action {
  font-family: var(--font-label);
  font-size: 0.7em;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.6;
}

.cursor__title {
  max-width: 16em;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-family: var(--font-heading);
  font-stretch: 78%;
  font-weight: 650;
  font-size: 1.05em;
  text-transform: uppercase;
}

@media (hover: none), (pointer: coarse) {
  .cursor { display: none; }
}

/* ─── Bannière cookies (js/consent.js) ─────────────────────── */

.consent {
  position: fixed;
  right: var(--pad);
  bottom: var(--pad);
  z-index: 160;
  display: flex;
  flex-direction: column;
  gap: 0.8em;
  width: min(25em, calc(100vw - 2 * var(--pad)));
  padding: 1.1em 1.15em 1.15em;
  border-radius: 1.1em;
  background: var(--bg-raised);
  box-shadow: inset 0 0 0 0.5px var(--faint), 0 2em 4em -1em rgba(0, 0, 0, 0.8);
  opacity: 0;
  translate: 0 1em;
  visibility: hidden;
  transition: opacity 0.4s var(--ease), translate 0.6s var(--ease), visibility 0s 0.4s;
}

.consent.is-open {
  opacity: 1;
  translate: 0 0;
  visibility: visible;
  transition: opacity 0.4s var(--ease), translate 0.6s var(--ease), visibility 0s;
}

.consent__label { display: flex; align-items: center; gap: 0.6em; color: var(--muted); }

.consent__dot {
  width: 0.45em;
  height: 0.45em;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0.6em var(--accent);
}

.consent__text { font-size: 0.95em; line-height: 1.45; color: var(--muted); text-wrap: pretty; }

.consent__text a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--faint);
  text-underline-offset: 0.2em;
}

.consent__text a:hover { text-decoration-color: var(--accent); }

/* deux choix de même poids : refuser est aussi simple qu'accepter */
.consent__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5em;
}

.consent__btn {
  padding: 0.75em 1em;
  border-radius: 999px;
  box-shadow: inset 0 0 0 0.5px rgba(236, 235, 230, 0.35);
  font-family: var(--font-label);
  font-size: 0.78em;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: background-color 0.3s var(--ease), color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.consent__btn:hover,
.consent__btn:focus-visible {
  background: var(--text);
  color: var(--bg);
  box-shadow: inset 0 0 0 0.5px var(--text);
  outline: none;
}

/* ─── Base : petits écrans et mouvement réduit ─────────────── */

@media (max-width: 767px) {
  .consent { bottom: calc(5.4em + env(safe-area-inset-bottom, 0px)); }
  .nav__list > .nav__item:has(.is-current) { display: none; }
  .nav__logo { flex-direction: column; align-items: flex-start; gap: 0.15em; padding: 0.4em 0.7em; }
  .nav__by { font-size: max(9.5px, 0.36em); }
  .nav { top: auto; bottom: 0; padding: 0 0 calc(0.75em + env(safe-area-inset-bottom, 0px)); }
  .nav__list { background: var(--bg-raised); box-shadow: 0 0 0 0.5px var(--faint); animation: nav-in-up 0.9s var(--ease) 0.1s both; }
  .nav__list > li { animation-name: nav-in-up; }
}

@media (prefers-reduced-motion: reduce) {
  .grain { animation: none; }
  .nav__list, .nav__list > li, .nav__by, .nav__dot { animation: none; }
}
