:root {
  --bg: #0c0c0e;
  --surface: #15151a;
  --text: #f4f4f5;
  --muted: #9ca3af;
  --accent: #ffffff;
  --radius: 18px;
  --shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.6);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100%;
}

img { display: block; max-width: 100%; }

/* Header */
.site-header {
  max-width: 1200px;
  margin: 0 auto;
  padding: 80px 24px 24px;
}
.eyebrow {
  font-size: 12px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--muted);
}
.eyebrow.light { color: rgba(255,255,255,0.65); }
.site-header h1 {
  font-size: clamp(40px, 6vw, 72px);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-top: 8px;
}
.lead {
  margin-top: 12px;
  color: var(--muted);
  max-width: 540px;
}

/* Toolbar : recherche + filtres */
.toolbar {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 24px 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
}
.search-wrap {
  position: relative;
  flex: 1 1 260px;
  max-width: 360px;
}
.search-icon {
  position: absolute;
  left: 14px; top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}
#searchInput {
  width: 100%;
  background: var(--surface);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--text);
  padding: 12px 16px 12px 42px;
  border-radius: 999px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}
#searchInput:focus {
  border-color: rgba(255,255,255,0.25);
  background: #1c1c22;
}
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.filter-chip {
  background: var(--surface);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.25s var(--ease);
}
.filter-chip:hover { color: var(--text); border-color: rgba(255,255,255,0.2); }
.filter-chip.is-active {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

.empty-state {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
  color: var(--muted);
  text-align: center;
  font-size: 14px;
}

/* Albums grid */
.albums {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 96px;
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  align-items: start;
}

.album-card {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  border: none;
  padding: 0;
  text-align: left;
  color: inherit;
  font: inherit;
  appearance: none;
  -webkit-appearance: none;
  box-shadow: var(--shadow);
  transform: none;
  vertical-align: top;
  transition: box-shadow 0.5s var(--ease);
}
.album-card:hover { box-shadow: 0 30px 80px -20px rgba(0,0,0,0.8); }

/* Wrapper interne pour le parallax (translate sans toucher à la carte) */
.album-card__media {
  position: absolute; inset: 0;
  overflow: hidden;
  border-radius: inherit;
}
.album-card__media img {
  position: absolute;
  left: 0;
  top: -8%;
  width: 100%;
  height: 116%;
  object-fit: cover;
  will-change: transform;
  transition: transform 1.2s var(--ease);
  --py: 0px;
  --s: 1;
  transform: translateY(var(--py)) scale(var(--s));
}
.album-card:hover .album-card__media img { --s: 1.06; }

.album-card.is-flying .album-card__media img { visibility: hidden; }

.album-card::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.85), rgba(0,0,0,0.1) 55%, transparent);
  pointer-events: none;
}

.album-card__caption {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 24px;
  z-index: 1;
}
.album-card__caption h2 {
  font-size: 24px; font-weight: 600;
  text-shadow: 0 2px 12px rgba(0,0,0,0.5);
}
.album-card__caption p { margin-top: 4px; font-size: 13px; color: rgba(255,255,255,0.7); }

.album-card__pill {
  position: absolute; top: 16px; right: 16px;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #fff;
  font-size: 12px; font-weight: 500;
  padding: 6px 12px;
  border-radius: 999px;
  z-index: 1;
  transition: background 0.3s ease;
}
.album-card:hover .album-card__pill { background: rgba(255,255,255,0.28); }

/* Album overlay */
.album-overlay {
  position: fixed; inset: 0;
  z-index: 40;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s var(--ease), visibility 0.5s;
}
.album-overlay.is-open { opacity: 1; visibility: visible; }

.album-overlay__bg {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.album-overlay__content {
  position: relative;
  height: 100%;
  overflow-y: auto;
}

/* Hero (image agrandie de la couverture) */
.album-hero {
  position: relative;
  width: 100%;
  height: 52vh;
  min-height: 320px;
  overflow: hidden;
}
.album-hero img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transform: scale(1.05);
  transition: transform 8s linear;
}
.album-overlay.is-open .album-hero img { transform: scale(1.18); }

.album-hero__shade {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(12,12,14,1) 0%, rgba(12,12,14,0.4) 50%, rgba(0,0,0,0.5) 100%);
}

.album-overlay__header {
  position: absolute; left: 0; right: 0; bottom: 0;
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}
.album-overlay__header h2 {
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-top: 8px;
  color: #fff;
}
.album-tags {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-top: 12px;
}
.album-tags span {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #fff;
  background: rgba(255,255,255,0.15);
  padding: 4px 10px;
  border-radius: 999px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.btn-close {
  background: rgba(255,255,255,0.15);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 14px;
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: background 0.3s;
  white-space: nowrap;
}
.btn-close:hover { background: rgba(255,255,255,0.28); }

.album-specs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  flex: 1;
}
.spec-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.15);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 14px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  white-space: nowrap;
  transition: background 0.3s;
}
.spec-chip:hover { background: rgba(255,255,255,0.28); }
.spec-chip__label { font-weight: 600; }
.spec-chip__stars { display: inline-flex; gap: 1px; letter-spacing: 1px; }
.spec-star { color: rgba(255,255,255,0.3); font-size: 13px; line-height: 1; }
.spec-star.is-on { color: #ffd24a; text-shadow: 0 0 6px rgba(255,210,74,0.5); }

@media (max-width: 720px) {
  .album-specs { display: none; }
}

/* Masonry */
.masonry {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px 96px;
  column-count: 3;
  column-gap: 16px;
}
@media (max-width: 900px) { .masonry { column-count: 2; } }
@media (max-width: 560px) { .masonry { column-count: 1; } }

.masonry img {
  width: 100%;
  margin-bottom: 16px;
  border-radius: 12px;
  cursor: zoom-in;
  break-inside: avoid;
  opacity: 0;
  transform: translateY(20px);
  transition: transform 0.7s var(--ease);
}
.masonry img:hover { transform: scale(1.02); }

/* FLIP element (carte volante) */
.flip-clone {
  position: fixed;
  z-index: 60;
  overflow: hidden;
  border-radius: var(--radius);
  pointer-events: none;
  box-shadow: 0 40px 100px rgba(0,0,0,0.6);
  will-change: transform, width, height, top, left, border-radius;
}
.flip-clone img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}

/* Lightbox */
.lightbox {
  position: fixed; inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s;
}
.lightbox.is-open { opacity: 1; visibility: visible; }
.lightbox__bg {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.94);
}
.lightbox__stage {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 64px 72px 140px;
  touch-action: pan-y;
}
.lightbox img {
  max-height: 100%;
  max-width: 100%;
  border-radius: 8px;
  box-shadow: 0 40px 100px rgba(0,0,0,0.8);
  transform: scale(0.94);
  transition: transform 0.35s var(--ease), opacity 0.25s ease;
  user-select: none;
  -webkit-user-drag: none;
}
.lightbox.is-open img { transform: scale(1); }
.lightbox img.is-swapping { opacity: 0; transform: scale(0.97); }

.lightbox__close {
  position: absolute;
  top: 20px; right: 20px;
  z-index: 2;
}
.lightbox__counter {
  position: absolute;
  top: 24px; left: 50%;
  transform: translateX(-50%);
  font-size: 13px;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.75);
  background: rgba(255,255,255,0.08);
  padding: 6px 14px;
  border-radius: 999px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 2;
}

.lb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 52px; height: 52px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  border: none;
  color: #fff;
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: background 0.25s, transform 0.25s;
  z-index: 2;
}
.lb-nav:hover { background: rgba(255,255,255,0.22); }
.lb-nav:active { transform: translateY(-50%) scale(0.94); }
.lb-prev { left: 16px; }
.lb-next { right: 16px; }

/* Thumbnails */
.lb-thumbs {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  max-width: calc(100% - 32px);
  display: flex;
  gap: 8px;
  padding: 8px;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.2) transparent;
  background: rgba(255,255,255,0.04);
  border-radius: 14px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 2;
}
.lb-thumbs::-webkit-scrollbar { height: 6px; }
.lb-thumbs::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 4px; }
.lb-thumb {
  flex: 0 0 auto;
  width: 72px; height: 54px;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  opacity: 0.55;
  transition: opacity 0.2s, border-color 0.2s, transform 0.2s;
  background: #000;
  padding: 0;
}
.lb-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lb-thumb:hover { opacity: 0.85; }
.lb-thumb.is-active {
  opacity: 1;
  border-color: #fff;
  transform: translateY(-2px);
}

/* Responsive lightbox */
@media (max-width: 720px) {
  .lightbox__stage { padding: 56px 12px 130px; }
  .lb-nav { width: 44px; height: 44px; font-size: 26px; }
  .lb-prev { left: 6px; }
  .lb-next { right: 6px; }
  .lb-thumb { width: 56px; height: 42px; }
  .album-hero { height: 42vh; min-height: 260px; }
}
@media (max-width: 480px) {
  .lb-thumbs { bottom: 8px; }
  .lightbox__stage { padding: 56px 8px 110px; }
}

body.no-scroll { overflow: hidden; }

@keyframes card-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.album-card {
  opacity: 0;
  animation: card-in 0.55s var(--ease) forwards;
  animation-delay: calc(var(--i, 0) * 60ms);
}
