/* =====================================================================
   CHARO LOVE — COUCHE « CINÉMA »
   Ajoutée par-dessus style.css. Mêmes couleurs, même typo, même structure.
   Tout est rangé sous html.cine (posé par cinema.js), donc :
   - si l'utilisateur demande moins d'animations, rien de ce fichier ne s'applique ;
   - html.cine-hd = ordinateur (effets plus riches : flou de mise au point, reflets).
   ===================================================================== */

/* ---------- Coupe de plan entre les pages ---------- */
.cine-cut { position: fixed; inset: 0; z-index: 95; pointer-events: none; }
.cine-bar { position: absolute; left: 0; right: 0; height: 9vh; background: #000; transform: scaleY(0); will-change: transform; }
.cine-bar.t { top: 0; transform-origin: top; box-shadow: 0 1px 0 rgba(255,45,85,.25); }
.cine-bar.b { bottom: 0; transform-origin: bottom; box-shadow: 0 -1px 0 rgba(255,45,85,.25); }
.cine-flare { position: absolute; left: 0; right: 0; top: 50%; height: 1px; opacity: 0; transform: scaleX(0);
  background: linear-gradient(90deg, transparent, rgba(255,143,163,.85) 30%, #fff 50%, rgba(255,143,163,.85) 70%, transparent);
  box-shadow: 0 0 16px 3px rgba(255,45,85,.55), 0 0 60px 10px rgba(225,29,72,.2); will-change: transform, opacity; }
.cine-cut.play .cine-bar { animation: cineBars .9s var(--ease) both; }
.cine-cut.play .cine-flare { animation: cineFlareCut .85s var(--ease) both; }
.cine-cut.open .cine-bar { animation: cineOpen 1.3s cubic-bezier(.65,0,.2,1) both; }
.cine-cut.open .cine-flare { animation: cineFlareCut 1.1s var(--ease) .05s both; }
@keyframes cineBars { 0% { transform: scaleY(0); } 32% { transform: scaleY(1); } 100% { transform: scaleY(0); } }
@keyframes cineOpen { 0%, 25% { transform: scaleY(1.3); } 100% { transform: scaleY(0); } }
@keyframes cineFlareCut { 0% { opacity: 0; transform: scaleX(.05); } 30% { opacity: 1; } 100% { opacity: 0; transform: scaleX(1.25); } }

/* Mouvement de caméra à l'arrivée sur une page (léger recul + mise au point) */
#app.cine-in { animation: cineCam .9s var(--ease) both; }
#app.cine-step { animation: cineStep .55s var(--ease) both; }
@keyframes cineCam { from { opacity: 0; transform: scale(1.035) translate3d(0, 12px, 0); } to { opacity: 1; transform: none; } }
@keyframes cineStep { from { opacity: .35; transform: scale(.985); } to { opacity: 1; transform: none; } }
.cine-hd #app.cine-in { animation-name: cineCamHd; }
@keyframes cineCamHd { from { opacity: 0; transform: perspective(1400px) translate3d(0, 14px, -60px); filter: blur(10px); } to { opacity: 1; transform: none; filter: none; } }

/* ---------- Titres façon générique ---------- */
.cine-split { perspective: 900px; }
.cine-split .cw { display: inline-block; }
.cine-split .cw-i { display: inline-block; transform-origin: 50% 100%; }
.cine .cine-split:not(.reveal) .cw-i,
.cine .cine-split.reveal.in .cw-i { animation: cineWord 1s var(--ease) calc(.12s + var(--i) * .07s) backwards; }
.cine .hero h1.cine-split .cw-i { animation-delay: calc(.4s + var(--i) * .08s); }
html.intro-on .cine-split .cw-i { animation-play-state: paused; }
@keyframes cineWord { from { opacity: 0; transform: translate3d(0, .55em, 0) rotateX(-55deg); } to { opacity: 1; transform: none; } }
.cine-hd .cine-split:not(.reveal) .cw-i, .cine-hd .cine-split.reveal.in .cw-i { animation-name: cineWordHd; }
@keyframes cineWordHd { from { opacity: 0; transform: translate3d(0, .55em, 0) rotateX(-55deg); filter: blur(8px); } to { opacity: 1; transform: none; filter: none; } }

/* Numéros de section (01, 02…) : deux traits de lumière qui s'étirent */
.cine .kicker { display: flex; align-items: center; justify-content: center; gap: 12px; }
.cine .kicker::before, .cine .kicker::after { content: ''; width: 46px; height: 1px; transform: scaleX(0);
  transition: transform 1.2s var(--ease) .2s; }
.cine .kicker::before { background: linear-gradient(90deg, transparent, var(--red-hot)); transform-origin: right; }
.cine .kicker::after { background: linear-gradient(90deg, var(--red-hot), transparent); transform-origin: left; }
.cine .kicker.in::before, .cine .kicker.in::after { transform: scaleX(1); }

/* Ordinateur : les blocs arrivent avec un peu de profondeur */
.cine-hd .reveal:not(.in) { transform: perspective(1100px) translate3d(0, 34px, 0) rotateX(7deg); transform-origin: 50% 100%; }

/* ---------- Accueil : lumière anamorphique + profondeur ---------- */
.cine .hero > :not(.hero-media):not(.hero-scroll) { position: relative; z-index: 1; }
.cine .hero::before { content: ''; position: absolute; left: -10%; right: -10%; top: 34%; height: 2px; z-index: 0; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255,45,85,.0) 15%, rgba(255,143,163,.75) 50%, rgba(255,45,85,0) 85%, transparent);
  box-shadow: 0 0 30px 6px rgba(255,45,85,.35); opacity: 0; transform: scaleX(.3);
  animation: cineLens 11s ease-in-out 2.4s infinite; }
@keyframes cineLens { 0%, 100% { opacity: 0; transform: scaleX(.3) translateX(-8%); } 45% { opacity: .55; transform: scaleX(1) translateX(0); } 70% { opacity: .2; transform: scaleX(1.1) translateX(6%); } }
html.intro-on .hero::before { animation-play-state: paused; }
.cine .hero-media { will-change: translate, opacity; }
.cine-hd .hero-media video, .cine-hd .hero-media img { scale: 1.07; }
.cine .hero .badge { overflow: hidden; }
.cine .hero .badge::after { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(110deg, transparent 35%, rgba(255,255,255,.35) 50%, transparent 65%);
  transform: translateX(-120%); animation: sweep 6s var(--ease) 2.2s infinite; }

/* Images avec parallaxe : légèrement agrandies pour ne jamais montrer les bords */
.cine .mode-art img, .cine .final-art img, .cine .auth-art img { scale: 1.14; }
.cine .showcase-art, .cine .styles-strip figure, .cine .premium-art, .cine .scan-bg { will-change: translate; }

/* ---------- Poussière de lumière ---------- */
.cine-dust { position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: 0; transition: opacity 2s var(--ease); }
.cine-dust.on { opacity: .9; }

/* ---------- Barre de progression de lecture ---------- */
.cine-progress { position: fixed; left: 0; right: 0; top: 0; height: 2px; z-index: 20; pointer-events: none; transform-origin: left; transform: scaleX(0);
  background: linear-gradient(90deg, var(--wine-500), var(--red-hot), var(--rose)); box-shadow: 0 0 10px var(--red-hot); opacity: 0; transition: opacity .4s; }
.cine-progress.on { opacity: 1; }
html[dir="rtl"] .cine-progress { transform-origin: right; }

/* ---------- Micro-interactions ---------- */
/* Onde de lumière au toucher */
.cine :is(.option, .folder, .tabbar button, .pill, .style-chips .chip, .upload, .history-item) { position: relative; }
.cine-rip { position: absolute; inset: 0; border-radius: inherit; overflow: hidden; pointer-events: none; z-index: 2; }
.cine-rip i { position: absolute; border-radius: 50%; transform: translate(-50%, -50%) scale(0); opacity: .55;
  background: radial-gradient(circle, rgba(255,255,255,.55), rgba(255,143,163,.25) 35%, transparent 65%);
  animation: cineRipple .7s var(--ease) forwards; }
@keyframes cineRipple { to { transform: translate(-50%, -50%) scale(1); opacity: 0; } }

/* Boutons : aimantés + reflet qui suit la souris (ordinateur) */
.cine-hd .btn { transition: transform .2s var(--ease), box-shadow .3s, filter .2s, translate .35s var(--ease); }
.cine-hd .btn::before { content: ''; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none; opacity: 0;
  background: radial-gradient(160px circle at var(--bx, 50%) var(--by, 50%), rgba(255,255,255,.35), transparent 60%); transition: opacity .3s; }
.cine-hd .btn:hover::before { opacity: 1; }
.cine-hd .btn.ghost::before { background: radial-gradient(160px circle at var(--bx, 50%) var(--by, 50%), rgba(255,45,85,.22), transparent 60%); }

/* Cartes : reflet de lumière qui glisse sur le verre (ordinateur) */
.cine-hd .tilt::after { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0;
  background: linear-gradient(115deg, transparent 38%, rgba(255,255,255,.07) 47%, rgba(255,143,163,.12) 50%, transparent 60%);
  background-size: 260% 100%; background-position: calc(100% - var(--mx, 50%)) 0; transition: opacity .4s; }
.cine-hd .tilt:hover::after { opacity: 1; }
.cine-hd .tilt:hover { box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 40px 80px -40px rgba(225,29,72,.55); }

/* Choix : léger relief lumineux à la sélection */
.cine .option.selected::after, .cine .taste.selected::before { content: ''; position: absolute; inset: -1px; border-radius: inherit; pointer-events: none;
  box-shadow: 0 0 0 1px rgba(255,45,85,.6); animation: cineHalo .7s var(--ease) both; }
.cine .taste.selected::before { z-index: 2; }
@keyframes cineHalo { from { box-shadow: 0 0 0 0 rgba(255,45,85,.8); } to { box-shadow: 0 0 0 10px rgba(255,45,85,0); } }

/* ---------- Analyse en cours : viseur de caméra ---------- */
.cine .scan-frame::after { content: ''; position: absolute; inset: 12px; z-index: 3; pointer-events: none;
  --c: rgba(255,143,163,.85);
  background:
    linear-gradient(var(--c), var(--c)) left top / 20px 2px no-repeat, linear-gradient(var(--c), var(--c)) left top / 2px 20px no-repeat,
    linear-gradient(var(--c), var(--c)) right top / 20px 2px no-repeat, linear-gradient(var(--c), var(--c)) right top / 2px 20px no-repeat,
    linear-gradient(var(--c), var(--c)) left bottom / 20px 2px no-repeat, linear-gradient(var(--c), var(--c)) left bottom / 2px 20px no-repeat,
    linear-gradient(var(--c), var(--c)) right bottom / 20px 2px no-repeat, linear-gradient(var(--c), var(--c)) right bottom / 2px 20px no-repeat;
  filter: drop-shadow(0 0 4px rgba(255,45,85,.8)); animation: cineFocus 2.2s ease-in-out infinite alternate; }
@keyframes cineFocus { from { transform: scale(.965); opacity: .6; } to { transform: scale(1); opacity: 1; } }
.cine .scan-frame::before { content: 'REC'; position: absolute; bottom: 20px; left: 50%; translate: -50% 0; z-index: 3; pointer-events: none;
  font-size: 10px; font-weight: 800; letter-spacing: .2em; color: var(--rose); display: flex; align-items: center; gap: 6px;
  text-shadow: 0 0 8px rgba(255,45,85,.8); animation: blink 1.4s infinite; }

/* ---------- Résultat : mise au point + onde au verdict ---------- */
.cine .ans-reply { animation: cineReveal 1s var(--ease) .3s both; }
@keyframes cineReveal { from { opacity: 0; transform: scale(1.06) translate3d(0, 10px, 0); } to { opacity: 1; transform: none; } }
.cine-hd .ans-reply { animation-name: cineRevealHd; }
@keyframes cineRevealHd { from { opacity: 0; transform: scale(1.06) translate3d(0, 10px, 0); filter: blur(10px); } to { opacity: 1; transform: none; filter: none; } }
.cine .ans-shot { animation: cineShot 1.1s var(--ease) both; }
@keyframes cineShot { from { opacity: 0; transform: perspective(900px) rotateX(14deg) translate3d(0, 20px, 0); } to { opacity: 1; transform: none; } }
.cine .score { position: relative; }
.cine .score::after { content: ''; position: absolute; inset: -4px; border-radius: 50%; pointer-events: none;
  border: 2px solid var(--red-hot); opacity: 0; animation: cineRing 1.3s var(--ease) 1.15s; }
@keyframes cineRing { from { opacity: .9; transform: scale(1); } to { opacity: 0; transform: scale(1.35); } }

/* ---------- Intro : trait de lumière sous le nom ---------- */
.cine .intro-word { position: relative; }
.cine .intro-word::after { content: ''; position: absolute; left: 50%; bottom: -12px; width: 160px; height: 1px; margin-left: -80px;
  background: linear-gradient(90deg, transparent, var(--rose), #fff, var(--rose), transparent); box-shadow: 0 0 12px 2px rgba(255,45,85,.6);
  transform: scaleX(0); opacity: 0; animation: cineUnderline 1.1s var(--ease) 1.1s forwards; }
@keyframes cineUnderline { to { transform: scaleX(1); opacity: 1; } }

/* ---------- Mon espace ---------- */
.cine .stat { animation: cineStat .8s var(--ease) both; }
.cine .stat:nth-child(2) { animation-delay: .08s; } .cine .stat:nth-child(3) { animation-delay: .16s; }
@keyframes cineStat { from { opacity: 0; transform: translate3d(0, 16px, 0) scale(.96); } to { opacity: 1; transform: none; } }
.cine .folders .folder { animation: cineStat .7s var(--ease) both; }
.cine .folders .folder:nth-child(2) { animation-delay: .06s; } .cine .folders .folder:nth-child(3) { animation-delay: .12s; }
.cine .folders .folder:nth-child(4) { animation-delay: .18s; } .cine .folders .folder:nth-child(n+5) { animation-delay: .24s; }

/* Sécurité : si le système demande moins d'animations en cours de route */
@media (prefers-reduced-motion: reduce) {
  .cine-cut, .cine-dust, .cine-progress, .cine-rip { display: none !important; }
}
