/* ============================================================
   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;
  /* Semáforo de Voltia Flex. Elegidos por contraste sobre el fondo #0A0E14. */
  --flex-verde: #2BD576;
  --flex-rojo: #FF5C6C;
  --flex-ambar: #F5A524;
  --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; }

/* ---------- Selector de idioma ---------- */
/* Vive fuera de <nav> a proposito: dentro quedaba escondido tras la
   hamburguesa en movil, y cambiar de idioma exigia abrir el menu. */
.lang {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: .78rem;
  letter-spacing: .06em;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px;
}
.lang a,
.lang span {
  padding: .22rem .5rem;
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  line-height: 1;
}
.lang a:hover { color: var(--text); }
.lang .lang--on {
  background: var(--panel-2);
  color: var(--text);
}

/* Orden dentro de la cabecera: marca · navegacion · idioma · hamburguesa.
   En el DOM el selector va antes que la nav (para que en movil, con la nav
   fuera de flujo, quede junto a la hamburguesa) y aqui se recoloca. */
.site-header .nav { order: 2; margin-left: auto; }
.site-header .lang { order: 3; margin-left: 14px; }
.site-header .nav-toggle { order: 4; }

@media (max-width: 900px) {
  /* La nav pasa a position:fixed, asi que solo quedan marca, idioma y boton:
     el selector se pega a la derecha, justo antes de la hamburguesa. */
  .site-header .lang { margin-left: auto; }
}

/* ---------- Hero: lazo anti-vertido ---------- */
.lazo { margin: 0; }
.lazo svg { width: 100%; height: auto; display: block; }
.lazo__pie {
  margin-top: 14px;
  text-align: center;
  color: var(--muted);
  font-size: .85rem;
}

/* Las curvas se dibujan solas al cargar: la longitud real de los trazados ronda
   los 600 px, 900 va sobrado y evita medirlos con JS. */
.lazo__consumo, .lazo__fv {
  stroke-dasharray: 900;
  stroke-dashoffset: 900;
  animation: lazo-trazo 2.6s cubic-bezier(.22, .61, .36, 1) forwards;
}
.lazo__fv { animation-delay: .5s; }
.lazo__area { opacity: 0; animation: lazo-aparece .9s ease-out 2.4s forwards; }
.lazo__nota { opacity: 0; animation: lazo-aparece .7s ease-out 3s forwards; }

@keyframes lazo-trazo { to { stroke-dashoffset: 0; } }
@keyframes lazo-aparece { to { opacity: 1; } }

/* Latido del indicador "en vivo" y pulsos que recorren el bucle de control */
.lazo__latido { animation: lazo-latido 2s ease-in-out infinite; }
@keyframes lazo-latido {
  0%, 100% { opacity: 1; }
  50%      { opacity: .25; }
}
.lazo__flujo {
  opacity: 0;
  animation-duration: 2.6s;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}
.lazo__flujo--a { animation-name: lazo-flujo-a; }
.lazo__flujo--b { animation-name: lazo-flujo-b; animation-delay: 1.3s; }
@keyframes lazo-flujo-a {
  0%        { transform: translateX(176px); opacity: 0; }
  15%, 85%  { opacity: 1; }
  100%      { transform: translateX(238px); opacity: 0; }
}
@keyframes lazo-flujo-b {
  0%        { transform: translateX(396px); opacity: 0; }
  15%, 85%  { opacity: 1; }
  100%      { transform: translateX(458px); opacity: 0; }
}

/* Quien pide menos movimiento ve el grafico entero y quieto, no a medio dibujar. */
@media (prefers-reduced-motion: reduce) {
  .lazo__consumo, .lazo__fv { stroke-dashoffset: 0; animation: none; }
  .lazo__area, .lazo__nota { opacity: 1; animation: none; }
  .lazo__latido, .lazo__flujo { animation: none; }
  .lazo__flujo { display: none; }
}

/* ---------- Formulario: trampa antispam y consentimiento ---------- */
/* Fuera de pantalla, no display:none: hay bots que ignoran lo oculto. */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.form-consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 18px;
  color: var(--muted);
  font-size: .88rem;
}
.form-consent input { margin-top: 3px; flex: 0 0 auto; }
.form-consent a { color: var(--cyan); }
.form-note--error { color: #FF8A8A; }

/* ---------- Franja "La flota, ahora mismo" ---------- */
.metrics__head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  padding-top: 38px;
}
.metrics__title {
  font-size: 1.05rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  margin: 0;
}
.metrics__head + .grid { padding-top: 22px; }
.metrics__foot {
  text-align: center;
  color: var(--muted);
  font-size: .82rem;
  margin: 0;
  padding-bottom: 34px;
}

/* Indicador de dato vivo: solo se muestra si el JSON viene fresco */
.live {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: .72rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--cyan);
  border: 1px solid rgba(0, 217, 255, .35);
  border-radius: 999px;
  padding: 4px 11px;
}
.live__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 0 0 rgba(0, 217, 255, .6);
  animation: live-pulse 2s infinite;
}
@keyframes live-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(0, 217, 255, .6); }
  70%  { box-shadow: 0 0 0 8px rgba(0, 217, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 217, 255, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .live__dot { animation: none; }
}

/* ---------- 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); }
}

/* ============================================================
   Voltia Flex — simulador de ahorro (simulador.html)
   ============================================================ */

.flex-sub { color: var(--muted); margin: -6px 0 26px; }

/* ---------- Gráfica de precio ---------- */
.flex-chartwrap { overflow-x: auto; }
#flex-chart { display: block; min-width: 660px; width: 100%; height: 230px; }
.flex-bar { opacity: .42; transition: opacity .15s ease; }
.flex-bar.is-sel { opacity: 1; }
.flex-bar--barato { fill: var(--flex-verde); }
.flex-bar--caro   { fill: var(--flex-rojo); }
.flex-bar--medio  { fill: #2A3346; }
.flex-bar-mark    { fill: var(--cyan); }
.flex-bar-label   { fill: var(--muted); font-size: 11px; font-family: var(--font-body); }
.flex-cero        { stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 3; }

.flex-legend {
  display: flex; flex-wrap: wrap; gap: 20px;
  margin-top: 14px; font-size: .85rem; color: var(--muted);
}
.flex-sw {
  display: inline-block; width: 11px; height: 11px;
  border-radius: 3px; margin-right: 7px; vertical-align: -1px;
}
.flex-sw--barato { background: var(--flex-verde); }
.flex-sw--caro   { background: var(--flex-rojo); }
.flex-sw--medio  { background: #2A3346; }
.flex-sw--sel    { background: var(--cyan); }

/* ---------- Barras de horario ---------- */
.flex-striplab { font-size: .9rem; font-weight: 600; margin: 22px 0 8px; color: var(--muted); }
.flex-striplab--on { color: var(--flex-verde); }
.flex-strip { display: flex; gap: 2px; }
.flex-strip span { flex: 1; height: 30px; border-radius: 2px; background: var(--panel-2); }
.flex-strip span.is-on  { background: var(--flex-verde); box-shadow: 0 0 9px rgba(43, 213, 118, .45); }
.flex-strip span.is-ref { background: var(--muted); }
.flex-striphours {
  display: flex; justify-content: space-between;
  font-size: .75rem; color: var(--muted); margin-top: 6px;
}

/* ---------- Avisos ---------- */
.flex-honest {
  margin-top: 26px; padding: 14px 18px;
  border-left: 3px solid var(--flex-ambar);
  background: rgba(245, 165, 36, .07);
  border-radius: 0 8px 8px 0;
  font-size: .92rem; color: #E8D5B0;
}
.flex-zero {
  margin-top: 20px; padding: 14px 18px;
  border-left: 3px solid var(--muted);
  background: rgba(139, 149, 165, .08);
  border-radius: 0 8px 8px 0;
  color: var(--muted);
}
.flex-warn { color: var(--flex-ambar); }
.flex-err  { color: var(--flex-rojo); font-size: .78rem; min-height: 1.1em; }

@media (max-width: 720px) {
  .flex-strip span { height: 22px; }
  .flex-legend { gap: 12px; font-size: .78rem; }
}

/* ============================================================
   Notas de aplicación (/notas)
   Tipografía de lectura larga. El ancho corto es deliberado:
   una línea de más de ~80 caracteres se lee peor en pantalla.
   ============================================================ */
/* La cabecera es fixed: el primer bloque tiene que apartarse de ella. */
.nota-top { padding-top: calc(var(--header-h) + 56px); }
.nota { max-width: 760px; }
.nota p, .nota li { color: var(--muted); }
.nota strong { color: var(--text); }
.nota h2 { font-size: 1.4rem; margin-top: 2.4em; }
.nota h3 { font-size: 1.08rem; margin-top: 1.9em; }
.nota ul, .nota ol { padding-left: 1.3em; margin-bottom: 1.2em; }
.nota li { margin-bottom: .5em; }
.nota a { text-decoration: underline; text-underline-offset: 3px; }

.nota__meta {
  display: flex; flex-wrap: wrap; gap: 10px 18px;
  align-items: center;
  color: var(--muted); font-size: .9rem;
  margin: 0 0 34px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}
.nota__meta time { font-variant-numeric: tabular-nums; }

.nota code {
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: .9em;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: .1em .38em;
  color: var(--text);
}
.nota pre {
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--blue);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 20px 22px;
  overflow-x: auto;
  margin: 0 0 1.5em;
}
.nota pre code {
  background: none; border: 0; padding: 0;
  font-size: .86rem; line-height: 1.65;
  color: var(--text); white-space: pre;
}

/* Regla de planta: lo que no se toca. Ámbar, como los avisos del simulador. */
.nota__regla {
  margin: 26px 0; padding: 16px 20px;
  border-left: 3px solid var(--flex-ambar);
  background: rgba(245, 165, 36, .07);
  border-radius: 0 8px 8px 0;
  color: #E8D5B0;
}
.nota__regla p:last-child { margin-bottom: 0; }
.nota__regla strong { color: #FFE3B0; }

/* Lo aprendido, al final de cada nota. */
.nota__poso {
  margin: 40px 0 0; padding: 22px 24px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.nota__poso h2 { margin-top: 0; font-size: 1.1rem; }
.nota__poso ul { margin-bottom: 0; }

.nota__cta {
  margin-top: 44px; padding-top: 28px;
  border-top: 1px solid var(--line);
}

/* ---------- Listado ---------- */
.notas-lista { display: grid; gap: 20px; }
.nota-card { display: block; color: inherit; }
.nota-card:hover { text-decoration: none; }
.nota-card h3 { margin-bottom: .45em; color: var(--text); }
.nota-card:hover h3 { color: var(--cyan); }
.nota-card p { color: var(--muted); margin-bottom: 0; }
.nota-card__meta {
  display: flex; flex-wrap: wrap; gap: 8px 14px;
  font-size: .85rem; color: var(--muted);
  margin-bottom: 12px;
}
.nota-card__tema {
  color: var(--cyan);
  text-transform: uppercase;
  letter-spacing: .1em;
  font-size: .74rem;
  font-family: var(--font-head);
}
