/* ============================================================
   VoltiaJP — main.css
   Design tokens + componentes compartidos (dark-first)
   ============================================================ */

/* ---------- Fuentes (variables, auto-alojadas) ---------- */
@font-face {
  font-family: "Inter";
  src: url("../assets/fonts/Inter.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Space Grotesk";
  src: url("../assets/fonts/SpaceGrotesk.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  --bg: #0A0E14;
  --panel: #131823;
  --panel-2: #1A2130;
  --line: #232B3B;
  --text: #F5F7FA;
  --muted: #8B95A5;
  --blue: #1F6FFF;
  --blue-hover: #4A8AFF;
  --cyan: #00D9FF;
  --radius: 12px;
  --font-head: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --container: 1180px;
  --header-h: 68px;
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; height: auto; display: block; }
a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 .5em;
  letter-spacing: -.01em;
}
h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.3rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
::selection { background: var(--blue); color: #fff; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

/* Rejilla técnica sutil de fondo (hero y bandas destacadas) */
.tech-grid {
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 44px 44px;
  position: relative;
}
.tech-grid::after {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 70% 60% at 50% 35%, transparent 0%, var(--bg) 90%);
  pointer-events: none;
}
.tech-grid > * { position: relative; z-index: 1; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-family: var(--font-head);
  font-weight: 500;
  font-size: 1rem;
  padding: .8rem 1.6rem;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease, transform .15s ease, box-shadow .2s ease;
  text-decoration: none !important;
}
.btn--primary {
  background: var(--blue);
  color: #fff;
}
.btn--primary:hover {
  background: var(--blue-hover);
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(31, 111, 255, .35);
}
.btn--ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--line);
}
.btn--ghost:hover {
  border-color: var(--cyan);
  color: var(--cyan);
  transform: translateY(-1px);
}
.btn--sm { padding: .5rem 1rem; font-size: .9rem; }

/* ---------- Secciones ---------- */
.section { padding: 96px 0; }
.section--alt { background: #0D121B; }
.section__kicker {
  font-family: var(--font-head);
  font-size: .8rem;
  font-weight: 500;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: .8rem;
}
.section__title { max-width: 720px; }
.section__lead {
  color: var(--muted);
  font-size: 1.1rem;
  max-width: 680px;
  margin-bottom: 2.5rem;
}
.section__head--center { text-align: center; }
.section__head--center .section__title,
.section__head--center .section__lead { margin-left: auto; margin-right: auto; }

/* ---------- Grids y tarjetas ---------- */
.grid { display: grid; gap: 22px; }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  transition: border-color .25s ease, transform .25s ease, box-shadow .25s ease;
}
.card:hover {
  border-color: rgba(31, 111, 255, .55);
  transform: translateY(-4px);
  box-shadow: 0 14px 34px rgba(0, 0, 0, .45);
}
.card h3 { margin-top: 0; }
.card p { color: var(--muted); font-size: .95rem; margin-bottom: 0; }
.card .card__link {
  display: inline-block;
  margin-top: 14px;
  font-family: var(--font-head);
  font-size: .9rem;
  color: var(--cyan);
}
.card__icon {
  width: 44px; height: 44px;
  margin-bottom: 16px;
  color: var(--blue);
}
.card__icon svg { width: 100%; height: 100%; }

/* ---------- Badges / chips ---------- */
.badge {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  transition: border-color .25s ease;
}
.badge:hover { border-color: rgba(0, 217, 255, .5); }
.badge__icon { width: 30px; height: 30px; flex: none; color: var(--cyan); margin-top: 2px; }
.badge__icon svg { width: 100%; height: 100%; }
.badge strong { font-family: var(--font-head); font-weight: 500; display: block; }
.badge span { color: var(--muted); font-size: .88rem; }

.tag {
  display: inline-block;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 100px;
  padding: .45rem 1.1rem;
  font-size: .9rem;
  color: var(--text);
  margin: 0 8px 10px 0;
}

/* ---------- Métricas ---------- */
.metrics {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #0D121B;
}
.metrics .grid { padding: 42px 0; }
.metric { text-align: center; }
.metric__value {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(1.7rem, 3.2vw, 2.4rem);
  color: var(--text);
}
.metric__value .accent { color: var(--cyan); }
.metric__label { color: var(--muted); font-size: .9rem; margin-top: 4px; }

/* ---------- Ilustración de hardware ---------- */
.hw-figure {
  position: relative;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(ellipse 80% 70% at 50% 42%, rgba(31, 111, 255, .12), transparent 70%),
    var(--panel);
  padding: 18px 18px 14px;
}
.hw-figure svg { width: 100%; height: auto; display: block; }
.hw-figure figcaption {
  margin-top: 8px;
  text-align: center;
  color: var(--muted);
  font-size: .82rem;
}

/* ---------- Capturas reales ---------- */
.screenshot {
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 18px 44px rgba(0, 0, 0, .45);
}
.screenshot--card { margin-bottom: 20px; }

/* Marco oscuro para imágenes de fondo claro (infografías): las integra en el tema oscuro */
.doc-frame {
  margin: 0;
  background: linear-gradient(180deg, #0F1420, #0B0F17);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, .45);
}
.doc-frame img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, .06);
}
@media (max-width: 640px) { .doc-frame { padding: 12px; } }

/* ---------- Hueco para imagen real ---------- */
.img-slot {
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 260px;
  color: var(--muted);
  font-size: .9rem;
  text-align: center;
  padding: 24px;
}
.img-slot svg { width: 40px; height: 40px; opacity: .5; }

/* ---------- Listas con check ---------- */
.checklist { list-style: none; padding: 0; margin: 0 0 1.5rem; }
.checklist li {
  position: relative;
  padding-left: 34px;
  margin-bottom: 14px;
  color: var(--muted);
}
.checklist li strong { color: var(--text); font-weight: 600; }
.checklist li::before {
  content: "";
  position: absolute; left: 0; top: 4px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background:
    url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%2300D9FF" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"/></svg>')
    center / 12px no-repeat,
    rgba(0, 217, 255, .12);
}

/* ---------- Header / nav ---------- */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--header-h);
  background: rgba(10, 14, 20, .82);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header .container {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text);
  text-decoration: none !important;
  letter-spacing: .02em;
}
.brand .brand__jp { color: var(--blue); }
.brand svg { width: 28px; height: 28px; }
.brand__logo { height: 30px; width: auto; display: block; }
.site-footer .brand__logo { height: 34px; }

.nav { display: flex; align-items: center; gap: 6px; }
.nav a {
  color: var(--text);
  font-size: .95rem;
  padding: .55rem .9rem;
  border-radius: 8px;
  text-decoration: none !important;
  transition: background .2s ease, color .2s ease;
}
.nav a:hover { background: var(--panel-2); }
.nav .nav__cta {
  background: var(--blue);
  color: #fff;
  font-family: var(--font-head);
  font-weight: 500;
  margin-left: 8px;
}
.nav .nav__cta:hover { background: var(--blue-hover); }

/* Dropdowns */
.nav__item { position: relative; }
.nav__item > a::after {
  content: "▾";
  font-size: .7em;
  margin-left: .4em;
  opacity: .7;
}
.dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 250px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, .5);
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity .18s ease, transform .18s ease, visibility .18s;
}
.nav__item:hover .dropdown,
.nav__item:focus-within .dropdown,
.nav__item.open .dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.dropdown a {
  display: block;
  padding: .55rem .8rem;
  font-size: .92rem;
  color: var(--text);
  border-radius: 7px;
}
.dropdown a:hover { background: var(--panel-2); color: var(--cyan); }
.dropdown .dropdown__group {
  font-size: .72rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
  padding: .6rem .8rem .2rem;
}

/* Hamburguesa */
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 20px; height: 2px;
  background: var(--text);
  margin: 4px 0;
  transition: transform .2s ease, opacity .2s ease;
}

/* ---------- Hero ---------- */
.hero {
  padding: calc(var(--header-h) + 84px) 0 90px;
  overflow: hidden;
}
.hero .container {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 56px;
  align-items: center;
}
.hero__kicker {
  font-family: var(--font-head);
  font-size: .8rem;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 1.2rem;
  display: flex;
  align-items: center;
  gap: 10px;
}
.hero__kicker::before {
  content: "";
  width: 34px; height: 1px;
  background: var(--cyan);
}
.hero p.hero__sub {
  color: var(--muted);
  font-size: 1.2rem;
  max-width: 520px;
  margin: 1.2rem 0 2.2rem;
}
.hero__actions { display: flex; gap: 14px; flex-wrap: wrap; }
.hero__visual { position: relative; }

/* ---------- CTA final ---------- */
.cta-band {
  background: linear-gradient(135deg, rgba(31, 111, 255, .16), rgba(0, 217, 255, .07));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: center;
  padding: 84px 0;
}
.cta-band h2 { max-width: 640px; margin: 0 auto .6em; }
.cta-band p { color: var(--muted); max-width: 560px; margin: 0 auto 2rem; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  background: #080B10;
  padding: 64px 0 32px;
  font-size: .92rem;
}
.site-footer .footer__grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 48px;
}
.site-footer h4 {
  font-size: .8rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1.1em;
}
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: .6em; }
.site-footer a { color: var(--text); opacity: .85; }
.site-footer a:hover { color: var(--cyan); opacity: 1; text-decoration: none; }
.footer__about p { color: var(--muted); max-width: 300px; }
.footer__bottom {
  border-top: 1px solid var(--line);
  padding-top: 26px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: .85rem;
}
.footer__social { display: flex; gap: 14px; }
.footer__social a { display: inline-flex; }
.footer__social svg { width: 20px; height: 20px; }

/* ---------- Tablas (comparativa plataforma) ---------- */
.compare-wrap { overflow-x: auto; }
.compare {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
  font-size: .95rem;
}
.compare th, .compare td {
  padding: 14px 18px;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.compare thead th {
  font-family: var(--font-head);
  background: var(--panel-2);
  font-size: 1.02rem;
}
.compare thead th .ed-tag {
  display: block;
  font-size: .72rem;
  letter-spacing: .16em;
  color: var(--cyan);
  text-transform: uppercase;
  font-weight: 500;
}
.compare tbody th {
  background: var(--panel);
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
}
.compare td { color: var(--text); background: rgba(19, 24, 35, .5); }

/* ---------- Formulario ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-field { display: flex; flex-direction: column; gap: 7px; }
.form-field--full { grid-column: 1 / -1; }
.form-field label {
  font-family: var(--font-head);
  font-size: .88rem;
  color: var(--text);
}
.form-field label .req { color: var(--cyan); }
.form-field input,
.form-field select,
.form-field textarea {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  padding: .75rem .9rem;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.form-field textarea { resize: vertical; min-height: 140px; }
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(31, 111, 255, .22);
}
.form-field select option { background: var(--panel); }
.form-note {
  margin-top: 16px;
  padding: 14px 18px;
  border: 1px solid rgba(0, 217, 255, .4);
  border-radius: 8px;
  background: rgba(0, 217, 255, .07);
  color: var(--text);
  font-size: .92rem;
}
.contact-aside .card { margin-bottom: 18px; }
.contact-aside .card p { margin-bottom: 0; }
.contact-aside .card a { color: var(--cyan); }

@media (max-width: 640px) {
  .form-grid { grid-template-columns: 1fr; }
}

/* ---------- Páginas legales ---------- */
.legal { max-width: 760px; }
.legal h2 { font-size: 1.25rem; margin-top: 2.4em; }
.legal p, .legal li { color: var(--muted); }
.legal ul { padding-left: 1.3em; margin-bottom: 1.2em; }
.legal li { margin-bottom: .5em; }
.legal strong { color: var(--text); }

/* ---------- Utilidades ---------- */
.grid--loose { gap: 56px; align-items: center; }
.mb-56 { margin-bottom: 56px; }
.section__lead--tight { margin-bottom: 1.6rem; }
.text-center { text-align: center; }
.section--flush-top { padding-top: 0; }
.grid--start { align-items: start; }
.mt-22 { margin-top: 22px; }
.kicker--tight { margin-bottom: .4rem; }
.img-slot--sm { min-height: 170px; margin-bottom: 20px; }
.brand--footer { margin-bottom: 14px; }
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Animaciones ---------- */
.reveal--init { opacity: 0; transform: translateY(22px); }
.reveal--visible {
  opacity: 1;
  transform: none;
  transition: opacity .7s ease, transform .7s ease;
}

/* Flujo de datos en diagramas SVG */
.flow-line {
  stroke-dasharray: 6 8;
  animation: flow 1.6s linear infinite;
}
@keyframes flow { to { stroke-dashoffset: -14; } }

.pulse-dot { animation: pulse 2.2s ease-in-out infinite; transform-origin: center; transform-box: fill-box; }
@keyframes pulse {
  0%, 100% { opacity: .55; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.25); }
}

.live-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--cyan);
  display: inline-block;
  animation: pulse 1.6s ease-in-out infinite;
  margin-right: 6px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal--init { opacity: 1; transform: none; }
  .flow-line, .pulse-dot, .live-dot { animation: none; }
  .card:hover, .btn:hover { transform: none; }
  *, *::before, *::after { transition: none !important; }
}

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
  .grid--3 { grid-template-columns: repeat(2, 1fr); }
  .hero .container { grid-template-columns: 1fr; gap: 40px; }
  .site-footer .footer__grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .nav {
    position: fixed;
    top: var(--header-h);
    left: 0; right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    align-items: stretch;
    padding: 12px 24px 20px;
    gap: 2px;
    display: none;
    max-height: calc(100vh - var(--header-h));
    overflow-y: auto;
  }
  .nav.open { display: flex; }
  .nav a { padding: .8rem .6rem; }
  .nav__item > a { display: block; }
  .dropdown {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: none;
    background: transparent;
    padding: 0 0 0 16px;
    display: none;
    min-width: 0;
  }
  .nav__item.open .dropdown { display: block; }
  .nav__item:hover .dropdown { display: none; }
  .nav__item.open:hover .dropdown { display: block; }
  .nav .nav__cta { margin: 10px 0 0; text-align: center; }
}

@media (max-width: 640px) {
  .section { padding: 64px 0; }
  .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }
  .metrics .grid { grid-template-columns: repeat(2, 1fr); gap: 28px; }
  .site-footer .footer__grid { grid-template-columns: 1fr; }
  .hero { padding-top: calc(var(--header-h) + 48px); }
}
