/* =====================================================================
   VIUTIM — Estilos
   Dark Elegance + interfaz espacial
   ===================================================================== */

/* ---------- 1. Colores y medidas (cambia aquí el acento) ---------- */
:root {
  --bg: #0A0908;          /* fondo negro cálido */
  --tx: #F3EEE4;          /* texto marfil */
  --mu: #A39B8D;          /* texto secundario */
  --ac: #9DB8FF;          /* ACENTO: Arco eléctrico. Champán: #D4B483 */
  --linea: rgba(255, 255, 255, .08);

  --panel: rgba(48, 43, 38, .42);
  --radio: 24px;
  --ancho: 1160px;

  --serif: "Instrument Serif", Georgia, serif;
  --sans: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, Consolas, monospace;

  --suave: cubic-bezier(.2, .7, .2, 1);
  color-scheme: dark;
}

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 96px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--tx);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, p { margin: 0; }
svg { display: block; }

:focus-visible { outline: 2px solid var(--ac); outline-offset: 3px; border-radius: 8px; }

::selection { background: var(--ac); color: var(--bg); }

/* Íconos de línea fina */
.icono, .etiqueta svg, .btn svg, .nav-toggle svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- 3. Luces ambientales ---------- */
.ambiente { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.luz { position: absolute; border-radius: 50%; filter: blur(90px); }
.luz-a {
  width: 520px; height: 520px; left: -160px; top: -200px;
  background: var(--ac); opacity: .13;
  animation: deriva-a 26s ease-in-out infinite alternate;
}
.luz-b {
  width: 480px; height: 480px; right: -180px; bottom: -200px;
  background: #6C7BD9; opacity: .10;
  animation: deriva-b 30s ease-in-out infinite alternate;
}
@keyframes deriva-a { to { transform: translate(60px, 40px); } }
@keyframes deriva-b { to { transform: translate(-60px, -30px); } }

/* ---------- 4. Panel espacial ---------- */
.sp {
  position: relative;
  background: var(--panel);
  -webkit-backdrop-filter: blur(30px) saturate(160%);
  backdrop-filter: blur(30px) saturate(160%);
  border-radius: var(--radio);
  box-shadow:
    0 24px 50px -24px rgba(0, 0, 0, .7),
    0 0 0 .5px rgba(255, 255, 255, .08),
    inset 0 1px 0 rgba(255, 255, 255, .14),
    inset 0 -1px 0 rgba(0, 0, 0, .25);
  transition: transform .35s var(--suave), box-shadow .35s var(--suave);
}
/* Reflejo que sigue al cursor */
.sp::before {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(260px circle at var(--x, 50%) var(--y, 0%), rgba(255, 255, 255, .10), transparent 60%);
  opacity: 0;
  transition: opacity .3s;
}
.sp:hover::before { opacity: 1; }

/* Navegadores sin desenfoque: panel opaco legible */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .sp { background: rgba(30, 27, 24, .92); }
}

/* ---------- 5. Botones ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 500;
  padding: 12px 22px;
  border-radius: 999px;
  transition: box-shadow .3s var(--suave), transform .2s var(--suave), background .2s;
}
.btn:active { transform: scale(.98); }
.btn svg { width: 16px; height: 16px; }
.btn-acento { background: var(--ac); color: var(--bg); }
.btn-acento:hover { box-shadow: 0 0 0 1px var(--ac), 0 0 22px -2px var(--ac); }
.btn-claro { background: var(--tx); color: var(--bg); }
.btn-claro:hover { box-shadow: 0 0 0 1px var(--tx), 0 0 18px -4px var(--tx); }
.btn-cristal { color: var(--tx); }

/* ---------- 6. Menú superior ---------- */
.nav-wrap {
  position: fixed; top: 16px; left: 0; right: 0; z-index: 50;
  padding: 0 16px;
}
.nav {
  max-width: var(--ancho); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 6px 6px 6px 20px;
  border-radius: 999px;
}
.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-size: 13px; letter-spacing: .16em; }
.logo-marca { width: 11px; height: 11px; border: 1.5px solid var(--ac); border-radius: 3px; transform: rotate(45deg); }

.nav-links { display: flex; gap: 2px; }
.nav-links a {
  display: block; font-size: 14px; color: var(--mu);
  padding: 8px 16px; border-radius: 999px;
  transition: background .2s, color .2s;
}
.nav-links a:hover, .nav-links a.activo { background: rgba(255, 255, 255, .11); color: var(--tx); }
.nav-cta { padding: 9px 18px; font-size: 13px; }

.nav-toggle {
  display: none;
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255, 255, 255, .08); border: 0; color: var(--tx); cursor: pointer;
  align-items: center; justify-content: center;
}
.nav-toggle svg { width: 20px; height: 20px; }

/* ---------- 7. Portada ---------- */
.hero {
  position: relative;
  min-height: 92vh;
  display: flex; align-items: center; justify-content: center;
  padding: 140px 20px 80px;
  text-align: center;
  overflow: hidden;
}
.fx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.hero-contenido { position: relative; max-width: 760px; }

.etiqueta {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 11px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--ac);
  margin-bottom: 22px;
}
.etiqueta svg { width: 14px; height: 14px; }

.hero-titulo {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(48px, 9vw, 104px);
  line-height: .98; letter-spacing: -.01em;
}
.hero-titulo em { color: var(--ac); }

.hero-texto { color: var(--mu); font-size: 17px; max-width: 520px; margin: 24px auto 34px; }
.hero-botones { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ---------- 8. Secciones ---------- */
.seccion { max-width: var(--ancho); margin: 0 auto; padding: 96px 20px; }
.seccion-cabecera { max-width: 620px; margin-bottom: 40px; }
.kicker { font-family: var(--mono); font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--ac); margin-bottom: 14px; }
.seccion-titulo { font-family: var(--serif); font-weight: 400; font-size: clamp(34px, 5vw, 52px); line-height: 1.05; }
.seccion-texto { color: var(--mu); margin-top: 14px; }

/* ---------- 9. Tarjetas de producto ---------- */
.grid-productos { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }

.card {
  display: flex; flex-direction: column; gap: 14px;
  padding: 24px;
  min-height: 250px;
}
a.card:hover, .card:hover {
  box-shadow:
    0 34px 60px -24px rgba(0, 0, 0, .8),
    0 0 0 .5px rgba(255, 255, 255, .14),
    inset 0 1px 0 rgba(255, 255, 255, .18),
    inset 0 -1px 0 rgba(0, 0, 0, .25);
}
.card-top { display: flex; justify-content: space-between; align-items: center; }
.card-icono {
  width: 42px; height: 42px; border-radius: 13px;
  background: rgba(255, 255, 255, .08);
  display: flex; align-items: center; justify-content: center;
  color: var(--mu);
}
.card-icono .icono { width: 20px; height: 20px; }
.card.activo .card-icono { background: rgba(255, 255, 255, .11); color: var(--ac); }

.estado {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 11px; padding: 4px 11px; border-radius: 999px;
  background: rgba(255, 255, 255, .07); color: var(--mu);
}
.card.activo .estado { background: rgba(255, 255, 255, .11); color: var(--ac); }
.estado-punto { width: 6px; height: 6px; border-radius: 50%; background: var(--ac); animation: carga 2.4s ease-in-out infinite; }
@keyframes carga { 0%, 100% { box-shadow: 0 0 0 0 var(--ac); } 50% { box-shadow: 0 0 9px 1px var(--ac); } }

.card-industria { font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--mu); }
.card-nombre { font-family: var(--serif); font-weight: 400; font-size: 30px; line-height: 1.1; margin-top: 4px; }
.card:not(.activo) .card-nombre { color: var(--mu); }
.card-desc { color: var(--mu); font-size: 14px; }
.card-enlace { margin-top: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--ac); }
.card-enlace .icono { width: 15px; height: 15px; transition: transform .25s var(--suave); }
a.card:hover .card-enlace .icono { transform: translate(2px, -2px); }

/* Corriente eléctrica que recorre el borde */
.corriente { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; opacity: 0; transition: opacity .3s; }
.corriente rect {
  fill: none; stroke: var(--ac); stroke-width: 1.2;
  stroke-dasharray: 6 94;
  filter: drop-shadow(0 0 4px var(--ac));
  animation: corriente 1.8s linear infinite;
}
.card:hover .corriente, .card:focus-visible .corriente { opacity: 1; }
@keyframes corriente { to { stroke-dashoffset: -100; } }

/* ---------- 10. Industrias ---------- */
.grid-industrias { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.industria { padding: 20px; border-radius: 20px; }
.industria .icono { width: 22px; height: 22px; color: var(--ac); margin-bottom: 16px; }
.industria h3 { font-size: 15px; font-weight: 500; }
.industria p { color: var(--mu); font-size: 13px; margin-top: 6px; line-height: 1.5; }

/* ---------- 11. Enfoque ---------- */
.grid-enfoque { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.principio { padding: 28px; }
.principio .icono { width: 26px; height: 26px; color: var(--ac); margin-bottom: 22px; }
.principio h3 { font-family: var(--serif); font-weight: 400; font-size: 26px; line-height: 1.15; }
.principio p { color: var(--mu); font-size: 14px; margin-top: 10px; }

/* ---------- 12. Contacto ---------- */
.contacto {
  display: grid; grid-template-columns: 1.3fr 1fr; gap: 32px; align-items: end;
  padding: 48px;
}
.contacto-accion { display: flex; flex-direction: column; align-items: flex-start; gap: 18px; }
.contacto-correo {
  font-family: var(--serif); font-size: clamp(24px, 3vw, 32px);
  border-bottom: 1px solid var(--linea);
  transition: border-color .2s, color .2s;
  word-break: break-all;
}
.contacto-correo:hover { color: var(--ac); border-color: var(--ac); }

/* ---------- 13. Pie de página ---------- */
.pie {
  max-width: var(--ancho); margin: 0 auto;
  padding: 40px 20px 48px;
  border-top: 1px solid var(--linea);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px;
}
.pie-links { display: flex; flex-wrap: wrap; gap: 24px; }
.pie-links a { color: var(--mu); font-size: 14px; transition: color .2s; }
.pie-links a:hover { color: var(--tx); }
.pie-legal { width: 100%; color: var(--mu); font-size: 13px; }

/* ---------- 14. Apariciones al bajar ---------- */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .8s var(--suave), transform .8s var(--suave); }
.js .reveal.visible { opacity: 1; transform: none; }
/* Tras aparecer, recupera la respuesta rápida al cursor */
.js .reveal.listo { transition: transform .35s var(--suave), box-shadow .35s var(--suave); }

/* ---------- 15. Celulares y tabletas ---------- */
@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; }
  .nav-cta { display: none; }
  .nav { border-radius: 28px; flex-wrap: wrap; padding: 6px 6px 6px 20px; }
  .nav-links {
    display: none;
    width: 100%; flex-direction: column; gap: 2px;
    padding: 6px 0 8px;
  }
  .nav.abierto .nav-links { display: flex; }
  .nav-links a { padding: 12px 14px; font-size: 15px; }

  .contacto { grid-template-columns: 1fr; padding: 32px 24px; }
  .seccion { padding: 72px 20px; }
}
@media (max-width: 480px) {
  .hero { padding-top: 120px; min-height: 86vh; }
  .hero-texto { font-size: 16px; }
  .card { padding: 20px; }
}

/* ---------- 16. Movimiento reducido ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
  .fx { display: none; }
}
