/* ==========================================================================
   Hero: título, núcleo (sistema vivo) y franja de capacidades
   ========================================================================== */

/* ---------- Hero ---------- */

.hero {
  --hero-p: 0;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: calc(var(--header-h) + clamp(2rem, 1rem + 4vw, 4rem)) 0 clamp(2rem, 1rem + 3vw, 4rem);
  background: var(--ink-950);
  color: var(--text-on-dark-muted);
}

.hero__backdrop {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(900px circle at 74% 46%, rgba(244, 165, 36, 0.09), transparent 62%),
    radial-gradient(760px circle at 0% 0%, rgba(62, 102, 170, 0.2), transparent 62%),
    linear-gradient(180deg, var(--ink-950) 0%, var(--ink-900) 100%);
}

/* Retícula técnica que se desvanece hacia los bordes. */
.hero__backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--line-dark) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-dark) 1px, transparent 1px);
  background-size: 72px 72px;
  -webkit-mask-image: radial-gradient(ellipse 60% 70% at 72% 45%, #000 0%, transparent 72%);
  mask-image: radial-gradient(ellipse 60% 70% at 72% 45%, #000 0%, transparent 72%);
  opacity: 0.55;
}

.hero__inner {
  display: grid;
  gap: 1.5rem;
  align-items: center;
}

.hero__content {
  position: relative;
  z-index: 2;
  transform: translate3d(0, calc(var(--hero-p) * -48px), 0);
  opacity: calc(1 - var(--hero-p) * 1.1);
}

.hero__eyebrow,
.hero__lead,
.hero__actions {
  animation: rise-in 0.9s var(--ease-out) both;
}

.hero__lead { animation-delay: 0.55s; }
.hero__actions { animation-delay: 0.7s; }

.hero__title {
  font-size: clamp(2.75rem, 1.3rem + 4.8vw, 5.25rem);
  font-weight: 600;
  line-height: 0.98;
  letter-spacing: -0.05em;
  color: var(--text-on-dark);
}

/* Cada palabra entra desenfocada y se asienta: el título "se enfoca" como el sistema. */
.hero__word {
  display: inline-block;
  animation: word-in 1.1s var(--ease-out) both;
}

.hero__word:nth-child(2) { animation-delay: 0.08s; }
.hero__word:nth-child(3) { animation-delay: 0.16s; }
.hero__word:nth-child(4) { animation-delay: 0.24s; }
.hero__word:nth-child(5) { animation-delay: 0.5s; }

.hero__lead {
  max-width: 34rem;
  margin: 1.75rem 0 2.25rem;
  font-size: var(--fs-lg);
  line-height: 1.65;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

@media (max-width: 479px) {
  .hero__actions .btn {
    width: 100%;
  }
}

.hero__scroll {
  display: none;
}

@media (min-width: 1024px) {
  .hero {
    display: flex;
    align-items: center;
    min-height: max(100svh, 720px);
  }

  .hero__inner {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: 1rem;
  }

  .hero__scroll {
    position: absolute;
    left: 50%;
    bottom: 1.75rem;
    display: inline-flex;
    align-items: center;
    gap: 0.85rem;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-on-dark-muted);
    transform: translateX(-50%);
    opacity: calc(1 - var(--hero-p) * 3);
    transition: color var(--dur-fast) ease;
  }

  .hero__scroll:hover {
    color: var(--text-on-dark);
  }
}

.hero__scroll-line {
  position: relative;
  width: 40px;
  height: 1px;
  overflow: hidden;
  background: var(--line-dark-strong);
}

.hero__scroll-line::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--amber-500);
  animation: scroll-line 2.2s var(--ease-in-out) infinite;
}

@keyframes word-in {
  from {
    opacity: 0;
    filter: blur(12px);
    transform: translate3d(0, 0.35em, 0);
  }
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translate3d(0, 22px, 0);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
}

@keyframes scroll-line {
  0% { transform: translateX(-100%); }
  60%, 100% { transform: translateX(100%); }
}

/* ---------- Hero: el núcleo (sistema vivo) ---------- */

.core {
  position: relative;
  height: 400px;
  margin: 0 calc(var(--gutter) * -1);
  transform: translate3d(0, calc(var(--hero-p) * 70px), 0) scale(calc(1 - var(--hero-p) * 0.08));
  opacity: calc(1 - var(--hero-p) * 0.9);
  animation: fade-in 1.6s 0.2s ease both;
}

@media (min-width: 1024px) {
  .core {
    height: min(74vh, 680px);
    margin: 0 calc(var(--gutter) * -1) 0 0;
  }
}

.core__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.core__anchor {
  position: absolute;
  left: 50%;
  top: 44%;
}

@media (min-width: 1024px) {
  .core__anchor {
    left: 52%;
    top: 48%;
  }
}

.core-chip {
  --px: 0px;
  --py: 0px;
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.42rem 0.8rem 0.42rem 0.6rem;
  border: 1px solid var(--line-dark-strong);
  border-radius: var(--radius-pill);
  background: rgba(10, 18, 33, 0.72);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
  color: var(--text-on-dark);
  transform: translate3d(var(--px), var(--py), 0);
  transition:
    border-color 0.5s ease,
    box-shadow 0.5s ease,
    color 0.5s ease;
  animation: fade-in 1s ease both;
}

.core-chip .icon {
  width: 14px;
  height: 14px;
  color: var(--text-on-dark-muted);
}

.core-chip--out .icon {
  color: var(--amber-400);
}

.core-chip.is-hit {
  border-color: rgba(244, 165, 36, 0.75);
  box-shadow:
    0 0 0 4px rgba(244, 165, 36, 0.1),
    0 0 26px -4px rgba(244, 165, 36, 0.55);
}

.core-chip--in.is-hit {
  border-color: rgba(246, 245, 240, 0.5);
  box-shadow: 0 0 22px -6px rgba(246, 245, 240, 0.45);
}

/* Mobile: las entradas arriba, las salidas abajo (el flujo baja). */
.core-chip--in-1 { left: 5%; top: 3%; animation-delay: 0.9s; }
.core-chip--in-2 { right: 5%; top: 3%; animation-delay: 1s; }
.core-chip--in-3 { display: none; }
.core-chip--out-1 { left: 5%; top: 76%; animation-delay: 1.2s; }
.core-chip--out-2 { right: 5%; top: 76%; animation-delay: 1.3s; }
.core-chip--out-3 { display: none; }
.core-chip--out-4 { left: 50%; top: 89%; margin-left: -72px; animation-delay: 1.4s; }

/* Escritorio: el flujo va de izquierda a derecha. */
@media (min-width: 1024px) {
  .core-chip--in-1 { left: 2%; top: 20%; right: auto; }
  .core-chip--in-2 { left: 0; top: 47%; right: auto; }
  .core-chip--in-3 { display: inline-flex; left: 5%; top: 74%; animation-delay: 1.1s; }
  .core-chip--out-1 { left: auto; right: 6%; top: 12%; }
  .core-chip--out-2 { left: auto; right: 1%; top: 37%; }
  .core-chip--out-3 { display: inline-flex; right: 3%; top: 62%; animation-delay: 1.35s; }
  .core-chip--out-4 { left: auto; right: 9%; top: 86%; margin-left: 0; }
}

.core__caption {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: max-content;
  max-width: 92%;
  font-size: 0.75rem;
  line-height: 1.4;
  text-align: center;
  color: rgba(166, 176, 195, 0.75);
  transform: translateX(-50%);
}

@media (max-width: 1023px) {
  .core__caption {
    display: none;
  }
}

/* ---------- Franja de capacidades ---------- */

.marquee {
  position: relative;
  overflow: hidden;
  padding: 1.5rem 0 calc(1.5rem + clamp(24px, 1rem + 2vw, 44px));
  background: var(--ink-900);
  border-top: 1px solid var(--line-dark);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}

.marquee__track {
  display: flex;
  width: max-content;
  animation: marquee 48s linear infinite;
}

.marquee:hover .marquee__track {
  animation-play-state: paused;
}

.marquee__list {
  display: flex;
  flex: none;
}

.marquee__list li {
  display: flex;
  align-items: center;
  gap: 2rem;
  padding-right: 2rem;
  font-size: clamp(1.25rem, 0.9rem + 1.6vw, 2.25rem);
  font-weight: 500;
  letter-spacing: -0.03em;
  white-space: nowrap;
  color: rgba(246, 245, 240, 0.5);
}

.marquee__list li::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--amber-500);
}

@keyframes marquee {
  to {
    transform: translateX(-50%);
  }
}
