:root { color-scheme: dark; }
* { margin:0; padding:0; box-sizing: border-box; }
html, body { height:100%; background:#000; color:#ddd;
             font-family: ui-monospace, "SF Mono", monospace;
             overflow: hidden; user-select: none; }

header {
  position: fixed; top: 0; left: 0; right: 0;
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 24px; z-index: 10;
  font-size: 11px; letter-spacing: 4px; color: #555;
}
.back {
  color: #888; text-decoration: none; font-size: 18px; line-height: 1;
  padding: 6px 12px; border: 1px solid #1a1a1a;
  background: rgba(0,0,0,0.6);
  transition: color .25s, border-color .25s;
}
.back:hover { color: #fff; border-color: #888; }
.view-toggle a, .view-toggle span {
  font-size: 11px; letter-spacing: 4px;
  color: #555; text-decoration: none;
  padding: 0 10px; transition: color .25s;
}
.view-toggle .active { color: #fff; }
.view-toggle a:hover { color: #aaa; }
.view-toggle .sep { color: #222; padding: 0; }

#hint {
  position: fixed; left: 50%; bottom: 14px; transform: translateX(-50%);
  font-size: 10px; letter-spacing: 4px; color: #333; z-index: 5;
}

#zoom {
  position: fixed; right: 16px; bottom: 16px; z-index: 6;
  display: flex; gap: 6px;
}
#zoom button {
  width: 32px; height: 32px;
  background: rgba(0,0,0,0.7);
  border: 1px solid #1a1a1a;
  color: #888; cursor: pointer;
  font-family: ui-monospace, monospace;
  font-size: 18px; line-height: 1;
  transition: color .2s, border-color .2s;
}
#zoom button:hover { color: #fff; border-color: #555; }

#timeline {
  position: fixed; inset: 0;
  cursor: grab;
}
#timeline.grabbing { cursor: grabbing; }

#track {
  position: absolute; top: 0; bottom: 0; left: 0;
  /* width set by JS */
  /* transform: translateX(...) controlled by JS */
  will-change: transform;
}

.axis {
  position: absolute;
  bottom: 22%; left: 0; right: 0;
  height: 1px; background: #1f1f1f;
}

.years { position: absolute; inset: 0; }
.year {
  position: absolute;
  bottom: 14%;
  font-size: 11px; letter-spacing: 5px; color: #555;
  transform: translateX(-50%);
  pointer-events: none;
}
.year::before {
  content: '';
  position: absolute;
  left: 50%; bottom: 100%;
  transform: translateX(-50%);
  width: 1px; height: 14px; background: #2a2a2a;
  margin-bottom: 8px;
}

.cards { position: absolute; inset: 0; }

.card {
  position: absolute;
  width: 90px;
  padding: 0;
  background: #060606;
  border: 1px solid #181818;
  border-left: 2px solid var(--family-color);
  text-decoration: none;
  color: #ddd;
  transition: transform .25s, border-color .25s, background .25s, box-shadow .25s;
  cursor: pointer;
  box-shadow: 0 0 0 transparent;
}
.card-thumb {
  overflow: hidden; /* l'image reste dans son cadre, mais la tige peut sortir */
}
.card:hover {
  transform: translateY(-6px);
  border-color: var(--family-color);
  background: #0c0c0c;
  box-shadow: 0 14px 40px -10px var(--family-color);
}
.card.f0 { --family-color: #d4a778; }
.card.f1 { --family-color: #6cd4e0; }
.card.f2 { --family-color: #e070c8; }
.card.f3 { --family-color: #80c878; }

.card-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #050505 center / cover no-repeat;
}
.card-thumb.no-image {
  display: grid; place-items: center;
  color: #2a2a2a; font-size: 28px;
}

.card-body { padding: 5px 6px 6px; }
.card-meta {
  font-size: 8px; letter-spacing: 1px; text-transform: lowercase;
  color: var(--family-color); margin-bottom: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.card-title {
  font-size: 9px; font-weight: 700; color: #f4f1e8;
  line-height: 1.15;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* tige reliant la carte à l'axe (height inline depuis JS) */
.stem-line {
  position: absolute;
  top: 100%; left: 50%;
  transform: translateX(-50%);
  width: 1px; background: #2a2a2a;
  transition: background .25s;
}
.card:hover .stem-line { background: var(--family-color); }
.card::before {
  content: '';
  position: absolute;
  bottom: -7px; left: 50%;
  transform: translateX(-50%);
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--family-color);
  z-index: 1;
}

/* empty state */
.empty {
  position: fixed; inset: 0; display: grid; place-items: center;
  color: #444; font-size: 11px; letter-spacing: 5px;
}
