/* Aptos : dépose les fichiers de la police dans le dossier fonts/
   (Aptos.ttf, Aptos-Bold.ttf). Sinon, la version installée sur l'ordinateur est utilisée. */
@font-face { font-family: "Aptos"; font-weight: 400; font-display: swap;
  src: local("Aptos"), url("fonts/Aptos.woff2") format("woff2"), url("fonts/Aptos.ttf") format("truetype"); }
@font-face { font-family: "Aptos"; font-weight: 700; font-display: swap;
  src: local("Aptos Bold"), local("Aptos-Bold"), url("fonts/Aptos-Bold.woff2") format("woff2"), url("fonts/Aptos-Bold.ttf") format("truetype"); }

:root {
  --bg: #fff;
  --fg: #111;
  --muted: #777;
  --line: #111;
  --gap: 14px;
  --font: "Aptos", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; }
body { background: var(--bg); color: var(--fg); font-family: var(--font); }
a { color: inherit; text-decoration: none; }
img { display: block; width: 100%; height: auto; }

/* ---------- Header ---------- */
.top {
  position: fixed; inset: 0 0 auto 0; z-index: 20;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 10px 16px; background: var(--bg);
}
.logo { display: block; width: fit-content; }
.logo img { height: 34px; width: auto; mix-blend-mode: multiply; transition: transform .3s; }
.logo:hover img { transform: rotate(-4deg); }
.about-link { justify-self: end; font-size: 13px; letter-spacing: .03em; }
.about-link:hover, .about-link.active { text-decoration: underline; text-underline-offset: 3px; }

.filters { display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; }
.filters button {
  font: 400 11px/1 var(--font); letter-spacing: .02em;
  padding: 3px 9px; border: 1px solid var(--line); border-radius: 20px;
  background: transparent; color: var(--fg); cursor: pointer; transition: background .15s, color .15s;
}
.filters button:hover, .filters button.on { background: var(--fg); color: var(--bg); }

main { padding: 64px 16px 40px; }

/* ---------- Grille (masonry) ---------- */
.grid { display: flex; gap: var(--gap); align-items: flex-start; }
.grid .col { flex: 1; min-width: 0; }
.card { margin-bottom: 22px; display: block; cursor: pointer; }
.card .thumb { overflow: hidden; background: #eee; }
.card .thumb img { transition: transform .5s ease; }
.card:hover .thumb img { transform: scale(1.025); }
.card .caption { font: 400 12px/1.3 var(--font); margin-top: 6px; }
.card .caption .meta { color: var(--muted); }
.card.hide { display: none; }
.card { animation: fade .5s both; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } }

/* Projet mis en avant tout en haut */
.hero { margin-bottom: 30px; cursor: pointer; display: block; }
.hero img { max-height: calc(100vh - 90px); object-fit: cover; }
.hero .caption { font: 400 12px/1.3 var(--font); margin-top: 6px; }

/* ---------- Page projet ---------- */
.project { position: fixed; inset: 0; z-index: 30; background: var(--bg); display: flex; flex-direction: column; }
.project .bar {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 10px 16px; font: 400 12px/1.2 var(--font);
}
.project .bar > :last-child { justify-self: end; }
.project .bar button { font: inherit; text-transform: inherit; letter-spacing: inherit; background: none; border: 0; cursor: pointer; color: inherit; }
.project .bar a:hover, .project .bar button:hover { text-decoration: underline; }

.slides {
  flex: 1; display: flex; gap: 8px; overflow-x: auto; overflow-y: hidden;
  padding: 0 16px; scroll-snap-type: x mandatory; scrollbar-width: none;
  overscroll-behavior-x: contain;
}
.slides::-webkit-scrollbar { display: none; }
.slides img { height: 100%; width: auto; flex: none; scroll-snap-align: center; scroll-snap-stop: always; object-fit: contain; cursor: pointer; }
.project .bar-end { justify-self: end; display: flex; gap: 14px; align-items: center; }
.project .count { color: var(--muted); font-variant-numeric: tabular-nums; }

.infos {
  position: absolute; right: 16px; bottom: 40px; width: min(420px, calc(100% - 32px));
  background: var(--bg); border: 1px solid var(--line); padding: 16px;
  font: 400 12px/1.5 var(--font); transform: translateY(20px); opacity: 0; pointer-events: none; transition: .25s;
}
.infos.open { transform: none; opacity: 1; pointer-events: auto; }
.infos dl { display: grid; grid-template-columns: 90px 1fr; gap: 4px 10px; margin-top: 12px; font-size: 10px; }
.infos dt { color: var(--muted); text-transform: uppercase; }

/* ---------- À propos ---------- */
.about { max-width: 1100px; display: grid; grid-template-columns: 2fr 1fr; gap: 40px; padding-top: 30px; }
.about .bio { font: 400 clamp(22px, 2.6vw, 36px)/1.2 var(--font); letter-spacing: -.01em; }
.about .bio p + p { margin-top: .8em; }
.about aside { font: 400 13px/1.5 var(--font); }
.about aside h2 { font: inherit; text-transform: uppercase; color: var(--muted); margin: 0 0 6px; }
.about aside section + section { margin-top: 24px; }
.about aside a { text-decoration: underline; text-underline-offset: 2px; }
.about .about-photo { margin-top: 28px; }

/* ---------- Now playing ---------- */
#nowplaying {
  position: fixed; right: 16px; bottom: 16px; z-index: 25;
  display: flex; align-items: center; gap: 10px; max-width: 280px;
  padding: 6px 12px 6px 6px; background: var(--bg); border: 1px solid var(--line); border-radius: 4px;
  font: 400 11px/1.3 var(--font);
}
#nowplaying[hidden] { display: none; }
#nowplaying img, #nowplaying .np-cover { width: 42px; height: 42px; flex: none; object-fit: cover; background: #ddd; }
#nowplaying { flex-wrap: wrap; width: 230px; padding: 6px; }
#nowplaying .np-gif { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
#nowplaying .np-text { flex: 1; }
#nowplaying .np-text { display: flex; flex-direction: column; min-width: 0; }
#nowplaying .np-title, #nowplaying .np-artist { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#nowplaying .np-artist, #nowplaying .np-status { color: var(--muted); }
#nowplaying .np-status { display: flex; align-items: center; gap: 5px; font-size: 10px; margin-bottom: 1px; }
#nowplaying .np-status i { width: 6px; height: 6px; border-radius: 50%; background: #1db954; animation: np-blink 1.4s infinite; }
#nowplaying:hover .np-title { text-decoration: underline; text-underline-offset: 2px; }
@keyframes np-blink { 50% { opacity: .25; } }
body.on-project #nowplaying { display: none; }
@media (max-width: 760px) {
  #nowplaying { right: 10px; bottom: 10px; width: 120px; padding: 4px; gap: 6px; font-size: 9px; }
  #nowplaying img, #nowplaying .np-cover { width: 26px; height: 26px; }
  #nowplaying .np-status { font-size: 8px; }
  #nowplaying .np-artist { display: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  .grid { --gap: 10px; }
  .top { grid-template-columns: auto 1fr; row-gap: 8px; }
  .filters { grid-column: 1 / -1; grid-row: 2; justify-content: flex-start; }
  main { padding-top: 92px; }
  .about { grid-template-columns: 1fr; }
  .slides { padding: 0 0 8px; gap: 0; }
  .slides img { width: 100vw; padding: 0 16px; box-sizing: border-box; }
}
