/* Rhum Barbancourt — concept Kreyol IA (non officiel) */
:root {
  --ink: #0b0806;
  --ink-2: #15100b;
  --gold: #c9a15a;
  --gold-hi: #e6c584;
  --gold-lo: #8a6a35;
  --cream: #f1e6d0;
  --cream-dim: rgba(241, 230, 208, .72);
  --line: rgba(201, 161, 90, .28);
  --serif: "Cormorant Garamond", "Times New Roman", serif;
  --sans: "Jost", "Helvetica Neue", Arial, sans-serif;
  --gutter: clamp(20px, 5vw, 72px);
  --ease: cubic-bezier(.22, .61, .36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--ink); }
body {
  margin: 0;
  background: var(--ink);
  color: var(--cream);
  font-family: var(--sans);
  font-weight: 300;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.is-loading { overflow: hidden; height: 100vh; }
a { color: inherit; }
img, svg { display: block; }
button { font: inherit; color: inherit; }

/* ---------- Canvas & voiles ---------- */
.stage {
  position: fixed; inset: 0;
  width: 100vw; height: 100vh; height: 100lvh;
  z-index: 0; display: block;
  background: var(--ink);
}
.veil {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background:
    radial-gradient(120% 90% at 50% 45%, transparent 45%, rgba(5,3,2,.55) 100%),
    linear-gradient(to bottom, rgba(5,3,2,.55) 0%, transparent 18%, transparent 70%, rgba(5,3,2,.6) 100%);
}
.veil::after { /* assombrissement supplémentaire piloté en JS (section finale) */
  content: ""; position: absolute; inset: 0;
  background: var(--ink);
  opacity: var(--dim, 0);
}
.grain {
  position: fixed; inset: -50%; z-index: 2; pointer-events: none;
  opacity: .07; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1.2s steps(6) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); } 20% { transform: translate(-3%, 2%); }
  40% { transform: translate(2%, -3%); } 60% { transform: translate(-2%, -1%); }
  80% { transform: translate(3%, 3%); } 100% { transform: translate(0, 0); }
}

/* ---------- Loader ---------- */
.loader {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-content: center; justify-items: center; gap: 4px;
  background: var(--ink); text-align: center;
  transition: opacity 1s var(--ease), visibility 1s;
}
.loader.is-done { opacity: 0; visibility: hidden; }
.loader__mark { width: 84px; height: 84px; margin-bottom: 18px; transform: rotate(-90deg); }
.loader__ring { fill: none; stroke: var(--line); stroke-width: 1; }
.loader__arc {
  fill: none; stroke: var(--gold); stroke-width: 1.2; stroke-linecap: round;
  stroke-dasharray: 351.86; stroke-dashoffset: 351.86;
  transition: stroke-dashoffset .4s var(--ease);
}
.loader__star { fill: none; stroke: var(--gold); stroke-width: .8; transform: rotate(90deg); transform-origin: 60px 60px; opacity: .85; }
.loader__brand {
  margin: 0; font-family: var(--serif); font-weight: 500;
  font-size: clamp(26px, 4vw, 38px); letter-spacing: .32em; text-transform: uppercase;
  padding-left: .32em; color: var(--cream);
}
.loader__since { margin: 0; font-size: 11px; letter-spacing: .6em; padding-left: .6em; color: var(--gold); }
.loader__pct { margin: 26px 0 0; font-family: var(--serif); font-size: 18px; color: var(--cream-dim); font-variant-numeric: tabular-nums; }
.loader__note { margin: 0; font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: rgba(241,230,208,.42); }

/* ---------- En-tête ---------- */
.top {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  display: flex; justify-content: space-between; align-items: center;
  padding: max(18px, env(safe-area-inset-top)) var(--gutter) 18px;
  pointer-events: none;
}
.top > * { pointer-events: auto; }
.top__brand { text-decoration: none; display: grid; line-height: 1.1; }
.top__name {
  font-family: var(--serif); font-weight: 500; font-size: 19px;
  letter-spacing: .3em; text-transform: uppercase;
}
.top__since { font-size: 10px; letter-spacing: .38em; text-transform: uppercase; color: var(--gold); margin-top: 3px; }
.lang { display: flex; gap: 2px; border: 1px solid var(--line); border-radius: 999px; padding: 3px; backdrop-filter: blur(6px); background: rgba(11,8,6,.3); }
.lang button {
  border: 0; background: none; cursor: pointer;
  font-size: 11px; letter-spacing: .14em; padding: 6px 11px; border-radius: 999px;
  color: var(--cream-dim); transition: background .3s, color .3s;
}
.lang button[aria-pressed="true"] { background: var(--gold); color: var(--ink); font-weight: 500; }
.lang button:focus-visible, .btn:focus-visible, .rail a:focus-visible { outline: 1px solid var(--gold-hi); outline-offset: 3px; }

/* ---------- Rail de progression ---------- */
.rail {
  position: fixed; right: var(--gutter); top: 50%; z-index: 20;
  transform: translate(50%, -50%);
  display: flex; align-items: center; gap: 14px;
  transition: opacity .6s;
}
.rail ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; }
.rail a {
  display: block; text-decoration: none; font-size: 10px; letter-spacing: .2em;
  color: rgba(241,230,208,.35); transition: color .4s;
}
.rail a.is-active { color: var(--gold-hi); }
.rail__bar { width: 1px; height: 210px; background: var(--line); position: relative; }
.rail__bar i { position: absolute; left: 0; top: 0; width: 1px; height: 100%; background: var(--gold); transform-origin: top; transform: scaleY(0); }
.rail.is-hidden, .badge.is-hidden { opacity: 0; pointer-events: none; }

/* ---------- Scènes ---------- */
main { position: relative; z-index: 5; }
.scene { position: relative; height: calc(var(--len) * 1vh); }
.panel {
  position: sticky; top: 0; height: 100vh; height: 100svh;
  display: flex; align-items: center;
  padding: 0 calc(var(--gutter) + 40px) 0 var(--gutter);
}
.panel--left { justify-content: flex-start; }
.panel--right { justify-content: flex-end; }
.panel--center { justify-content: center; text-align: center; }
.panel--hero { justify-content: flex-start; align-items: center; text-align: left; }

.copy { max-width: 520px; position: relative; isolation: isolate; will-change: opacity, transform; }
.copy::before { /* halo sombre discret derrière le texte (lisibilité sur ciel clair) */
  content: ""; position: absolute; z-index: -1; inset: -30% -35%;
  background: radial-gradient(closest-side, rgba(5,3,2,.55), rgba(5,3,2,.25) 60%, transparent);
  pointer-events: none;
}
.copy--wide { max-width: 760px; }
.panel--hero .copy { max-width: 520px; }

.num { margin: 0 0 18px; font-size: 11px; letter-spacing: .3em; color: var(--cream-dim); }
.num b { color: var(--gold); font-weight: 500; }
.eyebrow {
  margin: 0 0 14px; font-size: 11px; letter-spacing: .38em; text-transform: uppercase; color: var(--gold);
  display: inline-flex; align-items: center; gap: 14px;
}
.eyebrow::before { content: ""; width: 28px; height: 1px; background: var(--gold); opacity: .7; }
.panel--center .eyebrow::after, .final .eyebrow::after { content: ""; width: 28px; height: 1px; background: var(--gold); opacity: .7; }
.title {
  margin: 0 0 22px; font-family: var(--serif); font-weight: 400;
  font-size: clamp(44px, 6.4vw, 96px); line-height: .98; letter-spacing: -.01em;
  color: var(--cream);
  text-shadow: 0 2px 40px rgba(0,0,0,.45);
}
.panel--hero .title { font-size: clamp(58px, 8.6vw, 140px); font-style: italic; }
.lead { margin: 0; font-size: clamp(15px, 1.15vw, 17px); color: var(--cream-dim); text-shadow: 0 1px 18px rgba(0,0,0,.6); }
.meta {
  margin: 26px 0 0; padding-top: 16px; border-top: 1px solid var(--line);
  font-size: 11px; letter-spacing: .24em; text-transform: uppercase; color: rgba(241,230,208,.55);
}

.cue {
  position: absolute; bottom: 4vh; left: 50%; transform: translateX(-50%);
  display: grid; justify-items: center; gap: 10px;
  font-size: 10px; letter-spacing: .34em; text-transform: uppercase; color: rgba(241,230,208,.5);
}
.cue i { width: 1px; height: 46px; background: linear-gradient(var(--gold), transparent); animation: cue 2.2s var(--ease) infinite; transform-origin: top; }
@keyframes cue { 0% { transform: scaleY(0); opacity: 1; } 70% { transform: scaleY(1); opacity: 1; } 100% { transform: scaleY(1); opacity: 0; } }

/* Gamme */
.range {
  list-style: none; margin: 34px auto 0; padding: 0;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.range li { padding: 22px 14px; display: grid; justify-items: center; gap: 6px; }
.range li + li { border-left: 1px solid var(--line); }
.range strong { font-family: var(--serif); font-weight: 500; font-size: 20px; line-height: 1.15; color: var(--cream); }
.range em { font-style: normal; font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); }
.range__cap { width: 9px; height: 9px; border-radius: 50%; margin-bottom: 6px; box-shadow: 0 0 0 3px rgba(255,255,255,.04); }
.range__cap--blue { background: #3d5f9e; }
.range__cap--red { background: #a3342c; }
.range__cap--gold { background: var(--gold); }

/* ---------- Final ---------- */
.final {
  position: relative; min-height: 100vh; min-height: 100svh;
  display: grid; grid-template-rows: 1fr auto; place-items: center;
  padding: 120px var(--gutter) 28px; text-align: center; overflow: hidden;
}
.filigree { position: absolute; width: min(620px, 120vw); top: 50%; left: 50%; transform: translate(-50%, -52%); color: var(--gold); opacity: .14; pointer-events: none; }
.final__inner { position: relative; max-width: 720px; }
.title--final { font-size: clamp(34px, 4.6vw, 68px); text-wrap: balance; max-width: 16ch; margin-left: auto; margin-right: auto; }
.final .lead { max-width: 560px; margin: 0 auto; }
.ctas { margin: 38px 0 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 15px 26px; border-radius: 999px; text-decoration: none;
  font-size: 13px; letter-spacing: .14em; text-transform: uppercase; font-weight: 400;
  transition: transform .4s var(--ease), background .3s, color .3s, border-color .3s;
}
.btn svg { width: 18px; height: 18px; }
.btn--gold { background: linear-gradient(135deg, var(--gold-hi), var(--gold) 55%, var(--gold-lo)); color: var(--ink); font-weight: 500; }
.btn--gold:hover { transform: translateY(-2px); }
.btn--ghost { border: 1px solid var(--line); color: var(--cream); text-transform: none; letter-spacing: .06em; }
.btn--ghost:hover { border-color: var(--gold); color: var(--gold-hi); }
.final__site { margin: 22px 0 0; font-size: 12px; letter-spacing: .3em; text-transform: uppercase; }
.final__site a { color: var(--gold); text-decoration: none; }
.legal { position: relative; max-width: 640px; padding-top: 48px; }
.legal p { margin: 4px 0; font-size: 11px; line-height: 1.6; color: rgba(241,230,208,.42); }

.badge {
  position: fixed; left: var(--gutter); bottom: max(16px, env(safe-area-inset-bottom)); z-index: 20; margin: 0;
  font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: rgba(241,230,208,.4);
  pointer-events: none; transition: opacity .6s;
}

/* ---------- Mobile ---------- */
@media (max-width: 760px) {
  .top__name { font-size: 15px; letter-spacing: .24em; }
  .top__since { font-size: 9px; }
  .lang button { padding: 6px 9px; }
  .rail { display: none; }
  .panel, .panel--left, .panel--right {
    justify-content: center; align-items: flex-end; text-align: left;
    padding: 0 20px calc(9vh + env(safe-area-inset-bottom));
  }
  .panel--center { text-align: center; }
  .panel--hero { text-align: center; padding-bottom: 15vh; }
  .panel--hero .eyebrow::after { content: ""; width: 28px; height: 1px; background: var(--gold); opacity: .7; }
  .copy { max-width: 100%; }
  .title { font-size: clamp(40px, 11.5vw, 60px); margin-bottom: 16px; }
  .panel--hero .title { font-size: clamp(58px, 17vw, 88px); }
  .lead { font-size: 15px; }
  .num { margin-bottom: 12px; }
  .meta { margin-top: 18px; }
  .range { grid-template-columns: 1fr 1fr; margin-top: 22px; }
  .range li { padding: 14px 8px; }
  .range li:nth-child(3) { border-left: 0; }
  .range li:nth-child(n+3) { border-top: 1px solid var(--line); }
  .range strong { font-size: 17px; }
  .range em { font-size: 10px; letter-spacing: .14em; }
  .badge { left: 50%; transform: translateX(-50%); white-space: nowrap; bottom: max(10px, env(safe-area-inset-bottom)); font-size: 9px; }
  .btn { width: 100%; justify-content: center; }
  .ctas { max-width: 360px; margin-left: auto; margin-right: auto; }
}
/* Lisibilité mobile : dégradé plus fort derrière le texte en bas */
@media (max-width: 760px) {
  .veil { background:
    linear-gradient(to bottom, rgba(5,3,2,.55) 0%, transparent 16%, transparent 42%, rgba(5,3,2,.88) 100%); }
}

/* ---------- Mouvement réduit ---------- */
@media (prefers-reduced-motion: reduce) {
  .grain, .cue i { animation: none; }
  .loader, .loader__arc, .btn { transition: none; }
}
