/* Feuille unique du site bibliothèque. `#e0b83a` est remplacé à la génération (config/site.toml). */
:root {
  --bg: #0d0e10;
  --bg-2: #131418;
  --panel: #17191d;
  --panel-2: #1d1f24;
  --stage: #252527; /* identique au fond des rendus : les images se fondent dans la page */
  --line: #262931;
  --line-strong: #343842;
  --text: #edeef1;
  --muted: #9498a3;
  --muted-2: #6d717b;
  --accent: #e0b83a;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 12px 32px rgba(0, 0, 0, .35);
  --page: 1320px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body::before {
  content: "";
  position: fixed;
  inset: -20vh 0 auto 0;
  height: 70vh;
  background: radial-gradient(60% 60% at 50% 0%, color-mix(in srgb, var(--accent) 11%, transparent), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

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

.wrap { width: 100%; max-width: var(--page); margin: 0 auto; padding: 0 24px; position: relative; z-index: 1; }

/* ---------- en-tête ---------- */
.top {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.top .wrap { display: flex; align-items: center; gap: 18px; height: 58px; }
.brandmark { display: flex; align-items: center; gap: 10px; font-weight: 640; letter-spacing: -.01em; }
.brandmark .dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent);
}
.top nav { margin-left: auto; display: flex; gap: 18px; color: var(--muted); font-size: 13px; }
.top nav a:hover { color: var(--text); }

/* ---------- titres de page ---------- */
.hero { padding: 54px 0 26px; }
.hero h1 { margin: 0; font-size: clamp(30px, 4.6vw, 46px); line-height: 1.05; letter-spacing: -.025em; font-weight: 680; }
.hero p { margin: 12px 0 0; color: var(--muted); max-width: 62ch; font-size: 16px; }
.eyebrow {
  display: block;
  font-size: 11.5px; font-weight: 620; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent);
}

/* ---------- barre d'outils ---------- */
.toolbar {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  padding: 18px 0 22px;
  position: sticky; top: 58px; z-index: 15;
  background: linear-gradient(var(--bg) 72%, transparent);
}
.field { position: relative; flex: 1 1 260px; min-width: 0; }
.field svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted-2); }
input[type="search"], select {
  width: 100%; height: 42px;
  background: var(--panel); color: var(--text);
  border: 1px solid var(--line-strong); border-radius: 10px;
  font: inherit; font-size: 14px;
  padding: 0 14px;
}
input[type="search"] { padding-left: 38px; }
input[type="search"]::placeholder { color: var(--muted-2); }
select { width: auto; min-width: 190px; padding-right: 34px; appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 19px, calc(100% - 13px) 19px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
.count { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; margin-left: auto; }

/* ---------- grille de voitures ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 20px; padding-bottom: 60px; }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.card:hover { transform: translateY(-3px); border-color: var(--line-strong); box-shadow: var(--shadow); }
.card:hover .shot img { transform: scale(1.035); }
.shot { background: var(--stage); aspect-ratio: 16 / 10; overflow: hidden; }
.shot img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.card-body h2 { margin: 0; font-size: 17px; font-weight: 620; letter-spacing: -.012em; }
.card-meta { margin-top: auto; padding-top: 10px; color: var(--muted-2); font-size: 12px; font-variant-numeric: tabular-nums; display: flex; gap: 10px; flex-wrap: wrap; }
.card-meta span::after { content: ""; }
.empty { color: var(--muted); text-align: center; padding: 60px 0 80px; }

/* ---------- fiche voiture ---------- */
.back { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 13px; padding: 26px 0 0; }
.back:hover { color: var(--text); }
.carhead { padding: 18px 0 26px; display: flex; align-items: flex-end; gap: 20px; flex-wrap: wrap; }
.carhead h1 { margin: 6px 0 0; font-size: clamp(28px, 4.2vw, 42px); line-height: 1.05; letter-spacing: -.025em; font-weight: 680; }
.carid {
  margin-left: auto; color: var(--muted-2); font-size: 12.5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 5px 10px;
}

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; padding-bottom: 34px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 13px 15px; }
.stat dt { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted-2); margin: 0 0 5px; }
.stat dd { margin: 0; font-size: 19px; font-weight: 620; font-variant-numeric: tabular-nums; letter-spacing: -.015em; }
.stat dd small { font-size: 12px; font-weight: 450; color: var(--muted); letter-spacing: 0; }
.ok { color: var(--accent); }

section { padding-bottom: 46px; }
h2.section { font-size: 12px; font-weight: 620; letter-spacing: .13em; text-transform: uppercase; color: var(--muted); margin: 0 0 14px; }

.stage {
  position: relative; background: var(--stage); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
  aspect-ratio: 16 / 9; cursor: grab; touch-action: pan-y; user-select: none;
}
.stage.drag { cursor: grabbing; }
.stage img { width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.hint {
  position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%);
  background: rgba(0, 0, 0, .58); color: #e6e6e8; border-radius: 999px;
  padding: 6px 14px; font-size: 12px; transition: opacity .45s ease; pointer-events: none;
}
.bar { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--accent); width: 0; transition: width .12s linear; }
.controls { display: flex; align-items: center; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
button.ctl {
  background: var(--panel-2); color: var(--text); border: 1px solid var(--line-strong);
  border-radius: 9px; padding: 8px 14px; font: inherit; font-size: 13.5px; cursor: pointer; min-width: 106px;
}
button.ctl:hover { border-color: var(--accent); color: var(--accent); }
input[type="range"] { flex: 1; min-width: 150px; accent-color: var(--accent); background: transparent; }
.angle { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; min-width: 52px; text-align: right; }

.shots { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 16px; }
figure { margin: 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; cursor: zoom-in; }
figure img { width: 100%; height: auto; background: var(--stage); }
figcaption { color: var(--muted); font-size: 12.5px; padding: 10px 14px; border-top: 1px solid var(--line); }

.lightbox { position: fixed; inset: 0; z-index: 50; background: rgba(6, 6, 8, .93); display: none; align-items: center; justify-content: center; cursor: zoom-out; padding: 20px; }
.lightbox.open { display: flex; }
.lightbox img { max-width: 96vw; max-height: 94vh; width: auto; height: auto; border-radius: 6px; }

/* ---------- mentions légales ---------- */
.prose { max-width: 74ch; padding-bottom: 60px; }
.prose p { color: var(--muted); }
.legal { width: 100%; border-collapse: collapse; margin: 0 0 30px; }
.legal th, .legal td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; font-size: 14px; }
.legal th { color: var(--muted); font-weight: 500; width: 40%; }
.todo { color: #ffb4a2; background: rgba(255, 120, 90, .1); border: 1px solid rgba(255, 120, 90, .28); border-radius: 6px; padding: 1px 7px; font-size: 13px; }

/* ---------- pied ---------- */
footer { border-top: 1px solid var(--line); background: var(--bg-2); margin-top: auto; }
footer .wrap { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; padding-top: 22px; padding-bottom: 26px; color: var(--muted-2); font-size: 12.5px; }
footer a { color: var(--muted); }
footer a:hover { color: var(--text); }
footer .sep { color: var(--line-strong); }

@media (max-width: 720px) {
  .wrap { padding: 0 16px; }
  .hero { padding: 34px 0 18px; }
  .grid { grid-template-columns: 1fr; gap: 16px; }
  .toolbar { position: static; }
  .carid { margin-left: 0; }
  .shots { grid-template-columns: 1fr; }
}

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