/* ============================================================
   CROSSOVER — style.css
   CSS global — toutes les pages
   ============================================================ */

/* ── FONT ── */
@font-face {
  font-family: "Anton";
  src: url("Anton-Regular.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
}

/* ── RESET & VARIABLES ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:           #fff;
  --surface:      #fff;
  --border:       #e0e0e0;
  --text:         #111;
  --muted:        #888;
  --accent:       #111;
  --font:         'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-display: 'Anton', sans-serif;
}

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
}

a { color: inherit; }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #ddd; border-radius: 2px; }

/* ── SITE HEADER ── */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
}

.site-header .inner {
  max-width: 860px;
  margin: 0 auto;
  padding: 1.4rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-header .logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
}

.site-header .logo img {
  height: 40px;
  width: auto;
  display: block;
}

.site-header nav {
  display: flex;
  align-items: center;
  gap: 1.4rem;
}

.site-header nav a {
  font-size: 1.2rem;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s;
  line-height: 1;
}

.site-header nav a:hover { color: var(--text); }
.site-header nav a.active { color: var(--text); }

/* ── BODY OFFSET header fixe ── */
body.has-header { padding-top: 76px; }

/* ── SITE FOOTER ── */
.site-footer {
  padding: 2rem 1.5rem;
  font-size: 0.68rem;
  color: #ccc;
  text-align: center;
  border-top: 1px solid #f0f0f0;
  margin-top: auto;
}

.site-footer a { color: #bbb; text-decoration: none; transition: color 0.15s; }
.site-footer a:hover { color: var(--text); }

/* Sur page-map (overflow:hidden, hauteur 100vh) le footer doit être fixe en bas */
body.page-map .site-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 60;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(6px);
  border-top: 1px solid #f0f0f0;
  margin-top: 0;
}

/* ============================================================
   PAGE — INDEX (sélection artiste)
   ============================================================ */

body.page-index {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 3rem 2rem;
}

body.page-index .wrap { max-width: 860px; margin: 0 auto; width: 100%; }

.site-title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 2.5rem;
  color: var(--muted);
}

/* Alphabet */
.alphabet {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 0.2rem;
  margin-bottom: 3rem;
}

.letter {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.5vw, 3.8rem);
  line-height: 1;
  text-align: center;
  padding: 0.15em 0;
  text-decoration: none;
  color: #111;
  transition: opacity 0.12s;
  cursor: default;
  user-select: none;
}

.letter.available { cursor: pointer; }
.letter.available:hover { opacity: 0.35; }
.letter.active { color: #111; border-bottom: 3px solid #111; }
.letter.unavailable { color: #ddd; pointer-events: none; }

/* Liste artistes */
.artists-header {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--muted);
  margin-bottom: 1rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border);
}

.artists-list { display: flex; flex-direction: column; }

.artist-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 0.55rem 0;
  border-bottom: 1px solid #f5f5f5;
  gap: 1rem;
}
.artist-row:last-child { border-bottom: none; }

.artist-name {
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  letter-spacing: -0.01em;
  transition: opacity 0.15s;
}
.artist-name:hover { opacity: 0.45; }

.artist-count {
  font-size: 0.7rem;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.empty { font-size: 0.8rem; color: var(--muted); padding: 1rem 0; }

/* ============================================================
   PAGE — CHAIN (player automatique)
   ============================================================ */

body.page-chain {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

body.page-chain .wrap { max-width: 640px; width: 100%; text-align: center; }

.label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.start-artist { font-size: 0.9rem; color: var(--muted); margin-bottom: 3rem; }
.artist { font-size: 2.2rem; font-weight: 700; line-height: 1.1; }

.crossover-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--muted);
  margin: 1.2rem 0 0.3rem;
}

.crossover-artist { font-size: 1.4rem; font-weight: 400; color: #333; }

.track-info {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.title { font-size: 1.1rem; font-weight: 700; }
.album { font-size: 0.85rem; color: var(--muted); margin-top: 0.3rem; }
.link  { margin-top: 0.5rem; font-size: 0.8rem; }
.link a { text-decoration: underline; }

.chain-end {
  margin-top: 2rem;
  font-size: 0.85rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.timer-block {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.timer-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.timer-count { font-size: 2rem; font-weight: 700; color: #bbb; transition: color 0.3s; }
.timer-count.urgent { color: var(--text); }
.next-label { font-size: 0.8rem; color: var(--muted); margin-top: 0.5rem; }

.history { margin-top: 3rem; text-align: left; }

.history-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--muted);
  margin-bottom: 0.8rem;
}

.history li {
  font-size: 0.75rem;
  color: var(--muted);
  padding: 0.3rem 0;
  border-bottom: 1px solid #f0f0f0;
  list-style: none;
}

.step-num { color: #bbb; margin-right: 0.5rem; }

/* ============================================================
   PAGE — MAP (graphe explorer)
   ============================================================ */

body.page-map { overflow: hidden; }
html.page-map, body.page-map { width: 100%; height: 100%; }

/* 40px = hauteur approximative du footer fixe sur page-map */
#canvas { position: fixed; top: 0; left: 0; right: 0; bottom: 40px; }

#panel {
  position: fixed;
  right: 0; top: 0; bottom: 0;
  width: 300px;
  background: #fff;
  border-left: 1px solid var(--border);
  padding: 4.5rem 1.5rem 2rem;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 50;
}
#panel.open { transform: translateX(0); }

#panel-close {
  position: absolute;
  top: 1rem; right: 1rem;
  background: none; border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
  padding: 0.25rem;
}
#panel-close:hover { color: var(--text); }

.panel-section { margin-bottom: 1.8rem; }

.panel-label {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.panel-value { font-size: 1rem; font-weight: 700; line-height: 1.3; }

.panel-sub {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.2rem;
  line-height: 1.5;
}

.panel-link {
  display: inline-block;
  margin-top: 0.5rem;
  font-size: 0.72rem;
  text-decoration: underline;
  transition: opacity 0.15s;
}
.panel-link:hover { opacity: 0.5; }

.track-list { display: flex; flex-direction: column; gap: 0.5rem; }

.track-item {
  padding: 0.7rem 0.75rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 2px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.track-item:hover { background: #f5f5f5; border-color: #bbb; }
.track-item .t-title { font-size: 0.82rem; font-weight: 600; }
.track-item .t-album { font-size: 0.72rem; color: var(--muted); margin-top: 0.15rem; }
.track-item .t-link  { font-size: 0.68rem; margin-top: 0.25rem; text-decoration: underline; }

#intro {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 10;
}
#intro.hidden { opacity: 0; pointer-events: none; transition: opacity 0.5s; }
#intro p {
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 0.75rem;
}

#tooltip {
  position: fixed;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 0.4rem 0.7rem;
  font-size: 0.72rem;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 300;
  max-width: 200px;
  line-height: 1.4;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}
#tooltip.show { opacity: 1; }

#counter {
  position: fixed;
  bottom: 1.2rem;
  left: 1.5rem;
  font-size: 0.65rem;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  z-index: 50;
}
#counter span { font-weight: 700; color: var(--text); }

#legend {
  position: fixed;
  bottom: 1.2rem;
  right: 1.5rem;
  z-index: 50;
  display: none;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.25rem;
}
#legend.visible { display: flex; }
#legend-gradient {
  width: 90px;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(to right,
    rgb(190,190,190),
    rgb(30,30,30)
  );
}
#legend-labels {
  display: flex;
  justify-content: space-between;
  width: 90px;
  font-size: 0.58rem;
  color: var(--muted);
  letter-spacing: 0.05em;
}
#legend-title {
  font-size: 0.58rem;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ============================================================
   PAGE — STATS
   ============================================================ */

body.page-stats { padding: 3rem 2rem; }

body.page-stats .wrap { max-width: 720px; margin: 0 auto; }

body.page-stats h1 {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.3rem;
}

.subtitle { font-size: 0.8rem; color: var(--muted); margin-bottom: 3rem; }

.kpis { display: flex; gap: 2rem; margin-bottom: 3.5rem; flex-wrap: wrap; }
.kpi  { flex: 1; min-width: 120px; }
.kpi-val { font-size: 2.2rem; font-weight: 700; line-height: 1; }
.kpi-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-top: 0.4rem;
}

.section { margin-bottom: 3rem; }
.section-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--muted);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.bar-list { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; }
.bar-list li { display: flex; align-items: center; gap: 0.75rem; font-size: 0.8rem; }

.bar-label {
  width: 260px;
  flex-shrink: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #333;
}

.bar-wrap { flex: 1; background: #f0f0f0; height: 6px; border-radius: 3px; overflow: hidden; }
.bar-fill  { display: block; height: 100%; background: var(--text); border-radius: 3px; }
.bar-val   { width: 40px; text-align: right; color: var(--muted); font-size: 0.75rem; flex-shrink: 0; }
