/* =========================================================
   VISIOFRAME — Narration tablette en 5 actes (GSAP)
   Tablette landscape construite 100% en CSS — propre,
   bien proportionnée, jamais d'image qui déborde.
   ========================================================= */

/* ───── Stage ───── */
.story-stage {
  position: relative;
  width: 100%;
  height: 460vh;   /* réduit de 600vh → scroll plus court, plus fluide */
  background:
    radial-gradient(600px 400px at 20% 20%, rgba(240,112,48,.07), transparent 60%),
    radial-gradient(700px 500px at 80% 80%, rgba(107,102,224,.06), transparent 60%),
    linear-gradient(180deg, #fff 0%, var(--brand-50) 50%, #fff 100%);
  /* ⚠ PAS de "contain" ici : casse position:fixed du pin GSAP (containing block parasite). */
}
/* ⚠ position:sticky natif — plus fiable que le pin GSAP */
.story-pin {
  position: sticky;
  top: 0;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  display: flex; align-items: flex-end; justify-content: center;
  padding-bottom: 12vh;
  padding-top: calc(var(--header-h) + 24vh);
}

/* ───── Halos parallax fond (blur réduit pour perf) ───── */
.story-halo {
  position: absolute; border-radius: 50%; filter: blur(48px);
  will-change: transform;
  pointer-events: none;
  transform: translateZ(0); /* GPU layer */
}
.story-halo--brand {
  width: 360px; height: 360px;
  background: radial-gradient(circle, var(--brand) 0%, transparent 65%);
  opacity: .22; top: -100px; left: -120px;
}
.story-halo--indigo {
  width: 420px; height: 420px;
  background: radial-gradient(circle, #6B66E0 0%, transparent 65%);
  opacity: .18; bottom: -140px; right: -140px;
}

/* ───── Tablette LANDSCAPE construite en CSS — taille réduite ───── */
.story-tablet {
  position: relative;
  width: min(480px, 72vw);
  aspect-ratio: 16 / 10;
  background: #0a0a18;
  border-radius: 22px;
  padding: 14px;
  box-shadow:
    0 30px 60px rgba(20,20,40,.30),
    inset 0 0 0 1.5px #2a2a4a,
    inset 0 0 0 3px #0a0a18;
  will-change: transform;
  z-index: 5;
}
/* Petit point caméra centré sur le bord haut (landscape) */
.story-tablet::before {
  content: '';
  position: absolute;
  top: 6px; left: 50%; transform: translateX(-50%);
  width: 5px; height: 5px; border-radius: 50%;
  background: #2a2a4a;
  z-index: 6;
}
/* Petit point home/capteur sur le bord droit */
.story-tablet::after {
  content: '';
  position: absolute;
  right: 6px; top: 50%; transform: translateY(-50%);
  width: 6px; height: 6px; border-radius: 50%;
  border: 1px solid #2a2a4a;
  z-index: 6;
}

.story-screen-wrap {
  position: relative; width: 100%; height: 100%;
  background: #0a0a18;
  border-radius: 8px;
  overflow: hidden;
}

/* ───── Écrans (un par acte) ───── */
.scene-screen {
  position: absolute; inset: 0;
  opacity: 0;
  transform: scale(1.04);
  pointer-events: none;
}
.scene-screen.is-active {
  opacity: 1;
  transform: scale(1);
}

/* Écran 0 : Veille */
.s-idle {
  background:
    radial-gradient(circle at 50% 50%, rgba(240,112,48,.18) 0%, transparent 60%),
    #000;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.s-idle .clock {
  color: #fff; font-weight: 200; letter-spacing: 6px;
  font-size: 56px; opacity: .42;
}
.s-idle .date {
  color: rgba(255,255,255,.4);
  font-size: 12px; letter-spacing: 2px; text-transform: uppercase;
  font-weight: 700; margin-top: 6px;
}
.s-idle .wake-ring {
  position: absolute; left: 50%; top: 50%;
  width: 80px; height: 80px;
  margin: -40px 0 0 -40px;
  border: 2px solid rgba(240,112,48,.5);
  border-radius: 50%;
  opacity: 0;
}

/* Écran 1 : Appel entrant LANDSCAPE */
.s-incall {
  background: linear-gradient(135deg, #1A1A2E 0%, #0a0a18 100%);
  color: #fff;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  padding: 26px 32px;
  gap: 24px;
  align-items: center;
}
.s-incall .left { display: flex; flex-direction: column; align-items: center; justify-content: center; }
.s-incall .right { display: flex; flex-direction: column; gap: 12px; }
.s-incall .label {
  font-size: 11px; letter-spacing: 2px; text-transform: uppercase;
  opacity: .55; font-weight: 800; margin-bottom: 12px;
}
.s-incall .caller-name {
  font-size: 28px; font-weight: 900; margin-bottom: 2px;
}
.s-incall .caller-rel { font-size: 12px; opacity: .65; margin-bottom: 16px; }
.s-incall .avatar-big {
  width: 110px; height: 110px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  display: flex; align-items: center; justify-content: center;
  font-size: 44px; font-weight: 900; color: #fff;
  margin-bottom: 14px;
  position: relative;
}
.s-incall .avatar-big::before, .s-incall .avatar-big::after {
  content: ''; position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid var(--brand);
  opacity: .5;
  animation: ringPulse 1.8s ease-out infinite;
}
.s-incall .avatar-big::after { animation-delay: .9s; }
@keyframes ringPulse {
  0%   { transform: scale(1);   opacity: .55; }
  100% { transform: scale(1.7); opacity: 0;   }
}
.s-incall .auto-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(240,112,48,.22);
  color: var(--brand);
  font-size: 10px; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase;
  padding: 5px 12px;
  align-self: flex-start;
}
.s-incall .auto-badge .dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--brand);
  animation: blink 1.2s infinite;
}
@keyframes blink { 0%,100%{ opacity:1 } 50%{ opacity:.3 } }
.s-incall .info-line {
  font-size: 12px; color: rgba(255,255,255,.65);
  display: flex; align-items: center; gap: 8px;
  padding: 8px 0;
}
.s-incall .info-line::before { content: '✓'; color: var(--brand); font-weight: 900; }
.s-incall .call-actions {
  margin-top: 12px;
  display: flex; gap: 18px;
}
.s-incall .call-btn {
  width: 52px; height: 52px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; color: #fff;
  box-shadow: 0 6px 16px rgba(0,0,0,.4);
}
.s-incall .call-btn--accept { background: #2E7D32; }
.s-incall .call-btn--reject { background: #B71C1C; }

/* Écran 2 : Conversation visio LANDSCAPE */
.s-talking {
  background: #1A1A2E;
  display: flex; flex-direction: column;
}
.s-talking .talk-main {
  flex: 1;
  background: linear-gradient(135deg, #6B66E0, #1A1A2E);
  position: relative;
}
.s-talking .talk-main .silhouette {
  position: absolute; left: 50%; bottom: 0;
  width: 50%; height: 90%;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at 50% 30%, #FFE0CC 0%, #F07030 30%, transparent 75%);
  filter: blur(2px);
  opacity: .85;
}
.s-talking .talk-main .silhouette::before {
  content: '';
  position: absolute; left: 50%; top: 28%;
  transform: translateX(-50%);
  width: 24%; aspect-ratio: 1;
  background: radial-gradient(circle, #fff5e8, #ffd9b3);
  border-radius: 50%;
  box-shadow: 0 4px 30px rgba(0,0,0,.18);
}
.s-talking .talk-overlay {
  position: absolute; top: 14px; left: 14px;
  color: #fff;
  font-size: 11px;
  display: flex; align-items: center; gap: 6px;
  font-weight: 700;
}
.s-talking .live-dot {
  width: 8px; height: 8px; border-radius: 50%; background: #ff3838;
  animation: blink 1s infinite;
}
.s-talking .talk-timer {
  position: absolute; top: 14px; right: 14px;
  background: rgba(0,0,0,.4); color: #fff;
  font-size: 11px; font-weight: 800; padding: 4px 10px; border-radius: 12px;
}
.s-talking .pip {
  position: absolute; top: 50px; right: 14px;
  width: 80px; height: 56px;
  background: linear-gradient(135deg, #1A1A2E, #6B66E0);
  border: 2px solid #fff;
  border-radius: 6px;
  overflow: hidden;
}
.s-talking .pip::before {
  content: '';
  position: absolute; left: 50%; bottom: 0;
  width: 65%; height: 78%; transform: translateX(-50%);
  background: radial-gradient(ellipse at 50% 30%, #FFE0CC, transparent 70%);
}
.s-talking .subtitle {
  position: absolute; left: 50%; bottom: 70px; transform: translateX(-50%);
  background: rgba(0,0,0,.7); color: #fff;
  padding: 6px 14px; border-radius: 4px;
  font-size: 13px; font-weight: 700;
  letter-spacing: .3px;
  max-width: 75%;
  text-align: center;
}
.s-talking .talk-controls {
  background: rgba(10,10,24,.95);
  padding: 14px;
  display: flex; gap: 14px; justify-content: center;
}
.s-talking .ctrl-btn {
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(255,255,255,.12); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 13px;
}
.s-talking .ctrl-btn.end { background: #B71C1C; }

/* Écran 3 : Carnet contacts LANDSCAPE en grid 2 colonnes */
.s-contacts {
  background: #fff;
  display: flex; flex-direction: column;
}
.s-contacts .ct-head {
  background: var(--brand);
  color: #fff;
  padding: 14px 18px;
}
.s-contacts .ct-head .h {
  font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase;
  opacity: .85; font-weight: 800;
}
.s-contacts .ct-head .t {
  font-size: 16px; font-weight: 900; margin-top: 2px;
}
.s-contacts .ct-list {
  flex: 1; padding: 14px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  align-content: start;
}
.s-contacts .ct-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px;
  border: 1.5px solid #f0f0f0;
  border-radius: 6px;
}
.s-contacts .ct-row.focus { background: var(--brand-light); border-color: var(--brand); }
.s-contacts .ct-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 900; font-size: 15px;
  flex-shrink: 0;
}
.s-contacts .ct-name { font-weight: 800; color: var(--navy); font-size: 13px; }
.s-contacts .ct-rel  { font-size: 9px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.s-contacts .ct-call {
  margin-left: auto;
  width: 28px; height: 28px; border-radius: 50%;
  background: #2E7D32; color: #fff;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

/* Écran 4 : Vie autour LANDSCAPE 4 colonnes */
.s-life {
  background: #fafafa;
  display: flex; flex-direction: column;
}
.s-life .life-hd {
  background: var(--navy); color: #fff;
  padding: 14px 18px;
  display: flex; justify-content: space-between; align-items: center;
}
.s-life .life-hd .h { font-size: 10px; opacity: .6; letter-spacing: 1.5px; text-transform: uppercase; font-weight: 800; }
.s-life .life-hd .t { font-size: 16px; font-weight: 900; margin-top: 2px; }
.s-life .life-hd .weather {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.08);
  padding: 6px 12px;
  font-size: 11px; font-weight: 800;
}
.s-life .life-grid {
  flex: 1;
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 10px; padding: 14px;
}
.s-life .lc {
  background: #fff;
  padding: 14px;
  display: flex; flex-direction: column; gap: 8px;
  border-left: 3px solid var(--brand);
  border-radius: 0 4px 4px 0;
}
.s-life .lc .lc-i {
  width: 30px; height: 30px;
  background: var(--brand-light); color: var(--brand);
  display: flex; align-items: center; justify-content: center;
}
.s-life .lc .lc-t { font-size: 12px; font-weight: 900; color: var(--navy); }
.s-life .lc .lc-s { font-size: 9px; color: var(--muted); letter-spacing: .8px; text-transform: uppercase; }
.s-life .lc--photo { background: linear-gradient(135deg, #FFE0CC, #F07030); color: #fff; border-left-color: #fff; }
.s-life .lc--photo .lc-t, .s-life .lc--photo .lc-s { color: #fff; }
.s-life .lc--photo .lc-i { background: rgba(255,255,255,.2); color: #fff; }
.s-life .lc--ia { background: linear-gradient(135deg, #1A1A2E, #6B66E0); color: #fff; border-left-color: var(--brand); }
.s-life .lc--ia .lc-t, .s-life .lc--ia .lc-s { color: #fff; }
.s-life .lc--ia .lc-i { background: rgba(255,255,255,.18); color: #fff; }

/* ───── Headlines (1 par acte) — sous le sticky header ───── */
.scene-text {
  position: absolute;
  z-index: 6;
  top: calc(var(--header-h) + 4vh);
  left: 50%; transform: translateX(-50%);
  text-align: center;
  max-width: 700px; width: 92%;
  opacity: 0;
  pointer-events: none;
}
.scene-text .eyebrow { margin-bottom: 6px; display: inline-block; }
.scene-text h2 {
  color: var(--navy);
  font-size: clamp(1.5rem, 2.8vw, 2.2rem);
  margin-bottom: 8px;
  line-height: 1.15;
}
.scene-text p {
  color: var(--muted);
  font-size: 1rem; max-width: 50ch;
  margin: 0 auto;
}

/* ───── Badges parallax flottants ───── */
.scene-badge {
  position: absolute; z-index: 7;
  background: #fff;
  border-left: 3px solid var(--brand);
  padding: 11px 14px;
  box-shadow: 4px 4px 0 rgba(20,20,40,.10);
  font-size: 13px; font-weight: 800; color: var(--navy);
  display: flex; align-items: center; gap: 10px;
  pointer-events: none;
  opacity: 0;
  max-width: 240px;
}
.scene-badge .ico-wrap {
  width: 30px; height: 30px;
  background: var(--brand-light); color: var(--brand);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.scene-badge .sub {
  font-size: 9px; color: var(--muted); font-weight: 700;
  text-transform: uppercase; letter-spacing: 1px; margin-top: 2px;
}

/* ───── Particules photos qui flottent ───── */
.scene-photo {
  position: absolute; z-index: 3;
  border-radius: 8px;
  box-shadow: 0 14px 30px rgba(20,20,40,.18);
  pointer-events: none;
  opacity: 0;
}

/* ───── Progress dots ───── */
.scene-progress {
  position: absolute; bottom: 5vh; left: 50%; transform: translateX(-50%);
  display: flex; gap: 10px; z-index: 8;
}
.scene-progress span {
  width: 28px; height: 4px; background: rgba(20,20,40,.15);
  transition: background .25s, width .25s;
}
.scene-progress span.on { background: var(--brand); width: 44px; }

@media (max-width: 900px) {
  .story-stage { height: 380vh; }
  .story-pin { padding-top: calc(var(--header-h) + 16vh); padding-bottom: 8vh; }
  .scene-text { top: calc(var(--header-h) + 2vh); }
  .scene-text h2 { font-size: 1.25rem; }
  .scene-text p  { font-size: .85rem; }
  .scene-badge, .scene-photo { display: none; }
  .story-tablet { width: 86vw; padding: 10px; }
  .s-idle .clock { font-size: 38px; letter-spacing: 4px; }
  .s-incall { grid-template-columns: 1fr; padding: 16px; gap: 10px; text-align: center; }
  .s-incall .avatar-big { width: 80px; height: 80px; font-size: 32px; }
  .s-incall .caller-name { font-size: 20px; }
  .s-incall .right { align-items: center; }
  .s-life .life-grid { grid-template-columns: 1fr 1fr; }
  .s-contacts .ct-list { grid-template-columns: 1fr; }
}
