:root {
  /* Paleta de marca: negro, blanco y grises */
  --black: #000000;
  --ink: #0d0d0d;
  --graphite: #161616;
  --gray-700: #3a3a3a;
  --gray-500: #6e6e6e;
  --accent: #ff6a00; /* único color de acento; también está en ACCENT de site.js */
  --gray-400: #b7b7b7; /* gris del logo */
  --gray-200: #e4e4e4;
  --gray-100: #f3f3f3;
  --white: #ffffff;
  --line: rgba(255,255,255,.16);
  --radius: 4px;
  --max: 1240px;
  --display: "Oswald", "Arial Narrow", sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; background: var(--black); }
body {
  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--white); background: var(--black); line-height: 1.6;
  -webkit-font-smoothing: antialiased; overflow-x: clip;
}
a { color: inherit; text-decoration: none; }
.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 32px; }
h1, h2, h3 { font-family: var(--display); font-weight: 500; text-transform: uppercase; line-height: 1.04; letter-spacing: .01em; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 12px; font-size: .74rem; font-weight: 600;
  letter-spacing: .22em; text-transform: uppercase; color: var(--gray-400);
}
.eyebrow::before { content: ""; width: 28px; height: 1px; background: currentColor; }
.mark { display: block; fill: none; stroke: currentColor; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 16px 28px;
  border-radius: var(--radius); font-weight: 600; font-size: .8rem; letter-spacing: .14em;
  text-transform: uppercase; border: 1px solid transparent; cursor: pointer; font-family: inherit;
  transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.btn svg { transition: transform .2s ease; }
.btn:hover svg { transform: translateX(4px); }
.btn-light { background: var(--white); color: var(--black); }
.btn-light:hover { background: var(--gray-200); }
.btn-outline { border-color: rgba(255,255,255,.35); color: var(--white); }
.btn-outline:hover { border-color: var(--white); background: rgba(255,255,255,.08); }
.btn-dark { background: var(--black); color: var(--white); }
.btn-dark:hover { background: var(--gray-700); }

/* Escenario 3D fijo detrás de la página */
#stage { position: fixed; inset: 0; width: 100%; height: 100vh; z-index: 0; display: block; }
main, footer { position: relative; z-index: 2; }

/* Pantalla de carga con el logo */
#loader {
  position: fixed; inset: 0; z-index: 100; background: var(--black); display: grid; place-items: center;
  transition: opacity .7s ease, visibility .7s;
}
#loader.done { opacity: 0; visibility: hidden; }
#loader svg { width: 150px; height: auto; color: var(--white); }
#loader path { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.3s cubic-bezier(.65,0,.35,1) forwards; }
#loader path + path { animation-delay: 1s; animation-duration: .4s; }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* Cabecera */
header {
  position: fixed; inset: 0 0 auto 0; z-index: 50; border-bottom: 1px solid transparent;
  transition: background .25s ease, border-color .25s ease;
}
header.scrolled { background: rgba(0,0,0,.72); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-color: rgba(255,255,255,.08); }
.nav { display: flex; align-items: center; justify-content: space-between; height: 76px; }
.brand { display: flex; align-items: center; gap: 14px; color: var(--white); }
.brand .mark { width: 40px; height: 31px; }
.brand-name { font-family: var(--display); font-size: 1.12rem; letter-spacing: .08em; text-transform: uppercase; }
.nav-links { display: flex; gap: 34px; list-style: none; align-items: center; }
.nav-links a { color: rgba(255,255,255,.72); font-size: .76rem; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; transition: color .2s; }
.nav-links a:hover { color: var(--white); }
.nav-links .btn { padding: 11px 20px; color: var(--black); }
.menu-toggle { display: none; background: none; border: 0; cursor: pointer; width: 42px; height: 42px; color: var(--white); }
.menu-toggle span { display: block; width: 24px; height: 2px; background: currentColor; margin: 5px auto; transition: .25s; }

/* Portada */
.hero { position: relative; z-index: 3; min-height: 100vh; min-height: 100svh; display: flex; align-items: center; }
.hero-inner { padding-top: 100px; padding-bottom: 90px; }
.hero h1 { font-size: clamp(3.1rem, 7.6vw, 7.2rem); line-height: .96; margin: 22px 0 26px; }
.hero h1 .line { display: block; overflow: hidden; padding-bottom: .06em; }
.hero h1 .line > span { display: block; transform: translateY(110%); }
.ready .hero h1 .line > span { transform: none; transition: transform 1.1s cubic-bezier(.16,1,.3,1); }
.ready .hero h1 .line:nth-child(2) > span { transition-delay: .12s; }
.hero h1 .muted { color: var(--gray-400); }
.hero p { text-shadow: 0 1px 16px rgba(0,0,0,.9); font-size: clamp(1.02rem, 1.4vw, 1.18rem); color: rgba(255,255,255,.76); max-width: 480px; margin-bottom: 36px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; }
.scroll-cue {
  position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 10px;
  font-size: .66rem; letter-spacing: .3em; text-transform: uppercase; color: rgba(255,255,255,.6);
}
.scroll-cue span { position: relative; width: 1px; height: 44px; background: rgba(255,255,255,.2); overflow: hidden; }
.scroll-cue span::after { content: ""; position: absolute; left: 0; top: -50%; width: 1px; height: 50%; background: var(--white); animation: cue 2s ease-in-out infinite; }
@keyframes cue { to { top: 100%; } }

/* Instalación: recorrido por scroll */
/* Empieza debajo de la portada: la animación arranca con el primer scroll */
#instalacion { height: 1000vh; position: relative; margin-top: -100vh; margin-top: -100svh; scroll-margin-top: -60vh; }
.ins-sticky { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; pointer-events: none; }
.ins-sticky::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: var(--scrim, 0);
  background: radial-gradient(ellipse 66% 68% at 0% 100%, rgba(0,0,0,.95) 0%, rgba(0,0,0,.82) 45%, transparent 100%),
              radial-gradient(ellipse 34% 30% at 100% 0%, rgba(0,0,0,.72) 0%, transparent 100%);
}
.ins-sticky .container { position: relative; height: 100%; }
.cap {
  position: absolute; left: 32px; bottom: 11vh; max-width: 430px; opacity: 0; transform: translateY(24px);
  transition: opacity .45s ease, transform .45s ease;
}
.cap.on { opacity: 1; transform: none; }
.cap .n { font-family: var(--display); font-size: .95rem; letter-spacing: .14em; color: var(--accent); }
.cap h2 { font-size: clamp(2.2rem, 4.6vw, 4rem); margin: 8px 0 12px; text-shadow: 0 2px 30px rgba(0,0,0,.8); }
.cap .tag { font-family: var(--display); font-size: clamp(1.1rem, 1.7vw, 1.45rem); text-transform: uppercase; letter-spacing: .03em; line-height: 1.2; color: var(--gray-400); margin: -4px 0 12px; text-shadow: 0 1px 16px rgba(0,0,0,.9); }
.cap p { color: rgba(255,255,255,.8); text-shadow: 0 1px 16px rgba(0,0,0,.9); }
.cap .specs { margin-top: 18px; }
.hud {
  position: absolute; right: 32px; top: 104px; width: 220px; opacity: 0; transition: opacity .4s ease;
  font-size: .68rem; letter-spacing: .16em; text-transform: uppercase; color: rgba(255,255,255,.6);
}
.hud.on { opacity: 1; }
.hud strong { display: block; font-family: var(--display); font-weight: 400; font-size: 3rem; line-height: 1.05; letter-spacing: .02em; color: var(--white); font-variant-numeric: tabular-nums; }
.hud .bar { height: 2px; background: rgba(255,255,255,.16); margin: 12px 0; }
.hud .bar i { display: block; height: 100%; width: 0; background: var(--accent); }

/* Toma final: beneficios del muro */
.facts { position: absolute; inset: 0; display: flex; align-items: center; opacity: 0; transition: opacity .5s ease; }
.facts.on { opacity: 1; }
.ins-sticky .facts .container { height: auto; }
.facts .eyebrow { color: var(--accent); }
.fact-stack { position: relative; width: min(460px, 100%); height: 250px; margin-top: 18px; }
.fact { position: absolute; inset: 0; opacity: 0; transform: translateY(18px); transition: opacity .45s ease, transform .45s ease; }
.fact.on { opacity: 1; transform: none; }
.fact h2 { font-size: clamp(2.6rem, 5vw, 4.4rem); line-height: 1; margin-bottom: 14px; }
.fact p { color: rgba(255,255,255,.78); font-size: 1.08rem; max-width: 400px; }
.fact-dots { display: flex; gap: 8px; margin-bottom: 22px; }
.fact-dots i { width: 34px; height: 3px; background: rgba(255,255,255,.18); transition: background .3s; }
.fact-dots i.on { background: var(--accent); }
.facts .specs { width: min(460px, 100%); }

/* Fichas de datos */
.specs { display: grid; grid-template-columns: repeat(3, auto); justify-content: start; gap: 0; border-top: 1px solid var(--line); }
.specs div { padding: 12px 22px 0 0; }
.specs div + div { padding-left: 22px; border-left: 1px solid var(--line); }
.specs b { display: block; font-family: var(--display); font-weight: 500; font-size: 1.5rem; line-height: 1.1; white-space: nowrap; }
.specs b small { font-size: .62em; font-weight: 400; color: var(--gray-400); }
.specs span { font-size: .64rem; letter-spacing: .13em; text-transform: uppercase; color: var(--gray-400); }

/* Sistemas */
#sistemas { background: var(--black); }
.compare-head { max-width: 720px; margin-bottom: 56px; }
.compare-head h2 { font-size: clamp(2.4rem, 6vw, 5rem); margin: 16px 0 18px; }
.compare-head p { color: rgba(255,255,255,.7); font-size: 1.05rem; }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); }
.compare article { background: var(--black); padding: 44px 40px; }
.compare h3 { font-size: clamp(1.8rem, 3.2vw, 2.6rem); margin-bottom: 12px; }
.compare p { color: rgba(255,255,255,.72); margin-bottom: 24px; }
.compare ul { list-style: none; margin-top: 26px; display: grid; gap: 10px; }
.compare li { position: relative; padding-left: 22px; color: rgba(255,255,255,.8); font-size: .95rem; }
.compare li::before { content: ""; position: absolute; left: 0; top: .72em; width: 12px; height: 2px; background: var(--accent); }
.sys-note { margin-top: 20px; font-size: .78rem; color: rgba(255,255,255,.5); }

/* Cinta en movimiento */
.marquee { position: relative; background: var(--white); color: var(--black); overflow: hidden; padding: 20px 0; }
.marquee-track { display: flex; width: max-content; animation: slide 34s linear infinite; }
.marquee-track span { font-family: var(--display); font-size: clamp(1.5rem, 3vw, 2.5rem); text-transform: uppercase; letter-spacing: .03em; white-space: nowrap; padding-right: 56px; }
.marquee-track span::after { content: "/"; color: var(--gray-400); padding-left: 56px; }
@keyframes slide { to { transform: translateX(-50%); } }

/* Secciones claras */
.light { background: var(--white); color: var(--ink); }
.light-alt { background: var(--gray-100); color: var(--ink); }
.section { padding: 112px 0; }
.section-head { max-width: 680px; margin-bottom: 56px; }
.section-head h2 { font-size: clamp(2.2rem, 5vw, 3.8rem); color: var(--black); margin-top: 14px; }
.section-head p { color: var(--gray-500); margin-top: 16px; font-size: 1.05rem; }
.light .eyebrow, .light-alt .eyebrow { color: var(--gray-500); }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--black); }
.grid4 > div { padding: 30px 26px 0 0; }
.grid4 > div + div { padding-left: 26px; border-left: 1px solid var(--gray-200); }
.grid4 .num { font-family: var(--display); font-size: 3rem; line-height: 1; color: var(--accent); margin-bottom: 16px; }
.grid4 h3 { font-size: 1.35rem; letter-spacing: .04em; color: var(--black); margin-bottom: 8px; }
.grid4 p { color: var(--gray-500); font-size: .95rem; }
.cta { margin-top: 96px; background: var(--black); color: var(--white); padding: 64px; display: flex; align-items: center; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.cta h2 { font-size: clamp(1.8rem, 3.6vw, 2.8rem); max-width: 640px; }

/* Contacto */
.contact-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 64px; }
.contact-info h2 { font-size: clamp(2.2rem, 5vw, 3.8rem); color: var(--black); margin-top: 14px; }
.contact-info p { color: var(--gray-500); margin-top: 16px; }
.contact-list { list-style: none; margin-top: 36px; display: grid; gap: 22px; }
.contact-list li { display: flex; gap: 16px; align-items: flex-start; }
.contact-list .ic { width: 44px; height: 44px; flex: none; background: var(--black); color: var(--white); display: grid; place-items: center; }
.contact-list .ic svg { width: 18px; height: 18px; }
.contact-list b { display: block; font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; color: var(--black); }
.contact-list span, .contact-list a { color: var(--gray-500); font-size: .98rem; }
form { background: var(--white); border: 1px solid var(--gray-200); padding: 40px; display: grid; gap: 20px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
label { display: grid; gap: 8px; font-size: .72rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--black); }
input, textarea, select {
  font: inherit; font-weight: 400; font-size: .98rem; letter-spacing: normal; text-transform: none;
  padding: 13px 14px; border-radius: var(--radius); border: 1px solid var(--gray-200);
  background: var(--gray-100); color: var(--ink); width: 100%; transition: border-color .2s, background .2s;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--black); background: var(--white); }
textarea { min-height: 130px; resize: vertical; }
form .btn { justify-self: start; }
.form-note { font-size: .82rem; color: var(--gray-500); }
.form-note.error { color: #b3261e; }

/* Pie */
footer { background: var(--black); color: rgba(255,255,255,.55); padding: 72px 0 32px; font-size: .92rem; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; padding-bottom: 44px; border-bottom: 1px solid rgba(255,255,255,.1); }
footer .brand { margin-bottom: 20px; }
footer h4 { color: var(--white); font-family: var(--display); font-weight: 500; font-size: .95rem; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 16px; }
footer ul { list-style: none; display: grid; gap: 10px; }
footer a:hover { color: var(--white); }
.footer-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding-top: 28px; font-size: .8rem; }

/* Entrada al hacer scroll */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .8s ease, transform .8s ease; }
.reveal.visible { opacity: 1; transform: none; }

/* Sin 3D (navegador sin WebGL o sin conexión al CDN): contenido normal */
.no3d #stage, .no3d .hud { display: none; }
.no3d #instalacion { height: auto; margin-top: 0; }
.no3d .ins-sticky { position: static; height: auto; overflow: visible; padding: 56px 0; }
.no3d .ins-sticky .container { height: auto; display: grid; gap: 40px; }
.no3d .cap { position: static; opacity: 1; transform: none; max-width: 640px; }
.no3d .facts { position: static; opacity: 1; }
.no3d .fact-stack { height: auto; display: grid; gap: 28px; }
.no3d .fact { position: static; opacity: 1; transform: none; }
.no3d .fact-dots { display: none; }
.no3d .facts .specs { margin-top: 28px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .marquee-track, .scroll-cue span::after { animation: none; }
  .ready .hero h1 .line > span { transition: none; }
}

@media (max-width: 960px) {
  .grid4 { grid-template-columns: repeat(2, 1fr); }
  .grid4 > div:nth-child(3) { padding-left: 0; border-left: 0; }
  .grid4 > div:nth-child(n+3) { margin-top: 32px; }
  .contact-grid { grid-template-columns: 1fr; gap: 48px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 820px) {
  .menu-toggle { display: block; }
  .nav-links {
    position: fixed; top: 76px; left: 0; right: 0; flex-direction: column; gap: 0;
    background: var(--black); padding: 8px 24px 24px; align-items: stretch; border-bottom: 1px solid rgba(255,255,255,.1);
    transform: translateY(-12px); opacity: 0; pointer-events: none; transition: .25s ease;
  }
  .nav-links.open { transform: none; opacity: 1; pointer-events: auto; }
  .nav-links li a { display: block; padding: 16px 0; border-bottom: 1px solid rgba(255,255,255,.08); }
  .nav-links li:last-child a { display: flex; border: 0; margin-top: 16px; }
  header.menu-open { background: var(--black); }
  .menu-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .menu-toggle.open span:nth-child(2) { opacity: 0; }
  .menu-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .hero { align-items: flex-end; }
  .hero-inner { padding-bottom: 96px; }
  .cap { left: 16px; right: 16px; bottom: 26px; max-width: none; }
  .cap h2 { font-size: 2.1rem; }
  .cap p { font-size: .94rem; }
  .hud { right: 16px; top: 88px; width: 136px; font-size: .58rem; }
  .facts { align-items: flex-end; padding-bottom: 28px; }
  .fact-stack { height: 158px; margin-top: 12px; }
  .fact h2 { font-size: 2.3rem; margin-bottom: 10px; }
  .fact p { font-size: .95rem; }
  .fact-dots { margin-bottom: 14px; }
  .hud strong { font-size: 2rem; }
  .specs b { font-size: 1.2rem; }
  .specs div { padding-right: 14px; }
  .specs div + div { padding-left: 14px; }
}
@media (max-width: 640px) {
  .container { padding: 0 16px; }
  .section { padding: 76px 0; }
  .grid4, .row, .footer-grid, .compare { grid-template-columns: 1fr; }
  .compare article { padding: 32px 20px; }
  .grid4 > div, .grid4 > div + div { padding: 24px 0 0; border-left: 0; margin-top: 0; }
  .grid4 > div + div { margin-top: 24px; border-top: 1px solid var(--gray-200); }
  .cta { padding: 36px 24px; margin-top: 64px; }
  form { padding: 28px 18px; }
}
