:root {
  --bg: #07060b;
  --ink: #f4f1fa;
  --muted: #b9b2c9;
  --accent: #b69cff;
  --accent-strong: #9f7aea;
  --warm: #ffb27a;
  --panel: rgba(18, 14, 28, 0.62);
  --line: rgba(182, 156, 255, 0.22);
  --radius: 18px;
  --display: "Syne", "Inter", system-ui, sans-serif;
  --text: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--bg); }
body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: var(--text);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.skip {
  position: absolute; left: 16px; top: -60px; z-index: 50;
  background: var(--accent); color: #120c1f; padding: 10px 16px; border-radius: 999px; font-weight: 600; text-decoration: none;
}
.skip:focus { top: 12px; }

/* En-tête */
.top {
  position: fixed; inset: 0 0 auto 0; z-index: 30;
  display: flex; align-items: center; gap: 24px;
  padding: 16px clamp(16px, 4vw, 48px);
  background: linear-gradient(to bottom, rgba(7, 6, 11, 0.85), rgba(7, 6, 11, 0));
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--display); font-weight: 700; letter-spacing: 0.01em; }
.brand-mark {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
  border: 1.5px solid var(--accent); color: var(--accent); font-weight: 800;
  box-shadow: 0 0 18px rgba(182, 156, 255, 0.35);
}
.top nav { margin-left: auto; }
.top nav ul { display: flex; gap: 22px; list-style: none; margin: 0; padding: 0; }
.top nav a { text-decoration: none; color: var(--muted); font-size: 15px; }
.top nav a:hover { color: var(--ink); }

/* Boutons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border-radius: 999px;
  font-weight: 600; font-size: 16px; text-decoration: none; transition: transform 0.2s, background 0.2s, box-shadow 0.2s;
}
.btn-small { min-height: 40px; padding: 0 16px; font-size: 14px; }
.btn-primary { background: var(--accent); color: #140d22; box-shadow: 0 8px 30px rgba(159, 122, 234, 0.35); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 36px rgba(159, 122, 234, 0.5); }
.btn-ghost { border: 1px solid var(--line); color: var(--ink); background: rgba(255, 255, 255, 0.03); }
.btn-ghost:hover { border-color: var(--accent); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

/* La scène 3D, derrière tout */
#scene, #poster { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 0; display: block; object-fit: cover; }
/* Un voile sombre, plus marqué du côté du texte, pour que tout reste lisible sur les vidéos. */
.shade { position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: linear-gradient(90deg, rgba(7, 6, 11, 0.78) 0%, rgba(7, 6, 11, 0.35) 45%, rgba(7, 6, 11, 0.15) 70%, rgba(7, 6, 11, 0.45) 100%),
              linear-gradient(to bottom, rgba(7, 6, 11, 0.55), rgba(7, 6, 11, 0) 22%, rgba(7, 6, 11, 0) 70%, rgba(7, 6, 11, 0.6)); }
@media (max-width: 900px) { .shade { background: linear-gradient(to bottom, rgba(7, 6, 11, 0.5), rgba(7, 6, 11, 0.1) 30%, rgba(7, 6, 11, 0.55) 60%, rgba(7, 6, 11, 0.9)); } }
.gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 36px; }
.gallery figure { margin: 0; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: #0d0b14; }
.gallery img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; }
.gallery figcaption { padding: 12px 16px; font-family: var(--display); font-weight: 600; }
@media (max-width: 900px) { .gallery { grid-template-columns: 1fr 1fr; } }
.no-webgl body, .no-webgl .journey {
  background: radial-gradient(ellipse at 50% 20%, rgba(159, 122, 234, 0.28), transparent 60%), var(--bg);
}
.progress { position: fixed; left: 0; right: 0; top: 0; height: 2px; z-index: 40; }
.progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent-strong), var(--warm)); }

main, .foot { position: relative; z-index: 1; }

/* Le voyage */
.chapter {
  min-height: 100vh;
  display: flex; flex-direction: column; justify-content: center;
  padding: 120px clamp(16px, 6vw, 96px);
  max-width: 640px;
}
.chapter > * { opacity: 0; transform: translateY(28px); transition: opacity 0.9s ease, transform 0.9s ease; }
.chapter.is-visible > * { opacity: 1; transform: none; }
.chapter > *:nth-child(2) { transition-delay: 0.08s; }
.chapter > *:nth-child(3) { transition-delay: 0.16s; }
.chapter > *:nth-child(4) { transition-delay: 0.24s; }
.chapter-right { margin-left: auto; text-align: left; }
.chapter-hero { max-width: 860px; }
.chapter-final { margin: 0 auto; text-align: center; align-items: center; max-width: 720px; justify-content: flex-end; padding-bottom: 12vh; }
.chapter-final h2 { text-shadow: 0 2px 30px rgba(7, 6, 11, 0.9); }
.chapter-final .actions { justify-content: center; }
.chapter h1, .chapter h2, .block h2 { font-family: var(--display); line-height: 1.05; letter-spacing: -0.02em; margin: 0; }
.chapter h1 { font-size: clamp(34px, 4.6vw, 64px); font-weight: 800; }
.chapter h1 em { font-style: normal; color: var(--accent); text-shadow: 0 0 40px rgba(182, 156, 255, 0.45); }
.chapter h2 { font-size: clamp(34px, 5vw, 60px); font-weight: 700; }
.chapter p { color: var(--muted); font-size: clamp(17px, 1.6vw, 20px); margin: 18px 0 0; }
.chapter:not(.chapter-hero) p:not(.step-num) {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.chapter-final p:not(.step-num) { background: none !important; border: 0 !important; padding: 0 !important; backdrop-filter: none !important; }
.eyebrow, .step-num { text-transform: uppercase; letter-spacing: 0.16em; font-size: 13px !important; color: var(--accent) !important; font-weight: 600; margin: 0 0 16px !important; }
.lead { max-width: 560px; }
.scroll-hint { display: flex; align-items: center; gap: 12px; margin-top: 48px !important; font-size: 14px !important; }
.scroll-hint span { width: 22px; height: 36px; border: 1.5px solid var(--muted); border-radius: 12px; position: relative; }
.scroll-hint span::after {
  content: ""; position: absolute; left: 50%; top: 7px; width: 4px; height: 8px; margin-left: -2px;
  border-radius: 2px; background: var(--accent); animation: wheel 1.8s infinite;
}
@keyframes wheel { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(12px); } }

/* Les pages classiques, sur un fond plein pour rester lisibles */
.pages { position: relative; background: linear-gradient(to bottom, rgba(7, 6, 11, 0), var(--bg) 220px); padding-top: 160px; }
.block { max-width: 1120px; margin: 0 auto; padding: 72px clamp(16px, 4vw, 48px); }
.block h2 { font-size: clamp(30px, 4vw, 48px); font-weight: 700; max-width: 760px; }
.intro { color: var(--muted); max-width: 640px; margin: 16px 0 0; }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 40px; }
.card { position: relative; border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; background: rgba(255, 255, 255, 0.025); }
.card h3 { font-family: var(--display); font-size: 24px; margin: 0; }
.card .price { font-family: var(--display); font-size: 30px; color: var(--accent); margin: 10px 0 12px; }
.card p { color: var(--muted); margin: 0; }
.card .meta { margin-top: 18px; font-size: 14px; color: var(--ink); opacity: 0.75; }
.card-featured { border-color: var(--accent); background: rgba(159, 122, 234, 0.08); box-shadow: 0 0 0 1px rgba(182, 156, 255, 0.2), 0 30px 60px -30px rgba(159, 122, 234, 0.6); }
.tag { position: absolute; top: -12px; left: 24px; background: var(--accent); color: #140d22 !important; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; }
.note { color: var(--muted); font-size: 15px; margin-top: 24px; max-width: 760px; }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 40px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.steps li { counter-increment: s; border-top: 1px solid var(--line); padding-top: 18px; }
.steps li::before { content: counter(s, decimal-leading-zero); font-family: var(--display); color: var(--accent); font-size: 14px; letter-spacing: 0.1em; }
.steps h3 { font-family: var(--display); font-size: 21px; margin: 8px 0 6px; }
.steps p { color: var(--muted); margin: 0; }
.about { display: grid; grid-template-columns: 1fr 1.3fr; gap: 48px; align-items: start; }
.about-text p { color: var(--muted); margin: 0 0 18px; font-size: 18px; }
.about-text p:first-child { color: var(--ink); font-size: 21px; }
.contact { text-align: center; padding-bottom: 120px; }
.contact h2, .contact .intro { margin-left: auto; margin-right: auto; }
.contact .actions { justify-content: center; }
.foot { border-top: 1px solid var(--line); padding: 28px clamp(16px, 4vw, 48px); color: var(--muted); font-size: 14px; background: var(--bg); }
.foot p { margin: 0; }
.foot .small { opacity: 0.7; margin-top: 4px; }

@media (max-width: 900px) {
  .top nav { display: none; }
  .top .btn-small { margin-left: auto; }
  .cards, .steps { grid-template-columns: 1fr; }
  .about { grid-template-columns: 1fr; gap: 16px; }
  .chapter { justify-content: flex-end; padding-bottom: 72px; }
  .chapter-right { margin-left: 0; }
  .chapter-hero { justify-content: center; }
}
@media (max-width: 480px) {
  .brand span:last-child { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .chapter > * { opacity: 1; transform: none; transition: none; }
  .scroll-hint span::after { animation: none; }
  .btn { transition: none; }
}

#poster[hidden] { display: none; }

/* Un peu d’espace après le dernier chapitre, le temps que la porte finisse de s’ouvrir. */
.journey { padding-bottom: 60vh; }
