:root {
  --fond: #2c2c2c;
  --fond-2: #353535;
  --texte: #ffffff;
  --doux: #a7a7a7;
  --trait: rgba(255, 255, 255, .12);
  --vide: rgba(255, 255, 255, .04);
  --marge: clamp(20px, 5vw, 64px);
  --largeur: 1280px;
}
* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--fond);
  color: var(--texte);
  font-family: "Jost", -apple-system, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
h1, h2, h3 { font-weight: 500; margin: 0; }
button, input { font-family: inherit; }
.label { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--doux); margin: 0; }

/* Apparition douce au défilement */
.apparait { opacity: 0; transform: translateY(16px); transition: opacity 1.1s cubic-bezier(.2, .7, .2, 1), transform 1.1s cubic-bezier(.2, .7, .2, 1); }
.apparait.visible { opacity: 1; transform: none; }

/* ---------- Menu ---------- */
.menu {
  position: fixed; top: 0; left: 0; right: 0; z-index: 10;
  display: flex; justify-content: space-between; align-items: center;
  padding: 22px var(--marge);
  background: rgba(44, 44, 44, .88);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  transition: border-color .3s;
  border-bottom: 1px solid transparent;
}
.menu.defile { border-color: var(--trait); }
.menu a { text-decoration: none; font-size: 14px; }
.menu div { display: flex; gap: 28px; }
.menu div a { color: var(--doux); transition: color .4s ease; }
.menu div a:hover { color: var(--texte); }
.menu-nom { font-weight: 500; opacity: 0; transition: opacity .3s; }
.menu.defile .menu-nom { opacity: 1; }

/* ---------- Accueil : nom + portrait ---------- */
.accueil {
  max-width: var(--largeur); margin: 0 auto;
  min-height: 100svh;
  display: grid; grid-template-columns: 1fr 1.3fr; align-items: center; gap: clamp(32px, 6vw, 96px);
  padding: 110px var(--marge) 64px;
}
.accueil h1 { font-family: "Fraunces", Georgia, serif; font-size: clamp(22px, 2.9vw, 44px); font-weight: 600; letter-spacing: -.01em; line-height: 1.1; margin: 0 0 28px; white-space: nowrap; }
.intro { font-size: clamp(17px, 1.5vw, 20px); font-weight: 300; line-height: 1.5; max-width: 30ch; margin: 0 0 40px; }
.accueil-texte { text-align: center; }
.lien-fleche { display: inline-flex; gap: 10px; text-decoration: none; font-size: 19px; border-bottom: 1px solid var(--texte); padding-bottom: 3px; }
.lien-fleche span { transition: transform .3s; }
.lien-fleche:hover span { transform: translateY(3px); }

.portrait { margin: 0; justify-self: end; width: 100%; max-width: 720px; aspect-ratio: 4 / 5; background: var(--vide); overflow: hidden; transition-delay: .15s; }
.portrait img { width: 100%; height: 100%; object-fit: cover; object-position: center 20%; display: block; }
.portrait.vide { display: grid; place-items: center; color: var(--doux); font-size: 13px; }

/* ---------- Sections ---------- */
.section { scroll-margin-top: 40px; max-width: var(--largeur); margin: 0 auto; padding: 40px var(--marge); }
.titre-section {
  display: flex; align-items: baseline; gap: 20px;
  padding-bottom: 18px; margin-bottom: 48px; border-bottom: 1px solid var(--trait);
}
.titre-section h2 { font-size: clamp(22px, 2.5vw, 32px); font-weight: 400; letter-spacing: -.01em; }
.titre-section .label:last-child { margin-left: auto; }

/* ---------- Travaux ---------- */
.grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 300px)); gap: 56px 40px; }
.oeuvre {
  display: block; width: 100%; padding: 0; border: 0; background: none;
  font: inherit; color: inherit; text-align: left; cursor: pointer;
}
.vignette { display: block; position: relative; aspect-ratio: 3 / 4; background: var(--vide); overflow: hidden; }
.vignette img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 1.2s cubic-bezier(.2, .8, .2, 1); }
.vignette .icone { position: absolute; inset: 0; display: grid; place-items: center; color: #5a5a5a; }
.vignette .icone svg { width: 28px; height: 28px; fill: currentColor; }
.oeuvre:hover .vignette img { transform: scale(1.03); }
.oeuvre:focus-visible { outline: 1px solid var(--texte); outline-offset: 6px; }
.legende { display: grid; grid-template-columns: 1fr; gap: 4px 16px; margin-top: 18px; }
.legende .num { font-size: 12px; color: var(--doux); padding-top: 3px; }
.legende .titre { font-size: 18px; font-weight: 500; letter-spacing: -.01em; }
.legende .infos { color: var(--doux); font-size: 14px; }

/* ---------- Tracks ---------- */
.piste {
  display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 6px 20px;
  padding: 22px 0; border-bottom: 1px solid var(--trait);
}
.piste:first-child { padding-top: 0; }
.piste-titre { font-size: 17px; font-weight: 500; letter-spacing: -.01em; }
.piste-temps { font-size: 13px; color: var(--doux); font-variant-numeric: tabular-nums; }
.onde { grid-column: 2 / 4; height: 64px; cursor: pointer; border-radius: 2px; }
.onde canvas { display: block; width: 100%; height: 100%; }
.onde:focus-visible { outline: 1px solid var(--doux); outline-offset: 4px; }
.piste .play { grid-row: 1 / 3; align-self: start; }
.piste.joue .play::before { margin: 0; width: 10px; height: 13px; border: 0; border-left: 3px solid var(--texte); border-right: 3px solid var(--texte); }
.piste.erreur .onde, .piste.erreur .play { opacity: .35; pointer-events: none; }
.piste.erreur .piste-temps { color: var(--doux); }

/* ---------- À propos ---------- */
.apropos { max-width: 620px; }
.apropos p { font-size: 16px; font-weight: 400; line-height: 1.7; margin: 0 0 16px; }

/* ---------- Contact ---------- */
.contact-phrase { color: var(--doux); margin: 0 0 12px; }
.email {
  display: inline-block; text-decoration: none;
  font-size: 15px; font-weight: 400; line-height: 1.5;
  overflow-wrap: anywhere;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  transition: background-size .5s ease;
}
.email:hover { background-size: 100% 1px; }
.email { border-bottom: 1px solid var(--trait); padding-bottom: 2px; }
.reseaux { list-style: none; padding: 0; margin: 40px 0 0; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 16px 32px; }
.reseaux a { display: block; text-decoration: none; color: var(--doux); transition: color .4s ease, transform .4s ease; }
.reseaux a:hover { color: var(--texte); transform: translateY(-2px); }
.reseaux svg { display: block; width: 26px; height: 26px; fill: currentColor; }

.pied {
  max-width: var(--largeur); margin: 0 auto;
  display: flex; justify-content: space-between; gap: 16px;
  padding: 28px var(--marge) 40px; border-top: 1px solid var(--trait);
  color: var(--doux); font-size: 13px;
}
.pied a { text-decoration: none; }
.pied a:hover { color: var(--texte); }

/* ---------- Fenêtre lecteur ---------- */
.fenetre {
  width: min(960px, calc(100% - 32px)); max-height: calc(100% - 32px);
  border: 0; padding: 56px 32px 32px; background: var(--fond-2); color: var(--texte);
}
.fenetre::backdrop { background: rgba(0, 0, 0, .88); }
.fenetre:focus, .fenetre:focus-visible { outline: none; }
.fenetre[open] { animation: entre .5s cubic-bezier(.2, .8, .2, 1); }
.fenetre[open]::backdrop { animation: fondu .5s ease; }
.fenetre.ferme { animation: sort .35s ease forwards; }
.fenetre.ferme::backdrop { animation: fondu .35s ease reverse forwards; }
@keyframes entre { from { opacity: 0; transform: translateY(18px) scale(.985); } }
@keyframes sort { to { opacity: 0; transform: translateY(10px); } }
@keyframes fondu { from { opacity: 0; } }
.fermer {
  position: absolute; top: 16px; right: 20px;
  border: 0; background: none; padding: 4px; cursor: pointer;
  font: inherit; font-size: 14px; color: var(--doux);
}
.fermer:hover { color: var(--texte); }
.fermer:focus, .fermer:focus-visible { outline: none; }
.fenetre h3 { font-size: 22px; font-weight: 500; letter-spacing: -.01em; }
.fenetre .infos { color: var(--doux); margin: 2px 0 0; }
.fenetre .desc { margin: 14px 0 0; }
.fenetre .media { margin-top: 28px; }
.cadre { position: relative; aspect-ratio: 16 / 9; background: #000; }
.cadre iframe, .cadre video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Lecteur audio */
.lecteur { display: flex; align-items: center; gap: 16px; }
.play {
  flex-shrink: 0; width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--texte); background: transparent; cursor: pointer; display: grid; place-items: center;
}
.play::before { content: ""; margin-left: 3px; border-left: 11px solid var(--texte); border-top: 7px solid transparent; border-bottom: 7px solid transparent; }
.play:hover { background: var(--vide); }
.lecteur.joue .play::before { margin: 0; width: 10px; height: 13px; border: 0; border-left: 3px solid var(--texte); border-right: 3px solid var(--texte); }
.barre { flex: 1; height: 2px; background: var(--trait); position: relative; cursor: pointer; }
.barre::before { content: ""; position: absolute; inset: -10px 0; }
.rempli { height: 100%; width: 0; background: var(--texte); }
.temps { flex-shrink: 0; font-size: 13px; color: var(--doux); font-variant-numeric: tabular-nums; }
.lecteur.erreur .play, .lecteur.erreur .barre { opacity: .3; pointer-events: none; }
.erreur-msg { margin: 12px 0 0; font-size: 13px; color: var(--doux); }

/* ---------- Téléphone ---------- */
@media (max-width: 760px) {
  .accueil { grid-template-columns: 1fr; padding-top: 96px; gap: 40px; min-height: 0; }
  .portrait { order: -1; justify-self: stretch; max-width: none; }
  .accueil h1 { font-size: min(6.6vw, 44px); }
  .grille { grid-template-columns: repeat(2, 1fr); gap: 40px 16px; }
  .legende .titre { font-size: 15px; }
  .legende .infos { font-size: 13px; }
  .section { padding-top: 32px; padding-bottom: 32px; }
  .menu div { gap: 18px; }
  .menu-nom { display: none; }
  .menu { justify-content: flex-end; }
  .fenetre { padding: 52px 18px 22px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .apparait { opacity: 1; transform: none; }
}
