/* ==========================================================================
   Francisco Nasich — Hero Section
   Fondo · Blobs · Lamp · Layout grid · Títulos · Badges · Video
   ========================================================================== */

/* --- HERO (premium SaaS) --- */
.hero-section {
  position: relative;
  min-height: 100vh;
  min-height: 100svh; /* pequeña viewport height: excluye barra de dirección en mobile */
  display: flex;
  align-items: center;
  overflow: hidden;
  padding-top: 0;
  box-sizing: border-box;
}

/* Transición gradiente hero → siguiente sección */
.hero-section::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 120px;
  background: linear-gradient(to bottom, transparent, var(--bg));
  pointer-events: none;
  z-index: 2;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* Hero background — fondo claro, blobs de marca en esquinas */
.hero-bg-gradient {
  position: absolute;
  inset: 0;
  background: var(--bg);
}

/* Blob container — blur elevado para difuminar y evitar círculos visibles */
.hero-bg-blobs {
  position: absolute;
  inset: 0;
  filter: blur(110px);
  overflow: hidden;
}

.hero-bg-blob {
  position: absolute;
  border-radius: 50%;
  mix-blend-mode: multiply;
}

/* Blob A — naranja brand · inferior izquierda */
.hero-bg-blob--a {
  width: 72%;
  height: 65%;
  bottom: -22%;
  left: -18%;
  background: radial-gradient(circle, rgba(255, 110, 47, 0.38) 0%, rgba(255, 110, 47, 0.10) 55%, transparent 72%);
  animation: heroBlobPulse 11s ease-in-out infinite alternate;
}

/* Blob B — pink brand · superior derecha */
.hero-bg-blob--b {
  width: 60%;
  height: 58%;
  top: -18%;
  right: -18%;
  background: radial-gradient(circle, rgba(254, 66, 106, 0.28) 0%, rgba(254, 66, 106, 0.07) 55%, transparent 72%);
  animation: heroBlobPulse 14s ease-in-out infinite alternate-reverse;
}

/* Blob C — naranja suave · centro-superior, rellena el medio */
.hero-bg-blob--c {
  display: block;
  width: 50%;
  height: 45%;
  top: -10%;
  left: 25%;
  background: radial-gradient(circle, rgba(255, 150, 60, 0.14) 0%, transparent 65%);
  animation: heroBlobPulse 17s ease-in-out infinite alternate;
}

.hero-bg-blob--d {
  display: none;
}

/* Pulso suave: escala + leve desplazamiento, sin rotación orbital */
@keyframes heroBlobPulse {
  from { transform: scale(1)    translate(0,   0  ); opacity: 0.60; }
  to   { transform: scale(1.18) translate(3%, 5% ); opacity: 0.90; }
}

/* Vignette: aclara los bordes para fundir con la página */
.hero-bg-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 90% 85% at 50% 50%, transparent 40%, rgba(255, 255, 255, 0.72) 100%);
}

/* --- Colorimetría de textos del hero (fondo claro) --- */
.hero-section .hero-title {
  color: var(--text);
}

.hero-section .hero-sub {
  color: var(--text-2);
}

.hero {
  position: relative;
  z-index: 3;
  width: 100%;
  /* Padding top: nunca menos que nav-height + 20px de aire (~88px mínimo) */
  padding: clamp(92px, 8vw, 116px) var(--space-md) clamp(56px, 6vw, 96px);
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto;
  grid-template-areas:
    "left   right"
    "bottom right";
  column-gap: clamp(40px, 5.5vw, 96px);
  row-gap: clamp(20px, 2.8vw, 40px);
  align-items: start;
}

/* ── Columna izquierda — texto ────────────────────── */
.hero-left {
  grid-area: left;
  display: flex;
  flex-direction: column;
  min-width: 0;
  align-self: start; /* explícito — igual que .hero-right, evita que el grid lo estire */
}

/* ── Tag — hijo flex de .hero-right, encima del video ── */
.hero-tag-wrap {
  flex-shrink: 0;
  -webkit-animation: heroRiseUp 1.1s cubic-bezier(0.16, 1, 0.3, 1) 0.2s both;
          animation: heroRiseUp 1.1s cubic-bezier(0.16, 1, 0.3, 1) 0.2s both;
  will-change: transform, opacity;
}

/* ── Columna derecha — tag + video ── */
.hero-right {
  grid-area: right;
  display: flex;
  flex-direction: column;
  gap: clamp(12px, 1.6vw, 22px);
  min-width: 0;
  align-self: start; /* altura determinada por su contenido, no por la grid */
}

/* ── Fila inferior izquierda — badges + CTA ──────── */
.hero-bottom {
  grid-area: bottom;
  display: flex;
  flex-direction: column;
  gap: clamp(16px, 2.2vw, 28px);
  min-width: 0;
  align-self: start;
  -webkit-animation: heroRiseUp 1.1s cubic-bezier(0.16, 1, 0.3, 1) 0.2s both;
          animation: heroRiseUp 1.1s cubic-bezier(0.16, 1, 0.3, 1) 0.2s both;
  will-change: transform, opacity;
}

/* hero-text-group — alineado a la izquierda en layout split */
.hero-text-group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
  max-width: none;
  margin: 0;
  text-align: left;
}

.hero-text-group .hero-title,
.hero-text-group .hero-sub {
  width: 100%;
  max-width: none;
  margin-left: 0;
  margin-right: 0;
  text-align: left;
  align-self: stretch;
}

.hero-content {
  text-align: left;
  max-width: none;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: clamp(18px, 2.5vw, 36px);
  /* Literal cubic-bezier en vez de var() — Safari no acepta variables en animation shorthand */
  -webkit-animation: heroRiseUp 1.1s cubic-bezier(0.16, 1, 0.3, 1) 0.2s both;
          animation: heroRiseUp 1.1s cubic-bezier(0.16, 1, 0.3, 1) 0.2s both;
  will-change: transform, opacity;
}

/* ── Hero pain badges — expandibles ───────────────── */
.hero-pain-pills {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0;
  margin: 0;
}

.hero-pain-pill {
  /* wrapper sin overflow ni bordes propios */
}

/* ── Trigger — badge clickeable ───────────────────── */
.hero-pill-trigger {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 4px 14px 4px 4px;
  width: 100%;
  text-align: left;
  background: #fff;
  border: 1px solid rgba(255, 110, 47, 0.22);
  border-radius: var(--r-full);
  cursor: pointer;
  font-family: var(--ft);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-fast), border-color var(--transition-fast);
}

.hero-pill-trigger:hover {
  box-shadow: var(--shadow-md);
  border-color: rgba(255, 110, 47, 0.38);
}

/* ── Parte izquierda — fondo suave de marca + avatar + nombre ── */
.hero-pill-left {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(255, 110, 47, 0.1);
  border-radius: var(--r-full);
  padding: 5px 13px 5px 5px;
  flex-shrink: 0;
  margin-right: 12px;
}

.hero-pill-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--orange);
  overflow: hidden;
}

.hero-pill-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 15%; /* enfoca la cara, no el cuerpo */
  border-radius: 50%;
  display: block;
}

.hero-pill-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--orange);
  white-space: nowrap;
  letter-spacing: -0.01em;
}

/* ── Texto del badge ──────────────────────────────── */
.hero-pill-label {
  flex: 1;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--orange);
  line-height: 1.4;
  min-width: 0;
}

.pill-label-mobile { display: none; }

/* ── Chevron ──────────────────────────────────────── */
.hero-pill-chevron {
  flex-shrink: 0;
  color: var(--orange);
  transition: transform 0.3s ease;
  display: flex;
  align-items: center;
  margin-left: 8px;
  opacity: 0.75;
}

.hero-pain-pill.open .hero-pill-chevron {
  transform: rotate(180deg);
}

/* ── Card de detalle — separada del trigger, sin bordes ── */
.hero-pill-detail {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.38s ease;
}

.hero-pill-detail p {
  margin-top: 6px;
  padding: 13px 16px 15px 18px;
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.7;
  font-style: italic;
  background: rgba(255, 110, 47, 0.05);
  border-radius: 12px;
  border: 1px solid rgba(255, 110, 47, 0.12);
}

.hero-pain-pill.open .hero-pill-detail {
  max-height: 180px;
}

/* ── CTA wrap ─────────────────────────────────────── */
.hero-cta-wrap {
  display: flex;
  align-items: center;
}

@-webkit-keyframes heroRiseUp {
  from { opacity: 0; -webkit-transform: translateY(72px); transform: translateY(72px); }
  to   { opacity: 1; -webkit-transform: translateY(0);    transform: translateY(0); }
}
@keyframes heroRiseUp {
  from { opacity: 0; transform: translateY(72px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── Hero lamp / spotlight effect ─────────────────────────── */
/* All animations use only transform + opacity → GPU-accelerated, zero layout reflow */
.hero-lamp {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: min(15rem, 45vh);
  pointer-events: none;
}

/* Lamp cones — ocultos, los blobs ya dan el efecto ambiental */
.hero-lamp-left,
.hero-lamp-right,
.hero-lamp-glow { display: none; }

/* Thin gradient line at the very top — the "lamp edge" */
.hero-lamp-line {
  position: absolute;
  top: 0;
  left: 50%;
  width: min(30rem, 80vw);
  height: 2px;
  transform: translateX(-50%) scaleX(0.4);
  transform-origin: center;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 110, 47, 0.8) 28%,
    rgba(254, 66, 106, 0.8) 72%,
    transparent 100%
  );
  animation: lampLine 0.85s var(--ease-out-expo) 0.3s both;
}

@keyframes lampFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes lampLine {
  from { transform: translateX(-50%) scaleX(0.4); opacity: 0; }
  to   { transform: translateX(-50%) scaleX(1);   opacity: 1; }
}
@keyframes lampCone {
  from { transform: scaleX(0.4); opacity: 0; }
  to   { transform: scaleX(1);   opacity: 1; }
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1px solid var(--border);
  padding: clamp(9px, 1vw, 12px) clamp(20px, 2vw, 28px) clamp(9px, 1vw, 12px) clamp(14px, 1.5vw, 20px);
  font-family: var(--ft);
  font-weight: 500;
  font-size: clamp(12px, 1.1vw, 16px);
  letter-spacing: -0.01em;
  text-transform: none;
  color: var(--text-2);
  margin-bottom: clamp(10px, 1.8vw, 24px);
  margin-left: 0;
  margin-right: auto;
  max-width: 100%;
  line-height: 1.5;
  white-space: nowrap;
  border-radius: var(--r-full);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(8px);
}

.hero-tag-mobile {
  display: none;
}

.hero-tag::before {
  content: '';
  width: 8px;
  height: 8px;
  background: var(--grad);
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 0 4px rgba(255, 110, 47, 0.14);
  animation: pulse 2.2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.7); }
}

.hero-title {
  font-size: clamp(30px, 4.2vw, 68px);
  letter-spacing: -0.04em;
  line-height: 1.07;
  margin-top: 0;           /* override UA h1 { margin-block-start: 0.67em } */
  margin-block-start: 0;  /* propiedad lógica — por si acaso */
  margin-bottom: clamp(14px, 1.8vw, 24px);
  max-width: none;
  margin-left: 0;
  margin-right: 0;
  text-wrap: balance;
  color: var(--text);
  font-weight: 800;
}

.hero-title em {
  font-style: normal;
  display: inline;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-sub {
  font-size: clamp(14px, 1.2vw, 17px);
  color: var(--text-2);
  max-width: none;
  margin-left: 0;
  margin-right: 0;
  line-height: 1.45;
  margin-bottom: 0;
  font-weight: 400;
  letter-spacing: -0.01em;
}

.hero-sub + .hero-sub {
  margin-top: 10px;
}

/* El <br> en hero-sub no genera espacio extra — line-height lo maneja */
.hero-sub br {
  content: '';
  display: block;
  margin-bottom: 0;
}

.hero-sub strong {
  color: var(--text);
  font-weight: 600;
}

@media (min-width: 641px) {
  .hero {
    grid-template-columns: minmax(0, 820px);
    grid-template-rows: auto auto auto;
    grid-template-areas:
      "right"
      "left"
      "bottom";
    justify-content: center;
    justify-items: center;
    row-gap: clamp(18px, 2.2vw, 30px);
    text-align: center;
  }

  .hero-right {
    width: 100%;
    align-items: center;
  }

  .hero-left,
  .hero-bottom,
  .hero-content,
  .hero-text-group {
    width: 100%;
    align-items: center;
    text-align: center;
  }

  .hero-text-group .hero-title,
  .hero-text-group .hero-sub {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
  }

  .hero-text-group .hero-sub {
    max-width: 680px;
  }

  .hero-bottom {
    max-width: 680px;
  }

  .hero-cta-wrap {
    justify-content: center;
  }
}
