/* Helix Hero — todo está bajo .helix-hero para no chocar con los estilos de tu web. */

.helix-hero {
  /* Personalización: cambia estos valores */
  --hh-bg: #04060d; /* fondo más oscuro */
  --hh-glow: #13355f; /* resplandor del fondo y reflejo azul */
  --hh-accent: #ff8c00; /* anillos luminosos */
  --hh-brand: #ffc107; /* amarillo de Piraminet: botones y logotipo */
  --hh-accent-2: #ffc107; /* anillos dorados */
  --hh-rim: #38c6ff; /* luz de contorno */
  --hh-metal: #465468; /* metal de la hélice */
  --hh-ink: #f4f7fb; /* texto principal */
  --hh-ink-soft: #97a3b4; /* texto secundario */
  --hh-font: 'Poppins', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --hh-scroll: 700vh; /* longitud del recorrido; 100vh = sin recorrido */
  --hh-gutter: var(--hh-site-gutter, clamp(20px, 4vw, 64px));
  --hh-chat-a: #00d4ff; /* tarjeta de chat */
  --hh-chat-b: #a855f7;
  --hh-voice-a: #ffc107; /* tarjeta de voz */
  --hh-voice-b: #ff7a18;

  position: relative;
  height: var(--hh-scroll);
  background: var(--hh-bg);
  color: var(--hh-ink);
  font-family: var(--hh-font);
  -webkit-font-smoothing: antialiased;
}
.helix-hero *,
.helix-hero *::before,
.helix-hero *::after {
  box-sizing: border-box;
}

.hh-stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(70% 70% at 72% 32%, color-mix(in srgb, var(--hh-glow) 55%, transparent), transparent 70%),
    var(--hh-bg);
}
.hh-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: -2;
}
/* Base en penumbra: fija el texto sobre fondo oscuro y funde la salida del hero */
.hh-stage::after {
  content: '';
  position: absolute;
  inset: 45% 0 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(to bottom, transparent, color-mix(in srgb, var(--hh-bg) 88%, transparent) 78%, var(--hh-bg));
}

/* Penumbra superior: separa la navegación de la hélice */
.hh-stage::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 130px;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(to bottom, color-mix(in srgb, var(--hh-bg) 82%, transparent), transparent);
}

/* Botón */
.hh-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  background: var(--hh-brand);
  color: #1b1200;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 0 24px -6px var(--hh-brand);
  transition: filter 0.2s, box-shadow 0.2s;
}
.hh-btn:hover {
  filter: brightness(1.1);
  box-shadow: 0 0 34px -4px var(--hh-brand);
}
.helix-hero a:focus-visible,
.helix-hero button:focus-visible,
.helix-hero input:focus-visible {
  outline: 2px solid var(--hh-ink);
  outline-offset: 3px;
}

/* Paneles de texto: helix-hero.js los muestra según data-hh-range="desde,hasta" */
.hh-panel {
  position: absolute;
  will-change: opacity, transform, filter;
}
.hh-panel--a,
.hh-panel--row {
  left: var(--hh-gutter);
  right: var(--hh-gutter);
  bottom: clamp(32px, 9vh, 96px);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
}
.hh-copy {
  flex: 0 1 620px;
  min-width: 0;
}
.hh-panel--left {
  left: var(--hh-gutter);
  bottom: clamp(32px, 9vh, 96px);
  width: min(620px, calc(100% - 2 * var(--hh-gutter)));
}
.hh-panel--b {
  right: var(--hh-gutter);
  bottom: clamp(32px, 10vh, 110px);
  width: min(500px, calc(100% - 2 * var(--hh-gutter)));
}
.hh-panel--c {
  left: 50%;
  top: 42%;
  width: min(760px, calc(100% - 2 * var(--hh-gutter)));
  margin-left: calc(min(760px, 100% - 2 * var(--hh-gutter)) / -2);
  text-align: center;
}
/* Penumbra tras el texto centrado, para que se lea sobre la hélice */
.hh-panel--c::before {
  content: '';
  position: absolute;
  inset: -55% -22%;
  z-index: -1;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--hh-bg) 88%, transparent) 45%, transparent);
}
.hh-title {
  margin: 0;
  font-size: clamp(2.1rem, 3.9vw, 3.9rem);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.03em;
  background: linear-gradient(to bottom, var(--hh-ink) 15%, var(--hh-ink-soft) 115%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-wrap: balance;
}
.hh-title--md {
  font-size: clamp(1.8rem, 3vw, 3rem);
  line-height: 1.1;
}
.hh-title--sm {
  font-size: clamp(1.7rem, 2.9vw, 2.75rem);
  line-height: 1.14;
}
.hh-lead {
  margin: 18px 0 0;
  max-width: 44ch;
  color: var(--hh-ink-soft);
  font-size: clamp(0.95rem, 1.1vw, 1.05rem);
  line-height: 1.55;
}
.hh-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 22px;
  color: var(--hh-ink);
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
}
.hh-link span {
  color: var(--hh-brand);
  transition: transform 0.2s;
}
.hh-link:hover span {
  transform: translateX(4px);
}

/* Antetítulo */
.hh-eyebrow {
  margin: 0 0 16px;
  color: var(--hh-brand);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Tarjetas animadas */
.hh-chip {
  --sa: var(--hh-chat-a);
  --sb: var(--hh-chat-b);
  position: relative;
  flex: 0 0 340px;
  padding: 18px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(15, 21, 37, 0.72), rgba(10, 15, 29, 0.6));
  border: 1px solid rgba(255, 255, 255, 0.12);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  backdrop-filter: blur(18px) saturate(140%);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.45);
  color: var(--hh-ink);
  pointer-events: none;
}
.hh-chip {
  margin-bottom: 44px; /* deja libre el botón de chat */
}
.hh-chip--voice {
  --sa: var(--hh-voice-a);
  --sb: var(--hh-voice-b);
}
.hh-chip::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, var(--sa), transparent 40%, transparent 60%, var(--sb));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0.7;
}
.hh-chip-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.hh-chip-head strong {
  display: block;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.2;
}
.hh-chip-head em {
  display: flex;
  align-items: center;
  gap: 6px;
  font-style: normal;
  font-size: 0.74rem;
  color: var(--hh-ink-soft);
}
.hh-chip-head b {
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--sa);
}
.hh-live {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10ffa1;
  box-shadow: 0 0 8px #10ffa1;
  animation: hh-blink 1.6s infinite;
}
@keyframes hh-blink {
  50% {
    opacity: 0.35;
  }
}
.hh-chip-icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 12px;
  background: color-mix(in srgb, var(--sa) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--sa) 30%, transparent);
  color: var(--sa);
}
.hh-chip-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hh-chip-icon svg {
  width: 20px;
  height: 20px;
}
.hh-bubble {
  margin-bottom: 8px;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 0.82rem;
  line-height: 1.45;
  opacity: 0;
  transform: translateY(10px);
}
.hh-bubble--user {
  margin-left: 40px;
  background: linear-gradient(135deg, var(--sa), var(--sb));
  color: #050a16;
  font-weight: 500;
  border-bottom-right-radius: 4px;
}
.hh-bubble--bot {
  margin-right: 24px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom-left-radius: 4px;
}
.hh-on .hh-bubble {
  animation: hh-bubble-in 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
}
.hh-on .hh-bubble--user {
  animation-delay: 0.5s;
}
.hh-on .hh-bubble--bot {
  animation-delay: 1.5s;
}
@keyframes hh-bubble-in {
  to {
    opacity: 1;
    transform: none;
  }
}
.hh-typing {
  display: inline-flex;
  gap: 4px;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
}
.hh-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--hh-ink-soft);
  animation: hh-typing 1.2s infinite;
}
.hh-typing span:nth-child(2) {
  animation-delay: 0.15s;
}
.hh-typing span:nth-child(3) {
  animation-delay: 0.3s;
}
@keyframes hh-typing {
  0%,
  60%,
  100% {
    transform: translateY(0);
    opacity: 0.4;
  }
  30% {
    transform: translateY(-5px);
    opacity: 1;
  }
}
.hh-wave {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 64px;
  margin: 4px 0 14px;
}
.hh-wave span {
  flex: 1;
  height: 20%;
  border-radius: 4px;
  background: linear-gradient(180deg, var(--sa), var(--sb));
  animation: hh-wave 1.1s ease-in-out infinite;
}
.hh-wave span:nth-child(3n) {
  animation-duration: 0.9s;
}
.hh-wave span:nth-child(4n) {
  animation-duration: 1.3s;
}
.hh-wave span:nth-child(5n) {
  animation-duration: 0.75s;
}
.hh-wave span:nth-child(2n) {
  animation-delay: -0.4s;
}
.hh-wave span:nth-child(7n) {
  animation-delay: -0.7s;
}
@keyframes hh-wave {
  0%,
  100% {
    height: 18%;
  }
  50% {
    height: 100%;
  }
}
.hh-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.hh-tags span {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--sa) 35%, transparent);
  background: color-mix(in srgb, var(--sa) 10%, transparent);
  color: var(--sa);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Acciones del cierre */
.hh-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 26px;
}
.hh-btn--ghost {
  background: color-mix(in srgb, var(--hh-bg) 45%, transparent);
  color: var(--hh-ink);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--hh-ink) 26%, transparent);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}
.hh-btn--ghost:hover {
  box-shadow: inset 0 0 0 1px var(--hh-brand);
}
.hh-legal {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin: 10px 0 0;
  font-size: 0.75rem;
}
.hh-legal a {
  color: var(--hh-ink-soft);
  text-decoration: none;
}
.hh-legal a:hover {
  color: var(--hh-ink);
}
.hh-note {
  margin: 16px 0 0;
  color: var(--hh-ink-soft);
  font-size: 0.85rem;
}

/* Entrada al cargar */
.hh-panel--a .hh-copy > * {
  animation: hh-rise 1.1s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.hh-panel--a .hh-copy > :nth-child(2) {
  animation-delay: 0.12s;
}
.hh-panel--a .hh-copy > :nth-child(3) {
  animation-delay: 0.22s;
}
@keyframes hh-rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
}

/* Sin JavaScript o sin WebGL el texto sigue accesible, sin recorrido */
.helix-hero:not(.hh-ready) {
  height: auto;
}
.helix-hero:not(.hh-ready) .hh-stage {
  position: relative;
  height: auto;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 56px;
  padding: 120px var(--hh-gutter) 56px;
}
.helix-hero:not(.hh-ready) .hh-panel {
  position: static;
  width: min(760px, 100%);
  margin: 0;
  text-align: left;
}
.helix-hero:not(.hh-ready) .hh-chip {
  display: none;
}
.helix-hero:not(.hh-ready) .hh-actions {
  justify-content: flex-start;
}
.helix-hero:not(.hh-ready) .hh-canvas {
  display: none;
}

@media (max-width: 1000px) {
  .hh-chip {
    flex-basis: 300px;
  }
}
@media (max-width: 820px) {
  .hh-panel--a,
  .hh-panel--row {
    flex-direction: column;
    align-items: stretch;
    gap: 18px;
    bottom: clamp(24px, 5svh, 56px);
  }
  .hh-copy {
    flex: none;
    order: 2;
  }
  .hh-chip {
    margin-bottom: 0;
    flex: none;
    order: 1;
    padding: 14px;
    width: min(320px, 100%);
    align-self: flex-end;
  }
  .hh-chip-head {
    margin-bottom: 10px;
  }
  .hh-wave {
    height: 44px;
    margin-bottom: 10px;
  }
  .hh-bubble {
    margin-bottom: 6px;
    padding: 8px 12px;
    font-size: 0.78rem;
  }
  .hh-panel--left {
    bottom: clamp(24px, 5svh, 56px);
  }
  /* Libera el botón de chat, abajo a la derecha */
  .hh-panel .hh-lead {
    max-width: calc(100% - 72px);
  }
  .hh-panel--b {
    left: var(--hh-gutter);
    right: auto;
    bottom: clamp(24px, 5svh, 56px);
  }
  .hh-panel--c {
    top: auto;
    bottom: clamp(36px, 12svh, 110px);
  }
  .hh-btn {
    min-height: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hh-panel--a .hh-copy > * {
    animation: none;
  }
  .hh-live,
  .hh-typing span,
  .hh-wave span {
    animation: none;
  }
  .hh-wave span {
    height: 42%;
  }
  .hh-wave span:nth-child(3n) {
    height: 82%;
  }
  .hh-wave span:nth-child(5n) {
    height: 62%;
  }
  .hh-wave span:nth-child(7n) {
    height: 96%;
  }
  .hh-on .hh-bubble {
    animation: none;
    opacity: 1;
    transform: none;
  }
  .hh-panel {
    will-change: auto;
  }
}

.hh-line {
  display: block;
}

@media (max-width: 820px) and (max-height: 720px) {
  .hh-lead,
  .hh-chip-head em,
  .hh-tags {
    display: none;
  }
  .hh-typing {
    display: none;
  }
}
