:root {
  --bg-black: #000000;
  --bg-graphite: #2b2929;
  --accent: #ed1b34;
  --accent-dim: rgba(237, 27, 52, 0.35);
  --steel: #9a9d9e;
  --steel-dim: #5c5f60;
  --panel: #141313;
  --panel-2: #1c1b1b;
  --line: rgba(255, 255, 255, 0.09);
  --text: #eeeeec;
  --text-dim: #9b9b97;
  --led: #3ddc84;
  --display: "Barlow Condensed", sans-serif;
  --body: "IBM Plex Sans", sans-serif;
  --mono: "IBM Plex Mono", monospace;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background: linear-gradient(
    180deg,
    var(--bg-black) 0%,
    var(--bg-graphite) 100%
  );
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--body);
  overflow-x: hidden;
  position: relative;
}

/* ambient blueprint grid */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  opacity: 0.35;
  pointer-events: none;
  z-index: 0;
  mask-image: radial-gradient(
    ellipse 90% 70% at 50% 0%,
    black 40%,
    transparent 100%
  );
}

::selection {
  background: var(--accent);
  color: #fff;
}

a {
  color: inherit;
  text-decoration: none;
}

.wrap {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 32px;
  position: relative;
  z-index: 2;
}

/* ---------- NAV ---------- */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  backdrop-filter: blur(10px);
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0));
  border-bottom: 1px solid transparent;
  transition:
    border-color 0.3s ease,
    background 0.3s ease;
}
header.scrolled {
  border-bottom: 1px solid var(--line);
  background: rgba(10, 10, 10, 0.85);
}
nav {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 32px;
  max-width: 1240px;
  margin: 0 auto;
}
.nav-menu {
  display: flex;
  align-items: center;
  gap: 36px;
}
.logo {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo img {
  height: 34px;
  width: auto;
  display: block;
}
.logo .dot {
  width: 9px;
  height: 9px;
  background: var(--accent);
  border-radius: 1px;
  box-shadow: 0 0 10px var(--accent);
  animation: blink 2.4s infinite;
}
@keyframes blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.25;
  }
}
nav ul {
  list-style: none;
  display: flex;
  gap: 36px;
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
}
nav ul a {
  position: relative;
  padding-bottom: 4px;
  transition: color 0.25s;
}
nav ul a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 1px;
  width: 0;
  background: var(--accent);
  transition: width 0.25s ease;
}
nav ul a:hover {
  color: var(--text);
}
nav ul a:hover::after {
  width: 100%;
}
.nav-cta {
  font-family: var(--mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border: 1px solid var(--steel-dim);
  padding: 9px 18px;
  color: var(--text);
  transition: all 0.25s ease;
}
.nav-cta:hover {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 18px var(--accent-dim);
}
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px;
  height: 32px;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text);
  transition:
    transform 0.3s ease,
    opacity 0.3s ease;
}
.nav-toggle.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle.active span:nth-child(2) {
  opacity: 0;
}
.nav-toggle.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ---------- HERO ---------- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  padding-top: 110px;
}
.hero .wrap {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 40px;
  align-items: center;
  width: 100%;
}
.eyebrow {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
  opacity: 0;
  transform: translateY(10px);
  animation: rise 0.7s ease forwards 0.1s;
}
.eyebrow::before {
  content: "";
  width: 26px;
  height: 1px;
  background: var(--accent);
}
h1 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2.6rem, 5.4vw, 4.6rem);
  line-height: 1.02;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(16px);
  animation: rise 0.8s ease forwards 0.25s;
}
h1 span {
  color: var(--accent);
}
.hero p.lead {
  font-family: var(--body);
  font-weight: 300;
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--text-dim);
  max-width: 480px;
  margin-top: 22px;
  opacity: 0;
  transform: translateY(16px);
  animation: rise 0.8s ease forwards 0.4s;
}
.hero-cta {
  display: flex;
  gap: 16px;
  margin-top: 36px;
  flex-wrap: wrap;
  opacity: 0;
  transform: translateY(16px);
  animation: rise 0.8s ease forwards 0.55s;
}
@keyframes rise {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.btn {
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 15px 26px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: all 0.25s ease;
  cursor: pointer;
  border: none;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 30px -8px var(--accent-dim);
}
.btn-primary:hover {
  background: #ff2b45;
  transform: translateY(-2px);
  box-shadow: 0 12px 34px -6px var(--accent-dim);
}
.btn-ghost {
  border: 1px solid var(--steel-dim);
  color: var(--text);
}
.btn-ghost:hover {
  border-color: var(--text);
}

.hero-stats {
  display: flex;
  gap: 34px;
  margin-top: 56px;
  flex-wrap: wrap;
  opacity: 0;
  transform: translateY(16px);
  animation: rise 0.8s ease forwards 0.7s;
}
.stat b {
  display: block;
  font-family: var(--display);
  font-size: 2rem;
  color: var(--text);
}
.stat span {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.hero-canvas-wrap {
  position: relative;
  height: 520px;
  border: 1px solid var(--line);
  background:
    radial-gradient(
      ellipse at 50% 30%,
      rgba(237, 27, 52, 0.06),
      transparent 60%
    ),
    var(--panel);
}
.hero-canvas-wrap::before {
  content: "CAB-01 / ENSAMBLE EN TIEMPO REAL";
  position: absolute;
  top: 14px;
  left: 16px;
  z-index: 3;
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  color: var(--text-dim);
}
.hero-canvas-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.55);
}
#cabinet-canvas {
  width: 100%;
  height: 100%;
  display: block;
}
.canvas-corner {
  position: absolute;
  width: 14px;
  height: 14px;
  border-color: var(--steel-dim);
  z-index: 3;
}
.canvas-corner.tl {
  top: -1px;
  left: -1px;
  border-top: 1px solid var(--accent);
  border-left: 1px solid var(--accent);
}
.canvas-corner.br {
  bottom: -1px;
  right: -1px;
  border-bottom: 1px solid var(--accent);
  border-right: 1px solid var(--accent);
}
.scan-status {
  position: absolute;
  bottom: 14px;
  right: 16px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 0.65rem;
  color: var(--led);
  letter-spacing: 0.06em;
}
.scan-status .led {
  width: 6px;
  height: 6px;
  background: var(--led);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--led);
  animation: blink 1.6s infinite;
}

/* ---------- SOFTWARE SERVICE PANEL (hero, software.html) ---------- */
.sw-panel {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  padding: 46px 28px 28px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
}
.sw-panel-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--mono);
  font-size: 0.9rem;
  letter-spacing: 0.03em;
  color: var(--text);
  opacity: 0;
  transform: translateX(-10px);
  animation: rise 0.6s ease forwards;
}
.sw-panel-row:nth-child(1) { animation-delay: 0.15s; }
.sw-panel-row:nth-child(2) { animation-delay: 0.28s; }
.sw-panel-row:nth-child(3) { animation-delay: 0.41s; }
.sw-panel-row:nth-child(4) { animation-delay: 0.54s; }
.sw-panel-row:nth-child(5) { animation-delay: 0.67s; }
.sw-panel-row:nth-child(6) { animation-delay: 0.8s; }
.sw-panel-row:nth-child(7) { animation-delay: 0.93s; }
.sw-panel-etc {
  color: var(--text-dim);
  font-style: italic;
}
.sw-dot {
  width: 7px;
  height: 7px;
  border-radius: 1px;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-dim);
  flex-shrink: 0;
}

/* ---------- marquee ---------- */
.marquee {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  white-space: nowrap;
  padding: 16px 0;
  position: relative;
  z-index: 2;
  background: rgba(0, 0, 0, 0.2);
}
.marquee-track {
  display: inline-flex;
  gap: 60px;
  animation: scroll-left 32s linear infinite;
}
.marquee-track span {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 60px;
}
.marquee-track span em {
  color: var(--accent);
  font-style: normal;
  margin-right: 60px;
}
@keyframes scroll-left {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

/* ---------- SECTION shared ---------- */
section {
  padding: 130px 0;
  position: relative;
  z-index: 2;
}
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 40px;
  margin-bottom: 70px;
  flex-wrap: wrap;
}
.section-head .tag {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--accent);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 14px;
  display: block;
}
.section-head h2 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2rem, 3.6vw, 3rem);
  text-transform: uppercase;
  letter-spacing: -0.01em;
  max-width: 640px;
}
.section-head p {
  font-family: var(--body);
  font-weight: 300;
  color: var(--text-dim);
  max-width: 340px;
  font-size: 0.95rem;
  line-height: 1.6;
}

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 0.7s ease,
    transform 0.7s ease;
}
.reveal.in {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- CAPACIDADES ---------- */
.rack {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.015);
}
.rack-row {
  display: grid;
  grid-template-columns: 90px 1fr 240px;
  gap: 24px;
  align-items: center;
  padding: 28px 30px;
  border-bottom: 1px solid var(--line);
  transition: background 0.25s ease;
  position: relative;
}
.rack-row:last-child {
  border-bottom: none;
}
.rack-row:hover {
  background: rgba(237, 27, 52, 0.045);
}
.rack-row:hover .toggle i {
  background: var(--led);
  box-shadow: 0 0 10px var(--led);
}
.rack-id {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--steel-dim);
}
.rack-body h3 {
  font-family: var(--display);
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  margin-bottom: 8px;
  text-transform: uppercase;
}
.rack-body p {
  color: var(--text-dim);
  font-size: 0.9rem;
  font-weight: 300;
  line-height: 1.6;
  max-width: 520px;
}
.toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-self: end;
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--steel-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.toggle i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--steel-dim);
  display: inline-block;
  transition: all 0.3s ease;
}

/* ---------- PROCESO ---------- */
.process {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.process.process-4 {
  grid-template-columns: repeat(4, 1fr);
}
.proc-step {
  background: var(--panel);
  padding: 34px 22px;
  position: relative;
  min-height: 230px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.proc-num {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--accent);
  letter-spacing: 0.08em;
}
.proc-step h4 {
  font-family: var(--display);
  font-size: 1.35rem;
  text-transform: uppercase;
  margin: 14px 0 10px;
  font-weight: 600;
}
.proc-step p {
  font-size: 0.82rem;
  color: var(--text-dim);
  font-weight: 300;
  line-height: 1.55;
}
.proc-bar {
  height: 2px;
  background: var(--steel-dim);
  margin-top: 18px;
  position: relative;
  overflow: hidden;
}
.proc-bar i {
  position: absolute;
  inset: 0;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.8s ease;
}
.proc-step.in .proc-bar i {
  transform: scaleX(1);
}

/* ---------- PROYECTOS ---------- */
.projects {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.project-card {
  background: var(--panel);
  padding: 38px;
  min-height: 290px;
  position: relative;
  overflow: hidden;
  transition: background 0.3s ease;
}
.project-card:hover {
  background: var(--panel-2);
}
.project-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.5s ease;
}
.project-card:hover::before {
  transform: scaleX(1);
}
.p-tag {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  text-transform: uppercase;
  display: flex;
  justify-content: space-between;
}
.p-tag em {
  color: var(--led);
  font-style: normal;
}
.project-card h3 {
  font-family: var(--display);
  font-size: 1.9rem;
  font-weight: 600;
  text-transform: uppercase;
  margin: 26px 0 14px;
}
.project-card p {
  color: var(--text-dim);
  font-weight: 300;
  font-size: 0.9rem;
  line-height: 1.65;
  max-width: 420px;
}
.p-specs {
  display: flex;
  gap: 26px;
  margin-top: 24px;
  flex-wrap: wrap;
}
.p-specs div {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--steel-dim);
}
.p-specs div b {
  display: block;
  color: var(--text);
  font-size: 0.85rem;
  font-family: var(--body);
  font-weight: 500;
}

/* ---------- PARTNERS ---------- */
.partners-line {
  border: 1px solid var(--line);
  padding: 44px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  flex-wrap: wrap;
  background: rgba(255, 255, 255, 0.015);
}
.partners-line p {
  max-width: 520px;
  color: var(--text-dim);
  font-size: 0.92rem;
  font-weight: 300;
  line-height: 1.7;
}
.partners-list {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}
.partners-list span {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--steel);
  border: 1px solid var(--steel-dim);
  padding: 9px 16px;
}

/* ---------- CTA ---------- */
.cta-section {
  text-align: center;
  padding: 150px 0;
  position: relative;
  background: radial-gradient(
    ellipse 60% 100% at 50% 100%,
    rgba(237, 27, 52, 0.08),
    transparent 70%
  );
}
.cta-section h2 {
  font-family: var(--display);
  font-size: clamp(2.2rem, 5vw, 4rem);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: -0.01em;
  max-width: 820px;
  margin: 0 auto 26px;
}
.cta-section p {
  color: var(--text-dim);
  font-weight: 300;
  max-width: 460px;
  margin: 0 auto 40px;
  font-size: 0.98rem;
}

/* ---------- FOOTER ---------- */
footer {
  border-top: 1px solid var(--line);
  padding: 60px 0 36px;
  position: relative;
  z-index: 2;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 60px;
}
.footer-grid h5 {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 18px;
}
.footer-grid ul {
  list-style: none;
}
.footer-grid li {
  margin-bottom: 11px;
  font-size: 0.88rem;
  color: var(--text-dim);
  font-weight: 300;
}
.footer-grid li a:hover {
  color: var(--accent);
}
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 30px;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
  gap: 14px;
}
.footer-bottom p {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--steel-dim);
  letter-spacing: 0.04em;
}

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .nav-toggle {
    display: flex;
  }
  .nav-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 22px;
    background: rgba(10, 10, 10, 0.97);
    border-bottom: 1px solid var(--line);
    padding: 22px 32px 28px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-8px);
    transition:
      opacity 0.25s ease,
      transform 0.25s ease,
      visibility 0s linear 0.25s;
  }
  .nav-menu.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
    transition:
      opacity 0.25s ease,
      transform 0.25s ease,
      visibility 0s linear 0s;
  }
  nav ul {
    flex-direction: column;
    gap: 20px;
  }
  .hero .wrap {
    grid-template-columns: 1fr;
  }
  .hero-canvas-wrap {
    height: 380px;
    order: -1;
  }
  .process,
  .process.process-4 {
    grid-template-columns: repeat(2, 1fr);
  }
  .projects {
    grid-template-columns: 1fr;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
  .rack-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .toggle {
    justify-self: start;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
