/* ==========================================================================
   Hero - split layout : pitch à gauche, mockup conversation à droite
   ========================================================================== */
.hero {
  position: relative;
  padding: 8rem 0 5rem;
  overflow: hidden;
}
.hero .hero-grid { overflow: visible; }
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 700px 400px at 80% 20%, rgba(99,102,241,0.12), transparent 60%),
    radial-gradient(ellipse 500px 300px at 10% 80%, rgba(236,72,153,0.08), transparent 65%);
  pointer-events: none;
  z-index: 0;
}
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(99,102,241,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99,102,241,0.04) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at center, black 0%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 0%, transparent 75%);
  pointer-events: none;
  z-index: 0;
}

.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(380px, 1.05fr);
  align-items: center;
  gap: 3rem;
}

.hero-text {
  max-width: 540px;
}
.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.9rem;
  background: white;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-light);
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}
.hero-pill .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
}
.hero-pill strong { color: var(--text-dark); font-weight: 700; }

.hero h1 {
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.06;
  color: var(--text-dark);
  margin-bottom: 1.25rem;
}
/* Animation séquentielle du H1 : ligne 1 puis ligne 2, en boucle.
   Les deux phrases occupent le même emplacement (position:absolute dans
   un wrapper .hero-title-stage qui réserve la hauteur dans le flux). */
.hero h1 .hero-title-stage {
  position: relative;
  display: block;
  /* Hauteur réservée = 2 lignes à line-height 1.06 (pour wrap mobile) */
  min-height: calc(1.06em * 2.2);
}
.hero h1 .hero-title-line {
  position: absolute;
  inset: 0;
  display: block;
  opacity: 0;
  transform: translateY(10px);
  animation: heroTitleSwap 8s ease-in-out infinite;
  will-change: opacity, transform;
}
.hero h1 .hero-title-line:nth-of-type(1) { animation-delay: 0s; }
.hero h1 .hero-title-line:nth-of-type(2) { animation-delay: 4s; }

@keyframes heroTitleSwap {
  0%   { opacity: 0; transform: translateY(10px); }
  6%   { opacity: 1; transform: translateY(0); }
  44%  { opacity: 1; transform: translateY(0); }
  50%  { opacity: 0; transform: translateY(-10px); }
  100% { opacity: 0; transform: translateY(-10px); }
}

@media (prefers-reduced-motion: reduce) {
  .hero h1 .hero-title-stage { min-height: 0; }
  .hero h1 .hero-title-line {
    position: static;
    opacity: 1;
    transform: none;
    animation: none;
  }
}

.hero-lead {
  font-size: 1.1rem;
  color: var(--text-light);
  line-height: 1.55;
  margin-bottom: 2rem;
}

.hero-actions {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.hero-meta {
  display: flex;
  gap: 1.5rem;
  font-size: 0.82rem;
  color: var(--text-light);
  flex-wrap: wrap;
}
.hero-meta-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.hero-meta-item svg {
  width: 16px; height: 16px;
  color: var(--success);
}

/* === Mockup conversation === */
.hero-mockup {
  position: relative;
  perspective: 1500px;
}
.mockup-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  transform: rotateY(-3deg) rotateX(2deg);
  transition: transform 0.4s ease;
}
.mockup-card:hover { transform: rotateY(0) rotateX(0); }

.mockup-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: linear-gradient(180deg, var(--bg-soft), white);
}
.mockup-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--gradient);
  color: white;
  font-weight: 700;
  font-size: 0.9rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.mockup-info { flex: 1; min-width: 0; }
.mockup-info .name { font-weight: 700; font-size: 0.95rem; color: var(--text-dark); }
.mockup-info .meta { font-size: 0.75rem; color: var(--text-light); display: flex; align-items: center; gap: 0.4rem; }
.mockup-info .meta .live {
  display: inline-flex; align-items: center; gap: 0.3rem;
  padding: 0.1rem 0.5rem;
  background: rgba(239,68,68,0.1);
  color: var(--danger);
  font-weight: 700; font-size: 0.7rem;
  border-radius: 999px;
}
.mockup-info .meta .live::before {
  content: '';
  width: 5px; height: 5px;
  background: var(--danger);
  border-radius: 50%;
  animation: liveDot 1.2s infinite;
}
@keyframes liveDot { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }
.mockup-timer {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text-light);
}

.mockup-body {
  padding: 1.25rem;
  background: var(--bg-soft);
  min-height: 320px;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.bubble {
  max-width: 80%;
  padding: 0.65rem 0.95rem;
  border-radius: 1rem;
  font-size: 0.88rem;
  line-height: 1.45;
  animation: bubbleIn 0.4s ease both;
}
@keyframes bubbleIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.bubble.bot {
  background: white;
  color: var(--text-dark);
  border: 1px solid var(--border);
  border-bottom-left-radius: 0.3rem;
  align-self: flex-start;
  box-shadow: var(--shadow-sm);
}
.bubble.client {
  background: var(--gradient);
  color: white;
  border-bottom-right-radius: 0.3rem;
  align-self: flex-end;
  box-shadow: 0 4px 12px -2px rgba(99,102,241,0.4);
}
.bubble .typing {
  display: inline-flex;
  gap: 3px;
  padding: 0.2rem 0;
}
.bubble .typing span {
  width: 6px; height: 6px;
  background: var(--text-muted);
  border-radius: 50%;
  animation: typing 1.4s infinite;
}
.bubble .typing span:nth-child(2) { animation-delay: 0.15s; }
.bubble .typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes typing {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-3px); opacity: 1; }
}

.mockup-footer {
  padding: 0.85rem 1.25rem;
  background: white;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  color: var(--text-light);
}
.mockup-footer .lang {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-weight: 600;
}
.mockup-footer .lang::before {
  content: '🇫🇷';
}
.mockup-footer .actions {
  display: flex; gap: 0.4rem;
}
.mockup-footer .icon-btn {
  width: 30px; height: 30px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--bg-elev);
  color: var(--text-light);
  transition: all 0.15s;
}
.mockup-footer .icon-btn:hover { background: var(--primary); color: white; }
.mockup-footer .icon-btn svg { width: 14px; height: 14px; }

/* Floating tag - booking confirmation */
.floating-card {
  position: absolute;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-size: 0.83rem;
  z-index: 2;
  animation: float-card 4s ease-in-out infinite;
}
@keyframes float-card {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
.floating-card .ico {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: rgba(16,185,129,0.12);
  color: var(--success);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.floating-card .ico svg { width: 16px; height: 16px; }
.floating-card .label { font-weight: 700; color: var(--text-dark); }
.floating-card .sub { font-size: 0.74rem; color: var(--text-light); }

.floating-card.fc-1 { top: -1rem; right: -1rem; }
.floating-card.fc-2 { bottom: -1rem; left: -1.5rem; animation-delay: -2s; }

@media (max-width: 960px) {
  .hero { padding: 7rem 0 4rem; }
  .hero-grid { grid-template-columns: 1fr; gap: 3rem; }
  .hero-text { max-width: 100%; text-align: center; margin: 0 auto; }
  .hero-actions { justify-content: center; }
  .hero-meta { justify-content: center; }
  .mockup-card { transform: none; max-width: 460px; margin: 0 auto; }
  .floating-card.fc-1 { right: 0; }
  .floating-card.fc-2 { left: 0; }
}
@media (max-width: 480px) {
  .floating-card { display: none; }
}

/* =======================================================
   HERO VISUAL - style Truecaller
   Photo lifestyle + téléphones superposés + cartes flottantes
   ======================================================= */

.hero-visual {
  position: relative;
  min-height: 520px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
}

/* Photo professionnelle (arrière-plan, style Truecaller) */
.hero-visual-photo {
  position: absolute;
  inset: 0;
  border-radius: 28px;
  background:
    linear-gradient(135deg, rgba(99,102,241,0.15) 0%, rgba(236,72,153,0.08) 50%, transparent 70%),
    url("https://images.unsplash.com/photo-1573497019940-1c28c88b4f3e?auto=format&fit=crop&w=900&q=80") center 30% / cover no-repeat;
  box-shadow: 0 40px 80px -24px rgba(99, 102, 241, 0.35);
  overflow: hidden;
}
.hero-visual-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    rgba(255,255,255,0.92) 0%,
    rgba(255,255,255,0.55) 38%,
    rgba(250,249,255,0.25) 58%,
    transparent 78%
  );
  border-radius: inherit;
}

.hero-visual-glow {
  position: absolute;
  width: 380px;
  height: 380px;
  right: -40px;
  top: 50%;
  transform: translateY(-50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(139,92,246,0.25), transparent 68%);
  filter: blur(24px);
  pointer-events: none;
  z-index: 0;
}

/* --- Téléphones empilés --- */
.hero-phones {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 420px;
  height: 440px;
  margin: 0 auto;
}

.phone {
  position: absolute;
  width: 200px;
  filter: drop-shadow(0 24px 48px rgba(15, 23, 42, 0.22));
}
.phone-bezel {
  background: #0f172a;
  border-radius: 36px;
  padding: 10px;
  border: 2px solid rgba(255,255,255,0.12);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.06),
    0 0 0 1px rgba(15,23,42,0.2);
}
.phone-notch {
  width: 72px;
  height: 22px;
  background: #0f172a;
  border-radius: 0 0 14px 14px;
  margin: -2px auto 6px;
  position: relative;
  z-index: 3;
}
.phone-screen {
  background: #fff;
  border-radius: 26px;
  overflow: hidden;
  min-height: 340px;
}

.phone-back {
  left: 0;
  top: 24px;
  transform: rotate(-14deg) scale(0.92);
  opacity: 0.92;
  z-index: 1;
  animation: phone-back-float 5s ease-in-out infinite;
}
.phone-main {
  right: 0;
  top: 0;
  width: 220px;
  z-index: 3;
  animation: phone-main-float 4.5s ease-in-out infinite;
}
@keyframes phone-back-float {
  0%, 100% { transform: rotate(-14deg) scale(0.92) translateY(0); }
  50%      { transform: rotate(-12deg) scale(0.92) translateY(-8px); }
}
@keyframes phone-main-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}

/* Écran tableau de bord */
.phone-screen-dash {
  padding: 1rem 0.9rem 1.1rem;
  background: linear-gradient(180deg, #faf9ff, #fff);
  font-size: 0.72rem;
}
.dash-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
}
.dash-logo {
  font-weight: 800;
  font-size: 0.85rem;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.dash-badge {
  font-size: 0.62rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  background: rgba(99,102,241,0.12);
  color: var(--primary);
  border-radius: 999px;
}
.dash-label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}
.dash-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.dash-list li {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.5rem;
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
}
.dash-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--gradient);
  color: white;
  font-size: 0.62rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.dash-avatar.alt { background: linear-gradient(135deg, #10b981, #059669); }
.dash-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}
.dash-info strong {
  font-size: 0.72rem;
  color: var(--text-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-info span {
  font-size: 0.62rem;
  color: var(--text-muted);
}
.dash-pill {
  font-size: 0.58rem;
  font-weight: 700;
  padding: 0.15rem 0.4rem;
  border-radius: 999px;
  background: rgba(99,102,241,0.1);
  color: var(--primary);
  flex-shrink: 0;
}
.dash-pill.ok { background: rgba(16,185,129,0.12); color: #059669; }
.dash-pill.live {
  background: rgba(239,68,68,0.12);
  color: var(--danger);
  animation: live-pulse 1.2s infinite;
}
@keyframes live-pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.55; } }

/* Écran appel entrant */
.phone-screen-call {
  padding: 1.5rem 1rem 1.25rem;
  text-align: center;
  background: linear-gradient(180deg, #1e1b4b 0%, #312e81 45%, #4c1d95 100%);
  color: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 380px;
}
.call-status {
  font-size: 0.68rem;
  font-weight: 600;
  color: rgba(255,255,255,0.7);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 1.1rem;
}
.call-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 10px #34d399;
  animation: live-pulse 1s infinite;
}
.call-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, #818cf8, #a78bfa);
  font-size: 1.35rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.65rem;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
}
.call-name {
  font-size: 1.05rem;
  font-weight: 800;
  margin: 0 0 0.2rem;
  letter-spacing: -0.02em;
}
.call-number {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.75);
  font-family: var(--mono, ui-monospace, monospace);
  margin: 0 0 0.75rem;
}
.call-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: center;
  margin-bottom: 0.85rem;
}
.call-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.62rem;
  font-weight: 600;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.9);
}
.call-tag.verified {
  background: rgba(16,185,129,0.25);
  color: #a7f3d0;
}
.call-tag.verified svg { width: 12px; height: 12px; }
.call-transcript {
  width: 100%;
  text-align: left;
  background: rgba(0,0,0,0.22);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  padding: 0.65rem 0.75rem;
  margin-bottom: auto;
}
.call-transcript-label {
  display: block;
  font-size: 0.58rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.5);
  margin-bottom: 0.35rem;
}
.call-transcript p {
  font-size: 0.72rem;
  line-height: 1.45;
  color: rgba(255,255,255,0.88);
  margin: 0;
  font-style: italic;
}
.call-actions {
  display: flex;
  gap: 2.5rem;
  align-items: center;
  justify-content: center;
  margin-top: 1rem;
}
.call-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.call-btn.decline {
  background: rgba(239,68,68,0.9);
  box-shadow: 0 6px 20px rgba(239,68,68,0.45);
}
.call-btn.decline svg { width: 22px; height: 22px; color: white; }
.call-btn.accept {
  background: #22c55e;
  box-shadow: 0 6px 20px rgba(34,197,94,0.5);
  animation: accept-pulse 2s ease-in-out infinite;
}
.call-btn.accept svg { width: 24px; height: 24px; color: white; }
@keyframes accept-pulse {
  0%, 100% { box-shadow: 0 6px 20px rgba(34,197,94,0.5); }
  50%      { box-shadow: 0 6px 28px rgba(34,197,94,0.75), 0 0 0 8px rgba(34,197,94,0.15); }
}

/* Cartes flottantes (comme Truecaller) */
.hero-float {
  position: absolute;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.7rem 0.95rem;
  background: rgba(255,255,255,0.96);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 12px 32px -8px rgba(15,23,42,0.18);
  backdrop-filter: blur(10px);
  font-size: 0.8rem;
  max-width: 200px;
  animation: hero-float-card 4s ease-in-out infinite;
}
.hero-float strong {
  display: block;
  font-weight: 700;
  color: var(--text-dark);
  font-size: 0.78rem;
  line-height: 1.2;
}
.hf-sub {
  display: block;
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}
.hf-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.hf-icon svg { width: 18px; height: 18px; }
.hf-icon.green { background: rgba(16,185,129,0.12); color: #059669; }
.hf-icon.purple { background: rgba(139,92,246,0.12); color: #7c3aed; }
.hf-icon.blue { background: rgba(99,102,241,0.12); color: var(--primary); }

.hf-identified { top: 8%; left: -8%; animation-delay: 0s; }
.hf-ai { bottom: 28%; left: -12%; animation-delay: -1.3s; }
.hf-booking { top: 18%; right: -6%; animation-delay: -2.6s; }

@keyframes hero-float-card {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-7px); }
}

@media (max-width: 960px) {
  .hero-visual { min-height: 480px; max-width: 460px; margin: 0 auto; }
  .hero-visual-photo { border-radius: 22px; }
  .hf-identified { left: -2%; }
  .hf-ai { left: -4%; }
  .hf-booking { right: -2%; }
}

@media (max-width: 480px) {
  .hero-visual { min-height: 420px; }
  .hero-phones { height: 380px; max-width: 100%; }
  .phone-back { left: -4%; transform: rotate(-12deg) scale(0.85); }
  .phone-main { width: 200px; right: -4%; }
  .hero-float { max-width: 160px; padding: 0.55rem 0.75rem; font-size: 0.72rem; }
  .hf-identified { top: 2%; left: 0; }
  .hf-ai { bottom: 22%; left: 0; }
  .hf-booking { top: 12%; right: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .phone-back, .phone-main, .hero-float, .call-dot, .dash-pill.live, .call-btn.accept {
    animation: none;
  }
}

/* =======================================================
   EVOLUTION CUBE 3D (legacy - conservé si réutilisation)
   ======================================================= */

.hero-cube-wrap {
  perspective: 1400px;
  perspective-origin: 50% 45%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 520px;
  position: relative;
  isolation: isolate;
}

/* Halo qui pulse derriere le cube. */
.hero-cube-wrap::before {
  content: "";
  position: absolute;
  width: 460px;
  height: 460px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.22) 0%, rgba(99, 102, 241, 0.12) 35%, transparent 70%);
  filter: blur(20px);
  z-index: -1;
  animation: cube-halo 6s ease-in-out infinite;
}
@keyframes cube-halo {
  0%, 100% { transform: scale(1);   opacity: 0.85; }
  50%      { transform: scale(1.12); opacity: 1;   }
}

.cube-scene {
  width: clamp(260px, 32vw, 340px);
  height: clamp(260px, 32vw, 340px);
  perspective: 1400px;
  position: relative;
}

.cube {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  /* Animation = 4 faces de 90 deg, total 360deg sur 16s (4s par face). */
  animation: cube-rotate 16s cubic-bezier(0.65, 0, 0.35, 1) infinite;
  will-change: transform;
}
.hero-cube-wrap:hover .cube { animation-play-state: paused; }

@keyframes cube-rotate {
  /* Pause sur chaque face (~3s visible) puis rotation rapide (~1s) vers la suivante. */
  0%,    18.75% { transform: rotateY(0deg)    rotateX(-6deg); }
  25%,   43.75% { transform: rotateY(-90deg)  rotateX(-6deg); }
  50%,   68.75% { transform: rotateY(-180deg) rotateX(-6deg); }
  75%,   93.75% { transform: rotateY(-270deg) rotateX(-6deg); }
  100%          { transform: rotateY(-360deg) rotateX(-6deg); }
}

.cube-face {
  position: absolute;
  inset: 0;
  border-radius: 28px;
  padding: 1.4rem 1.4rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 0.45rem;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  background: linear-gradient(155deg, rgba(255,255,255,0.95), rgba(245,243,255,0.92));
  border: 1px solid rgba(99, 102, 241, 0.18);
  box-shadow:
    0 30px 60px -20px rgba(99, 102, 241, 0.45),
    0 10px 30px -10px rgba(15, 23, 42, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  overflow: hidden;
  text-align: left;
}
/* Effet "shine" diagonal sur chaque face */
.cube-face::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 30%, rgba(255,255,255,0.55) 50%, transparent 70%);
  opacity: 0.45;
  pointer-events: none;
  mix-blend-mode: overlay;
}

/* Demi-arete = cube-size / 2 ; on assume 320px par defaut, override avec var pour clarte. */
:root { --cube-size: 320px; }
@media (max-width: 720px) { :root { --cube-size: 260px; } }

.cube-face-1 { transform: rotateY(0deg)    translateZ(calc(var(--cube-size) / 2)); }
.cube-face-2 { transform: rotateY(90deg)   translateZ(calc(var(--cube-size) / 2)); }
.cube-face-3 { transform: rotateY(180deg)  translateZ(calc(var(--cube-size) / 2)); }
.cube-face-4 { transform: rotateY(270deg)  translateZ(calc(var(--cube-size) / 2)); }

/* Couleurs / accents differents par niveau */
.cube-face-1 { background: linear-gradient(155deg, #ffffff, #eef2ff); }
.cube-face-2 { background: linear-gradient(155deg, #ffffff, #ede9fe); }
.cube-face-3 { background: linear-gradient(155deg, #fff7ed, #fef3c7); border-color: rgba(245, 158, 11, 0.28); box-shadow: 0 30px 60px -20px rgba(245, 158, 11, 0.4), 0 10px 30px -10px rgba(15, 23, 42, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.9); }
.cube-face-4 {
  background: linear-gradient(155deg, #0f172a, #312e81);
  color: white;
  border-color: rgba(139, 92, 246, 0.45);
  box-shadow: 0 30px 60px -20px rgba(139, 92, 246, 0.6), 0 10px 30px -10px rgba(15, 23, 42, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.cube-level {
  font-family: var(--font-mono, ui-monospace, "JetBrains Mono", monospace);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--primary, #6366f1);
  background: rgba(99, 102, 241, 0.12);
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
}
.cube-face-3 .cube-level { color: #b45309; background: rgba(245, 158, 11, 0.15); }
.cube-face-4 .cube-level { color: #ddd6fe; background: rgba(139, 92, 246, 0.22); }

.cube-emoji {
  font-size: clamp(2.4rem, 4vw, 2.8rem);
  margin-top: 0.2rem;
  margin-bottom: 0.1rem;
  filter: drop-shadow(0 6px 12px rgba(15, 23, 42, 0.18));
}

.cube-title {
  font-size: clamp(1.4rem, 2.2vw, 1.7rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-dark, #0f172a);
  line-height: 1.05;
}
.cube-face-4 .cube-title { color: #ffffff; }

.cube-desc {
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text-muted, #64748b);
  margin: 0.1rem 0 0.2rem;
}
.cube-face-4 .cube-desc { color: rgba(255, 255, 255, 0.78); }

.cube-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: auto;
}
.cube-tag {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.1);
  color: var(--primary-dark, #4338ca);
}
.cube-face-3 .cube-tag { background: rgba(245, 158, 11, 0.16); color: #92400e; }
.cube-face-4 .cube-tag { background: rgba(255, 255, 255, 0.14); color: #ffffff; backdrop-filter: blur(4px); }

/* Steps en bas du cube (synchronises avec l'animation) */
.cube-steps {
  margin-top: 2rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.8rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(99, 102, 241, 0.18);
  backdrop-filter: blur(8px);
  box-shadow: 0 6px 18px -8px rgba(15, 23, 42, 0.15);
  font-family: var(--font-sans, inherit);
}
.cube-step {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted, #64748b);
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  transition: background 0.4s ease, color 0.4s ease;
}
.cube-step[data-step="1"] { animation: step-active-1 16s linear infinite; }
.cube-step[data-step="2"] { animation: step-active-2 16s linear infinite; }
.cube-step[data-step="3"] { animation: step-active-3 16s linear infinite; }
.cube-step[data-step="4"] { animation: step-active-4 16s linear infinite; }
@keyframes step-active-1 { 0%, 25% { background: var(--gradient, linear-gradient(135deg,#6366f1,#8b5cf6)); color: #fff; } 25.01%, 100% { background: transparent; color: var(--text-muted, #64748b); } }
@keyframes step-active-2 { 0%, 25% { background: transparent; color: var(--text-muted, #64748b); } 25.01%, 50% { background: var(--gradient, linear-gradient(135deg,#6366f1,#8b5cf6)); color: #fff; } 50.01%, 100% { background: transparent; color: var(--text-muted, #64748b); } }
@keyframes step-active-3 { 0%, 50% { background: transparent; color: var(--text-muted, #64748b); } 50.01%, 75% { background: linear-gradient(135deg, #f59e0b, #f97316); color: #fff; } 75.01%, 100% { background: transparent; color: var(--text-muted, #64748b); } }
@keyframes step-active-4 { 0%, 75% { background: transparent; color: var(--text-muted, #64748b); } 75.01%, 100% { background: linear-gradient(135deg, #6366f1, #8b5cf6); color: #fff; } }

/* Orbiteurs decoratifs */
.cube-orbit {
  position: absolute;
  border-radius: 50%;
  border: 1px dashed rgba(99, 102, 241, 0.25);
  pointer-events: none;
  z-index: -1;
}
.cube-orbit-1 {
  width: 420px; height: 420px;
  top: 50%; left: 50%;
  margin-top: -210px; margin-left: -210px;
  animation: orbit-rotate 22s linear infinite;
}
.cube-orbit-2 {
  width: 320px; height: 320px;
  top: 50%; left: 50%;
  margin-top: -160px; margin-left: -160px;
  animation: orbit-rotate-rev 16s linear infinite;
  border-color: rgba(139, 92, 246, 0.3);
}
.cube-orbit-1::before, .cube-orbit-2::before {
  content: "";
  position: absolute;
  top: -5px; left: 50%;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--primary, #6366f1);
  box-shadow: 0 0 16px rgba(99, 102, 241, 0.6);
  transform: translateX(-50%);
}
.cube-orbit-2::before { background: #8b5cf6; box-shadow: 0 0 16px rgba(139, 92, 246, 0.7); }
@keyframes orbit-rotate     { from { transform: rotate(0); } to { transform: rotate(360deg); } }
@keyframes orbit-rotate-rev { from { transform: rotate(0); } to { transform: rotate(-360deg); } }

@media (max-width: 720px) {
  .hero-cube-wrap { min-height: 440px; }
  .cube-scene { width: 260px; height: 260px; }
  .hero-cube-wrap::before { width: 360px; height: 360px; }
  .cube-orbit-1 { width: 340px; height: 340px; margin: -170px 0 0 -170px; }
  .cube-orbit-2 { width: 260px; height: 260px; margin: -130px 0 0 -130px; }
}
@media (max-width: 480px) {
  .cube-orbit-1, .cube-orbit-2 { display: none; }
}

/* Accessibilite : si l'user prefere reduire les animations, on fige sur la face 1 */
@media (prefers-reduced-motion: reduce) {
  .cube { animation: none; transform: rotateY(0deg) rotateX(-6deg); }
  .cube-step { animation: none; }
  .cube-step[data-step="1"] { background: var(--gradient, linear-gradient(135deg,#6366f1,#8b5cf6)); color: #fff; }
  .cube-orbit-1, .cube-orbit-2 { animation: none; }
  .hero-cube-wrap::before { animation: none; }
}

/* =======================================================
   HERO B - Bannière full-bleed avec photo de fond
   ======================================================= */
.hero-b {
  position: relative;
  width: 100%;
  min-height: 400px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background:
    url("https://images.unsplash.com/photo-1556761175-5973dc0f32e7?auto=format&fit=crop&w=2000&q=80")
    center / cover no-repeat;
}
.hero-b-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(100deg, rgba(15, 23, 42, 0.82) 0%, rgba(49, 46, 129, 0.72) 45%, rgba(76, 29, 149, 0.55) 100%);
}
.hero-b-content {
  position: relative;
  z-index: 1;
  color: white;
  padding: 4rem 1.5rem;
  max-width: 720px;
}
.hero-b-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.95rem;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.92);
  margin-bottom: 1.25rem;
  backdrop-filter: blur(8px);
}
.hero-b-pill .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 10px #34d399;
}
.hero-b-title {
  font-size: clamp(2rem, 4.2vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.1;
  margin: 0 0 1rem;
  color: white;
}
.text-gradient-light {
  background: linear-gradient(135deg, #c4b5fd 0%, #f0abfc 60%, #fbcfe8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-b-lead {
  font-size: 1.05rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.85);
  margin: 0 0 1.75rem;
  max-width: 560px;
}
.hero-b-actions {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
}
.btn-light {
  background: rgba(255, 255, 255, 0.95);
  color: var(--text-dark);
  border: 1px solid rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(8px);
}
.btn-light:hover { background: white; }

@media (max-width: 640px) {
  .hero-b { min-height: 360px; }
  .hero-b-content { padding: 3rem 1.25rem; }
}
