/* ============================================================================
   cine.css – l'accueil « cinématique » de mmbt.fr (MMBT, 2026)
   ----------------------------------------------------------------------------
   Ajouté PAR-DESSUS style.css et plus.css : on ne réécrit rien, on surcharge.
   Mêmes couleurs que le site (noir, or #c2ad4a, cartes #121210).
   Trois ingrédients : un grand écran d'ouverture, des blocs qui apparaissent
   en douceur quand on descend, et des cartes qui réagissent au doigt / à la souris.
   Tout s'arrête si le téléphone demande « moins d'animations ».
   ============================================================================ */

:root { --cine-or-clair: #e6d98a; --cine-vert: #1f6b4a; }
html { scroll-behavior: smooth; }
body { background: #000; }

/* ---- Barre de progression (fine ligne dorée en haut, remplie en descendant) ---- */
.cine-progres { position: fixed; top: 0; left: 0; height: 2px; width: 100%; z-index: 60; transform-origin: 0 50%; transform: scaleX(var(--p, 0));
  background: linear-gradient(90deg, var(--or-fonce), var(--cine-or-clair)); pointer-events: none; }

/* ---- Menu en verre dépoli ---- */
.barre { background: var(--nav-bg, rgba(8,8,6,.55)); -webkit-backdrop-filter: saturate(180%) blur(18px); backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid var(--line, rgba(255,255,255,.07)); }

/* ---- Écran d'ouverture : toute la hauteur de l'écran, aurore dorée qui respire ---- */
header#haut { position: relative; isolation: isolate; width: 100%; max-width: none; min-height: calc(100svh - 60px); margin: -60px 0 0;
  padding: 96px 20px 120px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
header#haut::before, header#haut::after { content: ""; position: absolute; z-index: -1; border-radius: 50%; filter: blur(70px); opacity: .8; pointer-events: none; }
header#haut::before { width: min(70vw, 620px); height: min(70vw, 620px); left: 8%; top: 8%;
  background: radial-gradient(circle, var(--glow1, rgba(194,173,74,.55)), transparent 68%); animation: cine-derive 16s ease-in-out infinite alternate; }
header#haut::after { width: min(60vw, 520px); height: min(60vw, 520px); right: 6%; bottom: 10%;
  background: radial-gradient(circle, var(--glow2, rgba(31,107,74,.6)), transparent 68%); animation: cine-derive 20s ease-in-out infinite alternate-reverse; }
@keyframes cine-derive { from { transform: translate3d(-4%, -3%, 0) scale(1); } to { transform: translate3d(6%, 5%, 0) scale(1.18); } }

header#haut .logo-tag { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .78rem; font-weight: 500; letter-spacing: .32em;
  text-transform: uppercase; color: var(--muted); margin: 0 0 18px; }
header#haut .karibu { font-family: "Fraunces", Georgia, serif; font-style: italic; font-weight: 500; font-size: clamp(4.6rem, 17vw, 11rem); line-height: .95; letter-spacing: -.03em; margin: 0 0 10px; padding: .02em .14em .06em .08em; /* marge : l'italique dépasse de son cadre, sans elle le dernier « u » est coupé */
  background: var(--karibu, linear-gradient(100deg, #8d7a26 0%, #e6d98a 38%, #fff6c9 50%, #e6d98a 62%, #8d7a26 100%)); background-size: 220% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: cine-brille 7s ease-in-out infinite; }
@keyframes cine-brille { 0%, 100% { background-position: 100% 0; } 50% { background-position: 0 0; } }
header#haut h1 { font-size: clamp(1.7rem, 5.2vw, 3.6rem); line-height: 1.08; letter-spacing: -.035em; font-weight: 600; margin: 8px 0 22px; max-width: 22ch; }
header#haut > p:last-of-type { font-size: clamp(1rem, 2.4vw, 1.3rem); color: var(--muted); max-width: 30ch; }
/* Indication « faites défiler » */
.cine-descendre { position: absolute; left: 50%; bottom: 36px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 10px;
  color: var(--muted); font: 500 .7rem/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .3em; text-transform: uppercase; text-decoration: none; }
.cine-descendre i { width: 22px; height: 36px; border: 1.5px solid rgba(255,255,255,.35); border-radius: 12px; position: relative; }
.cine-descendre i::after { content: ""; position: absolute; left: 50%; top: 7px; width: 3px; height: 7px; margin-left: -1.5px; border-radius: 2px; background: var(--or); animation: cine-molette 1.8s ease-in-out infinite; }
@keyframes cine-molette { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(12px); } }

/* ---- Mot de bienvenue : grande phrase, sans cadre lourd ---- */
.mot { max-width: 860px; margin: 40px 0 56px; padding: 0 4px; border: 0; background: none; box-shadow: none; font-size: clamp(1.1rem, 2.6vw, 1.5rem); line-height: 1.55; letter-spacing: -.01em; text-align: start; color: var(--mot, #d8d4c4); }
.mot strong { color: var(--mot-fort, var(--cine-or-clair)); }
.mot .signe { text-align: end; margin-top: 18px; font-family: "Fraunces", Georgia, serif; font-size: 1.5rem; font-weight: 500; }
/* Signature manuscrite sous le nom : l'image sert de pochoir (mask), la couleur suit donc le thème comme le nom au-dessus */
.mot .signature { display: block; width: clamp(140px, 30vw, 190px); aspect-ratio: 724 / 321; margin: 6px 0 0 auto; background: currentColor;
  -webkit-mask: url(signature.png?v=2) center / contain no-repeat; mask: url(signature.png?v=2) center / contain no-repeat; }
[dir="rtl"] .mot .signature { margin: 6px auto 0 0; }

/* ---- Chiffres : grands nombres ---- */
.chiffres { max-width: 1000px; gap: 14px; margin-bottom: 18px; }
.chiffres div { border: 0; background: var(--chiffre-fond, linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.015))); padding: 26px 14px; }
/* Les nombres s'adaptent à la largeur de leur case (même « 8 000 » ou « 12 500 ») au lieu d'être coupés. */
.chiffres > div { container-type: inline-size; }
.chiffres b { white-space: nowrap; font-family: "Fraunces", Georgia, serif; font-weight: 500; font-size: clamp(1.7rem, 21cqi, 3.4rem); letter-spacing: -.03em; color: var(--chiffre-tx, var(--cine-or-clair)); }

/* ---- Titres de sections ---- */
.sur-titre { font-size: .78rem; letter-spacing: .32em; text-align: center; margin: 40px auto 26px; }
.valeurs h2, .moi h2, .idee h2 { font-size: clamp(2rem, 5.4vw, 3.2rem); letter-spacing: -.035em; line-height: 1.05; }

/* ---- Cartes des applications : verre, relief, halo qui suit le doigt ---- */
.grid { gap: 22px; max-width: 1040px; }
.card { animation: none; opacity: 1; border-radius: 24px; border: 1px solid var(--line2, rgba(255,255,255,.09)); padding: 28px;
  background: var(--card-fond, linear-gradient(160deg, rgba(255,255,255,.06), rgba(255,255,255,.015) 45%, rgba(0,0,0,.2)), #0c0c0a);
  transition: transform .5s cubic-bezier(.2,.8,.2,1), border-color .3s, box-shadow .5s; }
.card::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .35s;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%), rgba(230,217,138,.16), transparent 62%); }
.card:hover::after { opacity: 1; }
.card:hover, .card.flot { transform: translateY(-6px); border-color: rgba(194,173,74,.55); box-shadow: 0 30px 60px -28px rgba(194,173,74,.35); animation: none; }
.card h3 { font-size: 1.55rem; letter-spacing: -.03em; }
.card .icone { border-radius: 18px; box-shadow: 0 10px 30px -10px rgba(0,0,0,.8); }
.card .capture { border-radius: 14px; transition: transform .7s cubic-bezier(.2,.8,.2,1); }
.card:hover .capture { transform: scale(1.035); }

/* ---- Principes, avis, « qui suis-je » : même douceur ---- */
.valeur, .avis, .moi, .bientot { border-radius: 24px; border-color: var(--line2, rgba(255,255,255,.09)); }
.valeur svg { width: 40px; height: 40px; }

/* ---- Apparition douce au défilement (le script ajoute .cine-r puis .cine-vu) ---- */
.cine-r { opacity: 0; transform: translate3d(0, 38px, 0) scale(.985); filter: blur(6px);
  transition: opacity .9s cubic-bezier(.2,.8,.2,1), transform .9s cubic-bezier(.2,.8,.2,1), filter .9s; transition-delay: var(--d, 0ms); }
.cine-r.cine-vu { opacity: 1; transform: none; filter: none; }
/* L'écran d'ouverture se révèle d'un coup, un élément après l'autre */
header#haut > * { animation: cine-entree 1.1s cubic-bezier(.2,.8,.2,1) backwards; } /* « backwards » : après l'entrée, l'élément reste libre de bouger avec le défilement */
header#haut > :nth-child(1) { animation-delay: .1s; } header#haut > :nth-child(2) { animation-delay: .25s; }
header#haut > :nth-child(3) { animation-delay: .45s; } header#haut > :nth-child(4) { animation-delay: .65s; }
@keyframes cine-entree { from { opacity: 0; transform: translate3d(0, 28px, 0); filter: blur(8px); } to { opacity: 1; transform: none; filter: none; } }

/* ---- Mouvements liés au défilement et au pointeur (réglés par cine.js) ---- */
/* Le grand écran d'ouverture s'éloigne doucement quand on descend : il rétrécit, monte et s'efface. */
header#haut > :not(.cine-descendre) { transform: translate3d(0, calc(var(--hp, 0) * -46px), 0) scale(calc(1 - var(--hp, 0) * .07)); opacity: calc(1 - var(--hp, 0) * 1.15); will-change: transform, opacity; }
.cine-descendre { opacity: clamp(0, calc(1.7 - var(--hp, 0) * 2), 1); } /* reste visible tant que le grand écran est là, puis s'efface doucement */
/* Les lueurs suivent le pointeur (ordinateur) et se décalent plus lentement que le texte (effet de profondeur). */
header#haut::before { translate: calc(var(--ax, 0) * 46px) calc(var(--ay, 0) * 34px + var(--hp, 0) * 120px); }
header#haut::after { translate: calc(var(--ax, 0) * -38px) calc(var(--ay, 0) * -28px + var(--hp, 0) * 70px); }
/* Les cartes se penchent légèrement vers le pointeur (ordinateur seulement). */
@media (hover: hover) and (pointer: fine) {
  .card.cine-tilt { transition: transform .18s ease-out, border-color .3s, box-shadow .5s; }
  .card:hover { transform: perspective(1000px) translateY(-6px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); }
}
/* Les icônes des applications flottent doucement, chacune à son rythme. */
.card .icone, .card .duo { animation: cine-flotte 6.5s ease-in-out infinite; }
.grid > :nth-child(2n) .icone { animation-delay: -2.2s; } .grid > :nth-child(3n) .icone { animation-delay: -4.1s; }
@keyframes cine-flotte { 0%, 100% { translate: 0 0; } 50% { translate: 0 -7px; } }
/* Le rond doré de la photo « Qui suis-je ? » respire. */
.moi .photo { animation: cine-respire 5.5s ease-in-out infinite; }
@keyframes cine-respire { 0%, 100% { box-shadow: 0 0 0 0 rgba(194,173,74,.0); } 50% { box-shadow: 0 0 0 14px rgba(194,173,74,.12); } }

/* ---- Téléphone ---- */
@media (max-width: 760px) {
  header#haut { margin-top: -96px; padding-top: 140px; min-height: 100svh; }
  .card { padding: 22px; border-radius: 22px; }
  .cine-descendre { bottom: 22px; }
}

/* ---- « Moins d'animations » : tout apparaît tout de suite, rien ne bouge ---- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  header#haut::before, header#haut::after, header#haut .karibu, .cine-descendre i::after, .card .icone, .card .duo, .moi .photo { animation: none; }
  header#haut > :not(.cine-descendre), .cine-descendre { transform: none; opacity: 1; } header#haut::before, header#haut::after { translate: none; }
  header#haut > * { animation: none; }
  .cine-r { opacity: 1; transform: none; filter: none; transition: none; }
  .card, .card .capture { transition: none; }
}
