/* ===================================================================
 * CitizOS · boot.css V3 NARRATIVE · cinématique 3 actes (~25s)
 * Constat → Rassurance → Gain · incarnée sur une PME de service
 * Skip clic / Skip intro / Escape · sessionStorage flag · 1×/session
 * =================================================================== */

#cinematic-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--ink);
  color: var(--paper);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  transition: opacity 0.9s cubic-bezier(0.22, 0.61, 0.36, 1),
              visibility 0.9s;
}

#cinematic-overlay::before {
  content: '';
  position: absolute;
  inset: -10%;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(35% 35% at 30% 40%, rgba(199,154,77,0.12) 0%, transparent 70%),
    radial-gradient(40% 40% at 70% 60%, rgba(42,138,140,0.08) 0%, transparent 70%);
  filter: blur(70px);
  animation: cn-ambient 18s ease-in-out infinite alternate;
}
@keyframes cn-ambient {
  0%   { transform: translate(0, 0) scale(1); opacity: 0.7; }
  100% { transform: translate(-3%, 3%) scale(1.08); opacity: 1; }
}

#cinematic-overlay.done {
  opacity: 0;
  visibility: hidden;
}
body.booting { overflow: hidden; }

/* ─── Brand persistent (top-left) ─────────────────────────────── */
.cn-brand {
  position: absolute;
  top: 28px;
  left: 32px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--paper);
  z-index: 5;
  opacity: 0;
  animation: cn-fade-in 0.7s ease 0.15s forwards;
}
.cn-brand .cn-glyph {
  width: 16px; height: 16px;
  border-radius: 4px;
  background: var(--paper);
  position: relative;
}
.cn-brand .cn-glyph::after {
  content: '';
  position: absolute; inset: 3px;
  background: var(--ink);
  border-radius: 1px;
}

/* ─── Skip intro button (top-right) ───────────────────────────── */
.cn-skip {
  position: absolute;
  top: 28px;
  right: 32px;
  z-index: 5;
  background: none;
  border: 1px solid rgba(245,243,237,0.2);
  color: rgba(245,243,237,0.65);
  padding: 7px 14px;
  border-radius: 999px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  opacity: 0;
  animation: cn-fade-in 0.7s ease 0.2s forwards;
  transition: color 0.25s ease, border-color 0.25s ease;
}
.cn-skip:hover {
  color: var(--gold);
  border-color: var(--gold);
}

/* ─── Progress indicator (bottom-center) · 7 dots ─────────────── */
.cn-progress {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 18px;
  z-index: 5;
  opacity: 0;
  animation: cn-fade-in 0.7s ease 0.25s forwards;
}
.cn-progress .cn-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: rgba(245,243,237,0.18);
  transition: background 0.4s ease, transform 0.4s cubic-bezier(0.22, 0.61, 0.36, 1),
              box-shadow 0.4s ease;
}
.cn-progress .cn-dot.active {
  background: var(--gold);
  transform: scale(1.4);
  box-shadow: 0 0 10px rgba(199,154,77,0.6);
}
.cn-progress .cn-dot.done {
  background: rgba(199,154,77,0.45);
}

/* ─── Hint navigation (bottom-right) ──────────────────────────── */
.cn-hint {
  position: absolute;
  bottom: 30px;
  right: 32px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(245,243,237,0.4);
  z-index: 5;
  opacity: 0;
  animation: cn-fade-in 0.7s ease 0.3s forwards, cn-hint-pulse 3s ease 2s infinite;
}
.cn-hint .cn-arrow {
  color: var(--gold);
  margin-left: 4px;
}
@keyframes cn-hint-pulse {
  0%, 100% { opacity: 0.55; }
  50%      { opacity: 1; }
}

@keyframes cn-fade-in { to { opacity: 1; } }

/* ─── Scenes container ────────────────────────────────────────── */
.cn-stage {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 720px;
  padding: 0 32px;
  text-align: center;
}

.cn-scene {
  display: none;
  opacity: 0;
}
.cn-scene.active {
  display: block;
  animation: cn-scene-in 0.7s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}
.cn-scene.leaving {
  display: block;
  animation: cn-scene-out 0.45s cubic-bezier(0.4, 0, 0.6, 1) forwards;
}

@keyframes cn-scene-in {
  from { opacity: 0; transform: translateY(20px); filter: blur(8px); }
  to   { opacity: 1; transform: translateY(0); filter: blur(0); }
}
@keyframes cn-scene-out {
  from { opacity: 1; transform: translateY(0); filter: blur(0); }
  to   { opacity: 0; transform: translateY(-12px); filter: blur(6px); }
}

/* ─── Composants communs · titres/eyebrows/subtitles ──────────── */
.cn-eyebrow {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 600;
  margin-bottom: 20px;
  opacity: 0;
  animation: cn-fade-up 0.7s cubic-bezier(0.22, 0.61, 0.36, 1) 0.05s forwards;
}
.cn-title {
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: clamp(2rem, 3.5vw + 1rem, 3.5rem);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.15;
  color: var(--paper);
  margin: 0 auto 22px;
  max-width: 20ch;
}
.cn-title-narrow { max-width: 16ch; }
.cn-title-tight  { max-width: 14ch; }
.cn-title em {
  font-family: 'Fraunces', Georgia, serif;
  font-style: italic;
  font-weight: 500;
  color: var(--gold);
}
.cn-subtitle {
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: clamp(1rem, 0.5vw + 0.9rem, 1.2rem);
  color: rgba(245,243,237,0.72);
  max-width: 52ch;
  margin: 0 auto;
  line-height: 1.55;
  opacity: 0;
  animation: cn-fade-up 0.7s cubic-bezier(0.22, 0.61, 0.36, 1) 0.25s forwards;
}
@keyframes cn-fade-up {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ═════════════════════════════════════════════════════════════════
 * SCENE 1 · 23h47 · constat émotionnel
 * ═══════════════════════════════════════════════════════════════*/
.cn-scene-1 .cn-timestamp {
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(3rem, 6vw, 5rem);
  font-weight: 300;
  color: rgba(245,243,237,0.85);
  letter-spacing: 0.02em;
  margin-bottom: 28px;
  opacity: 0;
  animation: cn-fade-up 0.8s cubic-bezier(0.22, 0.61, 0.36, 1) 0.1s forwards;
}
.cn-scene-1 .cn-blink {
  display: inline-block;
  color: var(--gold);
  animation: cn-time-blink 1.1s steps(2) infinite;
}
@keyframes cn-time-blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0.2; }
}
.cn-scene-1 .cn-context {
  margin-top: 24px;
  font-family: 'Fraunces', Georgia, serif;
  font-style: italic;
  font-size: 14px;
  color: rgba(245,243,237,0.4);
  opacity: 0;
  animation: cn-fade-up 0.7s ease 1.4s forwards;
}

/* ═════════════════════════════════════════════════════════════════
 * SCENE 2 · Le poids invisible · listing cascade
 * ═══════════════════════════════════════════════════════════════*/
.cn-scene-2 .cn-burdens {
  list-style: none;
  margin: 32px auto 0;
  max-width: 460px;
  text-align: left;
  padding: 0;
}
.cn-scene-2 .cn-burden {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 0;
  font-size: 15.5px;
  color: rgba(245,243,237,0.78);
  font-family: 'Inter', sans-serif;
  border-bottom: 1px solid rgba(245,243,237,0.07);
  opacity: 0;
  transform: translateX(-12px);
  animation: cn-burden-in 0.5s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}
.cn-scene-2 .cn-burden:last-child { border-bottom: none; }
.cn-scene-2 .cn-burden:nth-child(1) { animation-delay: 0.4s; }
.cn-scene-2 .cn-burden:nth-child(2) { animation-delay: 0.7s; }
.cn-scene-2 .cn-burden:nth-child(3) { animation-delay: 1.0s; }
.cn-scene-2 .cn-burden:nth-child(4) { animation-delay: 1.3s; }
.cn-scene-2 .cn-burden:nth-child(5) { animation-delay: 1.6s; }
@keyframes cn-burden-in {
  to { opacity: 1; transform: translateX(0); }
}
.cn-scene-2 .cn-bdot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #a23b2d;
  flex-shrink: 0;
  box-shadow: 0 0 8px rgba(162,59,45,0.5);
}

/* ═════════════════════════════════════════════════════════════════
 * SCENE 4 · Vous gardez ce qui compte · checks rassurance
 * ═══════════════════════════════════════════════════════════════*/
.cn-scene-4 .cn-keeps {
  list-style: none;
  margin: 32px auto 28px;
  max-width: 480px;
  text-align: left;
  padding: 0;
}
.cn-scene-4 .cn-keep {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  margin-bottom: 8px;
  font-size: 15px;
  color: rgba(245,243,237,0.88);
  font-family: 'Inter', sans-serif;
  background: rgba(199,154,77,0.05);
  border: 1px solid rgba(199,154,77,0.18);
  border-radius: 8px;
  opacity: 0;
  animation: cn-keep-in 0.6s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}
.cn-scene-4 .cn-keep:nth-child(1) { animation-delay: 0.3s; }
.cn-scene-4 .cn-keep:nth-child(2) { animation-delay: 0.55s; }
.cn-scene-4 .cn-keep:nth-child(3) { animation-delay: 0.8s; }
@keyframes cn-keep-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.cn-scene-4 .cn-kcheck {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}
.cn-scene-4 .cn-tagline {
  font-family: 'Fraunces', Georgia, serif;
  font-size: clamp(1.1rem, 0.5vw + 1rem, 1.35rem);
  color: rgba(245,243,237,0.85);
  margin-top: 10px;
  opacity: 0;
  animation: cn-fade-up 0.7s ease 1.2s forwards;
}
.cn-scene-4 .cn-tagline em {
  font-style: italic;
  color: var(--gold);
}

/* ═════════════════════════════════════════════════════════════════
 * SCENE 5 · Démo timeline · appel → SMS → RDV
 * ═══════════════════════════════════════════════════════════════*/
.cn-scene-5 .cn-timeline {
  margin: 32px auto 0;
  max-width: 540px;
  border: 1px solid rgba(245,243,237,0.16);
  border-radius: 12px;
  padding: 14px 18px;
  background: rgba(245,243,237,0.03);
  text-align: left;
}
.cn-scene-5 .cn-tl-step {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 11px 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px;
  color: rgba(245,243,237,0.78);
  border-bottom: 1px dashed rgba(245,243,237,0.1);
  opacity: 0;
  animation: cn-tl-in 0.55s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}
.cn-scene-5 .cn-tl-step:last-child { border-bottom: none; }
.cn-scene-5 .cn-tl-step:nth-child(1) { animation-delay: 0.3s; }
.cn-scene-5 .cn-tl-step:nth-child(2) { animation-delay: 0.9s; }
.cn-scene-5 .cn-tl-step:nth-child(3) { animation-delay: 1.6s; }
.cn-scene-5 .cn-tl-step:nth-child(4) { animation-delay: 2.5s; }
@keyframes cn-tl-in {
  from { opacity: 0; transform: translateX(-8px); }
  to   { opacity: 1; transform: translateX(0); }
}
.cn-scene-5 .cn-tl-time {
  color: rgba(245,243,237,0.5);
  font-weight: 600;
}
.cn-scene-5 .cn-tl-text {
  color: rgba(245,243,237,0.88);
  font-family: 'Inter', sans-serif;
  font-size: 13.5px;
}
.cn-scene-5 .cn-tl-status {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 4px 9px;
  border-radius: 4px;
  font-weight: 600;
  white-space: nowrap;
}
.cn-scene-5 .cn-tl-status.detected {
  background: rgba(245,243,237,0.1);
  color: rgba(245,243,237,0.65);
}
.cn-scene-5 .cn-tl-status.waiting {
  background: rgba(199,154,77,0.18);
  color: var(--gold);
  animation: cn-pulse-waiting 1.4s ease-in-out infinite;
}
@keyframes cn-pulse-waiting {
  0%, 100% { opacity: 0.85; }
  50% { opacity: 1; box-shadow: 0 0 10px rgba(199,154,77,0.35); }
}
.cn-scene-5 .cn-tl-status.validated {
  background: var(--gold);
  color: var(--ink);
}
.cn-scene-5 .cn-tl-status.won {
  background: rgba(31,77,63,0.6);
  color: #7ad9a8;
  border: 1px solid rgba(122,217,168,0.3);
}

/* ═════════════════════════════════════════════════════════════════
 * SCENE 6 · Gains chiffrés
 * ═══════════════════════════════════════════════════════════════*/
.cn-scene-6 .cn-gains {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 18px;
  margin: 36px auto 0;
  max-width: 600px;
}
@media (max-width: 600px) {
  .cn-scene-6 .cn-gains { grid-template-columns: 1fr; gap: 14px; }
}
.cn-scene-6 .cn-gain {
  padding: 24px 18px;
  border: 1px solid rgba(245,243,237,0.16);
  border-radius: 12px;
  background: rgba(245,243,237,0.03);
  opacity: 0;
  animation: cn-gain-in 0.7s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}
.cn-scene-6 .cn-gain:nth-child(1) { animation-delay: 0.3s; }
.cn-scene-6 .cn-gain:nth-child(2) { animation-delay: 0.55s; }
.cn-scene-6 .cn-gain:nth-child(3) { animation-delay: 0.8s; }
@keyframes cn-gain-in {
  from { opacity: 0; transform: translateY(14px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.cn-scene-6 .cn-gain-num {
  font-family: 'Fraunces', Georgia, serif;
  font-size: clamp(2.4rem, 4vw, 3.4rem);
  font-weight: 500;
  color: var(--paper);
  line-height: 1;
  margin-bottom: 10px;
  letter-spacing: -0.03em;
}
.cn-scene-6 .cn-gain-num.gold { color: var(--gold); }
.cn-scene-6 .cn-gain-lbl {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(245,243,237,0.6);
  line-height: 1.45;
}

/* ═════════════════════════════════════════════════════════════════
 * SCENE 7 · CTA final
 * ═══════════════════════════════════════════════════════════════*/
.cn-scene-7 .cn-enter-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 32px;
  padding: 14px 28px;
  background: var(--gold);
  color: var(--ink);
  border: none;
  border-radius: 999px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
  opacity: 0;
  animation: cn-fade-up 0.7s cubic-bezier(0.22, 0.61, 0.36, 1) 0.6s forwards;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.cn-scene-7 .cn-enter-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(199,154,77,0.4);
}
.cn-scene-7 .cn-enter-btn .cn-arrow { font-size: 14px; }

/* ─── Reduced motion · skip total ─────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  #cinematic-overlay {
    transition: none;
    opacity: 0;
    visibility: hidden;
  }
  body.booting { overflow: auto; }
}
