/* ═══════════════════════════════════════════════════════════
   layout.css — Nav, secciones, container, grid, footer, responsive
   ═══════════════════════════════════════════════════════════ */

/* ── Scroll progress bar ── */
#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0%;
  background: linear-gradient(90deg, var(--gold) 0%, var(--gold-light) 100%);
  z-index: calc(var(--z-nav) + 1);
  transition: width 0.08s linear;
  pointer-events: none;
}

/* ── Canvas 3D fijo ── */
#canvas-container {
  position: fixed;
  inset: 0;
  z-index: var(--z-canvas);
  pointer-events: none;
}

#bg-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* ── Viñeta perimetral ── */
#vignette {
  position: fixed;
  inset: 0;
  z-index: var(--z-vignette);
  background: radial-gradient(
    ellipse 80% 80% at 50% 50%,
    transparent 30%,
    rgba(10, 8, 5, 0.45) 65%,
    rgba(10, 8, 5, 0.88) 100%
  );
  pointer-events: none;
}

/* ── Navegación fija ── */
#site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-nav);
  background: rgba(10, 8, 5, 0.72);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: var(--border);
  transition: background var(--dur) var(--ease-out),
              border-color var(--dur) var(--ease-out);
}

#site-nav.scrolled {
  background: rgba(10, 8, 5, 0.95);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: var(--sp-xl);
}

/* Logo */
.nav-logo {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  flex-shrink: 0;
  transition: opacity var(--dur-fast) var(--ease-out);
}

.nav-logo:hover { opacity: 0.85; }

.logo-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 30px;
  padding-inline: 7px;
  background: var(--gold);
  color: var(--bg-deep);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  border-radius: var(--radius-sm);
  line-height: 1;
  flex-shrink: 0;
}

.logo-text {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--text-main);
}

.logo-text em {
  font-style: normal;
  color: var(--gold);
}

/* Links de nav */
.nav-links {
  display: flex;
  align-items: center;
  gap: var(--sp-xl);
  margin: 0 auto;
}

.nav-links a {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
  transition: color var(--dur-fast) var(--ease-out);
  padding-block: var(--sp-xs);
}

.nav-links a:hover {
  color: var(--gold-light);
}

/* Botón hamburguesa */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  padding: var(--sp-sm);
  width: 36px;
  height: 36px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 1px;
  background: var(--text-main);
  transition: transform var(--dur) var(--ease-out),
              opacity var(--dur-fast);
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}
.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* ── Containers ── */
.container {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 5vw, 3rem);
}

.container--narrow {
  max-width: 720px;
}

/* ── Secciones ── */
.section {
  position: relative;
  z-index: var(--z-content);
  padding-block: var(--sp-5xl);
  background: var(--bg-deep);
}

.section-header {
  text-align: center;
  margin-bottom: var(--sp-3xl);
}

.section-header h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  margin-bottom: var(--sp-md);
}

.section-lead {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 520px;
  margin-inline: auto;
  line-height: 1.75;
}

/* Secciones con fondo alternado */
.section-split,
.section-lead-magnet,
.section-pricing {
  background: var(--bg-surface);
}

.section-testimonials {
  background: var(--bg-deep);
}

.section-archive {
  background: var(--bg-elevated);
}

/* ── Hero ── */
.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 88px;
  padding-bottom: var(--sp-3xl);
  position: relative;
  z-index: var(--z-content);
  background: transparent;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 240px;
  background: linear-gradient(to bottom, transparent, var(--bg-deep));
  pointer-events: none;
}

.hero-inner {
  max-width: 720px;
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-size: clamp(2.6rem, 6.5vw, 4.8rem);
  font-weight: 700;
  line-height: 1.08;
  margin-bottom: var(--sp-lg);
  letter-spacing: -0.025em;
  text-shadow: 0 2px 40px rgba(0, 0, 0, 0.6);
}

.hero-lead {
  font-size: clamp(1rem, 2vw, 1.15rem);
  color: var(--text-muted);
  max-width: 540px;
  line-height: 1.8;
  margin-bottom: var(--sp-xl);
}

.hero-stats {
  display: flex;
  gap: clamp(1.25rem, 4vw, 3rem);
  margin-top: var(--sp-2xl);
  flex-wrap: wrap;
  padding-top: var(--sp-xl);
  border-top: var(--border);
  width: fit-content;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2xs);
}

.stat-value {
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
}

.stat-label {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.scroll-hint {
  position: absolute;
  bottom: var(--sp-xl);
  left: clamp(1.25rem, 5vw, 3rem);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--sp-xs);
  color: var(--text-subtle);
  z-index: 1;
}

.scroll-hint-text {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.scroll-hint-arrow {
  font-size: 1.1rem;
}

/* ── Secciones split ── */
.split-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 6vw, 5rem);
  align-items: center;
}

.section-split--reverse .split-inner {
  direction: rtl;
}

.section-split--reverse .split-inner > * {
  direction: ltr;
}

.split-text h2 {
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  margin-bottom: var(--sp-lg);
}

.split-text p {
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: var(--sp-md);
}

/* ── Grid de topics ── */
.topics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-lg);
}

/* ── Lista de issues ── */
.issues-list {
  display: flex;
  flex-direction: column;
  border-top: var(--border);
}

.archive-cta {
  margin-top: var(--sp-2xl);
  text-align: center;
}

/* ── Grid de testimonios ── */
.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-lg);
  align-items: stretch;
}

/* ── Grid de precios ── */
.pricing-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-lg);
  max-width: 820px;
  margin-inline: auto;
  align-items: start;
}

/* ── CTA final ── */
.section-cta {
  background: var(--bg-deep);
  position: relative;
  overflow: hidden;
}

.section-cta::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse 60% 60% at 50% 50%,
    rgba(201, 169, 97, 0.06) 0%,
    transparent 70%
  );
  pointer-events: none;
}

.cta-inner {
  text-align: center;
  position: relative;
  z-index: 1;
}

.cta-inner h2 {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  margin-bottom: var(--sp-lg);
}

.cta-lead {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 500px;
  margin-inline: auto;
  margin-bottom: var(--sp-2xl);
  line-height: 1.75;
}

/* ── Footer ── */
#site-footer {
  background: var(--bg-surface);
  border-top: var(--border);
  position: relative;
  z-index: var(--z-content);
}

.footer-inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--sp-2xl);
  padding-block: var(--sp-4xl);
}

.footer-brand p {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.7;
  margin-top: var(--sp-md);
  max-width: 280px;
}

.footer-brand .nav-logo {
  margin-bottom: var(--sp-sm);
}

.footer-legal-note {
  margin-top: var(--sp-md) !important;
  color: var(--text-subtle) !important;
  font-size: 0.65rem !important;
}

.footer-bottom {
  border-top: var(--border);
}

.footer-bottom-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-block: var(--sp-lg);
  color: var(--text-subtle);
}

/* ── Responsive ── */
@media (max-width: 1024px) {
  .topics-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-inner {
    grid-template-columns: 1fr 1fr;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 768px) {
  .section {
    padding-block: var(--sp-4xl);
  }

  /* Nav móvil */
  .nav-links,
  .nav-cta {
    display: none;
  }

  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: 64px 0 0 0;
    background: rgba(10, 8, 5, 0.98);
    backdrop-filter: blur(20px);
    align-items: center;
    justify-content: center;
    gap: var(--sp-2xl);
    z-index: calc(var(--z-nav) - 1);
  }

  .nav-links.open a {
    font-size: 0.85rem;
    letter-spacing: 0.2em;
  }

  .nav-toggle {
    display: flex;
  }

  /* Layouts */
  .split-inner,
  .section-split--reverse .split-inner {
    grid-template-columns: 1fr;
    direction: ltr;
    gap: var(--sp-2xl);
  }

  .topics-grid {
    grid-template-columns: 1fr;
  }

  .pricing-grid {
    grid-template-columns: 1fr;
  }

  .testimonials-grid {
    grid-template-columns: 1fr;
  }

  .hero-stats {
    gap: var(--sp-lg);
  }

  .footer-inner {
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-xl);
  }

  .footer-brand {
    grid-column: 1 / -1;
  }

  .footer-bottom-inner {
    flex-direction: column;
    gap: var(--sp-sm);
    text-align: center;
  }
}

@media (max-width: 480px) {
  .section {
    padding-block: var(--sp-3xl);
  }

  .hero h1 {
    font-size: clamp(2rem, 9vw, 2.6rem);
  }

  .footer-inner {
    grid-template-columns: 1fr;
  }
}
