/* ================================================================
   Centralizer Ads — landing page
   spec-024-landing-page
   ================================================================ */

/* ================
   1) RESET
   ================ */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

img,
svg,
canvas {
  display: block;
  max-width: 100%;
}

/* ================
   2) TOKENS
   ================ */

:root {
  /* Colores */
  --bg-base:        #07070f;
  --bg-surface:     #0d0d1a;
  --bg-border:      #1a1a2e;
  --neon-blue:      #00c8ff;
  --neon-green:     #00ff88;
  --neon-purple:    #8b5cf6;
  --text-primary:   #f0f0ff;
  --text-secondary: #8888aa;
  --text-muted:     #444466;
  --glow-blue:      rgba(0, 200, 255, 0.15);
  --glow-green:     rgba(0, 255, 136, 0.12);
  --glow-purple:    rgba(139, 92, 246, 0.15);

  /* Escala tipográfica */
  --text-xs:   0.75rem;
  --text-sm:   0.875rem;
  --text-base: 1rem;
  --text-lg:   1.125rem;
  --text-xl:   1.25rem;
  --text-2xl:  1.5rem;
  --text-3xl:  1.875rem;
  --text-4xl:  2.25rem;
  --text-5xl:  3rem;
  --text-6xl:  3.75rem;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  font-size: var(--text-base);
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Foco accesible visible en todo elemento interactivo */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--neon-blue);
  outline-offset: 3px;
  border-radius: 4px;
}

::selection {
  background: rgba(0, 200, 255, 0.25);
  color: var(--text-primary);
}

/* Scrollbar oscuro coherente con la paleta */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb {
  background: var(--bg-border);
  border-radius: 100px;
}
::-webkit-scrollbar-thumb:hover { background: #262645; }

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 3rem;
}

/* Enlace de salto para lectores de pantalla y teclado */
.skip-link {
  position: absolute;
  left: 1rem;
  top: -100px;
  z-index: 200;
  padding: 0.625rem 1rem;
  background: var(--neon-blue);
  color: #07070f;
  font-size: var(--text-sm);
  font-weight: 600;
  border-radius: 8px;
  text-decoration: none;
  transition: top 0.2s;
}
.skip-link:focus { top: 1rem; }

/* ================
   3) NAVBAR
   ================ */

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 1rem 0;
  transition: background 0.3s, border-color 0.3s, padding 0.3s;
  border-bottom: 1px solid transparent;
}

.navbar--scrolled {
  background: rgba(7, 7, 15, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--bg-border);
  padding: 0.75rem 0;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 3rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  text-decoration: none;
  color: var(--text-primary);
  font-size: var(--text-lg);
  font-weight: 500;
  letter-spacing: -0.01em;
}

.nav-logo span { white-space: nowrap; }

.nav-logo strong {
  font-weight: 700;
  /* Único gradiente decorativo permitido: el logo */
  background: linear-gradient(100deg, var(--neon-blue), var(--neon-green));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.nav-logo svg {
  flex-shrink: 0;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.nav-logo:hover svg { transform: rotate(90deg); }

/* ================
   4) BOTONES
   ================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  font-weight: 600;
  border-radius: 8px;
  border: 1.5px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
  white-space: nowrap;
  letter-spacing: -0.01em;
}

.btn-sm { padding: 0.5rem 1rem;      font-size: var(--text-sm); }
.btn-lg { padding: 0.875rem 1.75rem; font-size: var(--text-base); }

.btn-primary {
  background: var(--neon-blue);
  color: #07070f;
  border-color: var(--neon-blue);
}
.btn-primary:hover {
  background: #33d4ff;
  box-shadow: 0 0 24px rgba(0, 200, 255, 0.4);
  transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); }

.btn-ghost {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--bg-border);
}
.btn-ghost:hover {
  border-color: var(--neon-blue);
  color: var(--neon-blue);
}

/* ================
   5) HERO
   ================ */

.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 8rem 3rem 5rem;
}

/* Halo radial sutil detrás del contenido del hero */
.hero::after {
  content: '';
  position: absolute;
  top: 42%;
  left: 50%;
  width: min(900px, 120vw);
  height: min(560px, 80vh);
  transform: translate(-50%, -50%);
  background: radial-gradient(
    ellipse at center,
    rgba(0, 200, 255, 0.09) 0%,
    rgba(139, 92, 246, 0.05) 42%,
    transparent 70%
  );
  pointer-events: none;
  z-index: 0;
}

#particle-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 760px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-block;
  padding: 0.3rem 0.875rem;
  border: 1px solid rgba(0, 200, 255, 0.3);
  border-radius: 100px;
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--neon-blue);
  letter-spacing: 0.05em;
  margin-bottom: 1.75rem;
  background: rgba(0, 200, 255, 0.05);
}

.hero-headline {
  font-size: var(--text-5xl);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
}

.hero-sub {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  line-height: 1.65;
  max-width: 560px;
  margin: 0 auto 2.5rem;
}

.hero-ctas {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.hero-note {
  margin-top: 1.25rem;
  font-size: var(--text-xs);
  color: var(--text-muted);
}

@media (min-width: 1024px) {
  .hero-headline { font-size: var(--text-6xl); }
}

/* Entrada escalonada del hero al cargar.
   Solo se oculta si hay JS (clase .js en <html>): sin JS todo queda visible. */
.js .hero-anim {
  opacity: 0;
  transform: translateY(16px);
  animation: hero-in 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.hero-anim:nth-child(1) { animation-delay: 0.05s; }
.hero-anim:nth-child(2) { animation-delay: 0.15s; }
.hero-anim:nth-child(3) { animation-delay: 0.25s; }
.hero-anim:nth-child(4) { animation-delay: 0.35s; }
.hero-anim:nth-child(5) { animation-delay: 0.45s; }

@keyframes hero-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ================
   6) REVELADO AL SCROLL
   ================ */

.js .reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ================
   7) SECCIONES
   ================ */

.section-heading {
  font-size: var(--text-3xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}

.section-sub {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  margin-bottom: 3rem;
  max-width: 480px;
}

/* ================
   8) FEATURES
   ================ */

.features { padding: 6rem 0; }

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.feature-card {
  padding: 1.75rem;
  background: var(--bg-surface);
  border-radius: 12px;
  border: 1px solid var(--bg-border);
  border-left-width: 3px;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s,
              opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.feature-card:hover { transform: translateY(-3px); }

.feature-card--blue   { border-left-color: var(--neon-blue); }
.feature-card--green  { border-left-color: var(--neon-green); }
.feature-card--purple { border-left-color: var(--neon-purple); }

.feature-card--blue:hover   { box-shadow: 0 8px 32px var(--glow-blue); }
.feature-card--green:hover  { box-shadow: 0 8px 32px var(--glow-green); }
.feature-card--purple:hover { box-shadow: 0 8px 32px var(--glow-purple); }

.feature-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--bg-border);
  margin-bottom: 1.25rem;
  color: var(--text-secondary);
  transition: transform 0.2s;
}
.feature-card:hover .feature-icon { transform: scale(1.06); }

.feature-card--blue   .feature-icon { color: var(--neon-blue);   background: rgba(0, 200, 255, 0.08); }
.feature-card--green  .feature-icon { color: var(--neon-green);  background: rgba(0, 255, 136, 0.08); }
.feature-card--purple .feature-icon { color: var(--neon-purple); background: rgba(139, 92, 246, 0.08); }

.feature-card h3 {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.625rem;
  letter-spacing: -0.01em;
}

.feature-card p {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.65;
}

/* Escalonado del revelado dentro del grid */
.features-grid .reveal:nth-child(1) { transition-delay: 0s; }
.features-grid .reveal:nth-child(2) { transition-delay: 0.07s; }
.features-grid .reveal:nth-child(3) { transition-delay: 0.14s; }
.features-grid .reveal:nth-child(4) { transition-delay: 0.21s; }
.features-grid .reveal:nth-child(5) { transition-delay: 0.28s; }
.features-grid .reveal:nth-child(6) { transition-delay: 0.35s; }

@media (max-width: 1023px) { .features-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 767px)  { .features-grid { grid-template-columns: 1fr; } }

/* ================
   9) DEMO — GRÁFICAS
   ================ */

.demo {
  padding: 6rem 0;
  border-top: 1px solid var(--bg-border);
}

.charts-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 1.5rem;
}

.chart-card {
  background: var(--bg-surface);
  border: 1px solid var(--bg-border);
  border-radius: 12px;
  padding: 1.5rem;
  min-width: 0;
}

.chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.chart-label {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.chart-value {
  font-size: var(--text-xl);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.chart-value--green { color: var(--neon-green); }

.chart-card canvas { background: transparent; }

/* Contenedores con alto fijo: Chart.js responsive necesita altura definida */
.chart-canvas-box {
  position: relative;
  height: 180px;
}

.donut-wrapper {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.donut-canvas-box {
  position: relative;
  height: 180px;
  flex: 1 1 auto;
  min-width: 0;
}

.donut-legend {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  flex-shrink: 0;
  min-width: 140px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.legend-pct {
  margin-left: auto;
  font-weight: 600;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

@media (max-width: 767px) {
  .charts-grid { grid-template-columns: 1fr; }
  .donut-wrapper { flex-direction: column; align-items: stretch; }
  .donut-legend { min-width: 0; }
}

/* ================
   10) FOOTER
   ================ */

.footer {
  border-top: 1px solid var(--bg-border);
  padding: 3rem 0 2rem;
}

.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
}

.footer-tagline {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-top: 0.5rem;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  align-items: flex-end;
}

.footer-links a {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.15s;
}
.footer-links a:hover { color: var(--neon-blue); }

.footer-bottom {
  padding-top: 1.5rem;
  border-top: 1px solid var(--bg-border);
}
.footer-bottom p {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* ================
   11) PÁGINAS LEGALES
   ================ */

.legal-page { padding: 8rem 0 5rem; }

.legal-header {
  margin-bottom: 3rem;
  border-bottom: 1px solid var(--bg-border);
  padding-bottom: 2rem;
}
.legal-header h1 {
  font-size: var(--text-4xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}
.legal-date {
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.legal-content { max-width: 720px; }
.legal-content h2 {
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--text-primary);
  margin: 2.5rem 0 0.75rem;
  letter-spacing: -0.01em;
}
.legal-content p,
.legal-content li {
  font-size: var(--text-base);
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 0.75rem;
}
.legal-content ul { padding-left: 1.5rem; }
.legal-content li::marker { color: var(--neon-blue); }
.legal-content a {
  color: var(--neon-blue);
  text-decoration: none;
}
.legal-content a:hover { text-decoration: underline; }
.legal-content strong { color: var(--text-primary); font-weight: 600; }

/* ================
   12) MOBILE
   ================ */

@media (max-width: 767px) {
  .nav-container { padding: 0 1.5rem; }
  .container { padding: 0 1.5rem; }
  .hero { padding: 7rem 1.5rem 4rem; min-height: auto; }
  .hero-headline { font-size: var(--text-4xl); }
  .hero-ctas { flex-direction: column; align-items: stretch; }
  .hero-ctas .btn { text-align: center; }
  .features, .demo { padding: 4rem 0; }
  .footer-links { align-items: flex-start; }
  .section-heading { font-size: var(--text-2xl); }
  .section-sub { font-size: var(--text-base); margin-bottom: 2rem; }
  .legal-page { padding: 6.5rem 0 4rem; }
  .legal-header h1 { font-size: var(--text-3xl); }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .container { padding: 0 3rem; }
  .nav-container { padding: 0 3rem; }
}

@media (min-width: 1280px) {
  .container { padding: 0 4rem; }
  .nav-container { padding: 0 4rem; }
}

/* Salto de línea del headline solo en pantallas anchas */
@media (max-width: 560px) {
  .hero-headline br { display: none; }
}

/* Pantallas muy angostas: comprimir navbar para que logo y CTA quepan en una línea */
@media (max-width: 420px) {
  .nav-logo { font-size: var(--text-base); gap: 0.5rem; }
  .nav-logo svg { width: 24px; height: 24px; }
  .navbar .btn-sm { padding: 0.5rem 0.875rem; font-size: var(--text-xs); }
  .hero-headline { font-size: var(--text-3xl); }
}

/* ================
   13) REDUCED MOTION
   ================ */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  /* El contenido debe quedar visible aunque no haya animación */
  .js .hero-anim { opacity: 1; transform: none; animation: none !important; }
  .js .reveal { opacity: 1; transform: none; }
}
