/* ============================================================
   QI · Quantum Innovation — Redesign
   Dark, premium tech-corporate system
   ============================================================ */

:root {
  /* Brand navy base */
  --navy-950: #010427;
  --navy-900: #02063A; /* brand navy */
  --navy-850: #050A4A;
  --navy-800: #0A1160;
  --navy-700: #141C6E;
  --line: rgba(151, 165, 255, 0.14);
  --line-strong: rgba(151, 165, 255, 0.28);

  /* Warm accents */
  --gold: #FDC501;
  --orange: #FF8300;
  --orange-deep: #FF5A00;
  --warm: linear-gradient(100deg, #FDC501 0%, #FF8300 48%, #FF5A00 100%);
  --warm-soft: linear-gradient(100deg, rgba(253,197,1,0.16), rgba(255,90,0,0.16));

  /* Text */
  --ink: #ECEEFB;
  --ink-dim: rgba(236, 238, 251, 0.66);
  --ink-faint: rgba(236, 238, 251, 0.42);

  /* Type */
  --font-display: "Hanken Grotesk", system-ui, sans-serif;
  --font-body: "Hanken Grotesk", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;

  /* Layout */
  --container: 1240px;
  --pad: clamp(20px, 5vw, 72px);
  --radius: 18px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  background: var(--navy-950);
  color: var(--ink);
  line-height: 1.6;
  font-size: 18.5px;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Ambient background layer (fixed) */
.bg-field {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(900px 600px at 78% -5%, rgba(255,131,0,0.16), transparent 60%),
    radial-gradient(800px 700px at 8% 12%, rgba(253,197,1,0.10), transparent 55%),
    radial-gradient(1000px 900px at 50% 105%, rgba(20,28,110,0.55), transparent 60%),
    var(--navy-950);
}
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(circle at 50% 30%, black, transparent 78%);
          mask-image: radial-gradient(circle at 50% 30%, black, transparent 78%);
  opacity: 0.5;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding-inline: var(--pad);
}

/* ---------- Shared type helpers ---------- */
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
}
.kicker::before {
  content: "";
  width: 26px;
  height: 1px;
  background: var(--warm);
}
.kicker.center { justify-content: center; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.02em;
}

.h-display {
  font-size: clamp(2.6rem, 6.4vw, 5.1rem);
  line-height: 0.98;
}
.h-section {
  font-size: clamp(2rem, 4.2vw, 3.3rem);
  letter-spacing: -0.025em;
}
.lead {
  font-size: clamp(1.12rem, 1.7vw, 1.36rem);
  color: var(--ink-dim);
  max-width: 56ch;
}
.text-warm {
  background: var(--warm);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.98rem;
  letter-spacing: -0.01em;
  padding: 15px 26px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  position: relative;
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease), background 0.3s;
  will-change: transform;
}
.btn .arr { transition: transform 0.4s var(--ease); }
.btn:hover .arr { transform: translateX(4px); }
.btn-primary {
  background: var(--warm);
  color: #1a0a00;
  box-shadow: 0 10px 30px -10px rgba(255,131,0,0.6);
}
.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 20px 46px -12px rgba(255,131,0,0.75);
}
.btn-ghost {
  background: rgba(151,165,255,0.05);
  border-color: var(--line-strong);
  color: var(--ink);
}
.btn-ghost:hover {
  transform: translateY(-3px);
  border-color: var(--gold);
  background: rgba(253,197,1,0.08);
}

/* ============================================================
   NAV
   ============================================================ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  transition: background 0.4s, border-color 0.4s, backdrop-filter 0.4s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(2, 6, 58, 0.72);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-bottom-color: var(--line);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 78px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand .logo-mark { width: 38px; height: 38px; flex: none; }
/* Logo real (PNG): limpio y sin recuadro (minimalista).
   En modo oscuro lleva una pastilla blanca sutil para que su texto oscuro se lea. */
.brand-logo {
  height: 52px; width: auto; display: block;
  border-radius: 10px;
}
html:not([data-theme="light"]) .brand-logo {
  background: #fff;
  padding: 5px 12px;
  box-shadow: 0 8px 20px -12px rgba(0,0,0,0.55);
}
.footer-brand .brand-logo { height: 62px; }
@media (max-width: 560px) {
  .brand-logo { height: 42px; }
  .footer-brand .brand-logo { height: 52px; }
}
.brand .logo-slot { width: 132px; height: 40px; }
.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.45rem;
  letter-spacing: 0.02em;
}
.brand-sub {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.28em;
  color: var(--ink-faint);
  text-transform: uppercase;
  margin-top: 3px;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 34px;
}
.nav-links a {
  font-size: 0.95rem;
  color: var(--ink-dim);
  position: relative;
  transition: color 0.25s;
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -6px;
  width: 0; height: 2px;
  background: var(--warm);
  transition: width 0.3s var(--ease);
}
.nav-links a:hover { color: var(--ink); }
.nav-links a:hover::after { width: 100%; }
.nav-cta { display: flex; align-items: center; gap: 14px; }
.nav-toggle {
  display: none;
  width: 44px; height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: rgba(151,165,255,0.05);
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.nav-toggle span {
  width: 18px; height: 2px; background: var(--ink);
  transition: 0.3s var(--ease);
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  padding-top: 150px;
  padding-bottom: 90px;
  overflow: hidden;
}
#hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  opacity: 0.9;
}
.hero .container { position: relative; z-index: 2; }
.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(36px, 5vw, 72px);
  align-items: center;
}
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px 8px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(151,165,255,0.04);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--ink-dim);
  margin-bottom: 28px;
}
.hero-eyebrow .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 0 rgba(253,197,1,0.6);
  animation: pulse 2.4s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(253,197,1,0.55); }
  70% { box-shadow: 0 0 0 9px rgba(253,197,1,0); }
  100% { box-shadow: 0 0 0 0 rgba(253,197,1,0); }
}
.hero h1 { margin-bottom: 22px; }
.hero .lead { margin-bottom: 34px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }

/* Hero console panel */
.console {
  position: relative;
  border-radius: 22px;
  border: 1px solid var(--line-strong);
  background:
    linear-gradient(180deg, rgba(10,17,96,0.6), rgba(2,6,58,0.75));
  box-shadow: 0 40px 90px -40px rgba(0,0,0,0.8), inset 0 1px 0 rgba(255,255,255,0.05);
  overflow: hidden;
  backdrop-filter: blur(8px);
}
.console-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-faint);
}
.console-bar .dots { display: flex; gap: 6px; margin-right: 8px; }
.console-bar .dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--line-strong); }
.console-bar .dots i:first-child { background: var(--orange-deep); }
.console-bar .dots i:nth-child(2) { background: var(--gold); }
.console-body { padding: 20px 22px 24px; }
.code-line {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 2;
  color: var(--ink-dim);
  white-space: nowrap;
  overflow: hidden;
}
.code-line .c-key { color: var(--gold); }
.code-line .c-str { color: #8be0a8; }
.code-line .c-num { color: var(--orange); }
.code-line .c-mut { color: var(--ink-faint); }

.meter { margin-top: 18px; }
.meter-row {
  display: flex; align-items: center; justify-content: space-between;
  font-family: var(--font-mono); font-size: 11.5px;
  color: var(--ink-faint); margin-bottom: 7px; letter-spacing: 0.04em;
}
.meter-track {
  height: 7px; border-radius: 999px;
  background: rgba(151,165,255,0.12);
  overflow: hidden; margin-bottom: 16px;
}
.meter-fill {
  height: 100%; border-radius: 999px;
  background: var(--warm);
  width: 0;
  transition: width 1.4s var(--ease);
}

/* ============================================================
   SECTION SCAFFOLD
   ============================================================ */
section { position: relative; }
.section-pad { padding-block: clamp(48px, 6.5vw, 90px); }
.section-head { max-width: 760px; margin-bottom: 56px; }
.section-head.center { margin-inline: auto; text-align: center; }
.section-head .h-section { margin-top: 18px; }
.section-head p { margin-top: 20px; }
.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line-strong), transparent);
}

/* ---------- Pillars ---------- */
.pillars {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
.pillar {
  position: relative;
  padding: 34px 30px 32px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(10,17,96,0.34), rgba(2,6,58,0.2));
  overflow: hidden;
  transition: transform 0.5s var(--ease), border-color 0.4s, background 0.4s;
}
.pillar::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--warm-soft);
  opacity: 0;
  transition: opacity 0.5s;
  pointer-events: none;
}
.pillar:hover {
  transform: translateY(-6px);
  border-color: var(--line-strong);
}
.pillar:hover::after { opacity: 1; }
.pillar-icon {
  width: 52px; height: 52px;
  display: grid; place-items: center;
  border-radius: 14px;
  border: 1px solid var(--line-strong);
  background: rgba(253,197,1,0.06);
  margin-bottom: 22px;
  color: var(--gold);
}
.pillar-icon svg { width: 26px; height: 26px; }
.pillar .num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 2.9rem;
  line-height: 1;
  margin-bottom: 4px;
}
.pillar h3 { font-size: 1.32rem; margin-bottom: 12px; }
.pillar p { color: var(--ink-dim); font-size: 1.05rem; }
.pillar .stat-label {
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--ink-faint); margin-bottom: 16px;
}

/* ---------- Team grid ---------- */
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 18px;
}
.team-card {
  position: relative;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(10,17,96,0.34), rgba(2,6,58,0.2));
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform 0.5s var(--ease), border-color 0.4s;
}
.team-card:hover { transform: translateY(-6px); border-color: var(--line-strong); }
/* Foto (o placeholder) que llena todo el cuadrado superior */
.team-media {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
  background: var(--warm-soft);
}
.team-media.placeholder {
  display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 800;
  font-size: 3.4rem; color: var(--gold);
}
.team-info { padding: 18px 20px 22px; }
.team-name { font-size: 1.18rem; margin-bottom: 4px; }
.team-role {
  font-family: var(--font-mono);
  font-size: 12px; letter-spacing: 0.06em;
  color: var(--gold); margin-bottom: 12px;
}
.team-bio { color: var(--ink-dim); font-size: 1rem; }

/* ---------- Testimonials ---------- */
.testi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 22px;
}
.testi-card {
  position: relative;
  padding: 30px 28px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(10,17,96,0.34), rgba(2,6,58,0.2));
  display: flex; flex-direction: column;
}
.testi-quote {
  color: var(--ink-dim);
  font-size: 1.1rem;
  line-height: 1.6;
  margin-bottom: 22px;
}
.testi-quote::before { content: "“"; color: var(--gold); font-family: var(--font-display); font-size: 2rem; line-height: 0; vertical-align: -0.35em; margin-right: 4px; }
.testi-author { display: flex; align-items: center; gap: 13px; margin-top: auto; }
.testi-avatar {
  width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center; object-fit: cover;
  font-family: var(--font-display); font-weight: 700; font-size: 1.1rem;
  color: var(--gold); background: var(--warm-soft); border: 1px solid var(--line-strong);
  flex: 0 0 auto;
}
.testi-name { font-family: var(--font-display); font-weight: 600; font-size: 1rem; }
.testi-role { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.05em; color: var(--ink-faint); }

/* ---------- Footer social ---------- */
.footer-social { display: flex; gap: 12px; margin-top: 18px; }
.footer-social a {
  width: 38px; height: 38px; border-radius: 10px;
  display: grid; place-items: center;
  border: 1px solid var(--line); color: var(--ink-dim);
  transition: border-color 0.2s, color 0.2s;
}
.footer-social a:hover { border-color: var(--line-strong); color: var(--gold); }
.footer-social svg { width: 18px; height: 18px; }

/* ---------- Mission statement band ---------- */
.mission {
  text-align: center;
}
.mission .stmt {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.5rem, 3.3vw, 2.6rem);
  line-height: 1.22;
  letter-spacing: -0.02em;
  max-width: 22ch;
  margin: 28px auto 0;
  text-wrap: balance;
}

/* ---------- Services ---------- */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
.service {
  position: relative;
  padding: 38px 32px 34px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(10,17,96,0.32), rgba(2,6,58,0.16));
  overflow: hidden;
  transition: transform 0.5s var(--ease), border-color 0.4s;
}
.service::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; height: 3px;
  background: var(--warm);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.5s var(--ease);
}
.service:hover { transform: translateY(-6px); border-color: var(--line-strong); }
.service:hover::before { transform: scaleX(1); }
.service .s-num {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--orange);
  letter-spacing: 0.1em;
  margin-bottom: 26px;
  display: block;
}
.service-icon {
  width: 54px; height: 54px;
  display: grid; place-items: center;
  border-radius: 14px;
  background: var(--warm);
  color: #1a0a00;
  margin-bottom: 24px;
}
.service-icon svg { width: 27px; height: 27px; }
.service h3 { font-size: 1.4rem; margin-bottom: 14px; line-height: 1.12; }
.service p { color: var(--ink-dim); font-size: 0.96rem; }

/* ---------- Big quote ---------- */
.quote-band { text-align: center; }
.quote-mark {
  font-family: var(--font-display);
  font-size: 5rem; line-height: 0.6;
  background: var(--warm);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  display: block; margin-bottom: 8px;
}
.quote-band blockquote {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.4rem, 3vw, 2.4rem);
  line-height: 1.3;
  letter-spacing: -0.02em;
  max-width: 24ch;
  margin: 0 auto;
  text-wrap: balance;
}

/* ---------- Allies grid ---------- */
.ally-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 18px;
}
.ally-card {
  position: relative;
  display: flex; flex-direction: column;
  aspect-ratio: 1 / 1;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(151,165,255,0.03);
  overflow: hidden;
  color: var(--ink-dim);
  transition: transform 0.4s var(--ease), border-color 0.3s, background 0.3s, box-shadow 0.3s;
}
/* Al pasar el cursor: se expande para dar contraste (no redirige) */
.ally-card:hover {
  transform: scale(1.1);
  border-color: var(--line-strong);
  background: rgba(253,197,1,0.06);
  box-shadow: 0 18px 44px -20px rgba(0,0,0,0.55);
  z-index: 2;
}
/* Logo completo, sin recorte (contain), centrado y con un margen cómodo */
.ally-logo {
  flex: 1;
  background-position: center; background-repeat: no-repeat; background-size: contain;
  background-origin: content-box;
  padding: 12%;
}
/* Aliado sin logo: nombre centrado en toda la tarjeta (sin inicial) */
.ally-noimg {
  flex: 1;
  display: grid; place-items: center;
  text-align: center; padding: 16px;
  font-family: var(--font-display); font-weight: 600; font-size: 1.05rem;
  letter-spacing: -0.01em; color: var(--ink);
}
.ally-cardname {
  padding: 13px 12px;
  text-align: center;
  font-family: var(--font-display); font-weight: 600; font-size: 0.98rem;
  letter-spacing: -0.01em;
  color: var(--ink);
  border-top: 1px solid var(--line);
  background: rgba(2,6,58,0.3);
}

/* ---------- Contact ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: clamp(34px, 5vw, 64px);
  align-items: start;
}
.contact-info .info-item {
  display: flex; align-items: center; gap: 16px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}
.contact-info .info-item:first-of-type { border-top: 1px solid var(--line); }
.info-ic {
  width: 46px; height: 46px; flex: none;
  display: grid; place-items: center;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  color: var(--gold);
  background: rgba(253,197,1,0.05);
}
.info-ic svg { width: 22px; height: 22px; }
.info-item .lbl {
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--ink-faint);
}
.info-item .val { font-size: 1.1rem; font-weight: 500; }
.contact-extra { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 30px; }
.chip {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 18px; border-radius: 999px;
  border: 1px solid var(--line-strong);
  font-size: 0.9rem; color: var(--ink-dim);
  transition: 0.3s var(--ease);
}
.chip:hover { color: var(--ink); border-color: var(--gold); transform: translateY(-2px); }

.form-card {
  padding: clamp(28px, 4vw, 44px);
  border-radius: var(--radius);
  border: 1px solid var(--line-strong);
  background: linear-gradient(180deg, rgba(10,17,96,0.4), rgba(2,6,58,0.3));
  box-shadow: 0 40px 90px -50px rgba(0,0,0,0.8);
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field.full { grid-column: 1 / -1; }
.field label {
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-faint);
}
.field label .req { color: var(--orange); }
.field input, .field textarea {
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--ink);
  background: rgba(1,4,39,0.5);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 14px 16px;
  transition: border-color 0.3s, box-shadow 0.3s, background 0.3s;
  width: 100%;
}
.field textarea { resize: vertical; min-height: 120px; }
.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--gold);
  background: rgba(1,4,39,0.8);
  box-shadow: 0 0 0 4px rgba(253,197,1,0.12);
}
.field input.invalid, .field textarea.invalid { border-color: var(--orange-deep); }
.form-foot { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 24px; flex-wrap: wrap; }
.form-note { font-size: 0.84rem; color: var(--ink-faint); max-width: 34ch; }
.form-ok {
  display: none;
  align-items: center; gap: 10px;
  font-family: var(--font-mono); font-size: 0.9rem;
  color: var(--gold);
}
.form-ok.show { display: inline-flex; }

/* ---------- Ethics ---------- */
.ethics-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.ethic {
  padding: 34px 30px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(10,17,96,0.28), rgba(2,6,58,0.14));
  transition: transform 0.5s var(--ease), border-color 0.4s;
}
.ethic:hover { transform: translateY(-5px); border-color: var(--line-strong); }
.ethic-ic {
  width: 50px; height: 50px;
  display: grid; place-items: center; border-radius: 14px;
  border: 1px solid var(--line-strong);
  color: var(--gold); background: rgba(253,197,1,0.05);
  margin-bottom: 22px;
}
.ethic-ic svg { width: 25px; height: 25px; }
.ethic h3 { font-size: 1.24rem; margin-bottom: 12px; }
.ethic p { color: var(--ink-dim); font-size: 0.95rem; }
.ethic a { color: var(--gold); border-bottom: 1px solid rgba(253,197,1,0.4); }
.ethics-foot {
  margin-top: 40px; text-align: center;
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(1.1rem, 2vw, 1.5rem); letter-spacing: -0.01em;
  color: var(--ink); text-wrap: balance;
}

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--line);
  padding-block: 64px 36px;
  background: linear-gradient(180deg, transparent, rgba(2,6,58,0.5));
}
.footer-top {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 48px;
}
.footer-brand p { color: var(--ink-dim); margin-top: 20px; max-width: 38ch; font-size: 1.02rem; }
.footer-col h4 {
  font-family: var(--font-mono); font-weight: 500;
  font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--ink-faint); margin-bottom: 18px;
}
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.footer-col a { color: var(--ink-dim); transition: color 0.25s; font-size: 1.02rem; }
.footer-col a:hover { color: var(--gold); }
.footer-bottom {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 16px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
  font-size: 0.86rem; color: var(--ink-faint);
}
.footer-bottom .links { display: flex; gap: 24px; }
.footer-bottom a:hover { color: var(--ink); }

/* ============================================================
   MODO CLARO
   ============================================================ */
html[data-theme="light"] {
  --navy-950:#EEF1FA; --navy-900:#FFFFFF; --navy-850:#F3F5FC; --navy-800:#E6EAF7; --navy-700:#DDE3F5;
  --line: rgba(10,17,80,0.14); --line-strong: rgba(10,17,80,0.26);
  --ink:#0A0F33; --ink-dim: rgba(10,15,51,0.82); --ink-faint: rgba(10,15,51,0.62);
}
html[data-theme="light"] .bg-field {
  background:
    radial-gradient(900px 600px at 78% -5%, rgba(255,131,0,0.10), transparent 60%),
    radial-gradient(800px 700px at 8% 12%, rgba(253,197,1,0.12), transparent 55%),
    var(--navy-950);
}
html[data-theme="light"] .bg-grid { opacity: 0.35; }
html[data-theme="light"] .nav.scrolled { background: rgba(255,255,255,0.85); }
html[data-theme="light"] .nav.mobile-open .nav-links { background: rgba(255,255,255,0.96); }

/* Tarjetas / superficies → claras, con borde y sombra suave para dar profundidad */
html[data-theme="light"] .pillar,
html[data-theme="light"] .service,
html[data-theme="light"] .ethic,
html[data-theme="light"] .team-card,
html[data-theme="light"] .testi-card,
html[data-theme="light"] .form-card,
html[data-theme="light"] .ally-card {
  background: #FFFFFF;
  box-shadow: 0 12px 32px -20px rgba(10,17,80,0.28);
}
html[data-theme="light"] .ally-cardname { background: rgba(10,17,80,0.035); }

/* Campos de formulario → blancos */
html[data-theme="light"] .field input,
html[data-theme="light"] .field textarea,
html[data-theme="light"] .field input:focus,
html[data-theme="light"] .field textarea:focus { background: #FFFFFF; }

/* Footer */
html[data-theme="light"] .footer { background: linear-gradient(180deg, transparent, rgba(10,17,80,0.05)); }

/* La "consola" del hero se mantiene oscura (estética de terminal):
   solo forzamos texto claro para que siga legible sobre el fondo oscuro */
html[data-theme="light"] .console-bar { color: rgba(236,238,251,0.55); }
html[data-theme="light"] .console .code-line { color: rgba(236,238,251,0.72); }
html[data-theme="light"] .console .code-line .c-mut,
html[data-theme="light"] .console .meter-row { color: rgba(236,238,251,0.5); }

/* ============================================================
   REVEAL ANIMATIONS
   ============================================================ */
@media (prefers-reduced-motion: no-preference) {
  html.anim .reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
  }
  html.anim .reveal.in { opacity: 1; transform: none; }
  html.anim .reveal[data-delay="1"] { transition-delay: 0.08s; }
  html.anim .reveal[data-delay="2"] { transition-delay: 0.16s; }
  html.anim .reveal[data-delay="3"] { transition-delay: 0.24s; }
  html.anim .reveal[data-delay="4"] { transition-delay: 0.32s; }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; }
  .console { max-width: 540px; }
  .pillars, .services-grid, .ethics-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .footer-top { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .nav-links, .nav-cta .btn { display: none; }
  .nav-toggle { display: flex; }
  .nav.mobile-open .nav-links {
    display: flex;
    position: absolute;
    top: 78px; left: 0; right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 18px var(--pad) 26px;
    background: rgba(2,6,58,0.96);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--line);
  }
  .nav.mobile-open .nav-links a { padding: 12px 0; width: 100%; font-size: 1.05rem; }
  .form-grid { grid-template-columns: 1fr; }
  .footer-top { grid-template-columns: 1fr; }
  .hero { padding-top: 120px; }
}

/* ============================================================
   PULIDO — selección, foco, scrollbar y botón "volver arriba"
   ============================================================ */
::selection { background: rgba(255,131,0,0.28); color: var(--ink); }

:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 3px;
}

* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: 999px;
  border: 3px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: var(--ink-faint); background-clip: content-box; }

.to-top {
  position: fixed;
  right: clamp(16px, 3vw, 32px);
  bottom: clamp(16px, 3vw, 32px);
  width: 48px; height: 48px;
  display: grid; place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--warm);
  color: #1a0e00;
  cursor: pointer;
  box-shadow: 0 16px 40px -16px rgba(0,0,0,0.6);
  opacity: 0; visibility: hidden; transform: translateY(14px);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease), visibility 0.3s;
  z-index: 60;
}
.to-top.show { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { filter: brightness(1.06); }
.to-top:active { transform: translateY(1px); }
.to-top svg { width: 20px; height: 20px; }

/* Botón de modo claro/oscuro en el nav */
.theme-toggle {
  width: 40px; height: 40px; flex: none;
  display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 10px;
  color: var(--ink-dim); background: transparent;
  transition: border-color 0.2s, color 0.2s;
}
.theme-toggle:hover { border-color: var(--line-strong); color: var(--ink); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .ic-sun { display: none; }
html[data-theme="light"] .theme-toggle .ic-sun { display: block; }
html[data-theme="light"] .theme-toggle .ic-moon { display: none; }

/* Barra de progreso de lectura */
.scroll-progress {
  position: fixed; top: 0; left: 0; right: 0;
  height: 3px; z-index: 100;
  background: var(--warm);
  transform: scaleX(0); transform-origin: 0 50%;
  transition: transform 0.08s linear;
  will-change: transform;
}

/* Enlace de la sección activa (scrollspy) */
.nav-links a.active { color: var(--ink); }
.nav-links a.active::after { width: 100%; }

/* Más profundidad / vida en botones e íconos */
.btn-primary { box-shadow: 0 10px 26px -12px rgba(255,131,0,0.55); }
.btn-primary:hover { box-shadow: 0 14px 30px -12px rgba(255,131,0,0.65); }
.pillar-icon, .service-icon, .ethic-ic { transition: transform 0.4s var(--ease), border-color 0.4s, color 0.4s; }
.pillar:hover .pillar-icon, .service:hover .service-icon, .ethic:hover .ethic-ic {
  transform: translateY(-3px) scale(1.05);
  border-color: var(--line-strong);
}

/* Campo trampa anti-spam (honeypot): invisible para personas, no para bots */
.hp-field {
  position: absolute !important;
  left: -9999px !important;
  width: 1px; height: 1px;
  opacity: 0; pointer-events: none;
}
