/* =========================================================
   sections.css
   Estilos específicos de cada sección y del header/footer.
   ========================================================= */

/* ---------- Test de nivel (cuestionario interactivo) ---------- */
.test__card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: clamp(1.5rem, 1rem + 3vw, 2.5rem);
  box-shadow: var(--sh-md);
  overflow: hidden;
}
.test__card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: var(--grad-accent);
}
.test__fallback { text-align: center; }
.test__fallback p { color: var(--text-muted); margin-bottom: var(--space-5); }

/* Barra de progreso */
.test__progress {
  height: 6px; border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden; margin-bottom: var(--space-3);
}
.test__progress span {
  display: block; height: 100%; width: 0;
  background: var(--grad-accent); border-radius: inherit;
  transition: width var(--t-base);
}
.test__step {
  font-family: var(--font-head); font-size: var(--fs-sm);
  color: var(--text-dim); margin-bottom: var(--space-5);
}

/* Transición entre preguntas */
.test__stage { transition: opacity var(--t-base), transform var(--t-base); outline: none; }
.test__stage.is-leaving { opacity: 0; transform: translateY(10px); }

.test__question { font-size: var(--fs-xl); margin-bottom: var(--space-5); }

/* Opciones */
.test__options { display: grid; gap: var(--space-3); }
.test__option {
  display: flex; align-items: center; gap: var(--space-4);
  width: 100%; text-align: left;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--space-4) var(--space-5);
  color: var(--text); font-size: var(--fs-base);
  transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast), transform var(--t-fast);
}
.test__option:hover { border-color: var(--border-strong); transform: translateX(2px); }
.test__option:focus-visible { border-color: var(--border-strong); box-shadow: 0 0 0 3px rgba(27, 63, 224, 0.25); }
.test__option[aria-checked="true"] {
  border-color: var(--c-cyan);
  box-shadow: 0 12px 34px -12px var(--glow-blue);
}
.test__option-mark {
  flex: none; width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid var(--border-strong);
  transition: border-color var(--t-fast), background var(--t-fast);
}
.test__option[aria-checked="true"] .test__option-mark {
  border-color: var(--c-cyan); background: var(--grad-accent);
}

/* Resultado */
.test__result { text-align: center; }
.test__result-badge {
  display: inline-block; margin-bottom: var(--space-4);
  font-family: var(--font-head); font-weight: 700;
  font-size: var(--fs-sm); letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--c-cyan);
  background: var(--grad-accent-soft);
  border: 1px solid var(--border-strong);
  padding: 0.4em 1em; border-radius: var(--r-pill);
}
.test__result-title { font-size: var(--fs-2xl); margin-bottom: var(--space-3); }
.test__result-desc {
  color: var(--text-muted); font-size: var(--fs-lg);
  max-width: 54ch; margin: 0 auto var(--space-6);
}
.test__reset {
  display: block; margin: var(--space-5) auto 0;
  color: var(--text-muted); font-size: var(--fs-sm);
  text-decoration: underline; text-underline-offset: 3px;
  transition: color var(--t-fast);
}
.test__reset:hover { color: var(--c-cyan); }

@media (prefers-reduced-motion: reduce) {
  .test__stage { transition: none; }
  .test__option:hover { transform: none; }
}

/* ---------- Header fijo ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  height: var(--header-h);
  display: flex;
  align-items: center;
  padding-top: env(safe-area-inset-top, 0px);
  transition: background var(--t-base), border-color var(--t-base), backdrop-filter var(--t-base);
  border-bottom: 1px solid transparent;
}
/* Al hacer scroll (clase añadida por nav.js) aparece el fondo con blur */
.site-header.is-scrolled {
  background: rgba(6, 12, 34, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom-color: var(--border);
}
.header__inner { display: flex; align-items: center; justify-content: space-between; gap: var(--space-5); width: 100%; }

.nav { display: none; } /* oculta en móvil */
.nav__list { display: flex; gap: var(--space-6); }
.nav__link {
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--text-muted);
  position: relative;
  transition: color var(--t-fast);
}
.nav__link::after {
  content: ""; position: absolute; left: 0; bottom: -6px;
  width: 0; height: 2px; background: var(--grad-accent);
  transition: width var(--t-base);
}
.nav__link:hover { color: var(--text); }
.nav__link:hover::after,
.nav__link.is-active::after { width: 100%; }
.nav__link.is-active { color: var(--text); }

.header__cta { display: none; } /* se muestra en desktop */

/* Botón hamburguesa */
.nav-toggle {
  display: inline-flex;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
}
.nav-toggle__bar { width: 24px; height: 2px; background: var(--text); border-radius: 2px; transition: transform var(--t-base), opacity var(--t-base); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Menú móvil */
.mobile-menu {
  position: fixed;
  inset: var(--header-h) 0 0 0;
  background: rgba(6, 12, 34, 0.98);
  backdrop-filter: blur(16px);
  z-index: 49;
  padding: var(--space-6) clamp(1rem,5vw,2rem) var(--space-8);
  overflow-y: auto;
  animation: menu-in var(--t-base);
}
@keyframes menu-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.mobile-menu__list { display: grid; gap: var(--space-2); margin-bottom: var(--space-6); }
.mobile-menu__link {
  display: block;
  font-family: var(--font-head);
  font-size: var(--fs-2xl);
  font-weight: 600;
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding-top: calc(var(--header-h) + var(--space-8));
  overflow: hidden;
}
.hero__bg { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }

/* Malla de gradiente reactiva al raton (firma visual).
   Las variables --mx / --my las actualiza effects.js con suavizado.
   Si no hay JS, se queda centrada y sigue viendose bien. */
.hero__mesh {
  position: absolute; inset: -20%;
  background:
    radial-gradient(circle 560px at var(--mx, 72%) var(--my, 24%), rgba(27,63,224,.5) 0%, transparent 55%),
    radial-gradient(circle 700px at calc(var(--mx, 72%) + 12%) calc(var(--my, 24%) - 12%), rgba(25,212,255,.24) 0%, transparent 55%),
    radial-gradient(circle 620px at calc(var(--mx, 72%) - 16%) calc(var(--my, 24%) + 18%), rgba(14,24,70,.9) 0%, transparent 55%);
  filter: blur(55px) saturate(125%);
  opacity: 0.6;
}

/* Motivo cinético: líneas diagonales finas (sensación de empuje/velocidad), esquina sup. dcha. */
.hero__kinetic {
  position: absolute; inset: 0; pointer-events: none;
  background-image: repeating-linear-gradient(
    -24deg,
    transparent 0 22px,
    rgba(25, 212, 255, 0.07) 22px 23px,
    transparent 23px 46px
  );
  -webkit-mask-image: radial-gradient(90% 70% at 100% 0%, #000 0%, transparent 62%);
  mask-image: radial-gradient(90% 70% at 100% 0%, #000 0%, transparent 62%);
}
.hero__glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.55;
}
.hero__glow--1 { width: 520px; height: 520px; background: var(--c-blue-royal); top: -140px; right: -80px; }
.hero__glow--2 { width: 420px; height: 420px; background: var(--c-cyan); bottom: -160px; left: -120px; opacity: 0.35; }
.hero__grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(to right, rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(circle at 50% 0%, #000 0%, transparent 70%);
  -webkit-mask-image: radial-gradient(circle at 50% 0%, #000 0%, transparent 70%);
}
.hero__inner { position: relative; z-index: 1; display: grid; gap: var(--space-8); align-items: center; }

/* Asimetría: una barra de acento vertical ancla el bloque a la izquierda */
.hero__content { position: relative; padding-left: clamp(1rem, 0.5rem + 2vw, 2rem); }
.hero__content::before {
  content: ""; position: absolute; left: 0; top: 0.3em; bottom: 0.3em;
  width: 3px; border-radius: var(--r-pill);
  background: var(--grad-accent);
}
.hero__title {
  font-size: var(--fs-hero);
  line-height: 1.0;
  letter-spacing: -0.035em;
  margin-bottom: var(--space-5);
}
/* Contraste tipográfico dentro del titular: segunda línea más ligera y atenuada */
.hero__title-accent { font-weight: 500; color: var(--text-muted); }
.hero__subtitle { color: var(--text-muted); font-size: var(--fs-lg); max-width: 52ch; margin-bottom: var(--space-6); }
.hero__actions { display: flex; flex-wrap: wrap; gap: var(--space-4); margin-bottom: var(--space-7); }

/* Riel de confianza definido (no "stat tiles" sueltos) */
.hero__trust {
  display: flex; flex-wrap: wrap; gap: var(--space-5);
  padding-top: var(--space-5);
  border-top: 1px solid var(--border);
  max-width: 560px;
}
.trust-chip { display: flex; flex-direction: column; }
.trust-chip strong { font-family: var(--font-head); font-size: var(--fs-xl); color: var(--text); line-height: 1.1; }
.trust-chip span { font-size: var(--fs-sm); color: var(--text-dim); }
.hero__trust li + li { padding-left: var(--space-5); border-left: 1px solid var(--border); }

/* ---------- Rejilla media+texto ---------- */
.grid-2--media-left { }      /* orden natural en móvil: media arriba */
.grid-2--cta { align-items: stretch; }

/* ---------- Banda manifiesto (momento a sangre completa) ---------- */
.manifesto {
  position: relative; overflow: hidden;
  background: var(--bg-alt);
  padding-block: clamp(4rem, 2rem + 8vw, 8rem);
}
.manifesto__bg { position: absolute; inset: 0; opacity: 0.5; pointer-events: none; }
.manifesto .container { position: relative; z-index: 1; }
.manifesto__line {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(1.8rem, 1rem + 3.8vw, 3.6rem);
  line-height: 1.08;
  letter-spacing: -0.025em;
  max-width: 18ch;
}
.manifesto__line em { font-style: normal; color: var(--c-cyan); }

/* ---------- "Cómo trabajo": filas escalonadas con número grande (no grid) ---------- */
.method { display: grid; gap: 0; max-width: 920px; }
.method__row {
  display: grid; grid-template-columns: auto 1fr;
  gap: clamp(1rem, 3vw, 2.75rem);
  align-items: start;
  padding: clamp(1.5rem, 1rem + 2vw, 2.5rem) 0;
  border-top: 1px solid var(--border);
}
.method__row:last-child { border-bottom: 1px solid var(--border); }
.method__num {
  font-family: var(--font-head); font-weight: 700; line-height: 1;
  font-size: clamp(2.2rem, 1rem + 3.4vw, 3.4rem);
  color: transparent; -webkit-text-stroke: 1px var(--border-strong);
  transition: -webkit-text-stroke-color var(--t-base);
}
.method__row:hover .method__num { -webkit-text-stroke: 1px var(--c-cyan); }
.method__title { font-size: var(--fs-xl); margin-bottom: var(--space-2); }
.method__body p { color: var(--text-muted); max-width: 62ch; }

/* ---------- Video ---------- */
.video {
  position: relative;
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
}
.video__play {
  position: absolute; inset: 0; z-index: 2;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-3);
  background: rgba(6,12,34,.55);
  transition: background var(--t-base);
}
.video__play:hover { background: rgba(6,12,34,.35); }
.video__play-icon {
  display: grid; place-items: center;
  width: 72px; height: 72px;
  border-radius: 50%;
  background: var(--grad-accent);
  color: #fff; font-size: 1.5rem;
  box-shadow: var(--sh-glow);
  padding-left: 4px;
}
.video__play-text { font-family: var(--font-head); font-weight: 600; }
.video iframe,
.video video { width: 100%; aspect-ratio: 16/9; display: block; border: 0; background: #000; }
/* Antes de reproducir (aún está el botón), damos alto 16/9 para que se vea
   el póster de fondo. Al pulsar, JS sustituye el contenido y el <video>/iframe
   aporta su propio alto. */
.video:has(.video__play) { aspect-ratio: 16/9; }

/* ---------- CTA final ---------- */
.cta-final { position: relative; overflow: hidden; background: var(--bg-alt); }
.cta-final__bg { position: absolute; inset: 0; z-index: 0; pointer-events: none; opacity: .5; }
.cta-final .container { position: relative; z-index: 1; }
.cta-final__actions { display: flex; flex-wrap: wrap; gap: var(--space-4); margin-top: var(--space-6); }
.cta-final__note { margin-top: var(--space-4); color: var(--text-dim); font-size: var(--fs-sm); }

/* ---------- Footer ---------- */
.footer { background: var(--c-black); border-top: 1px solid var(--border); padding-block: var(--space-8) var(--space-6); }
.footer__inner {
  display: grid; gap: var(--space-6);
  grid-template-columns: 1fr;
  justify-items: center;       /* centra cada bloque */
  text-align: center;
  padding-bottom: var(--space-6);
  border-bottom: 1px solid var(--border);
}
.footer__brand { display: flex; flex-direction: column; align-items: center; }
.footer__brand .brand__mark { margin-bottom: var(--space-3); }
.footer__tagline { color: var(--text-dim); font-size: var(--fs-sm); margin-top: var(--space-3); max-width: 42ch; margin-inline: auto; }
.footer__nav { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-5); }
.footer__nav a { color: var(--text-muted); font-size: var(--fs-sm); transition: color var(--t-fast); }
.footer__nav a:hover { color: var(--c-cyan); }
.footer__contact { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-5); }
.footer__link { color: var(--text-muted); font-weight: 600; font-size: var(--fs-sm); transition: color var(--t-fast); }
.footer__link:hover { color: var(--c-cyan); }
.footer__bottom {
  display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-2) var(--space-4);
  padding-top: var(--space-5);
  text-align: center;
  color: var(--text-dim); font-size: var(--fs-xs);
}
.footer__legal a:hover { color: var(--c-cyan); }
