:root {
  --bg-main: #050816;
  --bg-alt: #070b1f;
  --accent: #ff7b2c;
  --accent-soft: #ffb080;
  --neon: #22c55e;
  --neon-blue: #38bdf8;
  --text-main: #f5f5f5;
  --text-muted: #9ca3af;
  --card-bg: #0b1024;
  --border-subtle: rgba(255, 255, 255, 0.06);
  --nav-blur: rgba(5, 8, 22, 0.9);
  --shadow-soft: 0 18px 40px rgba(0, 0, 0, 0.5);
  --glow-accent: 0 0 22px rgba(255, 123, 44, 0.85);
}

/* ============ RESET / BASE ============ */

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

html {
  scroll-behavior: smooth;
}

html,
body {
  margin: 0;
  padding: 0;
  /* Blindaje iOS: overflow-x:hidden solo en body NO basta para bloquear el
     paneo lateral en Safari iOS (el layout viewport se calcula también
     contra elementos position:fixed, cuyo containing block es el viewport,
     no body). Se declara hidden primero como fallback universal y clip
     después: clip no crea un nuevo contexto de scroll y en iOS Safari
     moderno sí bloquea el paneo horizontal. Aplicarlo en html Y body (no en
     un div intermedio) no rompe el position:sticky del header. */
  overflow-x: hidden;
  overflow-x: clip;
}

body {
  /* Sin CDNs externas: afinamos la pila del sistema en lugar de cargar
     una fuente remota (Montserrat estaba declarada pero nunca se cargaba). */
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, system-ui, sans-serif;
  background: radial-gradient(circle at top left, #111827 0, #020617 30%, #000 100%);
  color: var(--text-main);
  line-height: 1.6;
  position: relative;
}

h1,
h2,
h3 {
  font-weight: 700;
  letter-spacing: -0.01em;
}

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

/* ============ ACCESIBILIDAD ============ */

.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 100;
  background: var(--accent);
  color: #020617;
  padding: 0.6rem 1rem;
  border-radius: 0.6rem;
  font-weight: 600;
  font-size: 0.9rem;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 1rem;
}

:focus-visible {
  outline: 2px solid var(--accent-soft);
  outline-offset: 3px;
  border-radius: 4px;
}

/* FONDO ANIMADO */

@media (prefers-reduced-motion: no-preference) {
  body::before {
    content: "";
    position: fixed;
    /* inset:-20% hacía este pseudo-elemento fixed un 40% más ancho que el
       viewport (140% de 390px ~= 546px, y hasta ~580px con el scale(1.06)
       del keyframe): es el culpable real del "canvas" ~555px que reportaba
       iOS Safari. Al ser position:fixed, su containing block es el viewport
       (no body), así que overflow-x:hidden en body no lo recorta, y iOS usa
       ese tamaño para decidir el layout viewport y hacer shrink-to-fit. Con
       inset:0 el efecto visual (glow radial en las esquinas) es idéntico
       porque los gradientes ya se desvanecen antes del borde. */
    inset: 0;
    background:
      radial-gradient(circle at 10% 10%, rgba(56, 189, 248, 0.16), transparent 55%),
      radial-gradient(circle at 80% 80%, rgba(249, 115, 22, 0.14), transparent 55%);
    opacity: 0.8;
    pointer-events: none;
    mix-blend-mode: screen;
    animation: bgFloat 18s ease-in-out infinite alternate;
    z-index: -1;
  }

  @keyframes bgFloat {
    0%   { transform: translate3d(0, 0, 0) scale(1); }
    50%  { transform: translate3d(-22px, 12px, 0) scale(1.06); }
    100% { transform: translate3d(14px, -10px, 0) scale(1.03); }
  }
}

/* ============ LAYOUT GENERAL ============ */

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section {
  padding: 3.5rem 0;
  scroll-margin-top: 84px;
}

.section-alt {
  padding: 4.5rem 0;
}

/* ============ NAV / HEADER ============ */

.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: linear-gradient(to bottom, var(--nav-blur), rgba(5, 8, 22, 0.6), transparent);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(148, 163, 184, 0.25);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0;
  position: relative;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  letter-spacing: 0.14em;
  font-size: 0.9rem;
  text-transform: uppercase;
}

.logo-mark {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.phoenix-mark {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 3px rgba(255, 176, 128, 0.55))
    drop-shadow(0 0 12px rgba(255, 123, 44, 0.5));
}

/* Marca de agua decorativa del footer */
.footer {
  position: relative;
  overflow: hidden;
}

.footer-phoenix-watermark {
  position: absolute;
  top: 50%;
  left: 50%;
  width: clamp(320px, 55vw, 640px);
  height: auto;
  transform: translate(-50%, -50%);
  opacity: 0.06;
  pointer-events: none;
}

.footer-content {
  position: relative;
  z-index: 1;
}

.logo-text {
  font-weight: 800;
  display: inline-flex;
}

.logo-text-calo {
  color: #f5f5f5;
}

.logo-text-tech {
  color: var(--accent);
  margin-left: 0.12em;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  font-size: 0.9rem;
}

.nav-link {
  position: relative;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  color: var(--text-muted);
  transition:
    color 0.18s ease,
    transform 0.18s ease;
}

.nav-link::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at top left, rgba(56, 189, 248, 0.4), transparent 70%);
  opacity: 0;
  transform: scale(0.8);
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
  z-index: -1;
}

.nav-link:hover {
  color: #f9fafb;
  transform: translateY(-1px);
}

.nav-link:hover::before {
  opacity: 0.25;
  transform: scale(1);
}

.nav-link.active {
  color: #f9fafb;
}

.nav-link.active::before {
  opacity: 0.4;
  transform: scale(1);
}

.nav-cta {
  border: 1px solid rgba(248, 250, 252, 0.14);
  background: radial-gradient(circle at top left, rgba(255, 123, 44, 0.25), transparent 65%);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 0.18rem;
  /* Área táctil real de 44x44 (antes el botón medía ~20x16px, solo lo que
     ocupaban las 3 líneas del ícono). */
  width: 44px;
  height: 44px;
  padding: 0;
  margin: -8px;
  background: transparent;
  border: none;
  border-radius: 0.6rem;
  cursor: pointer;
}

.nav-toggle span {
  width: 20px;
  height: 2px;
  border-radius: 2px;
  background: #e5e7eb;
  transition:
    transform 0.2s ease,
    opacity 0.2s ease;
}

.nav-toggle.open span:nth-child(1) {
  transform: translateY(4px) rotate(45deg);
}
.nav-toggle.open span:nth-child(2) {
  opacity: 0;
}
.nav-toggle.open span:nth-child(3) {
  transform: translateY(-4px) rotate(-45deg);
}

/* ============ HERO ============ */

.hero-section {
  min-height: calc(100vh - 70px);
  display: flex;
  align-items: center;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 3.2rem;
  align-items: center;
  padding: 3.8rem 0 4rem;
}

.hero-kicker {
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.7rem;
  color: var(--accent-soft);
  margin-bottom: 0.8rem;
}

.hero-title {
  font-size: clamp(2.2rem, 4vw, 3rem);
  line-height: 1.15;
  margin: 0 0 1rem;
}

.gradient-text {
  background: linear-gradient(to right, #38bdf8, #a855f7, var(--accent));
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
}

.outline-text {
  color: transparent;
  -webkit-text-stroke: 1px #e5e7eb;
}

.hero-subtitle {
  color: var(--text-muted);
  max-width: 32rem;
  margin-bottom: 3.5rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-bottom: 1.4rem;
}

/* BOTONES */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.75rem 1.25rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease,
    border-color 0.18s ease;
}

.btn-primary {
  background: radial-gradient(circle at top left, var(--accent), #f97316);
  border-color: rgba(249, 115, 22, 0.8);
  box-shadow: var(--glow-accent);
  color: #020617;
}

.btn-primary:hover {
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 0 32px rgba(249, 115, 22, 0.95);
}

.btn-ghost {
  background: transparent;
  border-color: rgba(148, 163, 184, 0.5);
  color: var(--text-main);
}

.btn-ghost:hover {
  border-color: var(--accent-soft);
  background: rgba(15, 23, 42, 0.7);
  transform: translateY(-1px);
}

.btn-full {
  width: 100%;
}

.btn-send {
  position: relative;
  overflow: hidden;
  gap: 0.5rem;
}

.btn-arrow {
  display: inline-block;
  transition: transform 0.25s ease;
}

.btn-send:hover .btn-arrow {
  transform: translateX(4px);
}

.btn-send::after {
  content: "";
  position: absolute;
  top: 0;
  left: -60%;
  width: 40%;
  height: 100%;
  background: linear-gradient(
    115deg,
    transparent,
    rgba(255, 255, 255, 0.45),
    transparent
  );
  transform: skewX(-20deg);
  transition: left 0.5s ease;
}

.btn-send:hover::after {
  left: 130%;
}

@media (prefers-reduced-motion: reduce) {
  .btn-arrow,
  .btn-send::after {
    transition: none;
  }
}

/* HERO TAGS */

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.pill {
  font-size: 0.75rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.5);
  color: #e5e7eb;
  background: rgba(15, 23, 42, 0.9);
}

/* HERO NETWORK: constelación de nodos y líneas neón (SVG inline, sin JS) */

.hero {
  position: relative;
}

.hero-network {
  position: relative;
  width: 100%;
  max-width: 480px;
  aspect-ratio: 1 / 1;
  margin: 0 auto;
  justify-self: center;
}

.network-svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.network-links path {
  fill: none;
  stroke: rgba(148, 163, 184, 0.22);
  stroke-width: 1.4;
}

.network-pulse {
  fill: none;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-dasharray: 0.05 1;
  opacity: 0.9;
}

.pulse-orange {
  stroke: var(--accent);
  filter: drop-shadow(0 0 5px rgba(255, 123, 44, 0.9));
}

.pulse-blue {
  stroke: var(--neon-blue);
  filter: drop-shadow(0 0 5px rgba(56, 189, 248, 0.9));
}

.pulse-green {
  stroke: var(--neon);
  filter: drop-shadow(0 0 5px rgba(34, 197, 94, 0.9));
}

.node {
  transform-box: fill-box;
  transform-origin: center;
}

.node-orange {
  fill: var(--accent);
  filter: drop-shadow(0 0 8px rgba(255, 123, 44, 0.85));
}

.node-blue {
  fill: var(--neon-blue);
  filter: drop-shadow(0 0 8px rgba(56, 189, 248, 0.85));
}

.node-green {
  fill: var(--neon);
  filter: drop-shadow(0 0 8px rgba(34, 197, 94, 0.85));
}

@media (prefers-reduced-motion: no-preference) {
  .hero-network {
    animation: networkDrift 18s ease-in-out infinite alternate;
  }

  @keyframes networkDrift {
    0%   { transform: translate3d(0, 0, 0); }
    50%  { transform: translate3d(0, -10px, 0); }
    100% { transform: translate3d(0, -4px, 0); }
  }

  .network-pulse {
    animation: pulseTravel 3.4s linear infinite;
  }

  @keyframes pulseTravel {
    from { stroke-dashoffset: 1; }
    to   { stroke-dashoffset: -1; }
  }

  .node {
    animation: nodeGlow 3.6s ease-in-out infinite;
  }

  @keyframes nodeGlow {
    0%, 100% { transform: scale(1); opacity: 0.85; }
    50%      { transform: scale(1.2); opacity: 1; }
  }
}

@media (prefers-reduced-motion: reduce) {
  .node {
    opacity: 1;
  }

  .network-pulse {
    opacity: 0.5;
    stroke-dasharray: none;
  }
}

/* ============ SECTION HEADERS ============ */

.section-header {
  text-align: center;
  max-width: 560px;
  margin: 0 auto 2.2rem;
}

.section-kicker {
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.7rem;
  color: var(--accent-soft);
  margin-bottom: 0.6rem;
}

.section-title {
  font-size: 1.7rem;
  margin-bottom: 0.6rem;
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* ============ GLASS CARDS (servicios) ============ */

.glass-stack {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 4.5rem;
  margin-bottom: 6.5rem;
}

.glass-card {
  position: relative;
  width: 180px;
  height: 180px;
  background: linear-gradient(#ffffff11, #ffffff03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 25px 25px rgba(0, 0, 0, 0.45);
  display: flex;
  justify-content: center;
  align-items: center;
  transition: 0.5s;
  border-radius: 16px;
  margin: 0 -45px;
  backdrop-filter: blur(14px);
  transform: rotate(calc(var(--r) * 1deg));
}

.glass-stack:hover .glass-card {
  transform: translateY(-6px) rotate(0deg);
  margin: 0 12px;
}

.glass-card::before {
  content: attr(data-text);
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 42px;
  background: rgba(15, 23, 42, 0.82);
  display: flex;
  justify-content: center;
  align-items: center;
  color: #f9fafb;
  font-size: 0.9rem;
  border-radius: 0 0 16px 16px;
  border-top: 1px solid rgba(148, 163, 184, 0.45);
}

.glass-icon {
  font-size: 2.6rem;
  margin-bottom: 50px;
}

/* Flotar SOLO en desktop y sin reducción de movimiento */
@media (min-width: 901px) and (prefers-reduced-motion: no-preference) {
  .glass-stack {
    animation: floatStack 12s ease-in-out infinite alternate;
  }

  @keyframes floatStack {
    0%   { transform: translateY(0); }
    50%  { transform: translateY(-10px); }
    100% { transform: translateY(-5px); }
  }
}

/* ============ GRID SERVICIOS DETALLE ============ */

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

.service-detail {
  padding: 1.2rem 1.3rem;
  border-radius: 1.2rem;
  background: radial-gradient(circle at top left, rgba(15, 23, 42, 0.9), #020617);
  border: 1px solid var(--border-subtle);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.85);
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease,
    border-color 0.25s ease;
}

.service-detail:hover {
  transform: translateY(-8px);
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.95);
  border-color: rgba(56, 189, 248, 0.55);
}

.service-detail h3 {
  margin-top: 0;
  margin-bottom: 0.5rem;
  font-size: 1.05rem;
}

.service-detail p {
  margin: 0 0 0.8rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.service-detail ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.service-detail li {
  font-size: 0.86rem;
  color: #e5e7eb;
  padding-left: 1.1rem;
  position: relative;
  margin-bottom: 0.25rem;
}

.service-detail li::before {
  content: "▹";
  color: var(--accent-soft);
  position: absolute;
  left: 0;
  top: 0;
}

/* ============ PORTAFOLIO ============ */

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
  margin-top: 0.5rem;
}

.portfolio-card {
  padding: 1.7rem 1.4rem 1.5rem;
  border-radius: 1.2rem;
  text-align: center;
  background: radial-gradient(circle at top left, rgba(15, 23, 42, 0.9), #020617);
  border: 1px solid var(--border-subtle);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.85);
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease,
    border-color 0.3s ease;
}

.portfolio-card:hover {
  transform: translateY(-8px);
  box-shadow:
    0 26px 50px rgba(15, 23, 42, 0.95),
    0 0 30px rgba(255, 123, 44, 0.25);
  border-color: rgba(255, 123, 44, 0.55);
}

.portfolio-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.02rem;
}

.portfolio-card p {
  margin: 0;
  font-size: 0.87rem;
  color: var(--text-muted);
}

.portfolio-cta {
  text-align: center;
  margin-top: 2.4rem;
}

/* Cascada de entrada por tarjeta */
.portfolio-grid .reveal:nth-child(1) { transition-delay: 0s; }
.portfolio-grid .reveal:nth-child(2) { transition-delay: 0.08s; }
.portfolio-grid .reveal:nth-child(3) { transition-delay: 0.16s; }
.portfolio-grid .reveal:nth-child(4) { transition-delay: 0.24s; }
.portfolio-grid .reveal:nth-child(5) { transition-delay: 0.32s; }
.portfolio-grid .reveal:nth-child(6) { transition-delay: 0.4s; }

/* Icono base compartido por las 6 tarjetas */

.portfolio-icon {
  position: relative;
  width: 84px;
  height: 84px;
  margin: 0 auto 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* --- 1. Facturación: documento + sello que "timbra" --- */

.invoice-doc {
  width: 44px;
  height: 56px;
  background: linear-gradient(180deg, #1e293b, #0b1024);
  border: 1px solid rgba(148, 163, 184, 0.4);
  border-radius: 6px;
  padding: 9px 7px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.5);
}

.invoice-line {
  height: 3px;
  border-radius: 2px;
  background: rgba(148, 163, 184, 0.55);
}

.invoice-line.short {
  width: 60%;
}

.invoice-stamp {
  position: absolute;
  right: 4px;
  bottom: 2px;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 2px solid var(--neon);
  color: var(--neon);
  font-size: 0.9rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(34, 197, 94, 0.12);
  transform: scale(0) rotate(-25deg);
  opacity: 0;
}

@media (prefers-reduced-motion: no-preference) {
  .icon-invoice .invoice-stamp {
    animation: stampDrop 3.2s ease-in-out infinite;
  }

  @keyframes stampDrop {
    0%, 55% { transform: scale(0) rotate(-25deg); opacity: 0; }
    68% { transform: scale(1.15) rotate(-8deg); opacity: 1; }
    78% {
      transform: scale(0.95) rotate(-14deg);
      opacity: 1;
      box-shadow: 0 0 16px rgba(34, 197, 94, 0.9);
    }
    92%, 100% {
      transform: scale(1) rotate(-14deg);
      opacity: 1;
      box-shadow: 0 0 6px rgba(34, 197, 94, 0.4);
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  .icon-invoice .invoice-stamp {
    opacity: 1;
    transform: scale(1) rotate(-14deg);
  }
}

/* --- 2. Punto de venta: ticket que "imprime" desde la ranura --- */

.icon-pos {
  overflow: hidden;
  border-radius: 10px;
}

.pos-slot {
  position: absolute;
  top: 14px;
  width: 54px;
  height: 8px;
  border-radius: 4px;
  background: rgba(148, 163, 184, 0.35);
  z-index: 1;
}

.pos-ticket {
  position: absolute;
  top: 20px;
  width: 42px;
  padding: 6px 5px 8px;
  background: #eef1f6;
  border-radius: 2px 2px 8px 8px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.45);
  transform: translateY(-42px);
}

.pos-ticket span {
  display: block;
  height: 2px;
  margin: 3px 0;
  border-radius: 1px;
  background: rgba(15, 23, 42, 0.35);
}

@media (prefers-reduced-motion: no-preference) {
  .icon-pos .pos-ticket {
    animation: ticketPrint 3s ease-in-out infinite;
  }

  @keyframes ticketPrint {
    0%, 15% { transform: translateY(-42px); }
    55%, 75% { transform: translateY(8px); }
    100% { transform: translateY(-42px); }
  }
}

@media (prefers-reduced-motion: reduce) {
  .icon-pos .pos-ticket {
    transform: translateY(0);
  }
}

/* --- 3. ERP: nodos y enlaces que "sincronizan" --- */

.erp-node {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 999px;
}

.erp-node.node-1,
.erp-node.node-4 {
  background: var(--neon-blue);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.8);
}

.erp-node.node-2,
.erp-node.node-3 {
  background: var(--accent);
  box-shadow: 0 0 10px rgba(255, 123, 44, 0.8);
}

.node-1 { top: 6px; left: 6px; }
.node-2 { top: 6px; right: 6px; }
.node-3 { bottom: 6px; left: 6px; }
.node-4 { bottom: 6px; right: 6px; }

.erp-link {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 66px;
  height: 2px;
  background: rgba(148, 163, 184, 0.4);
  transform-origin: left center;
}

.link-a { transform: translate(-33px, -1px) rotate(38deg); }
.link-b { transform: translate(-33px, -1px) rotate(-38deg); }

@media (prefers-reduced-motion: no-preference) {
  .erp-node {
    animation: nodePulse 2.4s ease-in-out infinite;
  }

  .node-1 { animation-delay: 0s; }
  .node-2 { animation-delay: 0.3s; }
  .node-4 { animation-delay: 0.6s; }
  .node-3 { animation-delay: 0.9s; }

  @keyframes nodePulse {
    0%, 100% { transform: scale(1); opacity: 0.75; }
    50% { transform: scale(1.35); opacity: 1; }
  }
}

/* --- 4. Nube: pulsos de sincronización + carga --- */

.cloud-shape {
  position: relative;
  width: 44px;
  height: 26px;
  background: #e2e8f0;
  border-radius: 40% 40% 45% 45% / 60% 60% 40% 40%;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.4);
}

.cloud-shape::before,
.cloud-shape::after {
  content: "";
  position: absolute;
  background: #e2e8f0;
  border-radius: 50%;
}

.cloud-shape::before {
  width: 22px;
  height: 22px;
  top: -10px;
  left: 4px;
}

.cloud-shape::after {
  width: 16px;
  height: 16px;
  top: -7px;
  right: 2px;
}

.cloud-ring {
  position: absolute;
  width: 30px;
  height: 30px;
  border: 2px solid rgba(56, 189, 248, 0.5);
  border-radius: 999px;
  opacity: 0;
}

.cloud-dot {
  position: absolute;
  bottom: 8px;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(255, 123, 44, 0.8);
  opacity: 0;
}

@media (prefers-reduced-motion: no-preference) {
  .cloud-ring {
    /* Se anima con transform:scale en vez de width/height: animar tamaño de
       caja fuerza layout/reflow en cada frame; scale solo afecta compositor
       (transform+opacity), evitando jank en gama baja móvil. */
    animation: cloudPulse 2.6s ease-out infinite;
  }

  .ring-2 {
    animation-delay: 1.3s;
  }

  @keyframes cloudPulse {
    0% { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(2.6); opacity: 0; }
  }

  .cloud-dot {
    animation: cloudUpload 2.2s ease-in-out infinite;
  }

  @keyframes cloudUpload {
    0% { transform: translateY(16px); opacity: 0; }
    35% { opacity: 1; }
    70% { transform: translateY(-22px); opacity: 0.2; }
    100% { transform: translateY(16px); opacity: 0; }
  }
}

@media (prefers-reduced-motion: reduce) {
  .cloud-dot {
    opacity: 1;
    transform: translateY(-4px);
  }
}

/* --- 5. Procesos: engranes que giran --- */

.gear {
  position: absolute;
  border-radius: 999px;
  border: 6px dashed rgba(148, 163, 184, 0.55);
  background: radial-gradient(circle, #0b1024 42%, transparent 43%);
}

.gear-big {
  width: 46px;
  height: 46px;
  top: 4px;
  left: 4px;
  border-color: rgba(255, 123, 44, 0.6);
}

.gear-small {
  width: 28px;
  height: 28px;
  bottom: 2px;
  right: 2px;
  border-color: rgba(56, 189, 248, 0.6);
}

@media (prefers-reduced-motion: no-preference) {
  .gear-big {
    animation: spinGear 6s linear infinite;
  }

  .gear-small {
    animation: spinGearReverse 4s linear infinite;
  }

  @keyframes spinGear {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
  }

  @keyframes spinGearReverse {
    from { transform: rotate(0deg); }
    to { transform: rotate(-360deg); }
  }
}

/* --- 6. Ciberseguridad: escudo con radar --- */

.shield-shape {
  position: relative;
  width: 46px;
  height: 54px;
  background: linear-gradient(180deg, rgba(56, 189, 248, 0.25), rgba(15, 23, 42, 0.95));
  border: 1px solid rgba(56, 189, 248, 0.5);
  clip-path: polygon(50% 0%, 100% 18%, 100% 55%, 50% 100%, 0% 55%, 0% 18%);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.shield-radar {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 50%;
  height: 2px;
  background: linear-gradient(to right, var(--neon), transparent);
  transform-origin: left center;
  transform: translateY(-50%) rotate(0deg);
}

@media (prefers-reduced-motion: no-preference) {
  .shield-radar {
    animation: radarSweep 2.4s linear infinite;
  }

  @keyframes radarSweep {
    from { transform: translateY(-50%) rotate(0deg); }
    to { transform: translateY(-50%) rotate(360deg); }
  }
}

/* ============ PROCESO STORYTELLING ============ */

.process {
  position: relative;
  max-width: 760px;
  margin: 0 auto;
  padding-left: 2.8rem;
}

.process-line {
  position: absolute;
  left: 14px;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(
    to bottom,
    rgba(250, 252, 253, 0.35),
    rgba(15, 23, 42, 0.9)
  );
  border-radius: 999px;
  overflow: hidden;
}

.process-line-fill {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 0;
  background: linear-gradient(to bottom, var(--neon-blue), var(--accent), var(--neon));
  box-shadow:
    0 0 12px rgba(56, 189, 248, 0.9),
    0 0 24px rgba(249, 115, 22, 0.9);
  transition: height 0.5s ease;
}

@media (prefers-reduced-motion: no-preference) {
  .process-line-fill {
    animation: lineGlowPulse 2.4s ease-in-out infinite;
  }

  @keyframes lineGlowPulse {
    0%, 100% {
      box-shadow:
        0 0 12px rgba(56, 189, 248, 0.9),
        0 0 24px rgba(249, 115, 22, 0.9);
    }
    50% {
      box-shadow:
        0 0 20px rgba(56, 189, 248, 1),
        0 0 36px rgba(249, 115, 22, 1);
    }
  }
}

.process-steps {
  display: flex;
  flex-direction: column;
  gap: 1.6rem;
}

.process-step {
  position: relative;
  padding-left: 1.8rem;
  opacity: 0.3;
  transform: translateY(12px);
  transition:
    opacity 0.45s ease,
    transform 0.45s ease;
}

.process-step.active {
  opacity: 1;
  transform: translateY(0);
}

.process-badge {
  position: absolute;
  left: -2.1rem;
  top: 0.35rem;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 1);
  border: 2px solid rgba(148, 163, 184, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  color: #e5e7eb;
  box-shadow: 0 0 0 rgba(249, 115, 22, 0);
  transition:
    border-color 0.3s ease,
    box-shadow 0.3s ease,
    background 0.3s ease,
    transform 0.3s ease,
    color 0.3s ease;
}

.process-step.active .process-badge {
  border-color: var(--accent);
  background: #020617;
  color: #fefce8;
  box-shadow:
    0 0 14px rgba(249, 115, 22, 0.9),
    0 0 24px rgba(56, 189, 248, 0.9);
  transform: scale(1.06);
}

@media (prefers-reduced-motion: no-preference) {
  .process-step.active .process-badge {
    animation: badgeIgnite 0.55s ease;
  }

  @keyframes badgeIgnite {
    0% {
      transform: scale(0.7);
      box-shadow: 0 0 0 rgba(249, 115, 22, 0);
    }
    55% {
      transform: scale(1.25);
      box-shadow:
        0 0 22px rgba(249, 115, 22, 1),
        0 0 36px rgba(56, 189, 248, 1);
    }
    100% {
      transform: scale(1.06);
      box-shadow:
        0 0 14px rgba(249, 115, 22, 0.9),
        0 0 24px rgba(56, 189, 248, 0.9);
    }
  }
}

.process-step-head {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.3rem;
}

.process-step h3 {
  margin: 0;
  font-size: 1.02rem;
}

.process-step p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* ---- Iconos animados por paso ---- */

.process-step-icon {
  position: relative;
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Paso 1: escuchar → pulso concéntrico */

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--neon-blue);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.9);
}

.pulse-ring {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  border: 1.5px solid rgba(56, 189, 248, 0.7);
  opacity: 0;
}

@media (prefers-reduced-motion: no-preference) {
  .pulse-ring {
    animation: pulseOut 2.2s ease-out infinite;
  }

  .pulse-ring.ring-delay {
    animation-delay: 1.1s;
  }

  /* transform:scale en vez de animar width/height: mismo efecto visual
     (10px -> 30px = 3x) sin forzar reflow en cada frame. */
  @keyframes pulseOut {
    0% { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(3); opacity: 0; }
  }
}

/* Paso 2: mapear → nodos conectados */

.icon-map {
  transform: scale(0.72);
}

.map-node {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 8px rgba(255, 123, 44, 0.8);
}

.map-node.n1 { top: 0; left: 2px; }
.map-node.n2 { bottom: 0; left: 0; }
.map-node.n3 { top: 8px; right: 0; background: var(--neon-blue); box-shadow: 0 0 8px rgba(56, 189, 248, 0.8); }

.map-link {
  position: absolute;
  height: 1.5px;
  background: rgba(148, 163, 184, 0.5);
  transform-origin: left center;
}

.map-link.l1 { top: 3px; left: 5px; width: 16px; transform: rotate(48deg); }
.map-link.l2 { bottom: 3px; left: 3px; width: 18px; transform: rotate(-18deg); }

@media (prefers-reduced-motion: no-preference) {
  .map-node {
    animation: nodePulse 2.4s ease-in-out infinite;
  }

  .map-node.n2 { animation-delay: 0.3s; }
  .map-node.n3 { animation-delay: 0.6s; }
}

/* Paso 3: construir → engranes mini */

.icon-build {
  transform: scale(0.6);
}

.mini-gear {
  position: absolute;
  border-radius: 999px;
  border: 5px dashed rgba(255, 123, 44, 0.65);
  background: radial-gradient(circle, #0b1024 42%, transparent 43%);
}

.gear-a { width: 30px; height: 30px; top: 0; left: 0; }
.gear-b {
  width: 18px;
  height: 18px;
  bottom: -2px;
  right: -6px;
  border-color: rgba(56, 189, 248, 0.65);
}

@media (prefers-reduced-motion: no-preference) {
  .gear-a { animation: spinGear 5s linear infinite; }
  .gear-b { animation: spinGearReverse 3.4s linear infinite; }
}

/* Paso 4: crecer → barras que suben */

.icon-grow {
  align-items: flex-end;
  gap: 3px;
}

.grow-bar {
  width: 5px;
  border-radius: 2px 2px 0 0;
  background: linear-gradient(to top, var(--neon-blue), var(--accent));
}

.bar-1 { height: 40%; }
.bar-2 { height: 70%; }
.bar-3 { height: 100%; }

@media (prefers-reduced-motion: no-preference) {
  .grow-bar {
    transform-origin: bottom;
    animation: growUp 1.8s ease-in-out infinite alternate;
  }

  .bar-1 { animation-delay: 0s; }
  .bar-2 { animation-delay: 0.2s; }
  .bar-3 { animation-delay: 0.4s; }

  @keyframes growUp {
    0% { transform: scaleY(0.55); opacity: 0.7; }
    100% { transform: scaleY(1); opacity: 1; }
  }
}

@media (prefers-reduced-motion: reduce) {
  .grow-bar { transform: scaleY(1); opacity: 1; }
}

/* ============ CONTACTO ============ */

.grid-contact {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.1fr);
  gap: 2.5rem;
  align-items: flex-start;
}

.contact-lead {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin: 0 0 1.2rem;
}

.contact-chips {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.chip-item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.65rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.85);
  font-size: 0.88rem;
  color: #e5e7eb;
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    background 0.2s ease;
}

.chip-item:hover {
  transform: translateX(4px);
  border-color: rgba(255, 123, 44, 0.55);
  background: rgba(15, 23, 42, 1);
}

.chip-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  flex-shrink: 0;
  font-size: 1.05rem;
}

/* Cascada de entrada + micro-vida por chip */
.contact-chips .chip-item:nth-child(1) { transition-delay: 0s; }
.contact-chips .chip-item:nth-child(2) { transition-delay: 0.1s; }
.contact-chips .chip-item:nth-child(3) { transition-delay: 0.2s; }

@media (prefers-reduced-motion: no-preference) {
  .chip-icon {
    animation: chipBounce 2.6s ease-in-out infinite;
  }

  .chip-item:nth-child(2) .chip-icon { animation-delay: 0.3s; }
  .chip-item:nth-child(3) .chip-icon { animation-delay: 0.6s; }

  @keyframes chipBounce {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-3px) rotate(-6deg); }
  }
}

.whatsapp-direct {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin-top: 1.1rem;
  padding: 0.6rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(34, 197, 94, 0.45);
  background: rgba(34, 197, 94, 0.1);
  color: #e5e7eb;
  font-size: 0.88rem;
  font-weight: 600;
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    background 0.2s ease;
}

.whatsapp-direct:hover {
  transform: translateX(4px);
  border-color: var(--neon);
  background: rgba(34, 197, 94, 0.18);
}

.whatsapp-icon {
  width: 1.15rem;
  height: 1.15rem;
  fill: var(--neon);
  flex-shrink: 0;
}

.btn-whatsapp {
  background: radial-gradient(circle at top left, #34d872, var(--neon));
  border-color: rgba(34, 197, 94, 0.8);
  box-shadow: 0 0 22px rgba(34, 197, 94, 0.55);
  color: #04140a;
}

.btn-whatsapp:hover {
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 0 32px rgba(34, 197, 94, 0.75);
}

.btn-whatsapp-icon {
  width: 1.2rem;
  height: 1.2rem;
  fill: currentColor;
  flex-shrink: 0;
}

.field-error {
  border-color: #f87171 !important;
  box-shadow: 0 0 0 1px rgba(248, 113, 113, 0.55) !important;
}

.form-note.is-error {
  color: #f87171;
}

.contact-form {
  padding: 1.4rem 1.5rem;
  border-radius: 1.4rem;
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-soft);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 0.8rem;
}

label {
  font-size: 0.8rem;
  color: #e5e7eb;
  transition:
    color 0.18s ease,
    transform 0.18s ease;
}

.form-group:focus-within label {
  color: var(--accent-soft);
  transform: translateX(2px);
}

input,
select,
textarea {
  border-radius: 0.6rem;
  border: 1px solid rgba(148, 163, 184, 0.5);
  background: rgba(15, 23, 42, 0.95);
  color: #e5e7eb;
  /* 16px mínimo: por debajo de este tamaño iOS Safari hace zoom automático
     al enfocar el campo, lo cual rompe la experiencia en el formulario. */
  font-size: 1rem;
  padding: 0.55rem 0.7rem;
  font-family: inherit;
  outline: none;
  transition:
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    background 0.16s ease,
    transform 0.12s ease;
}

input::placeholder,
textarea::placeholder {
  color: rgba(148, 163, 184, 0.7);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent-soft);
  box-shadow: 0 0 0 1px rgba(249, 115, 22, 0.5);
  background: rgba(15, 23, 42, 1);
  transform: translateY(-1px);
}

textarea {
  resize: vertical;
}

.form-note {
  margin-top: 0.6rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  transition: opacity 0.2s ease;
}

/* ============ FOOTER ============ */

.footer {
  padding: 1.8rem 0 2.2rem;
  border-top: 1px solid rgba(148, 163, 184, 0.3);
  background: radial-gradient(circle at bottom left, #020617 0, #000 55%);
}

.footer-content {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.footer-note {
  margin-top: 0.15rem;
}

/* ============ REVEAL ============ */

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity 0.6s ease,
    transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============ RESPONSIVE ============ */

@media (max-width: 900px) {
  .container {
    padding: 0 1.25rem;
  }

  .nav {
    height: 3.8rem;
  }

  .nav-links {
    position: absolute;
    top: 3.1rem;
    right: 1.25rem;
    left: 1.25rem;
    flex-direction: column;
    background: rgba(15, 23, 42, 0.98);
    border-radius: 1rem;
    padding: 0.9rem 1rem;
    border: 1px solid var(--border-subtle);
    transform-origin: top;
    transform: scaleY(0.85);
    opacity: 0;
    pointer-events: none;
    transition:
      opacity 0.22s ease,
      transform 0.22s ease;
  }

  .nav-links.open {
    opacity: 1;
    pointer-events: auto;
    transform: scaleY(1);
  }

  .nav-toggle {
    display: flex;
  }

  .nav-cta {
    width: 100%;
    text-align: center;
  }

  /* Links del menú móvil: subir altura táctil a ~44px (antes ~34px). */
  .nav-links .nav-link {
    display: flex;
    align-items: center;
    padding: 0.85rem 0.9rem;
    width: 100%;
  }

  .hero {
    grid-template-columns: minmax(0, 1fr);
    padding-top: 3.2rem;
  }

  .hero-subtitle {
    /* En una sola columna, 3.5rem deja un hueco enorme antes de los botones. */
    margin-bottom: 1.6rem;
  }

  .hero-copy {
    position: relative;
    z-index: 1;
  }

  /* En móvil la constelación es fondo: atenuada y desvanecida en los bordes
     (máscara radial) para fundirse con la página sin costuras y dejar relucir el texto */
  .hero-network {
    position: absolute;
    top: -1.5rem;
    left: 50%;
    transform: translateX(-50%);
    width: min(420px, 92%);
    max-width: none;
    opacity: 0.35;
    z-index: 0;
    pointer-events: none;
    -webkit-mask-image: radial-gradient(circle at center, #000 25%, transparent 72%);
    mask-image: radial-gradient(circle at center, #000 25%, transparent 72%);
  }

  @media (prefers-reduced-motion: no-preference) {
    .hero-network {
      animation: none;
    }
  }

  .grid-services {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .portfolio-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid-contact {
    grid-template-columns: minmax(0, 1fr);
  }

  .process {
    padding-left: 2.3rem;
  }

  /* Compactar sección de servicios */
  #servicios.section {
    padding: 2.5rem 0 2.8rem;
  }

  #servicios .section-header {
    margin-bottom: 1.4rem;
  }

  /* Glass cards → chips ligeros en móvil: misma info, sin pila de cuadros */
  .glass-stack {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.6rem;
    margin-top: 1.6rem;
    margin-bottom: 2rem;
    animation: none; /* la animación de flotar solo en desktop */
  }

  .glass-card,
  .glass-stack:hover .glass-card,
  .glass-stack.mobile-collapsed .glass-card,
  .glass-stack.mobile-expanded .glass-card {
    width: auto;
    height: auto;
    margin: 0;
    transform: none;
    padding: 0.5rem 0.95rem;
    border-radius: 999px;
    gap: 0.45rem;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35);
  }

  .glass-card::before {
    content: attr(data-text);
    position: static;
    order: 1; /* texto después del icono */
    width: auto;
    height: auto;
    background: transparent;
    border-top: none;
    border-radius: 0;
    font-size: 0.85rem;
  }

  .glass-icon {
    font-size: 1.15rem;
    margin-bottom: 0;
    line-height: 1;
  }
}

@media (max-width: 600px) {
  .container {
    padding: 0 1rem;
  }

  .grid-services {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }

  /* En móvil los servicios dejan de ser tarjetas: contenido fluido con
     acento lateral y separador, para no apilar más cuadros */
  .service-detail {
    background: transparent;
    border: none;
    border-left: 2px solid rgba(255, 123, 44, 0.55);
    border-radius: 0;
    box-shadow: none;
    padding: 0.35rem 0 1.4rem 1.1rem;
    margin-bottom: 0.4rem;
  }

  .service-detail:last-child {
    padding-bottom: 0.4rem;
  }

  .service-detail:hover {
    transform: none;
    box-shadow: none;
    border-color: rgba(255, 123, 44, 0.55);
  }

  .portfolio-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .form-row {
    grid-template-columns: minmax(0, 1fr);
  }
}
