/* ==========================================================================
   KORA — HERO PREMIUM (Butter-inspired craft & typography)
   ========================================================================== */

.kora-hero {
  color: #07070A;
  background: #FAFAFA;
  padding: 130px 0 40px;
  overflow: hidden;
  position: relative;
}

.kora-hero .kh-intro {
  text-align: center;
  padding: 0 20px;
  max-width: 980px;
  margin: auto;
  position: relative;
  z-index: 10;
  will-change: transform, opacity;
}

/* Eyebrow ultra-sobre */
.kora-hero .kh-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  color: #71717A;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.kora-hero .kh-eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #18181B;
}

/* Titre Hero : 2 lignes exactes */
.kora-hero h1 {
  font-family: "Polysans", Inter, sans-serif;
  font-size: clamp(34px, 4.6vw, 70px);
  line-height: 1.04;
  letter-spacing: -.04em;
  font-weight: 500;
  color: #07070A;
  text-wrap: balance;
  margin: 0 auto;
}
@media (min-width: 900px) {
  .kora-hero h1 { white-space: nowrap; }
  .kora-hero .kh-intro { max-width: none; }
}

.kora-hero h1 .kh-sub {
  color: #71717A;
  display: block;
  font-weight: 500;
}

.kora-hero .kh-lead {
  font-size: clamp(16px, 1.4vw, 19px);
  line-height: 1.55;
  margin: 20px auto 26px;
  color: #6E6878;
  max-width: 580px;
}

.kora-hero .kh-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 24px;
}

.kora-hero .kh-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 15px 30px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: var(--ink, #07070A);
  color: #FFFFFF;
  font-family: "Polysans", Inter, sans-serif;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 16px 36px -20px rgba(7, 7, 10, .72);
  transition: transform .3s var(--ease, cubic-bezier(.22, 1, .36, 1)), box-shadow .35s var(--ease, cubic-bezier(.22, 1, .36, 1)), border-color .35s var(--ease, cubic-bezier(.22, 1, .36, 1));
}

.kora-hero .kh-cta span {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #FFFFFF;
  transition: color .55s var(--ease, cubic-bezier(.22, 1, .36, 1));
}

.kora-hero .kh-cta svg {
  width: 16px;
  height: 16px;
  position: relative;
  z-index: 2;
  stroke: #FFFFFF;
  transition: transform .35s var(--ease, cubic-bezier(.22, 1, .36, 1)), stroke .45s var(--ease, cubic-bezier(.22, 1, .36, 1));
}

.kora-hero .kh-cta:hover {
  transform: translateY(-2px);
  border-color: rgba(7, 7, 10, .14);
  box-shadow: 0 20px 42px -16px rgba(7, 7, 10, .28);
}

.kora-hero .kh-cta:active {
  transform: scale(0.98) translateY(-1px);
}

.kora-hero .kh-cta:hover svg {
  transform: translateX(4px);
  stroke: var(--ink, #07070A);
}

.kora-hero .kh-cta::after {
  content: "";
  position: absolute;
  left: -24%;
  bottom: -78%;
  width: 148%;
  height: 190%;
  border-radius: 50% 50% 0 0 / 32px 32px 0 0;
  transform: translateY(104%);
  transition: transform .86s var(--ease, cubic-bezier(.22, 1, .36, 1));
  z-index: 1;
  background: #FFFFFF;
  pointer-events: none;
}

.kora-hero .kh-cta:hover::after {
  transform: translateY(-18%);
}

.kora-hero .kh-cta:hover span {
  color: var(--ink, #07070A);
}

/* Sélecteur segmenté des dashboards Hero */
.kh-switcher-wrap {
  display: flex;
  justify-content: center;
  margin: 24px auto 0;
  position: relative;
  z-index: 15;
}

.kh-switcher {
  display: inline-flex;
  gap: 4px;
  background: #ECEAE4;
  padding: 4px;
  border-radius: 14px;
  border: 1px solid rgba(7, 7, 10, 0.05);
}

.kh-switch-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: #6E6878;
  font-family: "Polysans", Inter, sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color .2s cubic-bezier(.23, 1, .32, 1), color .2s cubic-bezier(.23, 1, .32, 1), box-shadow .2s cubic-bezier(.23, 1, .32, 1);
}

@media (hover: hover) and (pointer: fine) {
  .kh-switch-btn:hover {
    color: #07070A;
  }
}

.kh-switch-btn.active {
  background: #FFFFFF;
  color: #07070A;
  box-shadow: 0 4px 14px rgba(7, 7, 10, 0.06);
}

.kh-switch-btn .kh-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}

.kh-switch-btn .kh-dot.blue { background: #2563EB; }
.kh-switch-btn .kh-dot.amber { background: #D97706; }

.kh-switch-tag {
  font-size: 11px;
  color: #928C9B;
  font-weight: 400;
}

.kh-switch-btn.active .kh-switch-tag {
  color: #71717A;
}

/* ==========================================================================
   Composition des Dashboards (2 suites distinctes en profondeur Butter)
   ========================================================================== */
.kh-fan-container {
  position: relative;
  width: 100%;
  max-width: 1200px;
  margin: 40px auto 0;
  height: 720px;
  overflow: visible;
}

.kh-dashboard-wrapper {
  position: absolute;
  top: 0;
  left: 50%;
  width: 1060px;
  max-width: 95vw;
  transform: translateX(-50%);
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.35s cubic-bezier(0.23, 1, 0.32, 1);
  will-change: transform, opacity;
  cursor: pointer;
  /* Contour effet glace : cadre translucide dépoli autour de la fenêtre */
  padding: 8px;
  border-radius: 21px;
  /* verre givré sans backdrop-filter : le flou provoquait des images vides pendant le changement de fenêtre */
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.85) 0%, rgba(255, 255, 255, 0.5) 55%, rgba(255, 255, 255, 0.7) 100%);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    inset 0 0 0 1px rgba(7, 7, 10, 0.04),
    0 30px 60px -24px rgba(7, 7, 10, 0.14);
}

/* État Linéa actif */
.kh-fan-container.show-linea .kh-card-linea {
  transform: translateX(-50%) translateY(0) scale(1);
  opacity: 1;
  z-index: 5;
  pointer-events: auto;
  /* la fenêtre qui passe devant devient opaque tout de suite : plus de fantôme translucide pendant le glissement */
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1), opacity 0s;
}

.kh-fan-container.show-linea .kh-card-terrava {
  transform: translateX(-43%) translateY(32px) scale(0.94) rotate(1.8deg);
  opacity: 0.38;
  z-index: 2;
  pointer-events: auto;
}

/* État Terrava actif */
.kh-fan-container.show-terrava .kh-card-terrava {
  transform: translateX(-50%) translateY(0) scale(1);
  opacity: 1;
  z-index: 5;
  pointer-events: auto;
  /* la fenêtre qui passe devant devient opaque tout de suite : plus de fantôme translucide pendant le glissement */
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1), opacity 0s;
}

.kh-fan-container.show-terrava .kh-card-linea {
  transform: translateX(-57%) translateY(32px) scale(0.94) rotate(-1.8deg);
  opacity: 0.38;
  z-index: 2;
  pointer-events: auto;
}

/* Style de la fenêtre d'application */
.kora-hero .dm-app {
  border: 1px solid rgba(7, 7, 10, 0.08);
  border-radius: 13px;
  box-shadow: 0 30px 60px -20px rgba(7, 7, 10, 0.1), 0 0 0 1px rgba(7, 7, 10, 0.03);
  background: #FFFFFF;
  overflow: hidden;
  height: 660px;
}

/* États initiaux pour les animations Anime.js / GSAP */
[data-demo-donut] {
  transition: none !important;
}

.dm-chart-line {
  transition: none !important;
}

[data-demo-bar] {
  transform-origin: left;
  transition: none !important;
}

/* ==========================================================================
   Responsive (Desktop compact, tablette et mobile 375 px)
   ========================================================================== */
/* Desktop : les templates dépassent un peu le bas de la section hero */
@media (min-width: 1101px) {
  .kora-hero {
    overflow-x: clip;
    overflow-y: visible;
    padding-bottom: 0;
    z-index: 3;
  }

  .kh-fan-container {
    height: 580px;
  }

  .kora-hero + .brand-section {
    padding-top: 160px;
  }
}

@media (max-width: 1100px) {
  .kh-fan-container {
    height: auto;
    min-height: 580px;
    margin-top: 30px;
  }
  
  .kh-dashboard-wrapper {
    width: 100%;
    left: 0;
    transform: none !important;
    position: relative;
    display: none;
  }

  .kh-fan-container.show-linea .kh-card-linea {
    display: block;
    transform: none !important;
    opacity: 1;
    filter: none;
  }

  .kh-fan-container.show-terrava .kh-card-terrava {
    display: block;
    transform: none !important;
    opacity: 1;
    filter: none;
  }

  .kora-hero .dm-app {
    height: auto;
    grid-template-columns: 1fr;
  }

  .kora-hero .dm-sidebar {
    display: none;
  }
}

@media (max-width: 680px) {
  .kora-hero {
    padding: 100px 16px 30px;
  }

  .kora-hero h1 {
    font-size: clamp(32px, 8.5vw, 42px);
    letter-spacing: -0.04em;
  }

  .kora-hero .kh-lead {
    font-size: 15px;
    margin: 14px auto 20px;
  }

  .kh-switcher-wrap {
    width: 100%;
    padding: 0 16px;
    margin-top: 16px;
  }

  .kh-switcher {
    width: 100%;
    max-width: 340px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-radius: 13px;
    background: #ECEAE4;
    border: 1px solid rgba(7, 7, 10, 0.08);
    padding: 3px;
  }

  .kh-switch-btn {
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 600;
    color: #52525B;
    justify-content: center;
    border-radius: 10px;
  }

  .kh-switch-btn.active {
    color: #07070A;
    background: #FFFFFF;
    box-shadow: 0 2px 6px rgba(7, 7, 10, 0.08);
  }

  .kh-switch-tag {
    display: none;
  }

  .kora-hero .dm-body {
    padding: 14px;
  }

  .kora-hero .dm-header h2 {
    font-size: 20px;
  }

  .kora-hero .dm-kpis {
    grid-template-columns: 1fr 1fr;
  }

  .kora-hero .dm-kpis>div+div {
    border-left: none;
  }

  .kora-hero .dm-commercial-grid,
  .kora-hero .dm-btp-grid {
    grid-template-columns: 1fr;
  }

  .kora-hero .dm-pipeline {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .kora-hero .dm-bottom-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .kora-hero * {
    animation: none !important;
    transition: none !important;
  }
  .dm-chart-line { stroke-dashoffset: 0 !important; }
  [data-demo-bar] { transform: scaleX(1) !important; }
  [data-demo-vbar] { transform: none !important; }
}
