:root {
  --bg: #efeee9;
  --ink: #141412;
  --muted: #74726b;
  --line: rgba(20, 20, 18, .12);
  --panel: #f7f6f2;
  --panel-2: #e9e8e2;
  --pill: #141412;
  --pill-ink: #f7f6f2;
  --shade: rgba(239, 238, 233, .82);
  --serif: "Newsreader", "Times New Roman", serif;
  --display: "Big Shoulders Display", "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121211;
    --ink: #eeece6;
    --muted: #9a978f;
    --line: rgba(238, 236, 230, .14);
    --panel: #1b1a18;
    --panel-2: #262522;
    --pill: #eeece6;
    --pill-ink: #141412;
    --shade: rgba(18, 18, 17, .84);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121211;
  --ink: #eeece6;
  --muted: #9a978f;
  --line: rgba(238, 236, 230, .14);
  --panel: #1b1a18;
  --panel-2: #262522;
  --pill: #eeece6;
  --pill-ink: #141412;
  --shade: rgba(18, 18, 17, .84);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
[hidden] { display: none !important; }
.eyebrow {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
}

/* ---------- Header ---------- */
.top {
  position: fixed; inset: 0 0 auto 0; z-index: 30;
  height: 52px;
  display: flex; align-items: center; gap: 28px;
  padding: 0 20px;
  background: var(--shade);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.logo {
  font-family: var(--display); font-weight: 800; font-size: 24px; letter-spacing: .02em;
  color: var(--ink); text-decoration: none; line-height: 1;
}
.nav { display: flex; gap: 20px; }
.nav button { font-size: 15px; opacity: .85; }
.nav button:hover, .nav button.on { opacity: 1; text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.tools { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.search-btn {
  display: flex; align-items: center; gap: 8px;
  height: 28px; padding: 0 8px 0 10px; min-width: 200px;
  border: 1px solid var(--line); border-radius: 999px;
  font-family: var(--mono); font-size: 11px; color: var(--muted);
}
.search-btn kbd { margin-left: auto; font-family: var(--mono); font-size: 10px; opacity: .7; }
.icon-btn { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; }
.icon-btn:hover { background: var(--panel-2); }

.index-panel {
  position: fixed; top: 52px; left: 0; z-index: 29;
  width: min(440px, 100vw);
  max-height: calc(100vh - 52px); overflow: auto;
  background: var(--panel);
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  padding: 8px 0;
}
.index-panel button {
  display: grid; grid-template-columns: 34px 1fr auto; align-items: baseline; gap: 10px;
  width: 100%; text-align: left; padding: 14px 20px;
  border-bottom: 1px solid var(--line);
}
.index-panel button:last-child { border-bottom: 0; }
.index-panel button:hover { background: var(--panel-2); }
.index-panel .n { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.index-panel .t { font-family: var(--display); font-weight: 800; font-size: 26px; text-transform: uppercase; line-height: 1; }
.index-panel .c { font-family: var(--mono); font-size: 10px; letter-spacing: .1em; color: var(--muted); text-transform: uppercase; }

.viewtoggle {
  position: fixed; top: 64px; right: 20px; z-index: 25;
  display: flex; padding: 3px; gap: 2px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--shade);
}
.viewtoggle button {
  font-family: var(--mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase;
  padding: 5px 12px; border-radius: 999px; color: var(--muted);
}
.viewtoggle button.on { background: var(--pill); color: var(--pill-ink); }

/* ---------- Gallery ---------- */
.gallery { position: fixed; inset: 0; }
#scene { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; outline: none; }
#scene.dragging { cursor: grabbing; }
#scene.hovering { cursor: pointer; }

.hud {
  position: absolute; left: 50%; bottom: 46px; transform: translateX(-50%);
  text-align: center; pointer-events: none; width: min(560px, 90vw);
}
.hud h2 {
  font-family: var(--display); font-weight: 800; text-transform: uppercase;
  font-size: clamp(30px, 4.2vw, 48px); line-height: .95; letter-spacing: .01em;
  margin: 8px 0 12px;
  transition: opacity .35s ease, transform .35s ease;
}
.hud h2.swap { opacity: 0; transform: translateY(6px); }
.link {
  pointer-events: auto;
  font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  border-bottom: 1px solid currentColor; padding-bottom: 2px;
}
.hud.dim { opacity: 0; transition: opacity .3s; }

.arrows { position: absolute; right: 22px; bottom: 74px; display: flex; gap: 8px; }
.arrows button {
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--shade);
  font-family: var(--mono); font-size: 13px;
}
.arrows button:hover { background: var(--pill); color: var(--pill-ink); }
.hint {
  position: absolute; right: 22px; bottom: 22px; margin: 0; text-align: right;
  font-family: var(--mono); font-size: 10px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--muted); line-height: 1.8;
}

.cursor-pill {
  position: fixed; z-index: 20; pointer-events: none;
  transform: translate(14px, -50%);
  background: var(--pill); color: var(--pill-ink);
  font-family: var(--mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase;
  padding: 6px 10px; border-radius: 999px; white-space: nowrap;
}

.focusbar {
  position: absolute; left: 20px; bottom: 22px;
  display: flex; align-items: flex-end; gap: 22px;
  max-width: min(620px, calc(100vw - 40px));
  padding: 16px 18px;
  background: var(--shade); border: 1px solid var(--line); border-radius: 4px;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  animation: rise .35s ease both;
}
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.fb-title { font-style: italic; font-size: 24px; line-height: 1.1; margin: 6px 0 4px; }
.fb-meta { font-size: 14px; color: var(--muted); margin: 0; }
.fb-actions { display: flex; flex-direction: column; gap: 6px; flex: none; }
.pill-btn {
  background: var(--pill); color: var(--pill-ink);
  font-family: var(--mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase;
  padding: 9px 14px; border-radius: 999px;
}
.ghost-btn {
  font-family: var(--mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase;
  padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line);
}

/* ---------- List ---------- */
.list {
  position: fixed; inset: 52px 0 0 0; overflow: auto; z-index: 10;
  background: var(--bg);
  padding: 72px 20px 80px;
}
.list-head { max-width: 1400px; margin: 0 auto 28px; }
.list-head h1 {
  font-family: var(--display); font-weight: 800; text-transform: uppercase;
  font-size: clamp(48px, 9vw, 120px); line-height: .88; margin: 10px 0 18px;
}
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button {
  font-family: var(--mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase;
  padding: 6px 11px; border-radius: 999px; border: 1px solid var(--line);
}
.chips button.on { background: var(--pill); color: var(--pill-ink); border-color: var(--pill); }
.col-section { max-width: 1400px; margin: 0 auto; padding: 36px 0 12px; border-top: 1px solid var(--line); }
.col-section header { display: grid; grid-template-columns: 1fr auto; gap: 6px 20px; margin-bottom: 22px; align-items: end; }
.col-section h2 {
  font-family: var(--display); font-weight: 800; text-transform: uppercase;
  font-size: clamp(34px, 5vw, 60px); line-height: .9; margin: 6px 0 0;
}
.col-section .intro { grid-column: 1 / -1; font-size: 17px; color: var(--muted); margin: 0; max-width: 60ch; }
.col-section .count { font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.grid { columns: 5 220px; column-gap: 22px; }
.card {
  break-inside: avoid; display: block; width: 100%; text-align: left;
  margin: 0 0 28px;
}
.card .ph { background: var(--panel-2); overflow: hidden; }
.card img { display: block; width: 100%; height: auto; transition: transform .5s ease, opacity .4s; }
.card:hover img { transform: scale(1.025); }
.card .t { font-style: italic; font-size: 17px; line-height: 1.2; margin: 10px 0 3px; }
.card .m { font-size: 13px; color: var(--muted); margin: 0; }

/* ---------- Modals ---------- */
.modal {
  position: fixed; inset: 0; z-index: 50;
  background: var(--shade);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  animation: fade .25s ease both;
}
@keyframes fade { from { opacity: 0; } }
.close {
  position: absolute; top: 16px; right: 18px; z-index: 2;
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--panel);
  font-family: var(--mono); font-size: 14px;
}

.detail { display: grid; grid-template-columns: 1fr minmax(320px, 420px); }
.detail .stage {
  position: relative; display: grid; place-items: center; padding: 48px; min-height: 0;
}
.detail .stage img {
  max-width: 100%; max-height: calc(100vh - 96px); object-fit: contain;
  box-shadow: 0 30px 60px -30px rgba(0,0,0,.45), 0 2px 6px rgba(0,0,0,.12);
  background: var(--panel-2);
}
.detail aside {
  background: var(--panel); border-left: 1px solid var(--line);
  padding: 70px 30px 30px; overflow: auto;
  display: flex; flex-direction: column;
}
.detail h1 { font-weight: 400; font-style: italic; font-size: 38px; line-height: 1.05; margin: 12px 0 10px; }
.detail .artist { font-size: 17px; margin: 0 0 4px; }
.detail .meta { font-size: 17px; color: var(--muted); margin: 0 0 22px; }
.detail dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 18px; margin: 0 0 22px; padding: 16px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.detail dt { font-family: var(--mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); padding-top: 3px; }
.detail dd { margin: 0; font-size: 15px; }
.detail .text { font-size: 16px; line-height: 1.6; }
.detail .text p { margin: 0 0 .9em; }
.detail .lang { display: inline-block; font-family: var(--mono); font-size: 10px; border: 1px solid var(--line); border-radius: 999px; padding: 2px 8px; margin-bottom: 10px; }
.detail .actions { margin-top: auto; padding-top: 22px; display: flex; gap: 8px; flex-wrap: wrap; }
.detail .nav-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--panel); font-family: var(--mono);
}
.detail .nav-arrow.prev { left: 14px; }
.detail .nav-arrow.next { right: 14px; }

.info { overflow: auto; }
.info .wrap { max-width: 980px; margin: 0 auto; padding: 96px 24px 80px; }
.info h1 {
  font-family: var(--display); font-weight: 800; text-transform: uppercase;
  font-size: clamp(52px, 10vw, 128px); line-height: .86; margin: 12px 0 26px;
}
.info .lede { font-size: 24px; line-height: 1.35; max-width: 36ch; margin: 0 0 56px; }
.info h2 { font-family: var(--mono); font-weight: 500; font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); margin: 0 0 16px; padding-top: 18px; border-top: 1px solid var(--line); }
.info .cols { display: grid; grid-template-columns: 1.3fr 1fr; gap: 56px; }
.timeline { margin: 0 0 40px; padding: 0; list-style: none; }
.timeline li { display: grid; grid-template-columns: 64px 1fr; gap: 14px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.timeline .y { font-family: var(--mono); font-size: 12px; color: var(--muted); padding-top: 3px; }
.timeline .e { font-size: 16px; line-height: 1.5; }
.tag { font-family: var(--mono); font-size: 9px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 1px 6px; margin-left: 6px; vertical-align: 2px; }
.books { list-style: none; padding: 0; margin: 0 0 40px; }
.books li { font-size: 15px; line-height: 1.5; padding: 10px 0; border-bottom: 1px solid var(--line); }
.info a { color: inherit; }

.search { display: flex; justify-content: center; align-items: flex-start; padding-top: 14vh; }
.search-box { width: min(640px, calc(100vw - 32px)); background: var(--panel); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; box-shadow: 0 30px 80px -30px rgba(0,0,0,.4); }
.search input {
  width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink);
  font-family: var(--serif); font-size: 22px; padding: 18px 20px; border-bottom: 1px solid var(--line);
}
.results { max-height: 56vh; overflow: auto; }
.results button { display: grid; grid-template-columns: 48px 1fr; gap: 14px; align-items: center; width: 100%; text-align: left; padding: 10px 20px; }
.results button:hover, .results button.sel { background: var(--panel-2); }
.results img { width: 48px; height: 48px; object-fit: cover; background: var(--panel-2); }
.results .t { font-style: italic; font-size: 17px; }
.results .m { font-size: 13px; color: var(--muted); }
.results .empty { padding: 20px; color: var(--muted); font-size: 15px; }

/* ---------- Loader ---------- */
.loader {
  position: fixed; inset: 0; z-index: 100; background: var(--bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  transition: opacity .7s ease, visibility .7s;
}
.loader h1 { font-family: var(--display); font-weight: 800; text-transform: uppercase; font-size: clamp(40px, 7vw, 84px); line-height: .9; margin: 0 0 18px; text-align: center; }
.loader .bar { width: 160px; height: 1px; background: var(--line); }
.loader .bar span { display: block; height: 100%; width: 0; background: var(--ink); transition: width .3s; }
.loader.done { opacity: 0; visibility: hidden; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .search-btn span, .search-btn kbd { display: none; }
  .search-btn { min-width: 0; width: 30px; padding: 0; justify-content: center; border: 0; }
  .nav { gap: 14px; }
  .detail { grid-template-columns: 1fr; grid-template-rows: 56vh auto; overflow: auto; }
  .detail .stage { padding: 56px 16px 16px; }
  .detail .stage img { max-height: calc(56vh - 72px); }
  .detail aside { border-left: 0; border-top: 1px solid var(--line); padding: 26px 20px 40px; }
  .info .cols { grid-template-columns: 1fr; gap: 0; }
}
@media (max-width: 600px) {
  .top { gap: 16px; padding: 0 16px; }
  .nav button[data-action="presse"] { display: none; }
  .hint { display: none; }
  .hud { bottom: 92px; }
  .arrows { left: 50%; right: auto; transform: translateX(-50%); bottom: 30px; }
  .viewtoggle { right: 16px; }
  .list { padding: 64px 16px 60px; }
  .grid { columns: 2 140px; column-gap: 14px; }
  .focusbar { left: 16px; right: 16px; bottom: 16px; flex-direction: column; align-items: stretch; gap: 12px; }
  .fb-actions { flex-direction: row; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* Masque le badge injecté par l'hébergeur */
#nl-badge-frame, #nl-hud-frame { display: none !important; }
