/* ============================================================
   NOXIS — home.css
   Estilos específicos de la pantalla de Inicio.
   ============================================================ */

/* ---------- Introducción / hero ---------- */
.home {
  position: relative;
  padding: clamp(56px, 8vw, 112px) 0 clamp(60px, 8vw, 96px);
  overflow: clip;
}

/* Contenedor de Home ligeramente más angosto: tarjetas algo más
   pequeñas y más aire lateral, manteniendo 4 columnas y ratio 2:3. */
.home .container {
  max-width: 1120px;
}

/* Retícula tecnológica muy sutil de fondo */
.home::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    radial-gradient(1px 1px at 20% 30%, rgba(110, 168, 255, 0.10), transparent 60%),
    radial-gradient(1px 1px at 50% 55%, rgba(167, 139, 250, 0.08), transparent 60%),
    radial-gradient(1px 1px at 80% 20%, rgba(110, 168, 255, 0.09), transparent 60%),
    radial-gradient(1px 1px at 30% 75%, rgba(110, 168, 255, 0.06), transparent 60%);
  background-size: 180px 180px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,0.9), transparent 70%);
  -webkit-mask-image: linear-gradient(180deg, rgba(0,0,0,0.9), transparent 70%);
  pointer-events: none;
}

.home__intro {
  position: relative;
  max-width: 720px;
  margin-bottom: clamp(64px, 8vw, 104px);
  animation: rise-in 0.7s var(--ease) both;
}

.home__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--accent-soft);
  margin-bottom: 22px;
}

.home__eyebrow::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent-soft);
  box-shadow: 0 0 6px var(--accent-glow);
}

.home__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.9rem, 4.2vw, 3rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  color: var(--text);
}

.home__title .text-grad {
  background: var(--grad-hero);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.home__subtitle {
  margin-top: 20px;
  font-size: 1.02rem;
  line-height: 1.55;
  color: #c3cad6;
  max-width: 52ch;
}

/* ---------- Efecto máquina de escribir (Inicio y Explorar) ---------- */
/* Mientras se escribe, cada letra permanece invisible hasta que le
   toca el turno (`is-on`). El contenedor `.tw-line` va oculto a
   lectores de pantalla: el texto real se expone vía aria-label. */
.tw-ch {
  transition: opacity 0.24s var(--ease);
}
.tw-typing .tw-ch {
  opacity: 0;
}
.tw-typing .tw-ch.is-on {
  opacity: 1;
}

/* Cursor fino con brillo, al final de la letra en curso. */
.tw-ch.is-caret {
  position: relative;
}
.tw-ch.is-caret::after {
  content: "";
  position: absolute;
  left: 100%;
  top: 0.06em;
  width: 1.5px;
  height: 0.94em;
  margin-left: 1px;
  border-radius: 1px;
  background: linear-gradient(180deg, var(--accent-soft), var(--accent));
  box-shadow: 0 0 9px var(--accent-glow);
  animation: tw-caret 1.05s ease-in-out infinite;
}

@keyframes tw-caret {
  0%,
  42% {
    opacity: 1;
  }
  58%,
  100% {
    opacity: 0;
  }
}

/* Al terminar: el cursor deja de parpadear y se desvanece. */
.tw-complete .tw-ch.is-caret::after {
  animation: none;
  opacity: 0;
  transition: opacity 0.32s var(--ease);
}

/* Sin animación: texto visible y sin cursor. */
@media (prefers-reduced-motion: reduce) {
  .tw-ch {
    opacity: 1 !important;
    transition: none;
  }
  .tw-ch.is-caret::after {
    display: none;
  }
}

/* ---------- Secciones / cabeceras ---------- */
.carousel-section {
  position: relative;
  margin-top: clamp(34px, 4.6vw, 52px);
  animation: rise-in 0.7s var(--ease) both;
}
.carousel-section:nth-of-type(2) { animation-delay: 0.08s; }
.carousel-section:nth-of-type(3) { animation-delay: 0.16s; }
.carousel-section:nth-of-type(4) { animation-delay: 0.24s; }

/* Grilla de la Home: un poco más de aire entre tarjetas.
   Solo en escritorio (4 columnas); en responsive se respeta
   el gap definido en components.css. */
@media (min-width: 1025px) {
  .carousel-section .cards-grid {
    gap: 24px;
  }
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 18px;
  gap: 16px;
}

.section-head__title {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.08rem;
  letter-spacing: -0.01em;
  color: var(--text);
}

/* Acento azul junto a cada título de sección */
.section-head__title::before {
  content: "";
  align-self: center;
  width: 3px;
  height: 16px;
  border-radius: 2px;
  background: var(--grad-brand);
  box-shadow: 0 0 10px var(--accent-glow);
}

.section-head__more {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-faint);
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease),
              background var(--dur) var(--ease);
}

.section-head__more:hover {
  color: var(--accent-soft);
  border-color: var(--line);
  background: rgba(59, 130, 246, 0.04);
}

/* ---------- Vista Explorar (reservada) ---------- */
.explore,
.game {
  min-height: 70vh;
  padding: clamp(40px, 8vw, 90px) 0;
}

.explore__placeholder {
  text-align: center;
}

/* ---------- Vista Juego (reservada) ---------- */
.game__placeholder {
  max-width: 640px;
}

.game__back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 28px;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  color: var(--text-dim);
  font-size: 0.88rem;
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

.game__back:hover {
  color: var(--text);
  border-color: var(--line-strong);
}

.game__ph-cover {
  width: 100%;
  max-width: 320px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
  margin-bottom: 28px;
}

/* ---------- Transición de vistas (solo las vistas, no las tarjetas) ---------- */
.home.is-visible,
.explore.is-visible {
  animation: rise-in 0.5s var(--ease) both;
}

/* ---------- Animación de entrada ---------- */
@keyframes rise-in {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}