/* ============================================================
   systemia.cl — v2 "sala de máquinas de luz"
   El lenguaje visual de los covers de SystemIA LAB llevado a web:
   navy profundo, circuitos azul→naranja, puntos de luz, titulares
   gigantes con UNA palabra naranja y subrayado cian.
   Naranja = único color de acción. Azul = estructura y luz.
   ============================================================ */
:root {
  --bg-0: #080f1f;
  --bg-1: #0b1324;
  --bg-2: #101b31;
  --bg-3: #172239;
  --borde: #1e2b44;
  --borde-luz: #2a3c5e;
  --txt-1: #f9f9f7;
  --txt-2: #a9b4c6;
  --txt-3: #6b7a90;
  --naranja: #e8a33d;
  --naranja-hover: #f4b75c;
  --naranja-txt: #1a1206;
  --azul: #2e9bd6;
  --cian: #a5ddfd;
  --f-titulo: "Poppins", system-ui, sans-serif;
  --f-cuerpo: "Plus Jakarta Sans", system-ui, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, monospace;
  --sp: 8px;
  --radio: 16px;
  --ancho: 1120px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

/* Atmósfera global: navy con auras de luz azul (izq) y cálida (der),
   como el degradado diagonal de la marca */
body {
  background-color: var(--bg-0);
  background-image:
    radial-gradient(1100px 700px at -10% -10%, rgba(46, 155, 214, 0.14), transparent 60%),
    radial-gradient(900px 650px at 110% 12%, rgba(232, 163, 61, 0.10), transparent 55%),
    radial-gradient(700px 500px at 50% 115%, rgba(46, 155, 214, 0.07), transparent 60%);
  background-attachment: fixed;
  color: var(--txt-1);
  font-family: var(--f-cuerpo);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: var(--cian); text-decoration: none; }
a:hover { text-decoration: underline; }
::selection { background: var(--naranja); color: var(--naranja-txt); }

.contenedor { max-width: var(--ancho); margin: 0 auto; padding: 0 calc(var(--sp) * 3); position: relative; }

/* ---------- Tipografía: escala dramática ---------- */
h1, h2, h3 { font-family: var(--f-titulo); font-weight: 800; line-height: 1.06; letter-spacing: -0.025em; }
h1 { font-size: clamp(2.6rem, 8vw, 5rem); text-wrap: balance; }
h2 { font-size: clamp(1.9rem, 5vw, 3rem); margin-bottom: calc(var(--sp) * 3); text-wrap: balance; }
h3 { font-size: 1.2rem; font-weight: 700; letter-spacing: -0.01em; }
.acento { color: var(--naranja); }

/* La firma: subrayado cian que se enciende al cargar */
.subrayado { display: inline-block; position: relative; padding-bottom: 8px; }
.subrayado::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 4px; width: 100%;
  background: linear-gradient(90deg, var(--azul), var(--cian));
  border-radius: 2px;
  box-shadow: 0 0 18px rgba(165, 221, 253, 0.55);
  transform-origin: left; animation: encender 0.9s 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) backwards;
}
@keyframes encender { from { transform: scaleX(0); } to { transform: scaleX(1); } }

.cifra { font-family: var(--f-mono); color: var(--naranja); font-weight: 600; }
.contador { font-variant-numeric: tabular-nums; }

/* Typewriter del hero */
.h1-l { display: block; }
.type-line { display: block; color: var(--naranja); min-height: 1.08em; }
.caret {
  display: inline-block; width: 4px; height: 0.85em; margin-left: 8px;
  background: var(--cian); vertical-align: -0.06em; border-radius: 2px;
  box-shadow: 0 0 10px rgba(165, 221, 253, 0.7);
  animation: parpadeo 1.05s steps(1) infinite;
}
@keyframes parpadeo { 50% { opacity: 0; } }

/* Circuitos que se dibujan al entrar en pantalla */
.circuito path { stroke-dasharray: 1; stroke-dashoffset: 1; }
.circuito.dibujado path { transition: stroke-dashoffset 1.8s cubic-bezier(0.4, 0, 0.2, 1); stroke-dashoffset: 0; }
.circuito.dibujado path:nth-of-type(2) { transition-delay: 0.9s; }
.circuito circle { opacity: 0; transition: opacity 0.5s ease 1.4s; }
.circuito.dibujado circle { opacity: 1; }
.muted { color: var(--txt-2); }
.honesto { color: var(--txt-2); font-style: italic; border-left: 3px solid var(--azul); padding-left: calc(var(--sp) * 2.5); }

.kicker {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--f-mono); font-size: 0.78rem; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--cian); margin-bottom: calc(var(--sp) * 2);
}
.kicker::before { content: ""; width: 34px; height: 2px; background: linear-gradient(90deg, var(--azul), transparent); }
.intro { color: var(--txt-2); max-width: 640px; font-size: 1.08rem; }

/* ---------- Botones ---------- */
.btn {
  display: inline-block; font-family: var(--f-titulo); font-weight: 700; font-size: 1rem;
  padding: 15px 30px; border-radius: 12px; border: 0; cursor: pointer; text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn-naranja {
  background: linear-gradient(180deg, var(--naranja-hover), var(--naranja));
  color: var(--naranja-txt);
  box-shadow: 0 6px 24px rgba(232, 163, 61, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.btn-naranja:hover { box-shadow: 0 10px 34px rgba(232, 163, 61, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.35); }
.btn-borde { background: rgba(16, 27, 49, 0.6); color: var(--txt-1); border: 1px solid var(--borde-luz); backdrop-filter: blur(4px); }
.btn-borde:hover { border-color: var(--azul); }
.link-flecha { font-weight: 700; color: var(--txt-1); font-family: var(--f-titulo); }
.link-flecha::after { content: " →"; color: var(--naranja); transition: margin-left 0.15s ease; }
.link-flecha:hover { text-decoration: none; }
.link-flecha:hover::after { margin-left: 4px; }

/* ---------- Header ---------- */
header.top {
  position: sticky; top: 0; z-index: 50;
  background: rgba(8, 15, 31, 0.82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(30, 43, 68, 0.7);
}
.top-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.logo img { height: 26px; width: auto; }
nav.principal { display: flex; align-items: center; gap: calc(var(--sp) * 3.5); }
nav.principal a { color: var(--txt-2); font-weight: 600; font-size: 0.95rem; }
nav.principal a:hover { color: var(--cian); text-decoration: none; }
nav.principal .btn { padding: 10px 20px; font-size: 0.9rem; }
.menu-btn { display: none; background: none; border: 1px solid var(--borde-luz); color: var(--txt-1); border-radius: 10px; padding: 8px 12px; font-size: 1.1rem; cursor: pointer; }

/* ---------- Secciones ---------- */
section { padding: calc(var(--sp) * 13) 0; position: relative; }
section.alt { background: linear-gradient(180deg, rgba(11, 19, 36, 0.0), rgba(16, 27, 49, 0.55) 18%, rgba(16, 27, 49, 0.55) 82%, rgba(11, 19, 36, 0)); }

/* Separador circuito entre secciones */
.circuito { display: block; width: min(92%, var(--ancho)); margin: 0 auto; height: 46px; opacity: 0.85; }

/* ---------- HERO home: el fondo REAL de la marca ---------- */
.hero {
  padding: calc(var(--sp) * 16) 0 calc(var(--sp) * 14);
  position: relative; isolation: isolate; overflow: hidden;
}
.hero-marca::before {
  content: ""; position: absolute; inset: 0; z-index: -2;
  background-image: url("/assets/img/hero-bg.webp");
  background-size: cover; background-position: center 30%;
}
.hero-marca::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(180deg, rgba(8, 15, 31, 0.55), rgba(8, 15, 31, 0.78) 70%, var(--bg-0)),
    linear-gradient(90deg, rgba(8, 15, 31, 0.5), transparent 55%);
}
.hero p.sub { margin: calc(var(--sp) * 3.5) 0 calc(var(--sp) * 5); max-width: 580px; color: var(--txt-2); font-size: clamp(1.05rem, 2.4vw, 1.25rem); }
.hero .acciones { display: flex; gap: calc(var(--sp) * 2.5); flex-wrap: wrap; align-items: center; }

/* Sello SIA flotando en el hero */
.hero-sello {
  position: absolute; right: 4%; top: 50%; transform: translateY(-50%);
  width: clamp(180px, 26vw, 340px); opacity: 0.9; z-index: -1;
  filter: drop-shadow(0 0 44px rgba(46, 155, 214, 0.35));
  animation: flotar 7s ease-in-out infinite;
}
@keyframes flotar { 0%, 100% { transform: translateY(-52%); } 50% { transform: translateY(-46%); } }

/* Carga: reveals escalonados del hero */
.hero h1, .hero .sub, .hero .acciones { animation: subir 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) backwards; }
.hero .sub { animation-delay: 0.15s; }
.hero .acciones { animation-delay: 0.3s; }
@keyframes subir { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }

/* ---------- Reveals al hacer scroll ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1); }
.reveal.visto { opacity: 1; transform: none; }
.reveal:nth-child(2) { transition-delay: 0.08s; }
.reveal:nth-child(3) { transition-delay: 0.16s; }
.reveal:nth-child(4) { transition-delay: 0.24s; }

/* ---------- Tarjetas: borde-gradiente + lift ---------- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: calc(var(--sp) * 3); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: calc(var(--sp) * 3); }
.tarjeta {
  position: relative;
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
  border: 1px solid var(--borde); border-radius: var(--radio);
  padding: calc(var(--sp) * 4);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.25s ease;
}
.tarjeta::before {
  content: ""; position: absolute; inset: -1px; border-radius: var(--radio); padding: 1px; z-index: 0;
  background: linear-gradient(135deg, rgba(46, 155, 214, 0.5), transparent 40%, transparent 60%, rgba(232, 163, 61, 0.45));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0; transition: opacity 0.25s ease; pointer-events: none;
}
.tarjeta:hover { transform: translateY(-4px); box-shadow: 0 18px 44px rgba(0, 0, 0, 0.45); }
a.tarjeta, a.tarjeta:hover { color: inherit; text-decoration: none; }
.tarjeta h3 { color: var(--txt-1); }
.tarjeta:hover::before { opacity: 1; }
.tarjeta h3 { margin-bottom: var(--sp); }
.tarjeta p { color: var(--txt-2); font-size: 0.98rem; }
.tarjeta .link-flecha { display: inline-block; margin-top: calc(var(--sp) * 2); }
.tarjeta .num {
  font-family: var(--f-mono); font-size: 2rem; font-weight: 600;
  background: linear-gradient(90deg, var(--cian), var(--azul));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  display: block; margin-bottom: var(--sp);
}

/* ---------- Listas de valor ---------- */
ul.valor { list-style: none; margin: calc(var(--sp) * 3) 0; max-width: 720px; }
ul.valor li { padding-left: calc(var(--sp) * 4); position: relative; margin-bottom: calc(var(--sp) * 2); color: var(--txt-2); }
ul.valor li::before {
  content: ""; position: absolute; left: 0; top: 0.5em; width: 9px; height: 9px; border-radius: 50%;
  background: var(--naranja); box-shadow: 0 0 12px rgba(232, 163, 61, 0.8);
}
ul.valor li strong { color: var(--txt-1); }

/* ---------- Escalera de precios ---------- */
.escalera { display: grid; grid-template-columns: repeat(3, 1fr); gap: calc(var(--sp) * 3); margin-top: calc(var(--sp) * 5); align-items: stretch; }
.nivel {
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
  border: 1px solid var(--borde); border-radius: var(--radio); padding: calc(var(--sp) * 4);
  transition: transform 0.2s ease;
}
.nivel:hover { transform: translateY(-3px); }
.nivel .precio { font-family: var(--f-mono); font-size: 1.9rem; color: var(--txt-1); margin: calc(var(--sp) * 1.5) 0; font-weight: 600; }
.nivel.destacado {
  border-color: rgba(232, 163, 61, 0.7);
  box-shadow: 0 0 0 1px rgba(232, 163, 61, 0.35), 0 14px 44px rgba(232, 163, 61, 0.12);
  position: relative; overflow: hidden;
}
.nivel.destacado::after {
  content: "EL POPULAR"; position: absolute; top: 14px; right: -34px; transform: rotate(38deg);
  font-family: var(--f-mono); font-size: 0.62rem; letter-spacing: 0.14em;
  background: var(--naranja); color: var(--naranja-txt); padding: 4px 38px;
}

/* ---------- Strip de herramientas ---------- */
.herramientas { display: flex; align-items: center; gap: calc(var(--sp) * 6); flex-wrap: wrap; margin-top: calc(var(--sp) * 4); }
.herramientas img { height: 34px; width: auto; opacity: 0.75; transition: opacity 0.2s ease, transform 0.2s ease; }
.herramientas img:hover { opacity: 1; transform: translateY(-2px); }

/* ---------- Testimonios ---------- */
.testimonios { display: grid; grid-template-columns: 1fr 1fr; gap: calc(var(--sp) * 3); }
.testimonio {
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
  border: 1px solid var(--borde); border-radius: var(--radio); padding: calc(var(--sp) * 3.5);
  position: relative;
}
.testimonio::before { content: "“"; position: absolute; top: 2px; left: 16px; font-family: var(--f-titulo); font-size: 4rem; color: var(--azul); opacity: 0.35; line-height: 1; }
.testimonio blockquote { color: var(--txt-1); font-size: 1.02rem; margin: 20px 0 16px; }
.testimonio figcaption { color: var(--txt-3); font-size: 0.88rem; }

/* ---------- Sección Jose ---------- */
.jose { display: grid; grid-template-columns: 300px 1fr; gap: calc(var(--sp) * 6); align-items: center; }
.jose-foto { position: relative; }
.jose-foto img { border-radius: var(--radio); border: 1px solid var(--borde-luz); }
.jose-foto::after {
  content: ""; position: absolute; inset: -14px -14px auto auto; width: 90px; height: 90px; z-index: -1;
  background: radial-gradient(circle, rgba(232, 163, 61, 0.5), transparent 70%);
}

/* ---------- Formularios ---------- */
form.f { display: grid; gap: calc(var(--sp) * 2); max-width: 540px; }
form.f label { font-size: 0.88rem; font-weight: 600; color: var(--txt-2); display: block; margin-bottom: 4px; }
form.f input, form.f textarea, form.f select {
  width: 100%; background: rgba(8, 15, 31, 0.75); color: var(--txt-1);
  border: 1px solid var(--borde-luz); border-radius: 12px;
  padding: 13px 15px; font-family: var(--f-cuerpo); font-size: 1rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
form.f input:focus, form.f textarea:focus, form.f select:focus {
  outline: none; border-color: var(--azul); box-shadow: 0 0 0 3px rgba(46, 155, 214, 0.25);
}
form.f .fila { display: flex; gap: calc(var(--sp) * 2); }
form.f .fila > div { flex: 1; }
.f-inline { display: flex; gap: calc(var(--sp) * 1.5); max-width: 500px; }
.f-inline input { flex: 1; }
.hp { position: absolute; left: -9999px; opacity: 0; height: 0; overflow: hidden; }
.f-msg { font-size: 0.92rem; margin-top: var(--sp); color: var(--txt-2); }
.f-msg.ok { color: var(--cian); }
.f-msg.error { color: var(--naranja); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 0.92rem; color: var(--txt-2); }
.check input { width: auto; margin-top: 4px; }

/* ---------- Footer ---------- */
footer.pie { border-top: 1px solid var(--borde); padding: calc(var(--sp) * 7) 0; background: rgba(11, 19, 36, 0.7); position: relative; }
footer.pie::before {
  content: ""; position: absolute; top: -1px; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--azul) 30%, var(--naranja) 70%, transparent);
}
.pie-inner { display: flex; justify-content: space-between; align-items: center; gap: calc(var(--sp) * 3); flex-wrap: wrap; }
.pie-inner img { height: 24px; }
.pie-nav { display: flex; gap: calc(var(--sp) * 3); flex-wrap: wrap; }
.pie-nav a { color: var(--txt-3); font-size: 0.9rem; }
.pie-nav a:hover { color: var(--cian); }
.pie .nota { color: var(--txt-3); font-size: 0.85rem; margin-top: calc(var(--sp) * 2.5); }

/* ---------- Móvil ---------- */
@media (max-width: 780px) {
  body { background-attachment: scroll; }
  .f-inline { flex-wrap: wrap; }
  .f-inline .btn { flex: 1 1 auto; }
  .grid-2, .grid-3, .escalera, .testimonios { grid-template-columns: 1fr; }
  .jose { grid-template-columns: 1fr; }
  .jose-foto { max-width: 260px; }
  .hero-sello { display: none; }
  nav.principal { display: none; position: absolute; top: 68px; left: 0; right: 0;
    background: var(--bg-1); border-bottom: 1px solid var(--borde);
    flex-direction: column; padding: calc(var(--sp) * 3); align-items: flex-start; }
  nav.principal.abierto { display: flex; }
  .menu-btn { display: block; }
  section { padding: calc(var(--sp) * 8) 0; }
  .hero { padding: calc(var(--sp) * 10) 0 calc(var(--sp) * 8); }
  form.f .fila { flex-direction: column; }
}

/* ---------- Movimiento: respeto ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  .circuito path { stroke-dashoffset: 0; }
  .circuito circle { opacity: 1; }
  .caret { display: none; }
  html { scroll-behavior: auto; }
}
