/* ============ TOKENS ============ */
:root {
  --brand-navy: #000034;
  --brand-purple: #6534ff;
  --brand-red: #ff3738;
  --brand-blue: #0144ff;
  --brand-orange: #ff9226;
  --brand-green: #17cc4a;
  --brand-paper: #f1ecf4;

  --grad-primary: linear-gradient(120deg, #ff3738 0%, #ff3a8a 30%, #6534ff 70%, #0144ff 100%);
  --grad-logo: linear-gradient(135deg, #ff3738 0%, #b53cc6 50%, #6534ff 100%);
  --radius-lg: 22px;
  --radius-md: 14px;
  --radius-sm: 8px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* ============ DARK (default) ============ */
html[data-theme="dark"] {
  --bg: #000020;
  --bg-2: #000034;
  --surface: #0a0f4a;
  --surface-2: #11185a;
  --line: rgba(241, 236, 244, 0.10);
  --line-strong: rgba(241, 236, 244, 0.18);
  --text: #f1ecf4;
  --text-soft: rgba(241, 236, 244, 0.72);
  --text-muted: rgba(241, 236, 244, 0.52);
  --grid: rgba(101, 52, 255, 0.10);
  --glow: rgba(101, 52, 255, 0.35);
  --btn-text-on-grad: #ffffff;
  --nav-bg: rgba(0, 0, 32, 0.72);
}

/* ============ LIGHT ============ */
html[data-theme="light"] {
  --bg: #f1ecf4;
  --bg-2: #ffffff;
  --surface: #ffffff;
  --surface-2: #f7f3fa;
  --line: rgba(0, 0, 52, 0.10);
  --line-strong: rgba(0, 0, 52, 0.18);
  --text: #000034;
  --text-soft: rgba(0, 0, 52, 0.74);
  --text-muted: rgba(0, 0, 52, 0.54);
  --grid: rgba(101, 52, 255, 0.07);
  --glow: rgba(101, 52, 255, 0.22);
  --btn-text-on-grad: #ffffff;
  --nav-bg: rgba(241, 236, 244, 0.78);
}

/* ============ BASE ============ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'DM Sans', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background 0.4s var(--ease), color 0.4s var(--ease);
  overflow-x: hidden;
}
h1, h2, h3, h4 {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin: 0;
}
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
.mono { font-family: 'JetBrains Mono', monospace; }

.container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 28px;
}

/* ============ NAV ============ */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  background: var(--nav-bg);
  border-bottom: 1px solid var(--line);
  transition: background 0.4s var(--ease), border-color 0.4s var(--ease);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  gap: 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  line-height: 0;
}
.brand-logo {
  height: 30px;
  width: auto;
  display: block;
  transition: filter 0.35s var(--ease);
}
/* Horizontal logo is dark-navy on white — invert on dark theme so it reads */
html[data-theme="dark"] .brand-logo--full,
html[data-theme="dark"] .brand-logo.footer {
  filter: invert(1) hue-rotate(180deg) brightness(1.15);
}
/* Mark logo is full-color, never invert */
.brand-logo--mark { display: none; height: 38px; }
.brand-logo.footer { height: 44px; }
.brand-logo--mark.footer { display: block; height: 48px; }
.nav-links {
  display: flex;
  gap: 32px;
  align-items: center;
}
.nav-links a {
  font-size: 14.5px;
  color: var(--text-soft);
  font-weight: 500;
  transition: color 0.2s var(--ease);
  position: relative;
}
.nav-links a:hover { color: var(--text); }
.nav-tools {
  display: flex;
  align-items: center;
  gap: 12px;
}
.icon-btn {
  width: 38px; height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid var(--line);
  color: var(--text-soft);
  transition: all 0.2s var(--ease);
}
.icon-btn:hover { color: var(--text); border-color: var(--line-strong); background: var(--surface); }
.lang-toggle {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid var(--line);
  padding: 3px;
  font-size: 12px;
  font-weight: 600;
  background: var(--surface);
}
.lang-toggle button {
  padding: 5px 10px;
  border-radius: 999px;
  color: var(--text-muted);
  transition: all 0.25s var(--ease);
  letter-spacing: 0.05em;
}
.lang-toggle button.active {
  background: var(--text);
  color: var(--bg);
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 14.5px;
  transition: transform 0.2s var(--ease), box-shadow 0.25s var(--ease), background 0.25s var(--ease);
  white-space: nowrap;
}
.btn-primary {
  color: var(--btn-text-on-grad);
  background: var(--grad-primary);
  background-size: 180% 180%;
  background-position: 0% 50%;
  box-shadow: 0 8px 28px -8px rgba(101, 52, 255, 0.55), 0 0 0 1px rgba(255,255,255,0.06) inset;
}
.btn-primary:hover { background-position: 100% 50%; transform: translateY(-1px); }
.btn-ghost {
  border: 1px solid var(--line-strong);
  color: var(--text);
  background: transparent;
}
.btn-ghost:hover { background: var(--surface); }
.btn-lg { padding: 15px 24px; font-size: 15.5px; border-radius: 14px; }

.nav-burger {
  display: none;
  color: var(--text);
  border-color: var(--line-strong);
}

/* ============ MOBILE MENU DRAWER ============ */
.mobile-menu {
  position: fixed;
  top: 72px;
  left: 0;
  right: 0;
  width: 100%;
  height: calc(100vh - 72px);
  height: calc(100dvh - 72px);
  background: var(--bg);
  border-top: 1px solid var(--line);
  padding: 24px 28px 32px;
  display: none;
  flex-direction: column;
  gap: 4px;
  z-index: 60;
  overflow-y: auto;
}
.mobile-menu a {
  padding: 14px 4px;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  border-bottom: 1px solid var(--line);
}
.mobile-menu a:last-child { border-bottom: none; }
.mobile-menu .mobile-cta {
  margin-top: 18px;
  justify-content: center;
  text-align: center;
}
html.menu-open { overflow: hidden; }
html.menu-open .mobile-menu { display: flex; }

/* ============ HERO ============ */
.hero {
  position: relative;
  padding: 156px 0 100px;
  overflow: hidden;
  isolation: isolate;
}
.hero-grid-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, var(--grid) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, #000 30%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, #000 30%, transparent 100%);
  z-index: -2;
  animation: gridDrift 28s linear infinite;
  will-change: background-position;
}
.hero-grid-bg::after {
  content: '';
  position: absolute;
  top: 10%;
  left: 0;
  width: 360px;
  height: 360px;
  margin-left: -180px;
  border-radius: 50%;
  background: radial-gradient(circle,
    rgba(101, 52, 255, 0.32) 0%,
    rgba(255, 55, 56, 0.14) 40%,
    transparent 70%);
  filter: blur(10px);
  animation: gridScan 14s ease-in-out infinite;
  pointer-events: none;
  will-change: transform, opacity;
}
html[data-theme="light"] .hero-grid-bg::after { opacity: 0.6; }

@keyframes gridDrift {
  from { background-position: 0 0, 0 0; }
  to   { background-position: 56px 56px, 56px 56px; }
}
@keyframes gridScan {
  0%   { transform: translate(15vw, 0); opacity: 0; }
  15%  { opacity: 1; }
  50%  { transform: translate(85vw, 8%); opacity: 1; }
  85%  { opacity: 1; }
  100% { transform: translate(15vw, 0); opacity: 0; }
}

/* En mobile: orbe más chico + recorrido más corto para que se vea contenido */
@media (max-width: 760px) {
  .hero-grid-bg::after {
    width: 240px;
    height: 240px;
    margin-left: -120px;
    filter: blur(8px);
  }
  @keyframes gridScan {
    0%   { transform: translate(20vw, 0); opacity: 0; }
    15%  { opacity: 1; }
    50%  { transform: translate(80vw, 5%); opacity: 1; }
    85%  { opacity: 1; }
    100% { transform: translate(20vw, 0); opacity: 0; }
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-grid-bg, .hero-grid-bg::after { animation: none; }
}
.hero-glow {
  position: absolute;
  z-index: -1;
  width: 720px; height: 720px;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.55;
  pointer-events: none;
}
.hero-glow.a { top: -260px; left: -160px; background: radial-gradient(circle, #6534ff 0%, transparent 60%); }
.hero-glow.b { top: -200px; right: -200px; background: radial-gradient(circle, #ff3738 0%, transparent 60%); opacity: 0.4; }
html[data-theme="light"] .hero-glow.a { opacity: 0.2; }
html[data-theme="light"] .hero-glow.b { opacity: 0.15; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px 7px 8px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  font-size: 13px;
  color: var(--text-soft);
  font-weight: 500;
}
.pill-dot {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--brand-green);
  display: inline-grid;
  place-items: center;
  box-shadow: 0 0 0 4px rgba(23, 204, 74, 0.18);
}
.pill-dot::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #00270c;
}

.hero h1 {
  font-size: clamp(48px, 7vw, 92px);
  margin-top: 28px;
  max-width: 14ch;
}
.grad-text {
  background: var(--grad-primary);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-sub {
  margin-top: 26px;
  max-width: 56ch;
  color: var(--text-soft);
  font-size: clamp(17px, 1.6vw, 20px);
  line-height: 1.55;
}
.hero-cta {
  margin-top: 36px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.hero-stats {
  margin-top: 84px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.stat {
  padding: 30px 4px;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.stat:last-child { border-right: none; }
.stat-num {
  font-family: 'Syne', sans-serif;
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  display: flex;
  align-items: baseline;
  gap: 2px;
}
.stat-suffix {
  font-size: 0.5em;
  color: var(--brand-purple);
  background: var(--grad-primary);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.stat-label {
  color: var(--text-muted);
  font-size: 13.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 500;
}

/* ============ SECTION HEADER ============ */
section { padding: 120px 0; position: relative; }
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 40px;
  margin-bottom: 64px;
  flex-wrap: wrap;
}
.eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--brand-purple);
  margin-bottom: 16px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: '';
  width: 22px; height: 1.5px;
  background: var(--brand-purple);
}
.section-head h2 {
  font-size: clamp(38px, 5vw, 60px);
  max-width: 18ch;
}
.section-head p {
  color: var(--text-soft);
  max-width: 38ch;
  font-size: 16.5px;
}

/* ============ SERVICES GRID ============ */
.services {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  background: var(--line-strong);
  gap: 1.5px;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.service-card {
  background: var(--bg);
  padding: 40px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  transition: background 0.3s var(--ease);
  position: relative;
}
.service-card:hover { background: var(--surface); }
.service-icon {
  width: 56px; height: 56px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: white;
  flex-shrink: 0;
}
.service-icon.purple { background: linear-gradient(135deg, #6534ff, #b53cc6); box-shadow: 0 10px 30px -10px rgba(101,52,255,0.6); }
.service-icon.red    { background: linear-gradient(135deg, #ff3738, #ff6b6b); box-shadow: 0 10px 30px -10px rgba(255,55,56,0.55); }
.service-icon.blue   { background: linear-gradient(135deg, #0144ff, #4a8fff); box-shadow: 0 10px 30px -10px rgba(1,68,255,0.55); }
.service-icon.orange { background: linear-gradient(135deg, #ff9226, #ffb866); box-shadow: 0 10px 30px -10px rgba(255,146,38,0.55); }
.service-num {
  position: absolute;
  top: 28px;
  right: 32px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.1em;
}
.service-card h3 {
  font-size: 26px;
  line-height: 1.15;
}
.service-card .desc {
  color: var(--text-soft);
  font-size: 15px;
  line-height: 1.6;
}
.service-list {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.service-list li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  color: var(--text-soft);
  font-size: 14.5px;
}
.service-list li::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--brand-green);
  margin-top: 8px;
  flex-shrink: 0;
}
.service-card .learn {
  margin-top: auto;
  padding-top: 16px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
}
.service-card .learn .arrow { transition: transform 0.25s var(--ease); }
.service-card:hover .learn .arrow { transform: translateX(4px); }

/* ============ TECH STACK ============ */
.tech-group { margin-bottom: 48px; }
.tech-group:last-child { margin-bottom: 0; }
.tech-cat {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 20px;
  font-weight: 500;
}
.tech-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
}
.tech-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 22px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 110px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.25s var(--ease), transform 0.25s var(--ease), background 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.tech-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 0%, rgba(101, 52, 255, 0.18), transparent 70%);
  opacity: 0;
  transition: opacity 0.3s var(--ease);
  pointer-events: none;
}
.tech-card:hover {
  border-color: var(--brand-purple);
  transform: translateY(-3px);
  box-shadow: 0 12px 30px -16px rgba(101, 52, 255, 0.55);
}
.tech-card:hover::before { opacity: 1; }
.tech-card img {
  width: 38px;
  height: 38px;
  object-fit: contain;
  border-radius: 8px;
  position: relative;
}
.tech-card span {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-soft);
  text-align: center;
  letter-spacing: 0.01em;
  position: relative;
}
.tech-card.brand-only span {
  font-family: 'Syne', sans-serif;
  font-size: 17px;
  font-weight: 700;
  background: var(--grad-primary);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: -0.01em;
}

@media (max-width: 980px) {
  .tech-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 580px) {
  .tech-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .tech-card { padding: 16px 10px; min-height: 92px; }
  .tech-card img { width: 28px; height: 28px; }
  .tech-card span { font-size: 11.5px; }
  .tech-card.brand-only span { font-size: 14.5px; }
}
@media (max-width: 420px) {
  .tech-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ============ ERP SHOWCASE ============ */
#erp { padding-top: 60px; }
.showcase {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 64px;
  align-items: center;
}
.showcase-copy h2 {
  font-size: clamp(38px, 5vw, 58px);
  margin-top: 16px;
}
.showcase-copy p {
  margin-top: 20px;
  color: var(--text-soft);
  font-size: 17px;
  max-width: 44ch;
}
.showcase-feats {
  margin: 32px 0 36px;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px 24px;
}
.showcase-feats li {
  display: flex; align-items: center; gap: 10px;
  color: var(--text-soft);
  font-size: 14.5px;
}
.check {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: rgba(23, 204, 74, 0.15);
  color: var(--brand-green);
  display: grid; place-items: center;
  flex-shrink: 0;
}

/* macOS-style window dashboard */
.window {
  background: var(--bg-2);
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  overflow: hidden;
  box-shadow:
    0 30px 70px -30px rgba(0,0,0,0.6),
    0 0 0 1px rgba(255,255,255,0.02) inset;
  font-size: 12px;
  position: relative;
}
html[data-theme="light"] .window {
  box-shadow:
    0 30px 70px -30px rgba(0, 0, 52, 0.25),
    0 0 0 1px rgba(0,0,52,0.04) inset;
}
.window-bar {
  height: 36px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  padding: 0 14px;
  gap: 8px;
}
.traffic { display: flex; gap: 7px; }
.traffic span {
  width: 12px; height: 12px;
  border-radius: 50%;
}
.traffic span:nth-child(1) { background: #ff5f57; }
.traffic span:nth-child(2) { background: #febc2e; }
.traffic span:nth-child(3) { background: #28c840; }
.url-bar {
  flex: 1;
  text-align: center;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.04em;
}
.dash {
  display: grid;
  grid-template-columns: 160px 1fr;
  min-height: 460px;
}
.dash-side {
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 18px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.dash-brand {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px 18px;
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 14px;
}
.dash-brand .mini-mark { width: 20px; height: 20px; }
.dash-nav {
  display: flex; flex-direction: column; gap: 2px;
  list-style: none; margin: 0; padding: 0;
}
.dash-nav li {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px;
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 500;
}
.dash-nav li svg { opacity: 0.7; }
.dash-nav li.active {
  background: linear-gradient(90deg, rgba(101,52,255,0.18), rgba(255,55,56,0.10));
  color: var(--text);
}
.dash-nav li.active svg { color: var(--brand-purple); opacity: 1; }
.dash-main {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: hidden;
}
.dash-top {
  display: flex; justify-content: space-between; align-items: center;
}
.dash-top h4 { font-family: 'Syne', sans-serif; font-size: 16px; }
.dash-search {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 5px 10px;
  color: var(--text-muted);
  font-size: 11px;
  display: flex; align-items: center; gap: 6px;
}
.kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.kpi {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  display: flex; flex-direction: column; gap: 4px;
}
.kpi-label { font-size: 10.5px; color: var(--text-muted); letter-spacing: 0.06em; text-transform: uppercase; }
.kpi-val { font-family: 'Syne', sans-serif; font-weight: 700; font-size: 18px; letter-spacing: -0.02em; }
.kpi-delta { font-size: 10.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 3px; }
.kpi-delta.up { color: var(--brand-green); }
.kpi-delta.down { color: var(--brand-red); }

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  display: flex; flex-direction: column; gap: 10px;
}
.panel-head {
  display: flex; justify-content: space-between; align-items: center;
}
.panel-head h5 { font-family: 'Syne', sans-serif; font-size: 13px; margin: 0; }
.panel-head .tag { font-size: 10px; color: var(--text-muted); }
.bars { display: flex; flex-direction: column; gap: 8px; }
.bar-row { display: grid; grid-template-columns: 80px 1fr 36px; align-items: center; gap: 10px; font-size: 11px; }
.bar-row .lbl { color: var(--text-soft); }
.bar-row .val { color: var(--text); font-family: 'JetBrains Mono', monospace; text-align: right; font-size: 10.5px; }
.bar-track {
  height: 6px;
  background: var(--bg);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}
.bar-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--grad-primary);
  transform-origin: left;
  animation: barIn 1.4s var(--ease) forwards;
  transform: scaleX(0);
}
.bar-fill.green { background: linear-gradient(90deg, #17cc4a, #4ae68a); }
.bar-fill.orange { background: linear-gradient(90deg, #ff9226, #ffc06b); }
.bar-fill.blue { background: linear-gradient(90deg, #0144ff, #4a8fff); }
.bar-fill.red { background: linear-gradient(90deg, #ff3738, #ff6b6b); }
@keyframes barIn { to { transform: scaleX(1); } }

.ai-alert {
  background: linear-gradient(135deg, rgba(101,52,255,0.16), rgba(255,55,56,0.10));
  border: 1px solid rgba(101,52,255,0.35);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex; gap: 12px;
  align-items: flex-start;
  position: relative;
  overflow: hidden;
}
.ai-alert::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.06), transparent);
  transform: translateX(-100%);
  animation: shimmer 3.5s var(--ease) infinite;
}
@keyframes shimmer { 50%, 100% { transform: translateX(100%); } }
.ai-icon {
  width: 28px; height: 28px;
  border-radius: 8px;
  background: var(--grad-logo);
  display: grid; place-items: center;
  color: #fff;
  flex-shrink: 0;
}
.ai-alert-body { display: flex; flex-direction: column; gap: 2px; }
.ai-alert h6 {
  margin: 0; font-family: 'Syne', sans-serif; font-size: 12.5px;
  display: flex; align-items: center; gap: 8px;
}
.ai-alert h6 .badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px; padding: 2px 6px;
  border-radius: 4px;
  background: rgba(101,52,255,0.25);
  color: var(--brand-purple);
  letter-spacing: 0.06em;
}
html[data-theme="dark"] .ai-alert h6 .badge { color: #c8b8ff; }
.ai-alert p { font-size: 11.5px; color: var(--text-soft); line-height: 1.45; }

/* Floating ERP labels */
.float-label {
  position: absolute;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 12px;
  color: var(--text);
  box-shadow: 0 10px 30px -10px rgba(0,0,0,0.4);
  display: flex; align-items: center; gap: 8px;
  font-weight: 500;
}
.float-label.tl { top: -16px; left: -28px; }
.float-label.br { bottom: -18px; right: -22px; }
.float-label .dot {
  width: 8px; height: 8px; border-radius: 50%;
}

/* ============ WHY US ============ */
.pillars {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.pillar {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 36px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.3s var(--ease), transform 0.3s var(--ease);
}
.pillar:hover { border-color: var(--line-strong); transform: translateY(-4px); }
.pillar-num {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 14px;
  color: var(--brand-purple);
  letter-spacing: 0.04em;
}
.pillar h3 { font-size: 28px; line-height: 1.1; }
.pillar p { color: var(--text-soft); font-size: 15.5px; }
.pillar-glyph {
  position: absolute;
  top: -10px; right: -10px;
  width: 110px; height: 110px;
  opacity: 0.10;
  pointer-events: none;
}

/* ============ CONTACT ============ */
.contact-wrap {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 32px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 48px;
}
.contact-wrap > * { min-width: 0; }
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  min-width: 0;
}
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field label {
  font-size: 12.5px;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 500;
}
.field input, .field select, .field textarea {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 13px 14px;
  color: var(--text);
  font-family: inherit;
  font-size: 14.5px;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
  width: 100%;
}
html[data-theme="light"] .field input,
html[data-theme="light"] .field select,
html[data-theme="light"] .field textarea { background: var(--surface-2); }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--brand-purple);
  box-shadow: 0 0 0 4px rgba(101,52,255,0.15);
}
.field textarea { min-height: 110px; resize: vertical; }
.contact-submit {
  margin-top: 4px;
  align-self: flex-start;
  position: relative;
  overflow: hidden;
}
.contact-form.sending .contact-submit { pointer-events: none; opacity: 0.85; }
.contact-success {
  position: absolute;
  inset: 0;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 14px;
  border-radius: 12px;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.97);
  transition: opacity 0.4s var(--ease), transform 0.5s var(--ease);
}
.contact-form.sent .contact-success { opacity: 1; pointer-events: auto; transform: scale(1); }
.success-mark {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--grad-primary);
  display: grid; place-items: center;
  color: white;
  animation: pop 0.5s var(--ease) both;
}
@keyframes pop { from { transform: scale(0); } 60% { transform: scale(1.15); } to { transform: scale(1); } }
.contact-success h4 { font-size: 24px; }
.contact-success p { color: var(--text-soft); text-align: center; max-width: 32ch; }

.contact-side {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.contact-card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 22px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  min-width: 0;
}
.contact-card > div:not(.ico) { min-width: 0; flex: 1; }
.contact-card .val { overflow-wrap: anywhere; word-break: normal; hyphens: auto; }
html[data-theme="light"] .contact-card { background: var(--surface-2); }
.contact-card .ico {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: grid; place-items: center;
  color: #fff;
  flex-shrink: 0;
}
.contact-card .lbl {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 3px;
}
.contact-card .val { font-weight: 600; font-size: 15px; }
.wa-btn {
  background: linear-gradient(135deg, #17cc4a, #0fa83b);
  color: white;
  padding: 18px 22px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  gap: 14px;
  font-weight: 600;
  box-shadow: 0 16px 40px -16px rgba(23, 204, 74, 0.6);
  transition: transform 0.2s var(--ease);
}
.wa-btn:hover { transform: translateY(-2px); }
.wa-btn .wa-ico { width: 38px; height: 38px; border-radius: 10px; background: rgba(255,255,255,0.18); display: grid; place-items: center; flex-shrink: 0; }
.wa-btn .wa-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.wa-btn .wa-text small { font-weight: 400; opacity: 0.8; font-size: 12px; }

/* ============ FOOTER ============ */
footer {
  border-top: 1px solid var(--line);
  padding: 60px 0 30px;
  margin-top: 60px;
}
.foot-top {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, 1fr);
  gap: 40px;
  margin-bottom: 50px;
}
.foot-top > * { min-width: 0; }
.foot-top ul a { overflow-wrap: anywhere; word-break: break-word; }
.foot-top h5 {
  font-family: 'Syne', sans-serif;
  font-size: 13px;
  margin: 0 0 18px;
  color: var(--text);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.foot-top ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 11px; }
.foot-top ul a { color: var(--text-soft); font-size: 14.5px; }
.foot-top ul a:hover { color: var(--text); }
.foot-tag {
  color: var(--text-soft);
  margin-top: 18px;
  max-width: 32ch;
  font-size: 14.5px;
}
.foot-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  color: var(--text-muted);
  font-size: 13px;
  gap: 20px;
  flex-wrap: wrap;
}
.foot-bottom .mono { letter-spacing: 0.04em; }

/* ============ RESPONSIVE ============ */
/* lg — tablet (incluye iPad landscape): activa menú móvil, colapsa grids */
@media (max-width: 1024px) {
  .nav-links { display: none; }
  .nav-burger { display: inline-flex; }
}
@media (max-width: 980px) {
  .services { grid-template-columns: 1fr; }
  .showcase { grid-template-columns: 1fr; gap: 40px; }
  .pillars { grid-template-columns: repeat(2, 1fr); }
  .contact-wrap { grid-template-columns: 1fr; padding: 30px; }
  .foot-top { grid-template-columns: 1fr 1fr; gap: 32px; }
  .hero { padding: 130px 0 80px; }
  section { padding: 90px 0; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .dash { grid-template-columns: 1fr; min-height: 0; }
  .dash-side { display: none; }
  .float-label.tl { top: -12px; left: 8px; }
  .float-label.br { bottom: -12px; right: 8px; }
}
/* md — tablet vertical / phablet */
@media (max-width: 760px) {
  .pillars { grid-template-columns: 1fr; gap: 18px; }
  .pillar { padding: 28px; }
  .section-head { margin-bottom: 44px; gap: 24px; }
  .hero { padding: 110px 0 64px; }
  .hero h1 { margin-top: 22px; }
  .hero-stats { margin-top: 56px; }
  .stat { padding: 22px 4px; }
  .service-card { padding: 32px; }
  .service-num { top: 22px; right: 24px; }
  .wa-btn { padding: 16px 18px; }
  .foot-bottom { flex-direction: column; gap: 14px; align-items: flex-start; text-align: left; }
}
/* sm — teléfonos */
@media (max-width: 580px) {
  .nav-cta { display: none; }
  .nav-inner { gap: 12px; height: 64px; }
  .mobile-menu {
    top: 64px;
    height: calc(100vh - 64px);
    height: calc(100dvh - 64px);
  }
  .brand-logo--full { display: none; }
  .brand-logo--mark { display: block; height: 40px; }
  .icon-btn { width: 36px; height: 36px; }
  .hero-stats { grid-template-columns: 1fr; }
  .stat { border-right: none; border-bottom: 1px solid var(--line); padding: 20px 4px; }
  .stat:last-child { border-bottom: none; }
  .showcase-feats { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; }
  .foot-top { grid-template-columns: 1fr; gap: 28px; }
  .container { padding: 0 18px; }
  .contact-wrap { padding: 22px; }
  .service-card { padding: 26px 22px; gap: 16px; }
  .service-icon { width: 48px; height: 48px; }
  .service-card h3 { font-size: 22px; }
  .btn-lg { padding: 13px 18px; font-size: 14.5px; }
  .hero-cta { gap: 10px; }
  .hero-cta .btn { flex: 1 1 100%; justify-content: center; }
  section { padding: 64px 0; }
  .float-label { display: none; }
  .window { font-size: 11px; }
  .bar-row { grid-template-columns: 64px 1fr 32px; gap: 8px; font-size: 10.5px; }
  .kpi-val { font-size: 16px; }
  .ai-alert { padding: 10px 12px; }
  .pill { font-size: 12px; padding: 6px 12px 6px 6px; }
  .contact-card { padding: 18px; }
  .wa-btn { padding: 14px 16px; }
  .wa-btn .wa-ico { width: 34px; height: 34px; }
}
/* xs — teléfonos chicos */
@media (max-width: 420px) {
  .hero h1 { font-size: clamp(36px, 11vw, 48px); }
  .section-head h2 { font-size: clamp(30px, 9vw, 40px); }
  .container { padding: 0 14px; }
  .nav-inner { gap: 6px; }
  .lang-toggle { padding: 2px; font-size: 11px; }
  .lang-toggle button { padding: 4px 7px; }
  .icon-btn { width: 34px; height: 34px; }
  .brand-logo--mark { height: 34px; }
}

/* hidden by language */
[data-i18n] [data-en] { display: none; }
html[lang="en"] [data-i18n] [data-en] { display: inline; }
html[lang="en"] [data-i18n] [data-es] { display: none; }
/* support block-level translation toggles */
.i18n-block [data-en] { display: none; }
html[lang="en"] .i18n-block [data-en] { display: block; }
html[lang="en"] .i18n-block [data-es] { display: none; }

/* Reveal on scroll */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.reveal.in { opacity: 1; transform: none; }
