/* ========================================
   KUBU ANALYTICS — Hero Section
   ======================================== */

.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 120px 0 80px;
  overflow: hidden;
  background: linear-gradient(165deg, #fff 0%, var(--red-light) 50%, #fff 100%);
}

/* Decorative background shapes */
.hero::before {
  content: '';
  position: absolute;
  top: -200px;
  right: -200px;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--red-glow) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -100px;
  left: -150px;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(212,43,43,.06) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

/* Grid pattern overlay */
.hero__grid-pattern {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 60px 60px;
  opacity: .25;
  pointer-events: none;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
}

.hero .container {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

/* Content */
.hero__content {
  max-width: 560px;
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-family: var(--font-display);
  font-size: .82rem;
  font-weight: 600;
  color: var(--dark-soft);
  margin-bottom: 28px;
  box-shadow: var(--shadow-sm);
  animation: fadeInDown .8s ease;
}

.hero__badge-dot {
  width: 8px;
  height: 8px;
  background: #22C55E;
  border-radius: 50%;
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .6; transform: scale(1.3); }
}

.hero__title {
  font-size: clamp(2.4rem, 5.5vw, 3.8rem);
  line-height: 1.12;
  margin-bottom: 24px;
  animation: fadeInUp .8s ease;
}

.hero__title-highlight {
  position: relative;
  color: var(--red-primary);
  white-space: nowrap;
}

.hero__title-highlight::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 0;
  width: 100%;
  height: 8px;
  background: var(--red-glow);
  border-radius: 4px;
  z-index: -1;
}

.hero__description {
  font-size: 1.15rem;
  line-height: 1.8;
  color: var(--text-body);
  margin-bottom: 36px;
  animation: fadeInUp .8s ease .15s backwards;
}

.hero__actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  animation: fadeInUp .8s ease .3s backwards;
}

.hero__stats {
  display: flex;
  gap: 40px;
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
  animation: fadeInUp .8s ease .45s backwards;
}

.hero__stat-number {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  color: var(--dark);
}

.hero__stat-label {
  font-size: .85rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Visual / Dashboard Preview */
.hero__visual {
  position: relative;
  animation: fadeInRight .9s ease .2s backwards;
}

.hero__dashboard {
  background: var(--dark);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255,255,255,.08);
  position: relative;
}

.hero__dashboard-bar {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
}

.hero__dashboard-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.hero__dashboard-dot:nth-child(1) { background: #EF4444; }
.hero__dashboard-dot:nth-child(2) { background: #F59E0B; }
.hero__dashboard-dot:nth-child(3) { background: #22C55E; }

.hero__dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.hero__dashboard-card {
  background: rgba(255,255,255,.06);
  border-radius: var(--radius-sm);
  padding: 16px;
  border: 1px solid rgba(255,255,255,.06);
}

.hero__dashboard-card-label {
  font-size: .72rem;
  color: rgba(255,255,255,.45);
  font-family: var(--font-display);
  font-weight: 500;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.hero__dashboard-card-value {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
}

.hero__dashboard-card-value.text-green { color: #22C55E; }
.hero__dashboard-card-value.text-blue { color: #3B82F6; }
.hero__dashboard-card-value.text-amber { color: #F59E0B; }
.hero__dashboard-card-value.text-red-val { color: var(--red-primary); }

.hero__dashboard-chart {
  grid-column: 1 / -1;
  background: rgba(255,255,255,.06);
  border-radius: var(--radius-sm);
  padding: 16px;
  border: 1px solid rgba(255,255,255,.06);
  height: 140px;
  display: flex;
  align-items: flex-end;
  gap: 6px;
}

.hero__chart-bar {
  flex: 1;
  background: linear-gradient(to top, var(--red-primary), rgba(212,43,43,.4));
  border-radius: 4px 4px 0 0;
  animation: growBar 1.2s ease forwards;
  transform-origin: bottom;
}

@keyframes growBar {
  from { transform: scaleY(0); }
  to { transform: scaleY(1); }
}

/* Floating elements */
.hero__float {
  position: absolute;
  background: #fff;
  border-radius: var(--radius-md);
  padding: 14px 20px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: .82rem;
  font-weight: 600;
  color: var(--dark);
  animation: float 4s ease-in-out infinite;
  z-index: 3;
}

.hero__float--top {
  top: -10px;
  right: -20px;
}

.hero__float--bottom {
  bottom: 20px;
  left: -30px;
  animation-delay: 1.5s;
}

.hero__float-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero__float-icon--green { background: #DCFCE7; color: #22C55E; }
.hero__float-icon--blue { background: #DBEAFE; color: #3B82F6; }

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

/* Animations */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-16px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInRight {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ---------- Responsive ---------- */
@media (max-width: 968px) {
  .hero .container {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero__content {
    max-width: 100%;
  }

  .hero__actions {
    justify-content: center;
  }

  .hero__stats {
    justify-content: center;
  }

  .hero__visual {
    max-width: 520px;
    margin: 0 auto;
  }

  .hero__float--top { right: 0; }
  .hero__float--bottom { left: 0; }
}

@media (max-width: 580px) {
  .hero__stats {
    gap: 24px;
  }

  .hero__actions {
    flex-direction: column;
    width: 100%;
  }

  .hero__actions .btn {
    width: 100%;
    justify-content: center;
  }

  .hero__float { display: none; }
}

/* ========================================
   Typewriter effect on hero title
   El rotor vive en su propia línea para evitar que el typewriter
   cause reflow del texto previo cuando borra/escribe.
   ======================================== */
.hero__title-typewrap {
  display: block;          /* fuerza salto de línea propio */
  white-space: nowrap;
  min-height: 1.2em;       /* reserva alto fijo aunque esté vacío */
  overflow: hidden;
  text-overflow: clip;
}

.hero__title-highlight.typewriter {
  display: inline-block;
  white-space: nowrap;
  min-height: 1em;
}

.typewriter-cursor {
  display: inline-block;
  font-weight: 400;
  color: var(--red-primary);
  margin-left: 2px;
  animation: typewriter-blink 0.85s steps(1) infinite;
}

@keyframes typewriter-blink {
  0%, 49%   { opacity: 1; }
  50%, 100% { opacity: 0; }
}
