/* ============================================
   Mimita Mie — Mouvement, 3D et interactions
   Tout est en CSS pur (aucune librairie 3D) pour rester
   rapide sur un téléphone en 3G.
   ============================================ */

/* ============ RÉVÉLATION AU SCROLL ============
   Piloté par IntersectionObserver dans js/ui.js (classe .in ajoutée). */
.reveal { opacity: 0; transform: translateY(30px); transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.22, 0.61, 0.36, 1); }
.reveal.in { opacity: 1; transform: none; }
.reveal-l { opacity: 0; transform: translateX(-38px); transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.22, 0.61, 0.36, 1); }
.reveal-l.in { opacity: 1; transform: none; }
.reveal-r { opacity: 0; transform: translateX(38px); transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.22, 0.61, 0.36, 1); }
.reveal-r.in { opacity: 1; transform: none; }
.reveal-z { opacity: 0; transform: scale(0.92); transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.22, 0.61, 0.36, 1); }
.reveal-z.in { opacity: 1; transform: none; }
.d1 { transition-delay: 0.1s; } .d2 { transition-delay: 0.2s; } .d3 { transition-delay: 0.3s; }
.d4 { transition-delay: 0.4s; } .d5 { transition-delay: 0.5s; } .d6 { transition-delay: 0.6s; }

/* ============ HÉROS ============ */
.hero {
  position: relative;
  min-height: min(92vh, 860px);
  display: flex;
  align-items: center;
  padding: 60px 0 80px;
  overflow: hidden;
  background:
    radial-gradient(1100px 620px at 82% 12%, rgba(232, 213, 183, 0.75), transparent 62%),
    radial-gradient(900px 520px at 8% 88%, rgba(201, 162, 39, 0.16), transparent 60%),
    var(--cream);
}
.hero-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 50px; align-items: center; }
.hero-copy h1 { margin: 16px 0 18px; }
.hero-copy h1 em { font-style: italic; color: var(--red); }
.hero-cta { display: flex; gap: 13px; flex-wrap: wrap; margin-top: 30px; }
.hero-proof { display: flex; gap: 26px; margin-top: 38px; flex-wrap: wrap; }
.hero-proof div b { font-family: var(--display); font-size: 1.9rem; display: block; line-height: 1; color: var(--brown); }
.hero-proof div span { font-size: 0.74rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--brown-3); }

/* Couches de parallaxe (translateY appliqué par js/ui.js) */
.parallax { will-change: transform; }
.hero-wheat {
  position: absolute; bottom: -18px; left: 0; right: 0; height: 190px;
  pointer-events: none; opacity: 0.5;
  background: repeating-linear-gradient(78deg, transparent 0 34px, rgba(201, 162, 39, 0.28) 34px 36px);
  mask-image: linear-gradient(to top, #000 0%, transparent 88%);
  -webkit-mask-image: linear-gradient(to top, #000 0%, transparent 88%);
}

/* ============ FARINE QUI FLOTTE ============ */
.flour { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.flour i {
  position: absolute;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.7);
  animation: floatUp linear infinite;
  bottom: -12px;
}
@keyframes floatUp {
  0%   { transform: translate(0, 0) scale(0.6); opacity: 0; }
  12%  { opacity: 0.9; }
  100% { transform: translate(var(--dx, 30px), -105vh) scale(1.1); opacity: 0; }
}

/* ============ BOCAL DE LEVAIN 3D ============ */
.jar-stage { perspective: 900px; display: grid; place-items: center; padding: 20px; }
.jar {
  position: relative;
  width: clamp(180px, 34vw, 250px);
  height: clamp(240px, 45vw, 330px);
  transform-style: preserve-3d;
  animation: jarSpin 22s linear infinite;
}
@keyframes jarSpin {
  0%   { transform: rotateY(-13deg) rotateX(4deg); }
  50%  { transform: rotateY(13deg) rotateX(-2deg); }
  100% { transform: rotateY(-13deg) rotateX(4deg); }
}
.jar-glass {
  position: absolute; inset: 30px 0 0;
  border-radius: 18px 18px 26px 26px;
  background: linear-gradient(105deg, rgba(255, 255, 255, 0.62) 0%, rgba(255, 255, 255, 0.2) 34%, rgba(232, 213, 183, 0.28) 66%, rgba(255, 255, 255, 0.5) 100%);
  border: 2px solid rgba(255, 255, 255, 0.75);
  box-shadow: inset -14px 0 26px rgba(138, 106, 80, 0.16), 0 26px 44px rgba(62, 42, 30, 0.2);
  overflow: hidden;
}
/* Reflet vertical qui glisse : donne l'illusion du verre */
.jar-glass::after {
  content: ''; position: absolute; top: 0; left: 16%; width: 14%; height: 100%;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0.1));
  filter: blur(2px);
}
.jar-lid {
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 78%; height: 44px;
  border-radius: 12px 12px 7px 7px;
  background: linear-gradient(180deg, var(--red-light) 0%, var(--red) 42%, var(--red-dark) 100%);
  box-shadow: 0 8px 18px rgba(153, 16, 31, 0.34), inset 0 -4px 10px rgba(0, 0, 0, 0.2);
}
.jar-lid::before {
  content: ''; position: absolute; inset: 8px 6px auto; height: 22px;
  background: repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.11) 0 3px, transparent 3px 7px);
  border-radius: 4px;
}
/* La pâte : niveau qui « pousse » lentement, comme un vrai levain actif */
.jar-dough {
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 46%;
  background: linear-gradient(180deg, #EBD9BC 0%, #DCC49F 45%, #CBAE84 100%);
  animation: doughRise 9s ease-in-out infinite;
}
@keyframes doughRise { 0%, 100% { height: 42%; } 50% { height: 57%; } }
.jar-dough::before {
  content: ''; position: absolute; top: -7px; left: 0; right: 0; height: 14px;
  background: radial-gradient(circle at 20% 60%, #F2E4CC 6px, transparent 7px),
              radial-gradient(circle at 52% 40%, #F2E4CC 8px, transparent 9px),
              radial-gradient(circle at 82% 65%, #F2E4CC 5px, transparent 6px);
}
/* Bulles de fermentation */
.jar-dough i {
  position: absolute; bottom: 6%;
  width: 9px; height: 9px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.62);
  animation: bubble ease-in infinite;
}
@keyframes bubble {
  0%   { transform: translateY(0) scale(0.4); opacity: 0; }
  25%  { opacity: 0.85; }
  100% { transform: translateY(-90px) scale(1.25); opacity: 0; }
}
.jar-tag {
  position: absolute; top: 74px; left: 50%; transform: translate(-50%, 0) rotate(-5deg);
  width: 96px; height: 88px;
  background: var(--levain);
  border: 1px solid var(--border-2);
  display: grid; place-items: center; text-align: center;
  box-shadow: var(--shadow-sm);
  clip-path: path('M48 88 C10 60 0 42 0 28 C0 10 16 0 30 8 C40 13 46 22 48 27 C50 22 56 13 66 8 C80 0 96 10 96 28 C96 42 86 60 48 88 Z');
  animation: tagSway 5s ease-in-out infinite;
}
@keyframes tagSway { 0%, 100% { transform: translate(-50%, 0) rotate(-5deg); } 50% { transform: translate(-50%, 0) rotate(3deg); } }
.jar-tag b { font-family: var(--display); font-size: 1.15rem; display: block; line-height: 1; margin-top: 12px; }
.jar-tag span { font-size: 0.55rem; letter-spacing: 0.06em; color: var(--brown-3); display: block; }

/* ============ COMPTEUR DE LEVAIN ============ */
.levain-badge {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 11px 20px 11px 13px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--border-2);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(6px);
}
.levain-badge .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 rgba(46, 125, 94, 0.55); animation: pulse 2.1s infinite; flex-shrink: 0; }
@keyframes pulse { 70% { box-shadow: 0 0 0 12px rgba(46, 125, 94, 0); } 100% { box-shadow: 0 0 0 0 rgba(46, 125, 94, 0); } }
.levain-badge b { font-family: var(--display); font-size: 1.15rem; }
.levain-badge span { font-size: 0.78rem; color: var(--brown-3); }

/* ============ CARTE EN TILT 3D ============ */
.tilt { transform-style: preserve-3d; transition: transform 0.18s ease-out, box-shadow 0.3s ease; will-change: transform; }
.tilt-inner { transform: translateZ(26px); }
.tilt-shine {
  position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, 0.5), transparent 46%);
  opacity: 0; transition: opacity 0.3s ease;
}
.tilt:hover .tilt-shine { opacity: 1; }

/* ============ VAPEUR (pain chaud) ============ */
.steam { position: absolute; top: -10px; left: 50%; transform: translateX(-50%); width: 90px; height: 80px; pointer-events: none; }
.steam i {
  position: absolute; bottom: 0;
  width: 10px; height: 10px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.6);
  filter: blur(4px);
  animation: steamUp 3.4s ease-in-out infinite;
}
@keyframes steamUp {
  0%   { transform: translate(0, 10px) scale(0.5); opacity: 0; }
  35%  { opacity: 0.75; }
  100% { transform: translate(var(--sx, 8px), -68px) scale(2.1); opacity: 0; }
}

/* ============ CHRONOLOGIE 24 H DU LEVAIN ============ */
.timeline { position: relative; max-width: 780px; margin: 0 auto; padding-left: 40px; }
.timeline::before { content: ''; position: absolute; left: 13px; top: 8px; bottom: 8px; width: 2px; background: linear-gradient(to bottom, var(--gold-light), var(--border-2)); }
.tl-step { position: relative; margin-bottom: 14px; }
.tl-step::before {
  content: ''; position: absolute; left: -33px; top: 20px;
  width: 15px; height: 15px; border-radius: 50%;
  background: var(--paper); border: 2.5px solid var(--gold);
  transition: var(--transition);
}
.tl-step.open::before { background: var(--red); border-color: var(--red); transform: scale(1.22); }
.tl-head {
  width: 100%; text-align: left;
  display: flex; align-items: center; gap: 14px;
  padding: 16px 18px;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: var(--transition);
}
.tl-head:hover { border-color: var(--border-2); box-shadow: var(--shadow-sm); }
.tl-hour { font-family: var(--display); font-weight: 700; font-size: 1.05rem; color: var(--red); min-width: 62px; }
.tl-title { font-weight: 600; flex: 1; font-size: 0.96rem; }
.tl-chev { color: var(--brown-3); transition: transform 0.3s ease; }
.tl-step.open .tl-chev { transform: rotate(180deg); }
.tl-body { max-height: 0; overflow: hidden; transition: max-height 0.4s cubic-bezier(0.22, 0.61, 0.36, 1); }
.tl-step.open .tl-body { max-height: 320px; }
.tl-body p { padding: 14px 18px 6px 76px; font-size: 0.9rem; }

/* ============ MARQUEE (bandeau défilant) ============ */
.marquee { overflow: hidden; background: var(--brown); color: var(--ivory); padding: 15px 0; white-space: nowrap; }
.marquee-track { display: inline-flex; gap: 46px; animation: marquee 26s linear infinite; }
.marquee-track span { font-family: var(--display); font-size: 1.28rem; letter-spacing: 0.1em; text-transform: uppercase; opacity: 0.9; }
.marquee-track span::after { content: ' ✦'; color: var(--gold); }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ============ BOUTON FLOTTANT INSTAGRAM ============ */
.fab-ig {
  position: fixed; bottom: 20px; right: 20px; z-index: 900;
  width: 54px; height: 54px; border-radius: 50%;
  display: grid; place-items: center;
  color: #fff; font-size: 1.3rem;
  background: linear-gradient(45deg, #F09433, #E6683C, #DC2743, #CC2366, #BC1888);
  box-shadow: var(--shadow);
  transition: var(--transition);
}
.fab-ig:hover { transform: translateY(-4px) scale(1.06); box-shadow: var(--shadow-lg); }

/* ============ RESPONSIVE ============ */
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; gap: 34px; text-align: center; }
  .hero-cta, .hero-proof { justify-content: center; }
  .hero { min-height: auto; padding: 40px 0 60px; }
  .timeline { padding-left: 34px; }
  .tl-body p { padding-left: 20px; }
  .tl-head { flex-wrap: wrap; gap: 8px 12px; }
}
@media (max-width: 480px) {
  .fab-ig { width: 48px; height: 48px; bottom: 16px; right: 16px; font-size: 1.15rem; }
  .hero-proof { gap: 18px; }
}

/* ============================================
   ÉCRAN DE LANCEMENT (js/splash.js)
   Le même bocal que l'écran de démarrage de l'app, en CSS pur.
   ============================================ */
#mmSplash {
  position: fixed; inset: 0; z-index: 9000;
  background: var(--cream);
  display: grid; place-items: center;
  text-align: center; padding: 32px;
  animation: spIn .4s ease;
}
#mmSplash.out { animation: spOut .5s ease forwards; }
@keyframes spIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes spOut { to { opacity: 0; visibility: hidden; } }

#mmSplash .sp-jar { width: 92px; height: 116px; margin: 0 auto 24px; position: relative; }
#mmSplash .sp-lid {
  position: absolute; top: 0; left: 14px; right: 14px; height: 19px;
  background: var(--red); border-radius: 5px 5px 3px 3px;
  box-shadow: inset 0 -3px 0 rgba(0,0,0,.12);
}
#mmSplash .sp-body {
  position: absolute; top: 17px; left: 4px; right: 4px; bottom: 0;
  border: 2px solid rgba(62,42,30,.32); border-top: none;
  border-radius: 7px 7px 14px 14px; overflow: hidden;
  background: rgba(255,255,255,.55);
}
#mmSplash .sp-dough {
  position: absolute; left: 0; right: 0; bottom: 0; height: 50%;
  background: linear-gradient(180deg, #EFDFC4, #E8D5B7);
  border-radius: 44% 44% 0 0 / 15px 15px 0 0;
  animation: spRise 2.4s ease-in-out infinite;
}
/* Les bulles qui remontent : c'est ce qui rend le levain « vivant ». */
#mmSplash .sp-dough i {
  position: absolute; border-radius: 50%; background: rgba(255,255,255,.75);
  width: 7px; height: 7px; bottom: 8px;
  animation: spBubble 2.8s ease-in infinite;
}
#mmSplash .sp-dough i:nth-child(1) { left: 16%; animation-delay: -.2s; }
#mmSplash .sp-dough i:nth-child(2) { left: 36%; width: 5px; height: 5px; animation-delay: -1.1s; }
#mmSplash .sp-dough i:nth-child(3) { left: 54%; animation-delay: -1.9s; }
#mmSplash .sp-dough i:nth-child(4) { left: 72%; width: 6px; height: 6px; animation-delay: -.7s; }
#mmSplash .sp-dough i:nth-child(5) { left: 86%; width: 4px; height: 4px; animation-delay: -2.3s; }
@keyframes spRise { 0%, 100% { height: 46%; } 50% { height: 58%; } }
@keyframes spBubble {
  0%   { transform: translateY(0) scale(.6); opacity: 0; }
  25%  { opacity: .9; }
  100% { transform: translateY(-42px) scale(1.1); opacity: 0; }
}

#mmSplash .sp-name {
  font-family: var(--display); font-size: 1.9rem; font-weight: 700;
  letter-spacing: .18em; text-transform: uppercase; color: var(--brown);
}
#mmSplash .sp-tag {
  font-size: .66rem; letter-spacing: .22em; text-transform: uppercase;
  color: var(--brown-3); margin-top: 5px;
}
#mmSplash .sp-slogan {
  font-family: var(--display); font-size: 1.5rem; color: var(--brown-2);
  margin-top: 20px; line-height: 1.3;
}
#mmSplash .sp-slogan em { color: var(--red); font-style: italic; }
#mmSplash .sp-day {
  display: inline-block; margin-top: 16px; padding: 7px 16px;
  border: 1px solid var(--border-2); border-radius: 999px;
  background: rgba(255,255,255,.7);
  font-family: var(--display); font-size: 1rem; color: var(--brown-2);
}
#mmSplash .sp-heart { margin-top: 14px; font-size: .78rem; color: var(--brown-3); }
