:root {
  --paper: #f4f0e8;
  --paper-2: #ebe5d9;
  --card: #fbf9f5;
  --ink: #2a2622;
  --ink-2: #6d655c;
  --ink-3: #9a9187;
  --line: #ddd5c7;
  --accent: #7b6a52;
  --serif: "Cormorant Garamond", Garamond, "Times New Roman", serif;
  --sans: "Source Sans 3", -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --nav-h: 64px;
  --max: 1080px;
  --top-h: 68px; /* hauteur de la barre du haut */
  --badge: 16px; /* marge du bas (lecteur plein écran, visionneuse) */
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html.no-scroll, html.no-scroll body { overflow: hidden; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; touch-action: manipulation; }
a, button { -webkit-tap-highlight-color: transparent; }
button:active, .track__btn:active, .nav a:active { opacity: .6; }
[hidden] { display: none !important; }

/* ---------- Barre ---------- */
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px;
  max-width: var(--max); margin: 0 auto;
  padding: 18px 24px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.top { flex-wrap: wrap; }
.top__name {
  font-family: var(--serif); font-size: 22px; font-weight: 500;
  text-decoration: none; letter-spacing: .01em; white-space: nowrap;
}
.nav { display: flex; gap: 4px; }
.nav a {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  font-size: 14px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink-2); text-decoration: none;
  border-bottom: 1px solid transparent;
}
.nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ink); }
.nav svg { display: none; }

svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Lecteur de musique (dans le bandeau du haut) ---------- */
.player {
  flex-basis: 100%;
  display: grid; grid-template-columns: 356px 1fr; gap: 20px; align-items: center;
  margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line);
}
/* YouTube demande un lecteur d'au moins 200 × 200 px */
.player__video { position: relative; width: 100%; height: 200px; background: #000; }
.player__video iframe, .player__video > div { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player__info { min-width: 0; }
.player__kicker { margin: 0; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
.player__title { margin: 4px 0 0; font-family: var(--serif); font-size: 26px; line-height: 1.15; }
.player__artist { margin: 2px 0 0; font-size: 15px; color: var(--ink-2); }
.player__ctrl { display: flex; align-items: center; gap: 4px; margin-top: 12px; }
.pbtn {
  display: inline-grid; place-items: center; width: 42px; height: 42px; padding: 0;
  border: 0; border-radius: 50%; background: none; cursor: pointer;
}
.pbtn svg { width: 20px; height: 20px; }
.pbtn:disabled { opacity: .3; cursor: default; }
.pbtn--main { border: 1px solid var(--ink-3); }
.pbtn--close { margin-left: auto; color: var(--ink-2); }
.pbtn .i-pause { display: none; }
.player.is-playing .pbtn .i-play { display: none; }
.player.is-playing .pbtn .i-pause { display: block; }

/* ---------- Mise en page ---------- */
main { max-width: var(--max); margin: 0 auto; padding: 0 24px; }
.view { padding: 56px 0 72px; animation: in .4s ease; }
@keyframes in { from { opacity: 0; } }

.head { margin-bottom: 32px; }
.head h2, .head h3 {
  margin: 0; font-family: var(--serif); font-weight: 400;
  font-size: clamp(34px, 5vw, 44px); line-height: 1.1;
}
.head h3 { font-size: 30px; }
.head p { margin: 8px 0 0; color: var(--ink-2); }
.head--sub { margin-top: 64px; padding-top: 40px; border-top: 1px solid var(--line); }

/* ---------- Accueil ---------- */
.intro { text-align: center; margin-bottom: 48px; }
.intro__kicker {
  margin: 0 0 10px; font-size: 13px; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-3);
}
.intro__name {
  margin: 0; font-family: var(--serif); font-weight: 400;
  font-size: clamp(40px, 7vw, 64px); line-height: 1.05;
}
.intro__sub { margin: 14px 0 0; font-family: var(--serif); font-style: italic; font-size: 21px; color: var(--ink-2); }

/* remerciement — portrait — remerciement ; les colonnes sont calculées pour que
   le portrait ait exactement la hauteur des cartes */
.cards { display: grid; grid-template-columns: 1.053fr .764fr 1.053fr; gap: 22px; align-items: start; max-width: 860px; margin: 0 auto; }
.card__label {
  display: block; margin-top: 10px; text-align: center;
  font-family: var(--serif); font-style: italic; font-size: 19px; color: var(--ink-2);
}
.portrait { margin: 0; }
.portrait img {
  width: 100%; height: auto; aspect-ratio: 765 / 1001; object-fit: cover;
  box-shadow: 0 1px 2px rgba(60, 45, 25, .10), 0 10px 28px -14px rgba(60, 45, 25, .35);
}
.card {
  margin: 0; padding: 0; border: 0; background: none; cursor: zoom-in;
  display: block; width: 100%;
}
.card img {
  width: 100%; height: auto;
  box-shadow: 0 1px 2px rgba(60, 45, 25, .10), 0 10px 28px -14px rgba(60, 45, 25, .35);
}

.home__note { text-align: center; margin: 48px auto 0; max-width: 34em; color: var(--ink-2); }
.home__links {
  list-style: none; padding: 0; margin: 28px 0 0;
  display: flex; justify-content: center; flex-wrap: wrap; gap: 10px 28px;
}
.home__links a {
  font-family: var(--serif); font-size: 21px; text-decoration: none;
  border-bottom: 1px solid var(--line); padding-bottom: 2px;
}

/* ---------- Photos ---------- */
.grid { columns: 3 260px; column-gap: 16px; }
.grid button {
  display: block; width: 100%; margin: 0 0 16px; padding: 0; border: 0; background: none;
  cursor: zoom-in; break-inside: avoid;
}
.grid img { width: 100%; height: auto; background: var(--paper-2); transition: opacity .2s; }
.grid span { display: block; padding: 6px 2px 0; text-align: left; font-size: 14px; color: var(--ink-2); }

/* ---------- Diaporama ---------- */
.slides { background: #1c1a18; color: #eee8de; }
.slides__stage { position: relative; aspect-ratio: 4 / 3; max-height: 72vh; width: 100%; overflow: hidden; }
.slides__stage img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain;
  opacity: 0; transition: opacity 1.2s ease;
}
.slides__stage img.on { opacity: 1; }
.slides:fullscreen, .slides:-webkit-full-screen, .slides.is-full {
  position: fixed; inset: 0; z-index: 60; margin: 0 !important;
  display: grid; grid-template-rows: 1fr auto; width: 100%; height: 100vh; height: 100dvh;
}
.slides:fullscreen .slides__stage, .slides:-webkit-full-screen .slides__stage, .slides.is-full .slides__stage {
  max-height: none; height: auto; aspect-ratio: auto;
}
.slides.is-full .slides__stage { margin-top: env(safe-area-inset-top); }
.slides.is-full .slides__bar { padding-bottom: calc(var(--badge) + env(safe-area-inset-bottom)); }
.slides__bar { display: flex; align-items: center; gap: 6px; padding: 10px 12px; border-top: 1px solid #34302b; }
.slides__count { margin-left: 8px; font-size: 14px; color: #a69d90; font-variant-numeric: tabular-nums; }
.slides__fs { margin-left: auto; }

.btn-icon {
  display: inline-grid; place-items: center; width: 44px; height: 44px;
  border: 0; background: none; border-radius: 50%; cursor: pointer;
}
.btn-icon--main { border: 1px solid #4a443d; }
.btn-icon .i-pause { display: none; }
.is-playing .btn-icon .i-play { display: none; }
.is-playing .btn-icon .i-pause { display: block; }

.videos { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px; }
.videos figure { margin: 0; }
.videos video { width: 100%; background: #000; }
.videos figcaption { margin-top: 8px; color: var(--ink-2); font-size: 15px; }

/* ---------- Lettres ---------- */
.docs { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 32px 24px; }
.doc {
  display: block; padding: 0; border: 0; background: none; text-align: left; cursor: pointer;
}
.doc.is-open .doc__thumb { outline: 2px solid var(--ink); outline-offset: 3px; }
.doc.is-open .doc__title { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }

/* Lecteur intégré à la page */
.reader {
  grid-column: 1 / -1;
  margin: 4px 0 8px; padding: 0 0 20px;
  background: var(--card); border: 1px solid var(--line);
  scroll-margin-top: calc(var(--top-h) + 12px);
  animation: in .3s ease;
}
.reader__head {
  position: sticky; top: var(--top-h); z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 12px 12px 20px;
  background: rgba(251, 249, 245, .96); border-bottom: 1px solid var(--line);
}
.reader__title { margin: 0; font-family: var(--serif); font-weight: 500; font-size: 24px; line-height: 1.2; }
.reader__meta { margin: 2px 0 0; font-size: 14px; color: var(--ink-2); }
.reader__close {
  flex: none; display: grid; place-items: center; width: 44px; height: 44px;
  border: 1px solid var(--line); border-radius: 50%; background: var(--paper); cursor: pointer;
}
.reader__page { margin: 24px auto 0; padding: 0 20px; max-width: 820px; }
.reader__page img { width: 100%; height: auto; background: var(--paper-2); box-shadow: 0 1px 3px rgba(60,45,25,.15); }
.reader__page figcaption { margin-top: 8px; text-align: center; font-size: 13px; color: var(--ink-3); }
.reader__done {
  display: block; margin: 24px auto 0; padding: 10px 22px;
  border: 1px solid var(--ink-3); border-radius: 999px; background: none; font-size: 15px; cursor: pointer;
}
.doc__thumb {
  position: relative; display: block; aspect-ratio: 3 / 4; overflow: hidden;
  background: var(--card); border: 1px solid var(--line);
}
.doc__thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform .4s ease; }
.doc__pages {
  position: absolute; right: 8px; bottom: 8px;
  padding: 2px 8px; font-size: 12px; background: rgba(251,249,245,.92); color: var(--ink-2);
}
.doc__title { display: block; margin-top: 12px; font-family: var(--serif); font-size: 21px; line-height: 1.25; }
.doc__meta { display: block; margin-top: 2px; font-size: 14px; color: var(--ink-2); }

/* ---------- Musiques ---------- */
.tracks { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); counter-reset: t; }
.track {
  display: grid; grid-template-columns: 36px 1fr auto; align-items: center; gap: 4px 16px;
  padding: 20px 0; border-bottom: 1px solid var(--line); counter-increment: t;
}
.track::before { content: counter(t, decimal-leading-zero); font-size: 13px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.track__title { font-family: var(--serif); font-size: 24px; line-height: 1.2; }
.track__artist { display: block; font-size: 15px; color: var(--ink-2); }
.track__btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px; border: 1px solid var(--ink-3); border-radius: 999px;
  background: none; text-decoration: none; font-size: 14px; cursor: pointer; white-space: nowrap;
}
.track__btn svg { width: 16px; height: 16px; }
.track.is-current .track__btn { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.track.is-current .track__title { text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 1px; }
.track audio { grid-column: 2 / -1; width: 100%; height: 40px; margin-top: 8px; }

/* ---------- Pied ---------- */
.foot {
  max-width: var(--max); margin: 0 auto; padding: 28px 24px 40px;
  border-top: 1px solid var(--line); text-align: center;
  font-size: 13px; letter-spacing: .08em; color: var(--ink-3);
}
.foot p { margin: 0; }

/* ---------- Visionneuse ---------- */
.lb {
  position: fixed; inset: 0; z-index: 50;
  display: grid; grid-template-rows: 1fr auto;
  height: 100vh; height: 100dvh;
  background: #181614; color: #eee8de;
  overscroll-behavior: contain;
  animation: fade .2s ease both;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.lb__scroll {
  min-height: 0; overflow: hidden;
  display: grid; place-items: center;
  padding: 64px 24px 8px;
}
.lb__scroll img {
  max-width: min(100%, 1400px); max-height: 100%; width: auto; height: auto;
  object-fit: contain; cursor: zoom-in; user-select: none; -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.lb.is-zoom .lb__scroll {
  display: block; overflow: auto; padding: 0; -webkit-overflow-scrolling: touch; touch-action: pan-x pan-y;
}
.lb.is-zoom .lb__scroll img { max-width: none; max-height: none; cursor: zoom-out; }
.lb__bar {
  display: grid; grid-template-columns: 52px 1fr 52px; align-items: center; gap: 8px;
  padding: 8px 12px calc(var(--badge) + env(safe-area-inset-bottom));
}
.lb__text { text-align: center; min-width: 0; }
.lb__cap { margin: 0; font-size: 15px; line-height: 1.35; color: #d8d0c4; }
.lb__hint { margin: 2px 0 0; font-size: 12px; color: #8c8378; }
.lb__hint:empty, .lb__cap:empty { display: none; }
.lb__close, .lb__nav {
  display: grid; place-items: center;
  width: 48px; height: 48px; border: 0; background: none; border-radius: 50%; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.lb__nav[hidden] { display: grid !important; visibility: hidden; }
.lb__close {
  position: absolute; z-index: 2; top: calc(8px + env(safe-area-inset-top)); right: 8px;
  background: rgba(24, 22, 20, .7);
}
.lb svg { width: 26px; height: 26px; }
@media (hover: hover) {
  .lb__close:hover, .lb__nav:hover { background: rgba(255,255,255,.08); }
}

@media (hover: hover) {
  .nav a:hover { color: var(--ink); }
  .home__links a:hover { border-color: var(--ink); }
  .grid button:hover img { opacity: .88; }
  .btn-icon:hover { background: rgba(255,255,255,.08); }
  .doc:hover .doc__thumb img { transform: scale(1.02); }
  .track__btn:hover { border-color: var(--ink); background: var(--card); }
}

/* ---------- Téléphone ---------- */
@media (max-width: 760px) {
  :root { --top-h: calc(var(--nav-h) + env(safe-area-inset-top)); }
  body { font-size: 16px; padding-bottom: var(--badge); }
  .top {
    position: sticky; top: 0; z-index: 30;
    display: block; padding: env(safe-area-inset-top) 4px 0;
    background: rgba(244, 240, 232, .97);
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line);
  }
  .top__name { display: none; }
  .nav { justify-content: space-around; gap: 0; height: var(--nav-h); }
  .player { grid-template-columns: 200px 1fr; gap: 12px; margin: 0 4px; padding: 8px 0 10px; }
  .player__kicker { font-size: 11px; }
  .player__title { font-size: 20px; }
  .player__artist { font-size: 14px; }
  .player__ctrl { gap: 0; margin-top: 8px; flex-wrap: wrap; }
  .pbtn { width: 38px; height: 38px; }
  .pbtn--close { margin-left: 0; }
  .nav a {
    flex: 1; min-width: 0; flex-direction: column; justify-content: center; gap: 3px; padding: 4px 0;
    font-size: 11px; letter-spacing: .03em; text-transform: none; border: 0;
  }
  .nav a { position: relative; }
  .nav a[aria-current="page"] { color: var(--ink); }
  .nav a[aria-current="page"] span { font-weight: 500; }
  .nav a[aria-current="page"]::after {
    content: ""; position: absolute; left: 30%; right: 30%; bottom: 0; height: 2px; background: var(--ink);
  }
  .nav svg { display: block; }

  main { padding: 0 16px; }
  .view { padding: 26px 0 40px; }
  .head { margin-bottom: 22px; }
  .head--sub { margin-top: 44px; padding-top: 28px; }
  .view[data-view="accueil"] { padding-top: 20px; }
  .intro { margin-bottom: 22px; }
  .intro__kicker { font-size: 12px; margin-bottom: 6px; }
  .intro__name { font-size: clamp(34px, 10.5vw, 44px); }
  .intro__sub { margin-top: 8px; font-size: 18px; }
  .cards { gap: 8px; }
  .card__label { margin-top: 6px; font-size: 16px; }
  .home__note { margin-top: 36px; }
  .home__links { display: none; }
  .grid { columns: 2; column-gap: 10px; }
  .grid button { margin-bottom: 10px; }
  .docs { grid-template-columns: 1fr 1fr; gap: 24px 14px; }
  .doc__title { font-size: 18px; }
  .reader { margin: 0 -16px; border-left: 0; border-right: 0; }
  .reader__head { padding: 10px 8px 10px 16px; }
  .reader__title { font-size: 21px; }
  .reader__page { margin-top: 16px; padding: 0 10px; }
  .track { grid-template-columns: 28px 1fr; }
  .track__btn { grid-column: 2; justify-self: start; margin-top: 8px; }
  .track__title { font-size: 21px; }
  .slides { margin: 0 -16px; }
  .slides__stage { aspect-ratio: 1 / 1; max-height: 64vh; max-height: 64dvh; }
  .slides__bar { padding: 8px; }
  .lb__scroll { padding: 60px 10px 6px; }
  .lb__bar { padding-left: 6px; padding-right: 6px; }
  .foot { padding: 22px 16px 8px; }
}

/* Téléphone à l'horizontale : on garde de la place pour les images */
@media (max-width: 760px) and (orientation: landscape) {
  .slides__stage { aspect-ratio: 16 / 9; max-height: 70vh; }
}
@media (max-width: 360px) {
  .nav a { font-size: 10px; }
  .docs { gap: 20px 10px; }
  .doc__title { font-size: 17px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
