/* =========================================================
   Medra Sistema Integral — Estilos principales
   ========================================================= */

:root {
  /* Paleta corporativa */
  --navy-950: #061530;
  --navy-900: #0A1F44;
  --navy-800: #0E2A57;
  --navy-700: #12305F;
  --blue-700: #0F4C9C;   /* principal oscuro (textos y enlaces) */
  --blue-600: #1450A3;   /* principal */
  --blue-500: #1663D6;   /* botones */
  --blue-400: #2F80ED;   /* acento */
  --cyan-400: #00B4FF;   /* acento brillante, uso moderado */
  --bg-soft: #F5F8FC;
  --border: #E1E8F2;
  --text: #33425B;
  --muted: #55657F;
  --heading: #0A1F44;
  --white: #FFFFFF;

  --grad-primary: linear-gradient(135deg, var(--blue-600) 0%, var(--blue-500) 100%);
  --grad-accent: linear-gradient(90deg, var(--blue-400) 0%, var(--cyan-400) 100%);

  /* Tipografía */
  --font-heading: "Plus Jakarta Sans", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Medidas */
  --container: 1200px;
  --radius: 16px;
  --header-h: 80px;
  --section-y: clamp(5rem, 9vw, 8rem);
  --shadow-sm: 0 1px 2px rgba(10, 31, 68, .04), 0 2px 8px rgba(10, 31, 68, .04);
  --shadow-md: 0 12px 32px -8px rgba(10, 31, 68, .12);
  --shadow-lg: 0 30px 60px -20px rgba(10, 31, 68, .25);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --transition: .3s var(--ease);
}

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

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

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  color: var(--heading);
  line-height: 1.15;
  margin: 0 0 .75rem;
}

p { margin: 0 0 1rem; }

img, svg { display: block; max-width: 100%; }

a { color: var(--blue-700); }

ul, ol { list-style: none; margin: 0; padding: 0; }

:focus-visible {
  outline: 3px solid var(--cyan-400);
  outline-offset: 3px;
  border-radius: 6px;
}

::selection { background: rgba(47, 128, 237, .2); }

.container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 1.5rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -100px;
  z-index: 200;
  padding: .6rem 1rem;
  background: var(--white);
  color: var(--navy-900);
  border-radius: 8px;
  font-weight: 600;
}
.skip-link:focus { top: 1rem; }

.text-gradient {
  background: linear-gradient(90deg, #5AA9FF 0%, var(--cyan-400) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- Botones ---------- */
.btn {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  padding: .85rem 1.5rem;
  border: 1px solid transparent;
  border-radius: 10px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: .95rem;
  letter-spacing: .005em;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--transition), color var(--transition),
              border-color var(--transition), transform var(--transition),
              box-shadow var(--transition);
}

/* Brillo que cruza el botón al pasar el mouse */
.btn::after {
  content: "";
  position: absolute;
  z-index: -1;
  top: 0;
  left: 0;
  width: 50%;
  height: 100%;
  background: linear-gradient(110deg, transparent 0%, rgba(255, 255, 255, .35) 50%, transparent 100%);
  transform: translateX(-180%) skewX(-20deg);
  transition: transform .75s var(--ease);
  pointer-events: none;
}
.btn:hover::after { transform: translateX(320%) skewX(-20deg); }
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn--primary {
  background: var(--grad-primary);
  color: var(--white);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .15) inset, 0 8px 20px -6px rgba(22, 99, 214, .55);
}
.btn--primary:hover {
  box-shadow: 0 1px 0 rgba(255, 255, 255, .15) inset, 0 14px 32px -8px rgba(0, 140, 255, .65);
}

.btn--ghost {
  border-color: rgba(255, 255, 255, .22);
  background: rgba(255, 255, 255, .04);
  color: var(--white);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.btn--ghost:hover {
  border-color: rgba(255, 255, 255, .5);
  background: rgba(255, 255, 255, .1);
}

.btn--sm { padding: .6rem 1.1rem; font-size: .88rem; border-radius: 9px; }
.btn--lg { padding: 1rem 1.75rem; font-size: 1rem; }
.btn--block { width: 100%; }
.btn:disabled { opacity: .7; cursor: wait; transform: none; }

.btn__arrow {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform var(--transition);
}
.btn:hover .btn__arrow { transform: translateX(4px); }

/* ---------- Logo ---------- */
.logo {
  display: inline-flex;
  align-items: center;
  gap: .75rem;
  text-decoration: none;
}
.logo__icon { width: 34px; height: 34px; flex-shrink: 0; }
.logo__text { display: flex; flex-direction: column; line-height: 1; }
.logo__name {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: .16em;
  margin-right: -.16em;
  text-transform: uppercase;
  color: var(--white);
}
.logo__tag {
  margin-top: .4rem;
  font-size: .56rem;
  font-weight: 500;
  letter-spacing: .34em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .7);
}

/* ---------- Header / navegación ---------- */
.header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  height: var(--header-h);
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background .4s ease, box-shadow .4s ease, border-color .4s ease, height .4s ease;
}
.header.is-scrolled {
  height: 68px;
  background: rgba(10, 31, 68, .88);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom-color: rgba(255, 255, 255, .07);
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .45);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.nav__menu {
  display: flex;
  align-items: center;
  gap: 2.25rem;
}

.nav__link {
  position: relative;
  padding: .25rem 0;
  color: rgba(255, 255, 255, .78);
  font-size: .94rem;
  font-weight: 500;
  text-decoration: none;
  transition: color var(--transition);
}
.nav__link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: var(--grad-accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition);
}
.nav__link:hover,
.nav__link.is-active { color: var(--white); }
.nav__link:hover::after,
.nav__link.is-active::after { transform: scaleX(1); }

.nav__cta-item { margin-left: .25rem; }

.nav__toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 10px;
  background: none;
  border: 0;
  cursor: pointer;
}
.nav__toggle span {
  display: block;
  height: 2px;
  background: var(--white);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}
.nav__toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav__toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: calc(var(--header-h) + 3.5rem) 0 9rem;
  background: var(--navy-900);
  color: rgba(255, 255, 255, .8);
}

.hero__bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

/* Degradado con movimiento muy sutil */
.hero__glow {
  position: absolute;
  border-radius: 50%;
  will-change: transform;
}
.hero__glow--1 {
  width: 70vw;
  height: 70vw;
  top: -35vw;
  right: -18vw;
  background: radial-gradient(circle, rgba(20, 80, 163, .7) 0%, rgba(20, 80, 163, 0) 65%);
  animation: glow-a 24s ease-in-out infinite alternate;
}
.hero__glow--2 {
  width: 60vw;
  height: 60vw;
  bottom: -38vw;
  left: -20vw;
  background: radial-gradient(circle, rgba(47, 128, 237, .32) 0%, rgba(47, 128, 237, 0) 65%);
  animation: glow-b 28s ease-in-out infinite alternate;
}
.hero__glow--3 {
  width: 34vw;
  height: 34vw;
  top: 40%;
  right: 18%;
  background: radial-gradient(circle, rgba(0, 180, 255, .14) 0%, rgba(0, 180, 255, 0) 65%);
  animation: glow-c 20s ease-in-out infinite alternate;
}

.hero__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, .04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .04) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 70% 40%, #000 0%, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 60% at 70% 40%, #000 0%, transparent 75%);
}

.hero__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* Velo para asegurar la legibilidad del texto sobre la red */
.hero__bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(10, 31, 68, .85) 0%, rgba(10, 31, 68, .45) 42%, rgba(10, 31, 68, 0) 70%),
    linear-gradient(0deg, rgba(10, 31, 68, .9) 0%, rgba(10, 31, 68, 0) 30%);
}

.hero__inner {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  align-items: center;
  gap: 4rem;
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  margin-bottom: 1.75rem;
  padding: .45rem 1rem .45rem .8rem;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 999px;
  background: rgba(255, 255, 255, .05);
  font-size: .85rem;
  font-weight: 500;
  color: rgba(255, 255, 255, .88);
}
.hero__badge-dot {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cyan-400);
}
.hero__badge-dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--cyan-400);
  animation: ping 2.4s cubic-bezier(0, 0, .2, 1) infinite;
}

.hero__title {
  font-size: clamp(2.3rem, 4.8vw, 3.9rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -.025em;
  color: var(--white);
  margin-bottom: 1.5rem;
}

.hero__subtitle {
  max-width: 34rem;
  margin-bottom: 2.5rem;
  font-size: clamp(1.05rem, 1.5vw, 1.2rem);
  line-height: 1.7;
  color: rgba(255, 255, 255, .74);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2.75rem;
}

.hero__highlights {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem 1.75rem;
  font-size: .9rem;
  color: rgba(255, 255, 255, .7);
}
.hero__highlights li {
  display: flex;
  align-items: center;
  gap: .55rem;
}
.hero__highlights li::before {
  content: "";
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  border-radius: 50%;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4.5 8.2l2.3 2.3 4.7-5' fill='none' stroke='%2300B4FF' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 16px no-repeat,
    rgba(0, 180, 255, .14);
}

/* Ilustración del hero */
.hero__visual { position: relative; }

.hero__panel {
  border-radius: 18px;
  box-shadow: 0 40px 80px -24px rgba(0, 0, 0, .6), 0 0 0 1px rgba(255, 255, 255, .04);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.hero__panel svg { width: 100%; height: auto; }

.chart-dot-ring {
  transform-box: fill-box;
  transform-origin: center;
  animation: ring 2.4s ease-out infinite;
}

.hero__chip {
  position: absolute;
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem 1rem .75rem .75rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 20px 40px -12px rgba(0, 0, 0, .45);
  color: var(--muted);
  font-size: .75rem;
  line-height: 1.35;
  white-space: nowrap;
  animation: float 7s ease-in-out infinite;
}
.hero__chip strong {
  display: block;
  font-family: var(--font-heading);
  font-size: .88rem;
  color: var(--heading);
}
.hero__chip small { font-size: .75rem; }
.hero__chip--a { top: 12%; left: -9%; }
.hero__chip--b { bottom: -6%; right: -3%; animation-delay: -3.5s; }

.hero__chip-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--grad-primary);
}
.hero__chip-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: #fff;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hero__scroll {
  position: absolute;
  left: 50%;
  bottom: 6.75rem;
  width: 24px;
  height: 38px;
  margin-left: -12px;
  border: 2px solid rgba(255, 255, 255, .3);
  border-radius: 14px;
}
.hero__scroll span {
  position: absolute;
  top: 7px;
  left: 50%;
  width: 4px;
  height: 8px;
  margin-left: -2px;
  border-radius: 2px;
  background: var(--cyan-400);
  animation: scroll-dot 2s ease-in-out infinite;
}

/* Entrada inicial del hero (escalonada) */
.js .hero-in {
  opacity: 0;
  transform: translateY(22px);
  animation: hero-in .9s var(--ease) forwards;
  animation-delay: calc(var(--d, 0) * 110ms + 150ms);
}
.js .chart-line {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: draw 2.2s 1s var(--ease) forwards;
}
.js .chart-area {
  opacity: 0;
  animation: fade-in 1.2s 2s ease forwards;
}

/* ---------- Cifras ---------- */
.stats {
  position: relative;
  z-index: 2;
  margin-top: -5.5rem;
  background: linear-gradient(180deg, transparent 0 5.5rem, var(--bg-soft) 5.5rem);
}

.stats__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 2.5rem 1rem;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .35rem;
  padding: .5rem 1rem;
  text-align: center;
}
.stat + .stat { border-left: 1px solid var(--border); }

.stat__value {
  font-family: var(--font-heading);
  font-size: clamp(2.2rem, 3.6vw, 3rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.03em;
  background: linear-gradient(135deg, var(--navy-900) 20%, var(--blue-500) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-variant-numeric: tabular-nums;
}
.stat__label {
  font-size: .9rem;
  font-weight: 500;
  color: var(--muted);
}

/* ---------- Secciones ---------- */
.section {
  position: relative;
  padding: var(--section-y) 0;
}

.section__header {
  max-width: 46rem;
  margin: 0 auto 4.5rem;
  text-align: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  margin-bottom: 1rem;
  font-family: var(--font-heading);
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--blue-700);
}
.eyebrow::before {
  content: "";
  width: 22px;
  height: 2px;
  border-radius: 2px;
  background: var(--grad-accent);
}
.eyebrow--light { color: #7FCBFF; }

.section__title {
  font-size: clamp(2rem, 3.6vw, 2.85rem);
  font-weight: 800;
  letter-spacing: -.022em;
  margin-bottom: 1.1rem;
}
.section__title--light { color: var(--white); }

.section__lead {
  font-size: 1.1rem;
  line-height: 1.75;
  color: var(--muted);
  margin: 0;
}
.section__lead--light { color: rgba(255, 255, 255, .72); }

/* ---------- Decoración de fondo (formas y circuitos) ---------- */
.has-deco { overflow: hidden; }

.deco {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.deco__shape {
  position: absolute;
  fill: none;
  stroke: rgba(20, 80, 163, .16);
  stroke-width: 1.5;
  animation: drift 16s ease-in-out infinite;
}
.deco__shape--light { stroke: rgba(127, 203, 255, .16); }
.deco__shape--hex { width: 150px; top: 9%; left: -40px; }
.deco__shape--hex-l { top: auto; bottom: 8%; left: 3%; width: 110px; animation-duration: 20s; }
.deco__shape--hex-b { top: auto; bottom: -30px; left: 42%; width: 120px; }
.deco__shape--ring { width: 140px; top: 46%; right: 4%; animation-duration: 22s; animation-direction: reverse; }
.deco__shape--ring-r { top: auto; bottom: 10%; right: 6%; }
.deco__shape--plus { width: 34px; bottom: 12%; left: 9%; stroke-width: 2; animation-duration: 12s; }
.deco__shape--plus-r { bottom: auto; top: 14%; left: auto; right: 10%; }
.testimonials .deco__shape--hex { left: auto; right: 6%; top: 12%; }

.deco__circuit {
  position: absolute;
  width: min(380px, 55vw);
}
.deco__circuit--left { top: 0; left: 0; }
.deco__circuit--right { top: 0; right: 0; }

.circuit-lines path {
  stroke: rgba(20, 80, 163, .16);
  stroke-width: 1.5;
}
.circuit-pulses path {
  stroke: var(--blue-400);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-dasharray: .07 .93;
  opacity: 0;
  animation: circuit-pulse 6s linear infinite;
}
.circuit-pulses path:nth-child(2) { animation-delay: -3s; animation-duration: 7.5s; }
.circuit-nodes circle { fill: rgba(47, 128, 237, .4); }

/* Los circuitos se dibujan lentamente al entrar en pantalla */
.js .circuit-lines path {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset 3.2s cubic-bezier(.6, 0, .2, 1);
}
.js .in-view .circuit-lines path { stroke-dashoffset: 0; }
.js .circuit-nodes circle {
  opacity: 0;
  transition: opacity .8s ease 2.4s;
}
.js .in-view .circuit-nodes circle { opacity: 1; }
.js .in-view .circuit-pulses path { opacity: .9; transition: opacity .8s ease 2.8s; }

/* Las animaciones decorativas solo corren mientras la sección es visible */
.js .has-deco:not(.in-view) .deco * { animation-play-state: paused; }

/* ---------- Servicios ---------- */
.services {
  padding-top: calc(var(--section-y) - 1rem);
  background:
    radial-gradient(circle at 1px 1px, rgba(20, 80, 163, .08) 1px, transparent 0) 0 0 / 28px 28px,
    var(--bg-soft);
}

.services__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.card {
  --mx: 50%;
  --my: 50%;
  position: relative;
  isolation: isolate;
  padding: 2.25rem 2rem 2rem;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform .45s var(--ease), box-shadow .45s var(--ease), border-color .45s var(--ease);
}
/* Borde con brillo azul */
.card::before {
  content: "";
  position: absolute;
  inset: -1px;
  z-index: -1;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, var(--blue-400), var(--cyan-400) 45%, rgba(47, 128, 237, .1) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  opacity: 0;
  transition: opacity .45s var(--ease);
}
/* Luz que sigue al cursor */
.card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: radial-gradient(420px circle at var(--mx) var(--my), rgba(47, 128, 237, .09), transparent 45%);
  opacity: 0;
  transition: opacity .45s var(--ease);
}
.card:hover {
  transform: translateY(-8px);
  border-color: transparent;
  box-shadow: 0 28px 50px -18px rgba(15, 76, 156, .35), 0 0 0 1px rgba(47, 128, 237, .08), 0 0 40px -8px rgba(0, 180, 255, .25);
}
.card:hover::before,
.card:hover::after { opacity: 1; }

.card__icon,
.feature__icon,
.contact__icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(20, 80, 163, .08), rgba(0, 180, 255, .12));
  color: var(--blue-600);
  transition: background .45s var(--ease), color .45s var(--ease), transform .45s var(--ease), box-shadow .45s var(--ease);
}
.card__icon { width: 56px; height: 56px; margin-bottom: 1.5rem; }
.card:hover .card__icon {
  background: var(--grad-primary);
  color: var(--white);
  transform: translateY(-2px) rotate(-6deg) scale(1.06);
  box-shadow: 0 12px 24px -8px rgba(22, 99, 214, .6);
}
.card__icon svg,
.feature__icon svg,
.contact__icon svg,
.step__marker svg,
.social svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
/* Trazo del ícono que se redibuja al pasar el mouse (pathLength lo asigna main.js) */
.card__icon.is-drawable svg > * { stroke-dasharray: 1; stroke-dashoffset: 0; }
.card:hover .card__icon.is-drawable svg > * { animation: draw .9s var(--ease) both; }

.card__title { font-size: 1.2rem; font-weight: 700; letter-spacing: -.01em; }
.card__text { margin: 0; color: var(--muted); font-size: .97rem; }

/* ---------- Cómo trabajamos ---------- */
.process { background: var(--white); }

.timeline { position: relative; }

.timeline__track {
  position: absolute;
  top: 36px;
  left: 12.5%;
  right: 12.5%;
  height: 2px;
  background: var(--border);
  border-radius: 2px;
}
.timeline__progress {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue-600), var(--blue-400), var(--cyan-400));
  transition: width 2.4s cubic-bezier(.6, 0, .2, 1), height 2.4s cubic-bezier(.6, 0, .2, 1);
}
.timeline__progress::after {
  content: "";
  position: absolute;
  right: -5px;
  bottom: -4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--cyan-400);
  box-shadow: 0 0 0 4px rgba(0, 180, 255, .2), 0 0 16px 2px rgba(0, 180, 255, .7);
}
.timeline.is-active .timeline__progress { width: 100%; }

.timeline__steps {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  counter-reset: step;
}

.step {
  --sd: 0s;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.step:nth-child(2) { --sd: .6s; }
.step:nth-child(3) { --sd: 1.2s; }
.step:nth-child(4) { --sd: 1.8s; }

.step__marker {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  margin-bottom: 1.5rem;
  border-radius: 50%;
  background: var(--white);
  border: 1px solid var(--border);
  color: var(--muted);
  box-shadow: var(--shadow-sm);
  transition: background .6s var(--ease) var(--sd), color .6s var(--ease) var(--sd),
              box-shadow .6s var(--ease) var(--sd), border-color .6s var(--ease) var(--sd),
              transform .6s var(--ease) var(--sd);
}
.timeline.is-active .step__marker {
  background: var(--grad-primary);
  border-color: transparent;
  color: var(--white);
  box-shadow: 0 0 0 8px rgba(47, 128, 237, .1), 0 16px 32px -10px rgba(20, 80, 163, .6);
  transform: scale(1.04);
}

.step__num {
  margin-bottom: .4rem;
  font-family: var(--font-heading);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--blue-700);
}
.step__title { font-size: 1.3rem; font-weight: 800; letter-spacing: -.015em; }
.step__text { max-width: 17rem; margin: 0; color: var(--muted); font-size: .96rem; }

.js .step__num,
.js .step__title,
.js .step__text {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .7s var(--ease) calc(var(--sd) + .15s), transform .7s var(--ease) calc(var(--sd) + .15s);
}
.js .timeline.is-active .step__num,
.js .timeline.is-active .step__title,
.js .timeline.is-active .step__text { opacity: 1; transform: none; }

/* ---------- Tecnologías ---------- */
.tech {
  padding: 4.5rem 0;
  background: var(--bg-soft);
  border-block: 1px solid var(--border);
}

.tech__title {
  margin-bottom: 2.25rem;
  font-family: var(--font-body);
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  text-align: center;
  color: var(--muted);
}

.marquee {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}

.marquee__track {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem 0;
  padding-block: .5rem;
}
.js .marquee__track {
  flex-wrap: nowrap;
  justify-content: flex-start;
  width: max-content;
  animation: marquee 48s linear infinite;
}
.marquee:hover .marquee__track { animation-play-state: paused; }

.tech__item {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-right: 1rem;
  padding: .8rem 1.35rem .8rem 1rem;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: #3E5577;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: .95rem;
  white-space: nowrap;
  transition: color var(--transition), border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}
.tech__item:hover {
  color: var(--blue-600);
  border-color: rgba(47, 128, 237, .4);
  box-shadow: 0 10px 24px -12px rgba(20, 80, 163, .4);
  transform: translateY(-2px);
}
.tech__item span { color: var(--heading); }
.tech__item svg { width: 32px; height: 32px; }
.tech__item .fill { fill: currentColor; }
.tech__item .line { fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.tech__item .cut { fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; }
.tech__item .dot { fill: #fff; }
.tech__item .glyph {
  fill: #fff;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 17px;
}
.tech__item .glyph--sm { font-size: 12px; }
.tech__item .glyph--xs { font-size: 9.5px; }

/* ---------- Sobre nosotros ---------- */
.about { background: var(--white); }

.about__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5rem;
  align-items: start;
}

.about__text { font-size: 1.06rem; color: var(--muted); }
.about__text strong { color: var(--heading); }

.mission {
  position: relative;
  overflow: hidden;
  margin-top: 2.25rem;
  padding: 2rem 2rem 2rem 2.25rem;
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 100% 0%, rgba(0, 180, 255, .18), transparent 50%),
    linear-gradient(135deg, var(--navy-900), var(--navy-700));
  color: rgba(255, 255, 255, .82);
  box-shadow: var(--shadow-lg);
}
.mission::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--cyan-400), var(--blue-400));
}
.mission__title { color: var(--white); font-size: 1.15rem; }
.mission p { margin: 0; }

.about__why-title { font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; margin-bottom: 1.5rem; }

.features { display: grid; gap: 1rem; }

.feature {
  display: flex;
  gap: 1.25rem;
  padding: 1.5rem 1.6rem;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}
.feature:hover {
  border-color: rgba(47, 128, 237, .35);
  box-shadow: var(--shadow-md);
  transform: translateX(6px);
}
.feature:hover .feature__icon { background: var(--grad-primary); color: var(--white); }
.feature__icon { width: 50px; height: 50px; }
.feature__title { font-size: 1.08rem; font-weight: 700; margin-bottom: .35rem; }
.feature p { margin: 0; color: var(--muted); font-size: .96rem; }

/* ---------- Testimonios ---------- */
.testimonials {
  background:
    radial-gradient(circle at 12% 15%, rgba(20, 80, 163, .55), transparent 45%),
    radial-gradient(circle at 88% 95%, rgba(0, 180, 255, .12), transparent 40%),
    var(--navy-900);
}

.testimonials__grid-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(ellipse 60% 70% at 50% 0%, #000, transparent 75%);
  mask-image: radial-gradient(ellipse 60% 70% at 50% 0%, #000, transparent 75%);
}

.testimonials__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.testimonial {
  position: relative;
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 2.25rem 2rem 2rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .03));
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: var(--radius);
  color: rgba(255, 255, 255, .86);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}
.testimonial:hover {
  border-color: rgba(0, 180, 255, .4);
  transform: translateY(-6px);
  box-shadow: 0 24px 48px -20px rgba(0, 0, 0, .6), 0 0 40px -12px rgba(0, 180, 255, .35);
}

.testimonial__quote {
  width: 32px;
  height: 32px;
  margin-bottom: 1.25rem;
  fill: var(--blue-400);
}

.testimonial blockquote { margin: 0 0 1.75rem; flex-grow: 1; }
.testimonial blockquote p { margin: 0; font-size: 1.02rem; line-height: 1.75; }

.testimonial figcaption {
  display: flex;
  align-items: center;
  gap: .9rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, .08);
  font-size: .88rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, .66);
}
.testimonial figcaption strong { color: var(--white); font-size: .95rem; }

.testimonial__avatar {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--grad-primary);
  color: var(--white);
  font-family: var(--font-heading);
  font-weight: 700;
}

/* Etiqueta visible para testimonios de ejemplo: eliminar al usar testimonios reales */
.badge-sample {
  position: absolute;
  top: 1.1rem;
  right: 1.1rem;
  padding: .2rem .6rem;
  border: 1px dashed rgba(0, 180, 255, .6);
  border-radius: 999px;
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #7FCBFF;
}

/* ---------- Contacto ---------- */
.contact { background: var(--bg-soft); }

.contact__grid {
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  gap: 5rem;
  align-items: start;
}

.contact__list { display: grid; gap: 1.5rem; margin-top: 2.5rem; }
.contact__list li { display: flex; align-items: center; gap: 1rem; }
.contact__icon { width: 50px; height: 50px; background: var(--white); border: 1px solid var(--border); }
.contact__label {
  display: block;
  font-size: .85rem;
  font-weight: 600;
  color: var(--heading);
}
.contact__list a { font-weight: 500; word-break: break-word; }

.form {
  position: relative;
  overflow: hidden;
  padding: 2.5rem;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
}
.form::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--blue-600), var(--blue-400), var(--cyan-400));
}

.form__title { font-size: 1.3rem; font-weight: 800; letter-spacing: -.015em; margin-bottom: 1.5rem; }

.form__field { margin-bottom: 1.25rem; }
.form__field label {
  display: block;
  margin-bottom: .45rem;
  font-weight: 600;
  font-size: .9rem;
  color: var(--heading);
}
.form__field input,
.form__field textarea {
  width: 100%;
  padding: .85rem 1rem;
  font: inherit;
  font-size: .97rem;
  color: var(--heading);
  background: var(--bg-soft);
  border: 1px solid #C9D5E5;
  border-radius: 10px;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}
.form__field textarea { resize: vertical; min-height: 140px; }
.form__field input::placeholder,
.form__field textarea::placeholder { color: #6A7A92; }
.form__field input:hover,
.form__field textarea:hover { border-color: #A9BBD3; }
.form__field input:focus,
.form__field textarea:focus {
  outline: none;
  background: var(--white);
  border-color: var(--blue-400);
  box-shadow: 0 0 0 4px rgba(47, 128, 237, .15);
}
.form__field .is-invalid { border-color: #B91C1C; }

.form__honeypot { position: absolute; left: -9999px; }

.form__status { margin: 1rem 0 0; font-weight: 500; min-height: 1.5em; }
.form__status.is-success { color: #047857; }
.form__status.is-error { color: #B91C1C; }

/* ---------- Footer ---------- */
.footer {
  background: var(--navy-950);
  color: rgba(255, 255, 255, .66);
  padding-top: 5rem;
  font-size: .95rem;
}

.footer__grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 3rem;
  padding-bottom: 4rem;
}

.footer__brand p { margin: 1.25rem 0 1.5rem; max-width: 22rem; }

.footer__title {
  font-family: var(--font-body);
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--white);
  margin-bottom: 1.25rem;
}

.footer__col ul { display: grid; gap: .75rem; }
.footer__col a,
.footer__top {
  color: rgba(255, 255, 255, .66);
  text-decoration: none;
  transition: color var(--transition);
}
.footer__col a:hover,
.footer__top:hover { color: var(--white); }

.social { display: flex; gap: .65rem; }
.social a {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 10px;
  color: rgba(255, 255, 255, .85);
  transition: background var(--transition), border-color var(--transition), color var(--transition), transform var(--transition);
}
.social a:hover {
  background: var(--blue-500);
  border-color: var(--blue-500);
  color: var(--white);
  transform: translateY(-2px);
}
.social svg { width: 20px; height: 20px; }
.social .fill { fill: currentColor; stroke: none; }

.footer__bottom {
  border-top: 1px solid rgba(255, 255, 255, .08);
  padding: 1.5rem 0;
  font-size: .86rem;
}
.footer__bottom-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .75rem;
}
.footer__bottom p { margin: 0; }

/* ---------- Animaciones al hacer scroll (escalonadas) ---------- */
.js .reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .8s var(--ease), transform .8s var(--ease);
  transition-delay: calc(var(--i, 0) * 100ms);
}
.js .reveal.is-visible { opacity: 1; transform: none; }
/* Al terminar de aparecer, main.js quita .reveal para que los efectos hover funcionen normalmente */

/* ---------- Keyframes ---------- */
@keyframes hero-in { to { opacity: 1; transform: none; } }
@keyframes fade-in { to { opacity: 1; } }
@keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }

@keyframes glow-a {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(-6vw, 5vw) scale(1.12); }
}
@keyframes glow-b {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(8vw, -4vw) scale(1.08); }
}
@keyframes glow-c {
  from { transform: translate(0, 0); }
  to { transform: translate(-10vw, -6vw); }
}

@keyframes ping {
  75%, 100% { transform: scale(2.6); opacity: 0; }
}
@keyframes ring {
  0% { transform: scale(1); opacity: .9; }
  100% { transform: scale(3); opacity: 0; }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}
@keyframes drift {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  33% { transform: translate(14px, -18px) rotate(8deg); }
  66% { transform: translate(-10px, 10px) rotate(-6deg); }
}
@keyframes circuit-pulse {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}
@keyframes scroll-dot {
  0% { transform: translateY(0); opacity: 1; }
  70% { transform: translateY(12px); opacity: 0; }
  100% { transform: translateY(0); opacity: 0; }
}
@keyframes marquee {
  to { transform: translateX(-50%); }
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .hero__chip--a { left: -2%; }
  .hero__chip--b { right: 0; }
}

@media (max-width: 1024px) {
  .services__grid,
  .testimonials__grid { grid-template-columns: repeat(2, 1fr); }
  .about__grid,
  .contact__grid { gap: 3rem; }
  .footer__grid { grid-template-columns: 1fr 1fr 1fr; }
  .footer__brand { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
  .nav__toggle { display: flex; }

  .nav__menu {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 1rem 1.5rem 1.75rem;
    background: rgba(10, 31, 68, .98);
    border-top: 1px solid rgba(255, 255, 255, .08);
    box-shadow: 0 16px 32px rgba(0, 0, 0, .35);
    transform: translateY(-12px);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition), transform var(--transition), visibility var(--transition);
  }
  .header.is-scrolled .nav__menu { top: 68px; }
  .nav__menu.is-open {
    transform: none;
    opacity: 1;
    visibility: visible;
  }
  .header:has(.nav__menu.is-open) { background: rgba(10, 31, 68, .98); }
  .nav__link {
    display: block;
    padding: .95rem 0;
    font-size: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
  }
  .nav__link::after { display: none; }
  .nav__cta-item { margin: 1.25rem 0 0; }
  .nav__cta-item .btn { width: 100%; padding: .9rem; }

  .hero { padding-bottom: 8rem; }
  .hero__inner { grid-template-columns: 1fr; gap: 3.5rem; text-align: center; }
  .hero__subtitle { margin-inline: auto; }
  .hero__actions,
  .hero__highlights { justify-content: center; }
  .hero__visual { max-width: 520px; width: 100%; margin-inline: auto; }
  .hero__bg::after {
    background: linear-gradient(180deg, rgba(10, 31, 68, .55) 0%, rgba(10, 31, 68, .35) 50%, rgba(10, 31, 68, .85) 100%);
  }
  .hero__scroll { display: none; }

  .stats__grid { grid-template-columns: repeat(2, 1fr); row-gap: 1.75rem; }
  .stat:nth-child(3) { border-left: 0; }

  .timeline__track {
    top: 36px;
    bottom: 36px;
    left: 35px;
    right: auto;
    width: 2px;
    height: auto;
  }
  .timeline__progress { width: 100%; height: 0; }
  .timeline__progress::after { right: -4px; bottom: -5px; }
  .timeline.is-active .timeline__progress { width: 100%; height: 100%; }
  .timeline__steps { grid-template-columns: 1fr; gap: 2.75rem; }
  .step {
    display: grid;
    grid-template-columns: 72px 1fr;
    column-gap: 1.5rem;
    align-items: start;
    text-align: left;
  }
  .step__marker { grid-row: 1 / span 3; margin: 0; }
  .step__num { margin-top: .35rem; }
  .step__text { max-width: none; }

  .about__grid,
  .contact__grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  /* Animaciones más livianas en celular */
  .deco--optional,
  .hero__glow--3 { display: none; }
  .hero__glow { animation-duration: 40s; }
  .hero__panel { backdrop-filter: none; -webkit-backdrop-filter: none; }
  .testimonial { backdrop-filter: none; -webkit-backdrop-filter: none; }
}

@media (max-width: 640px) {
  :root { --header-h: 68px; }

  .container { padding-inline: 1.25rem; }
  .section__header { margin-bottom: 3rem; }

  .services__grid,
  .testimonials__grid { grid-template-columns: 1fr; }

  .card,
  .testimonial { padding: 1.75rem 1.5rem; }
  .form { padding: 1.75rem 1.5rem; }

  .feature { flex-direction: column; gap: 1rem; }
  .feature:hover { transform: none; }

  .hero__actions .btn { flex: 1 1 100%; }
  .hero__chip { padding: .55rem .75rem .55rem .55rem; }
  .hero__chip small { display: none; }
  .hero__chip-icon { width: 30px; height: 30px; }
  .hero__chip--a { top: -6%; left: 0; }
  .hero__chip--b { bottom: -10%; right: 0; }

  .stats { margin-top: -4.5rem; background: linear-gradient(180deg, transparent 0 4.5rem, var(--bg-soft) 4.5rem); }
  .stats__grid { padding: 1.75rem .5rem; }
  .stat { padding: .25rem .5rem; }

  .logo__icon { width: 30px; height: 30px; }
  .logo__name { font-size: 1.2rem; }

  .footer__grid { grid-template-columns: 1fr 1fr; gap: 2.5rem 1.5rem; }
}

@media (max-width: 420px) {
  .footer__grid { grid-template-columns: 1fr; }
}

/* Sin efectos de luz que siguen al cursor en pantallas táctiles */
@media (hover: none) {
  .card::after { display: none; }
}

/* ---------- Respeto a "reducir movimiento" ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation: none !important;
    transition-duration: .01ms !important;
    transition-delay: 0s !important;
  }
  .js .reveal,
  .js .hero-in,
  .js .chart-area,
  .js .step__num,
  .js .step__title,
  .js .step__text { opacity: 1; transform: none; }
  .js .chart-line,
  .js .circuit-lines path { stroke-dashoffset: 0; }
  .js .circuit-nodes circle { opacity: 1; }
  .circuit-pulses { display: none; }
  .js .marquee__track { flex-wrap: wrap; justify-content: center; width: auto; }
  .marquee { -webkit-mask-image: none; mask-image: none; }
  .marquee__track [aria-hidden="true"] { display: none; }
}
