/* ==========================================================
   THE LAVA FLOW — feuille de style unique
   Palette : nuit + lave. Modifie les variables ci-dessous
   pour changer l'ambiance du site entier.
   ========================================================== */

@font-face {
  font-family: "Bebas Neue";
  src: url("../fonts/bebas-neue.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Barlow";
  src: url("../fonts/barlow-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Barlow";
  src: url("../fonts/barlow-600.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}

:root {
  --bg: #0a0605;
  --bg-2: #130a07;
  --panel: #1a0e0a;
  --panel-2: #231510;
  --line: #3a2218;
  --text: #f1e6df;
  --muted: #b39a8d;
  --ember: #ff7a1a;
  --lava: #ff4a12;
  --red: #d11f1f;
  --gold: #ffb347;
  --glow: 0 0 24px rgba(255, 90, 20, 0.45);
  --font-title: "Bebas Neue", Impact, "Arial Narrow Bold", "Haettenschweiler", sans-serif;
  --font-body: "Barlow", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --radius: 10px;
  --max: 1120px;
  --header-h: 64px;
}

*,
*::before,
*::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background:
    radial-gradient(1200px 500px at 50% -10%, rgba(255, 74, 18, 0.10), transparent 70%),
    var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--ember); text-underline-offset: 3px; }
a:hover { color: var(--gold); }

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--ember); color: #1a0a02; padding: 10px 16px;
  border-radius: 6px; font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 12px; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 20px; }

/* ---------- Titres ---------- */
h1, h2, h3 {
  font-family: var(--font-title);
  font-weight: 400;
  letter-spacing: 0.04em;
  line-height: 1.05;
  margin: 0 0 0.5em;
  text-transform: uppercase;
}
h1 { font-size: clamp(2.8rem, 8vw, 5rem); }
h2 { font-size: clamp(2rem, 5vw, 3rem); color: var(--ember); text-shadow: 0 0 18px rgba(255, 90, 20, 0.35); }
h3 { font-size: 1.55rem; color: var(--gold); }
p { margin: 0 0 1em; }

/* ---------- En-tête / navigation ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(10, 6, 5, 0.88);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; min-height: var(--header-h); flex-wrap: wrap;
}
.brand {
  font-family: var(--font-title); font-size: 1.6rem; letter-spacing: 0.08em;
  color: var(--text); text-decoration: none; white-space: nowrap;
}
.brand span { color: var(--ember); }
.brand:hover { color: var(--text); text-shadow: var(--glow); }

.nav-toggle {
  display: none;
  background: none; border: 1px solid var(--line); color: var(--text);
  border-radius: 8px; padding: 8px 12px; font: inherit; cursor: pointer;
}
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 6px; }
.site-nav a {
  display: block; padding: 8px 12px; border-radius: 8px;
  color: var(--muted); text-decoration: none; font-weight: 600;
  font-size: 0.98rem;
}
.site-nav a:hover { color: var(--text); background: var(--panel); }
.site-nav a[aria-current="page"] { color: var(--ember); background: var(--panel); }

@media (max-width: 860px) {
  .js .nav-toggle { display: inline-flex; }
  .js .site-nav { display: none; width: 100%; padding-bottom: 12px; }
  .js .site-nav.open { display: block; }
  .js .site-nav ul { flex-direction: column; }
  .js .site-nav a { padding: 12px; }
}

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; min-height: 48px; padding: 12px 26px;
  border-radius: 999px; border: 2px solid var(--ember);
  background: linear-gradient(180deg, var(--ember), var(--lava));
  color: #1a0a02; font-weight: 600; font-size: 1.02rem;
  text-decoration: none; cursor: pointer;
  box-shadow: var(--glow);
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn:hover { color: #1a0a02; transform: translateY(-2px); box-shadow: 0 0 34px rgba(255, 110, 30, 0.7); }
.btn.ghost { background: rgba(10, 6, 5, 0.55); color: var(--text); box-shadow: none; }
.btn.ghost:hover { color: var(--gold); border-color: var(--gold); box-shadow: var(--glow); }
.btn[aria-disabled="true"] {
  background: transparent; color: var(--muted); border-color: var(--line);
  box-shadow: none; cursor: not-allowed; transform: none;
}
.btn-row { display: flex; flex-wrap: wrap; gap: 14px; }

/* ---------- Accueil (hero) ---------- */
.hero {
  position: relative; isolation: isolate;
  min-height: calc(100svh - var(--header-h));
  min-height: calc(100vh - var(--header-h));
  display: flex; align-items: flex-end; overflow: hidden;
}
@supports (height: 100svh) { .hero { min-height: calc(100svh - var(--header-h)); } }
.hero-bg, .hero-bg img {
  position: absolute; inset: 0; width: 100%; height: 100%; z-index: -3;
}
.hero-bg img { object-fit: cover; object-position: 50% 40%; }
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(180deg, rgba(10,6,5,0.35) 0%, rgba(10,6,5,0.05) 35%, rgba(10,6,5,0.85) 82%, var(--bg) 100%),
    radial-gradient(ellipse at 50% 100%, rgba(255, 60, 10, 0.25), transparent 65%);
}
#embers { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -2; pointer-events: none; }
.hero-content { padding: 40px 0 56px; }
.hero h1 {
  margin-bottom: 0.2em;
  text-shadow: 0 0 30px rgba(255, 70, 10, 0.65), 0 4px 18px rgba(0, 0, 0, 0.8);
}
.hero h1 em { font-style: normal; color: var(--ember); }
.tagline {
  max-width: 34ch; font-size: clamp(1.15rem, 3vw, 1.5rem);
  color: var(--text); text-shadow: 0 2px 12px rgba(0, 0, 0, 0.9); margin-bottom: 1.4em;
}
.hero .badge { margin-bottom: 1rem; }

.badge {
  display: inline-block; padding: 4px 12px; border-radius: 999px;
  border: 1px solid var(--lava); color: var(--gold);
  background: rgba(209, 31, 31, 0.15);
  font-size: 0.85rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
}

/* ---------- Mise en page des pages ---------- */
main { flex: 1; }
.page-head {
  padding: 56px 0 28px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 74, 18, 0.08), transparent);
}
.page-head h1 { font-size: clamp(2.4rem, 7vw, 4rem); margin-bottom: 0.15em; }
.page-head p { color: var(--muted); max-width: 62ch; margin: 0; font-size: 1.15rem; }
.section { padding: 44px 0; }
.section.alt { background: var(--bg-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.prose { max-width: 70ch; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin-bottom: 0.4em; }

.grid { display: grid; gap: 18px; }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }

.card {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px;
}
.card h3 { margin-bottom: 0.3em; }
.card p:last-child { margin-bottom: 0; }

.notice {
  border-left: 4px solid var(--lava); background: var(--panel);
  padding: 14px 18px; border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--muted); margin: 1.2em 0;
}

/* ---------- Page « Le jeu » : listes d'état ---------- */
.status-list { list-style: none; padding: 0; margin: 0; }
.status-list li {
  position: relative; padding: 10px 0 10px 34px; border-bottom: 1px solid var(--line);
}
.status-list li:last-child { border-bottom: 0; }
.status-list li::before {
  position: absolute; left: 0; top: 10px; font-weight: 600;
  width: 24px; text-align: center;
}
.status-list.done li::before { content: "✔"; color: #7bd88f; }
.status-list.wip li::before { content: "●"; color: var(--gold); font-size: 0.8rem; }
.status-list.todo li::before { content: "○"; color: var(--muted); }
.status-list.idea li::before { content: "✦"; color: var(--ember); }

/* ---------- Roadmap ---------- */
.roadmap { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); align-items: start; }
.col { border-radius: var(--radius); border: 1px solid var(--line); background: var(--panel); overflow: hidden; }
.col > header { padding: 14px 18px; border-bottom: 1px solid var(--line); }
.col h2 { font-size: 1.8rem; margin: 0; text-shadow: none; color: var(--text); }
.col.done > header { border-top: 4px solid #7bd88f; }
.col.wip > header { border-top: 4px solid var(--gold); }
.col.todo > header { border-top: 4px solid var(--lava); }
.col.idea > header { border-top: 4px solid #8f6bd8; }
.col .status-list { padding: 8px 18px 12px; }

/* ---------- Galerie ---------- */
.gallery { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.gallery figure { margin: 0; }
.gallery a {
  display: block; position: relative; overflow: hidden;
  border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--panel); aspect-ratio: 16 / 9;
}
.gallery img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .5s ease, filter .3s ease;
}
.gallery a:hover img, .gallery a:focus-visible img { transform: scale(1.05); filter: brightness(1.12); }
.gallery a:hover { box-shadow: var(--glow); border-color: var(--lava); }
.gallery figcaption { color: var(--muted); font-size: 0.92rem; padding: 8px 4px 0; }

dialog.lightbox {
  border: 0; padding: 0; background: transparent; color: var(--text);
  width: 100vw; max-width: 100vw; height: 100vh; max-height: 100vh;
}
dialog.lightbox::backdrop { background: rgba(5, 2, 1, 0.94); }
.lb-inner {
  height: 100%; display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 56px 12px 16px; gap: 12px;
}
.lb-inner img { max-height: calc(100vh - 150px); max-width: 100%; width: auto; object-fit: contain; border-radius: 6px; box-shadow: 0 0 60px rgba(255, 70, 10, 0.25); }
.lb-caption { text-align: center; color: var(--muted); max-width: 70ch; min-height: 1.6em; margin: 0; }
.lb-btn {
  position: fixed; background: rgba(26, 14, 10, 0.85); color: var(--text);
  border: 1px solid var(--line); border-radius: 999px;
  width: 48px; height: 48px; font-size: 1.5rem; cursor: pointer; line-height: 1;
}
.lb-btn:hover { border-color: var(--ember); color: var(--gold); }
.lb-close { top: 12px; right: 12px; }
.lb-prev { left: 10px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 10px; top: 50%; transform: translateY(-50%); }

/* ---------- Devlog ---------- */
.post-list { display: grid; gap: 16px; }
.post-card { display: block; text-decoration: none; color: inherit; transition: border-color .2s, box-shadow .2s; }
.post-card:hover { border-color: var(--lava); box-shadow: var(--glow); color: inherit; }
.post-card time, .post-meta { color: var(--muted); font-size: 0.92rem; }
.post-card h2 { font-size: 1.9rem; margin: 0.1em 0 0.2em; text-shadow: none; }
.post-card p { color: var(--muted); }
.md h1 { font-size: clamp(2.2rem, 6vw, 3.4rem); color: var(--text); }
.md h2 { font-size: 2rem; margin-top: 1.6em; }
.md h3 { margin-top: 1.4em; }
.md img { border-radius: var(--radius); border: 1px solid var(--line); margin: 1.2em 0; }
.md blockquote { margin: 1.2em 0; padding: 4px 18px; border-left: 4px solid var(--lava); color: var(--muted); background: var(--panel); border-radius: 0 8px 8px 0; }
.md code { background: var(--panel-2); padding: 2px 6px; border-radius: 4px; font-size: 0.92em; }
.md pre { background: var(--panel-2); padding: 14px; border-radius: 8px; overflow-x: auto; border: 1px solid var(--line); }
.md pre code { background: none; padding: 0; }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }

/* ---------- FAQ ---------- */
.faq details {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); margin-bottom: 12px;
}
.faq summary {
  cursor: pointer; padding: 16px 20px; font-weight: 600; font-size: 1.1rem;
  list-style: none; display: flex; justify-content: space-between; gap: 16px; align-items: center;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--ember); font-size: 1.6rem; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq details[open] { border-color: var(--lava); }
.faq details > div { padding: 0 20px 6px; color: var(--text); }
.faq details > div p { color: var(--muted); }

/* ---------- Pied de page ---------- */
.site-footer {
  border-top: 1px solid var(--line); background: #070403;
  padding: 32px 0; color: var(--muted); font-size: 0.95rem;
}
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 14px 30px; justify-content: space-between; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--gold); }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; }

/* ---------- Apparition douce au défilement ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

/* ---------- Mouvement réduit : tout est désactivé ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  #embers { display: none; }
}
