/* ------------------------------------------------------------------ *
   Démos verticales 9:16 (TikTok, Reels, Shorts) : /demo/<fonction>.
   Univers sombre volontaire : c'est un écran de vidéo, pas une page de lecture.
 * ------------------------------------------------------------------ */
@font-face { font-family: "Unbounded"; src: url("/static/fonts/unbounded-latin.woff2") format("woff2"); font-weight: 500 900; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("/static/fonts/manrope-latin.woff2") format("woff2"); font-weight: 400 800; font-display: swap; }
/* Univers volontairement unique et sombre : c'est un écran de vidéo, pas une page de lecture. */
:root {
  color-scheme: dark;
  --void: #04060d;
  --deep: #0a1020;
  --panel: rgba(18, 28, 56, .62);
  --panel-line: rgba(94, 231, 255, .22);
  --blue: #2d6bff;
  --cyan: #5ee7ff;
  --amber: #ffb547;
  --red: #ff4d6a;
  --green: #36e39a;
  --text: #eaf0ff;
  --muted: #8d9bc2;
  --display: "Unbounded", "Arial Black", system-ui, sans-serif;
  --body: "Manrope", -apple-system, "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: #020309; color: var(--text); font-family: var(--body);
  display: grid; place-items: center; padding-inline: 16px; padding-block: 16px;
}
.player { display: grid; gap: 14px; justify-items: center; width: 100%; }

/* ---------- Scène 9:16 ---------- */
.stage {
  position: relative; overflow: hidden; container-type: inline-size;
  width: min(430px, 100%, calc((100dvh - 130px) * 9 / 16));
  aspect-ratio: 9 / 16; max-width: 100%;
  border-radius: 22px; background: var(--void);
  box-shadow: 0 0 0 1px rgba(94,231,255,.14), 0 30px 80px rgba(45,107,255,.25);
  isolation: isolate;
}
.stage:fullscreen { width: auto; height: 100%; border-radius: 0; }

.bg { position: absolute; inset: 0; z-index: -1; overflow: hidden; }
.bg::before {
  content: ""; position: absolute; inset: -20%;
  background:
    radial-gradient(40% 30% at 20% 15%, rgba(45,107,255,.45), transparent 70%),
    radial-gradient(35% 28% at 85% 70%, rgba(94,231,255,.22), transparent 70%),
    radial-gradient(30% 25% at 50% 110%, rgba(255,181,71,.18), transparent 70%);
  animation: drift 14s ease-in-out infinite alternate;
}
.grid-floor {
  position: absolute; left: -50%; right: -50%; bottom: -8%; height: 55%;
  background-image:
    linear-gradient(rgba(94,231,255,.28) 1px, transparent 1px),
    linear-gradient(90deg, rgba(94,231,255,.28) 1px, transparent 1px);
  background-size: 7cqw 7cqw;
  transform: perspective(60cqw) rotateX(64deg);
  transform-origin: bottom;
  mask-image: linear-gradient(to top, #000 10%, transparent 85%);
  animation: floor 3s linear infinite;
}
.scan {
  position: absolute; inset: 0; pointer-events: none; z-index: 20;
  background: repeating-linear-gradient(to bottom, rgba(255,255,255,.035) 0 1px, transparent 1px 3px);
  mix-blend-mode: overlay;
}
.hud-corner { position: absolute; width: 7cqw; height: 7cqw; border: 2px solid var(--cyan); opacity: .55; z-index: 19; }
.hud-corner.tl { top: 3.5cqw; left: 3.5cqw; border-right: 0; border-bottom: 0; }
.hud-corner.tr { top: 3.5cqw; right: 3.5cqw; border-left: 0; border-bottom: 0; }
.hud-corner.bl { bottom: 3.5cqw; left: 3.5cqw; border-right: 0; border-top: 0; }
.hud-corner.br { bottom: 3.5cqw; right: 3.5cqw; border-left: 0; border-top: 0; }

@keyframes drift { to { transform: translate(-6%, 4%) scale(1.08); } }
@keyframes floor { to { background-position: 0 7cqw; } }

/* Barres de progression façon stories */
.stories { position: absolute; top: 5cqw; left: 12cqw; right: 12cqw; display: flex; gap: 1.2cqw; z-index: 18; }
.stories span { flex: 1; height: .9cqw; border-radius: 1cqw; background: rgba(234,240,255,.22); overflow: hidden; }
.stories i { display: block; height: 100%; width: 0; background: var(--text); }

.brand-tag {
  position: absolute; top: 9cqw; left: 6cqw; z-index: 18; display: flex; gap: 2cqw; align-items: center;
  font: 700 3.2cqw/1 var(--mono); letter-spacing: .08em; color: var(--cyan);
}
.brand-tag b { width: 5.6cqw; height: 5.6cqw; border-radius: 1.4cqw; background: var(--blue); display: grid; place-items: center; box-shadow: 0 0 3cqw rgba(45,107,255,.8); }
.rec { margin-left: auto; position: absolute; top: 9cqw; right: 6cqw; z-index: 18; font: 700 3cqw/1 var(--mono); color: var(--red); display: flex; gap: 1.4cqw; align-items: center; }
.rec::before { content: ""; width: 2cqw; height: 2cqw; border-radius: 50%; background: var(--red); animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: .2; } }

/* Sous-titres façon TikTok */
.caption {
  position: absolute; left: 6cqw; right: 6cqw; bottom: 9cqw; z-index: 18; text-align: center;
  font: 800 5.2cqw/1.25 var(--body); text-wrap: balance;
  text-shadow: 0 .4cqw 0 #000, 0 0 3cqw rgba(0,0,0,.8);
}
.caption mark { background: none; color: var(--amber); }
.caption.pop { animation: pop .35s cubic-bezier(.2,1.6,.4,1); }
@keyframes pop { from { transform: scale(.82); opacity: 0; } }

/* ---------- Scènes ---------- */
.scene {
  position: absolute; inset: 17cqw 6cqw 30cqw; display: grid; align-content: center; gap: 4cqw;
  opacity: 0; transform: translateY(3cqw) scale(.98); transition: opacity .45s, transform .45s;
  pointer-events: none;
}
.scene.active { opacity: 1; transform: none; }
[data-in] { opacity: 0; transform: translateY(2.4cqw); transition: opacity .4s, transform .4s cubic-bezier(.2,1.3,.4,1); }
[data-in].on { opacity: 1; transform: none; }

.panel {
  background: var(--panel); border: 1px solid var(--panel-line); border-radius: 4cqw;
  padding: 4.5cqw; backdrop-filter: blur(10px);
  box-shadow: inset 0 0 6cqw rgba(94,231,255,.05), 0 2cqw 8cqw rgba(0,0,0,.4);
}
.label { font: 700 2.8cqw/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--cyan); }
.neon { font-family: var(--display); font-weight: 900; line-height: 1.02; letter-spacing: -.02em; text-wrap: balance; }

/* 1. Accroche */
.clock { font: 700 24cqw/1 var(--mono); text-align: center; letter-spacing: -.04em;
  color: var(--text); text-shadow: 0 0 4cqw rgba(94,231,255,.7), 0 0 12cqw rgba(45,107,255,.6); }
.clock small { display: block; font: 700 3.2cqw/1 var(--mono); letter-spacing: .3em; color: var(--muted); margin-top: 2cqw; }
.hook { font-size: 8.6cqw; text-align: center; }
.hook .glitch { color: var(--amber); position: relative; display: inline-block; }
.hook .glitch.on { animation: glitch .9s steps(2) 2; }
@keyframes glitch {
  0% { text-shadow: .8cqw 0 var(--red), -.8cqw 0 var(--cyan); transform: translateX(.6cqw); }
  50% { text-shadow: -.8cqw 0 var(--red), .8cqw 0 var(--cyan); transform: translateX(-.6cqw); }
  100% { text-shadow: none; transform: none; }
}

/* 2. Dictée */
.mic { width: 22cqw; height: 22cqw; margin: 0 auto; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle, var(--blue), #16307a); box-shadow: 0 0 0 0 rgba(45,107,255,.6); animation: ping 1.4s ease-out infinite; }
@keyframes ping { to { box-shadow: 0 0 0 7cqw rgba(45,107,255,0); } }
.wave { display: flex; gap: 1cqw; justify-content: center; align-items: center; height: 10cqw; }
.wave i { width: 1.2cqw; border-radius: 1cqw; background: var(--cyan); animation: wave 1s ease-in-out infinite; }
.wave i:nth-child(odd) { animation-duration: .7s; }
.wave i:nth-child(3n) { animation-duration: 1.2s; }
@keyframes wave { 0%, 100% { height: 2cqw; } 50% { height: 9cqw; } }
.typed { font: 700 5.4cqw/1.4 var(--body); min-height: 23cqw; }
.typed .cursor { display: inline-block; width: .8cqw; height: 5.4cqw; background: var(--cyan); vertical-align: -.8cqw; margin-left: .6cqw; animation: blink .8s steps(2) infinite; }

/* 3. Devis */
.quote-head { display: flex; justify-content: space-between; align-items: center; gap: 2cqw; }
.quote-head strong { font: 700 3.6cqw/1 var(--mono); }
.chip { font: 700 2.8cqw/1 var(--mono); padding: 1.3cqw 2.4cqw; border-radius: 10cqw; border: 1px solid currentColor; white-space: nowrap; }
.chip.cyan { color: var(--cyan); }
.chip.green { color: var(--green); background: rgba(54,227,154,.1); }
.chip.red { color: var(--red); background: rgba(255,77,106,.1); }
.chip.amber { color: var(--amber); background: rgba(255,181,71,.1); }
.lines-wrap { position: relative; margin-top: 3cqw; }
.lines { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.lines li { display: flex; justify-content: space-between; gap: 3cqw; padding: 2.4cqw 0; border-top: 1px solid rgba(141,155,194,.18); font-size: 3.5cqw; }
.lines li span:last-child { font: 700 3.5cqw/1.3 var(--mono); color: var(--cyan); white-space: nowrap; }
.lines li small { display: block; color: var(--muted); font-size: 2.8cqw; }
.beam { position: absolute; left: -4cqw; right: -4cqw; height: 12cqw; top: 0;
  background: linear-gradient(to bottom, transparent, rgba(94,231,255,.35), transparent); filter: blur(1px); opacity: 0; }
.beam.on { opacity: 1; animation: beam 1.1s ease-in-out 2; }
@keyframes beam { from { transform: translateY(-10cqw); } to { transform: translateY(60cqw); } }
.total { display: flex; justify-content: space-between; align-items: baseline; margin-top: 3cqw; padding-top: 3cqw; border-top: 1px solid var(--panel-line); }
.total span { font: 700 3cqw/1 var(--mono); color: var(--muted); letter-spacing: .1em; }
.total b { font: 900 9cqw/1 var(--display); color: var(--amber); text-shadow: 0 0 5cqw rgba(255,181,71,.55); font-variant-numeric: tabular-nums; }
.stopwatch { text-align: center; font: 700 3.4cqw/1 var(--mono); color: var(--green); }

/* 4. Argent */
.flow { display: grid; grid-template-columns: 1fr 1fr; gap: 3cqw; }
.tile { padding: 3.6cqw; border-radius: 3.4cqw; background: var(--panel); border: 1px solid var(--panel-line); display: grid; gap: 1.6cqw; }
.tile small { font: 700 2.6cqw/1 var(--mono); color: var(--muted); letter-spacing: .1em; text-transform: uppercase; }
.tile b { font: 900 6cqw/1 var(--display); }
.bar { height: 1.4cqw; border-radius: 2cqw; background: rgba(141,155,194,.18); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; border-radius: 2cqw; transition: width 1.1s cubic-bezier(.2,.8,.2,1); }
.tile.hot { border-color: var(--amber); box-shadow: 0 0 6cqw rgba(255,181,71,.35); }
.tile.hot b { color: var(--amber); }
.action-card { display: flex; align-items: center; justify-content: space-between; gap: 3cqw; }
.action-card div { display: grid; gap: 1cqw; }
.action-card strong { font-size: 4cqw; }
.action-card span { color: var(--muted); font-size: 3cqw; }
.btn { position: relative; font: 800 3.6cqw/1 var(--body); padding: 3cqw 4.4cqw; border-radius: 3cqw; background: var(--blue); color: #fff; white-space: nowrap; box-shadow: 0 0 5cqw rgba(45,107,255,.7); }
.btn.tap::after { content: ""; position: absolute; inset: 50% auto auto 50%; width: 4cqw; height: 4cqw; margin: -2cqw; border-radius: 50%; background: rgba(255,255,255,.8); animation: tap .6s ease-out forwards; }
@keyframes tap { to { transform: scale(9); opacity: 0; } }
.toast { display: flex; align-items: center; gap: 2.4cqw; justify-content: center; font: 800 4cqw/1 var(--body); color: var(--green); }
.toast i { width: 6cqw; height: 6cqw; border-radius: 50%; border: 2px solid var(--green); display: grid; place-items: center; font-style: normal; font-size: 3.6cqw; }

/* 5. Relance */
.letter { background: #f4f6fb; color: #151a28; border-radius: 3cqw; padding: 4.4cqw; font-size: 3.3cqw; line-height: 1.5; position: relative; min-height: 46cqw; }
.letter p { margin: 0 0 2cqw; }
.letter .from { font: 700 2.6cqw/1 var(--mono); color: #5a6479; letter-spacing: .08em; margin-bottom: 3cqw; }
.stamp { position: absolute; right: 4cqw; bottom: 4cqw; font: 900 4cqw/1 var(--display); color: var(--green); border: 3px solid var(--green); padding: 1.6cqw 2.6cqw; border-radius: 2cqw; transform: rotate(-8deg) scale(1.6); opacity: 0; transition: transform .35s cubic-bezier(.2,1.6,.4,1), opacity .2s; background: rgba(54,227,154,.08); }
.stamp.on { transform: rotate(-8deg) scale(1); opacity: 1; }

/* 6. Chantiers */
.site { display: grid; gap: 2.6cqw; }
.site-top { display: flex; justify-content: space-between; align-items: center; gap: 2cqw; }
.site-top strong { font-size: 4cqw; }
.site-top small { display: block; color: var(--muted); font-size: 2.9cqw; margin-top: .6cqw; }
.track { position: relative; height: 2.6cqw; border-radius: 3cqw; background: rgba(141,155,194,.18); }
.track i { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 3cqw; transition: width 1.1s cubic-bezier(.2,.8,.2,1); }
.track .marker { position: absolute; top: -1.6cqw; bottom: -1.6cqw; width: .7cqw; margin-left: -.35cqw; background: var(--text); border-radius: 1cqw; box-shadow: 0 0 2cqw #fff; }
.site-meta { display: flex; justify-content: space-between; font: 700 3cqw/1 var(--mono); color: var(--muted); }
.site.alert { border-color: rgba(255,77,106,.55); box-shadow: 0 0 7cqw rgba(255,77,106,.25); }

/* 7. Fin */
.logo { width: 24cqw; height: 24cqw; margin: 0 auto; border-radius: 6cqw; background: var(--blue); display: grid; place-items: center;
  box-shadow: 0 0 0 1.4cqw rgba(45,107,255,.2), 0 0 14cqw rgba(45,107,255,.9); }
.logo svg { width: 60%; height: 60%; }
.outro-name { text-align: center; font-size: 12cqw; letter-spacing: -.03em; }
.outro-line { text-align: center; font: 700 4.8cqw/1.35 var(--body); color: var(--muted); text-wrap: balance; }
.outro-line b { color: var(--text); }
.offer { display: flex; flex-wrap: wrap; gap: 2cqw; justify-content: center; }

/* ---------- Commandes ---------- */
.controls { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.controls button {
  font: 700 14px/1 var(--body); color: var(--text); background: #111a33; border: 1px solid #25325c;
  padding: 10px 14px; border-radius: 10px; cursor: pointer;
}
.controls button:hover { border-color: var(--cyan); }
.controls button:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.tip { font-size: 13px; color: var(--muted); text-align: center; max-width: 46ch; margin: 0; line-height: 1.5; }

@media (prefers-reduced-motion: reduce) {
  .bg::before, .grid-floor, .wave i, .mic, .rec::before { animation: none !important; }
  .scene, [data-in], .bar i, .track i { transition: none !important; }
}

/* ---------- Éléments propres aux démos par fonction ---------- */
.block-btn { display: block; text-align: center; margin-top: 2cqw; }
.phone { display: grid; gap: 3cqw; }
.phone-total { font: 900 9cqw/1 var(--display); color: var(--amber); letter-spacing: -.03em; }
.phone-field { display: grid; gap: 1.4cqw; font-size: 3cqw; color: var(--muted); }
.phone-field b { font: 700 4.6cqw/1.2 var(--body); color: var(--text); padding: 2.6cqw 3cqw; border-radius: 2.4cqw; border: 1px solid var(--panel-line); min-height: 10cqw; }
.phone-check { display: flex; gap: 2cqw; align-items: center; font-weight: 700; font-size: 3.8cqw; color: var(--green); }
.notif { display: grid; gap: 1.6cqw; }
.notif strong { font-size: 4.2cqw; }
.notif > span:last-child { color: var(--muted); font-size: 3cqw; }
.week { display: grid; gap: 1.6cqw; }
.week-row { display: grid; grid-template-columns: 16cqw repeat(5, minmax(0, 1fr)); gap: 1.2cqw; align-items: center; font-size: 2.8cqw; }
.week-row.head span { font: 700 2.6cqw/1 var(--mono); color: var(--muted); text-align: center; }
.week-row b { font-size: 3.2cqw; }
.slot { text-align: center; padding: 1.8cqw .6cqw; border-radius: 1.6cqw; background: rgba(45,107,255,.28); border: 1px solid rgba(94,231,255,.35); font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slot.empty { background: rgba(255,77,106,.14); border-color: rgba(255,77,106,.5); color: var(--red); }
.warn-chip { justify-self: center; font-size: 3cqw; }

/* Index des démos */
.demo-index { max-width: 640px; margin: 8vh auto; padding: 0 20px; color: var(--text); font-family: var(--body); }
.demo-index h1 { font: 800 32px/1.1 var(--display); letter-spacing: -.04em; margin-bottom: 10px; }
.demo-index p { color: var(--muted); line-height: 1.6; }
.demo-index ul { list-style: none; padding: 0; display: grid; gap: 10px; margin-top: 24px; }
.demo-index li { display: flex; gap: 14px; align-items: center; padding: 14px 16px; border-radius: 14px; background: #0d1426; border: 1px solid #22305a; }
.demo-index li span { flex: 1; font-weight: 700; }
.demo-index a { color: var(--cyan); font-weight: 700; }
