/* ============================================================
   apple-reveal.css — Module Scrollytelling Apple-style
   ISOLATION TOTALE : Toutes les règles sont scopées sur
   #apple-reveal-sequence. Aucune règle globale touchée.
   ============================================================ */

/* ── SECTION RACINE ─────────────────────────────────────── */
#apple-reveal-sequence {
  position: relative;
  height: 400vh; /* Indispensable pour la durée du défilement */
  background: #000;
}

/* ── STICKY WRAPPER — reste dans le viewport pendant le scroll ── */
#apple-reveal-sequence .sticky-container {
  position: sticky; /* La méthode CSS est beaucoup plus stable que le pin GSAP */
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
}

/* ── COUCHE TEXTE ────────────────────────────────────────── */
#apple-reveal-sequence .text-layer {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  pointer-events: none;
}

#apple-reveal-sequence .text-slide {
  position: absolute;
  text-align: center;
  max-width: 700px;
  padding: 0 32px;
  opacity: 0;
  will-change: opacity;
}

#apple-reveal-sequence .text-slide .eyebrow {
  display: block;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #e07820;
  margin-bottom: 18px;
}

#apple-reveal-sequence .text-slide h2 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(2.8rem, 6vw, 5.5rem);
  line-height: 1.05;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #ffffff;
  margin-bottom: 20px;
  text-wrap: balance;
}

#apple-reveal-sequence .text-slide p {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-size: clamp(0.95rem, 1.5vw, 1.1rem);
  color: rgba(255, 255, 255, 0.55);
  line-height: 1.75;
  font-weight: 400;
}

/* ── COUCHE MACBOOK ──────────────────────────────────────── */
#apple-reveal-sequence .macbook-wrap {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  will-change: transform;
}

/* Conteneur qui maintient les proportions du MacBook */
#apple-reveal-sequence .macbook-frame-wrap {
  position: relative;
  width: min(80vw, 900px);
  aspect-ratio: 1400 / 870;
  background: #000;
}

#apple-reveal-sequence .macbook-frame-wrap img.mac-screen {
  position: absolute;
  top: 6%;
  left: 10.5%;
  width: 79%;
  height: 82%;
  object-fit: cover;
  display: block;
  border: none;
  outline: none;
  z-index: 3;
  user-select: none;
  pointer-events: none;
  filter: brightness(0.88) contrast(1.06) saturate(0.92);
}

/* Reflet de dalle vitrée */
#apple-reveal-sequence .macbook-frame-wrap::after {
  content: '';
  position: absolute;
  top: 6%;
  left: 10.5%;
  width: 79%;
  height: 82%;
  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.07) 0%,
    rgba(255, 255, 255, 0.02) 35%,
    rgba(0, 0, 0, 0.0)        55%,
    rgba(0, 0, 0, 0.10)       100%
  );
  z-index: 4;
  pointer-events: none;
  border-radius: 2px;
}

/* Châssis MacBook */
#apple-reveal-sequence .macbook-frame-wrap img.mac-frame {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  position: relative;
  z-index: 1;
  user-select: none;
  pointer-events: none;
}

/* ── BARRE DE PROGRESSION ────────────────────────────────── */
#apple-reveal-sequence .ar-progress {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 2px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
  z-index: 20;
}

#apple-reveal-sequence .ar-progress__bar {
  height: 100%;
  width: 0%;
  background: #e07820;
  border-radius: 2px;
  transition: width 0.08s linear;
}

/* ── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 768px) {
  #apple-reveal-sequence .macbook-frame-wrap {
    width: min(95vw, 500px);
  }

  #apple-reveal-sequence .text-slide h2 {
    font-size: 2.2rem;
  }

  #apple-reveal-sequence .text-slide p {
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  #apple-reveal-sequence .macbook-frame-wrap {
    width: 98vw;
  }
}
