/* ============================================
   APESSS Software Solutions - Estilos
   ============================================ */

/* --- Partículas de fondo (toda la app) --- */
.bg-particles {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

/* --- Variables --- */
:root {
  --color-primary: #047857;
  --color-primary-light: #059669;
  --color-dark: #064e3b;
  --color-text: #1a1a2e;
  --color-text-muted: #3d4f5f;
  --color-bg: #f8faf8;
  --color-bg-alt: #e8f0ec;
  --color-white: #ffffff;
  --font-primary: 'JetBrains Mono', monospace;
  --font-body: 'Geist', system-ui, sans-serif;
  --transition-fast: 0.2s ease;
  --transition-medium: 0.35s ease;
  --transition-slow: 0.5s ease;
  --shadow-sm: 0 2px 8px rgba(4, 78, 59, 0.08);
  --shadow-md: 0 4px 20px rgba(4, 78, 59, 0.1);
  --shadow-lg: 0 8px 40px rgba(4, 78, 59, 0.14);
  --color-error: #f87171;
  --color-error-bg: rgba(248, 113, 113, 0.12);

  /* ── Theme system ── */
  --accent-color: #34d399;
  --accent-hover: #10b981;
  --color-accent: var(--accent-color);
  --color-accent-hover: var(--accent-hover);
  --bg-body: #000000;
  --bg-header: rgba(0, 0, 0, 0.75);
  --bg-nav: #000000;
  --bg-surface: rgba(255, 255, 255, 0.04);
  --bg-input: rgba(255, 255, 255, 0.05);
  --text-hi: #ffffff;
  --text-md: #94a3b8;
  --text-lo: #64748b;
  --text-xlo: #475569;
  --particle-h: 210;
  --particle-s: 85%;
  --particle-l: 75%;
}

/* ── Light theme ── */
[data-theme="light"] {
  --accent-color: #059669;
  --accent-hover: #047857;
  --bg-body: #f0f4f8;
  --bg-header: rgba(240, 244, 248, 0.88);
  --bg-nav: #f0f4f8;
  --bg-surface: rgba(0, 0, 0, 0.04);
  --bg-input: rgba(0, 0, 0, 0.04);
  --text-hi: #0f172a;
  --text-md: #475569;
  --text-lo: #64748b;
  --text-xlo: #94a3b8;
  --particle-h: 158;
  --particle-s: 64%;
  --particle-l: 35%;
}

/* ── Midnight theme ── */
[data-theme="midnight"] {
  --accent-color: #a78bfa;
  --accent-hover: #8b5cf6;
  --bg-body: #0d0b1e;
  --bg-header: rgba(13, 11, 30, 0.88);
  --bg-nav: #0d0b1e;
  --bg-surface: rgba(167, 139, 250, 0.05);
  --bg-input: rgba(167, 139, 250, 0.04);
  --text-hi: #f0eeff;
  --text-md: #a394c7;
  --text-lo: #6b5e8c;
  --text-xlo: #4a3f6b;
  --particle-h: 256;
  --particle-s: 85%;
  --particle-l: 75%;
}

/* ── Ocean theme ── */
[data-theme="ocean"] {
  --accent-color: #38bdf8;
  --accent-hover: #0ea5e9;
  --bg-body: #050f1c;
  --bg-header: rgba(5, 15, 28, 0.88);
  --bg-nav: #050f1c;
  --bg-surface: rgba(56, 189, 248, 0.05);
  --bg-input: rgba(56, 189, 248, 0.04);
  --text-hi: #e0f4ff;
  --text-md: #7ec8e8;
  --text-lo: #3f7a9e;
  --text-xlo: #275270;
  --particle-h: 199;
  --particle-s: 90%;
  --particle-l: 72%;
}

/* ── Sunset theme ── */
[data-theme="sunset"] {
  --accent-color: #fb923c;
  --accent-hover: #f97316;
  --bg-body: #100a06;
  --bg-header: rgba(16, 10, 6, 0.88);
  --bg-nav: #100a06;
  --bg-surface: rgba(251, 146, 60, 0.05);
  --bg-input: rgba(251, 146, 60, 0.04);
  --text-hi: #fff3e8;
  --text-md: #c89a6c;
  --text-lo: #7a5a38;
  --text-xlo: #523c24;
  --particle-h: 28;
  --particle-s: 95%;
  --particle-l: 65%;
}

/* ── Slate theme ── */
[data-theme="slate"] {
  --accent-color: #60a5fa;
  --accent-hover: #3b82f6;
  --bg-body: #0a0d12;
  --bg-header: rgba(10, 13, 18, 0.88);
  --bg-nav: #0a0d12;
  --bg-surface: rgba(96, 165, 250, 0.04);
  --bg-input: rgba(96, 165, 250, 0.03);
  --text-hi: #e8edf5;
  --text-md: #8da0ba;
  --text-lo: #4e6280;
  --text-xlo: #354557;
  --particle-h: 213;
  --particle-s: 92%;
  --particle-l: 68%;
}

/* --- Utility --- */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --- Modal resultado contacto --- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-medium), visibility var(--transition-medium);
}

.modal--open {
  opacity: 1;
  visibility: visible;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(6px);
  cursor: pointer;
}

.modal__box {
  position: relative;
  width: 100%;
  max-width: 26rem;
  padding: 2rem 2rem 2.25rem;
  border-radius: 1rem;
  text-align: center;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.35s ease;
}

.modal__box--exito {
  background: linear-gradient(145deg, #000000 0%, #0a0a0a 100%);
  border: 1px solid rgba(52, 211, 153, 0.35);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(52, 211, 153, 0.1);
}

.modal__box--error {
  background: linear-gradient(145deg, #1f0d0d 0%, #2a1414 100%);
  border: 1px solid rgba(248, 113, 113, 0.3);
  box-shadow: 0 8px 40px rgba(120, 40, 40, 0.2), 0 0 0 1px rgba(248, 113, 113, 0.08);
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(-10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal__icon {
  width: 4rem;
  height: 4rem;
  margin: 0 auto 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.modal__box--exito .modal__icon {
  color: var(--color-accent);
  background: rgba(52, 211, 153, 0.15);
}

.modal__box--error .modal__icon {
  color: var(--color-error);
  background: var(--color-error-bg);
}

.modal__icon svg {
  width: 2.25rem;
  height: 2.25rem;
}

.modal__title {
  font-family: var(--font-primary);
  font-size: 1.5rem;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
}

.modal__text {
  font-size: 1rem;
  line-height: 1.6;
  color: #b8c5d4;
  margin-bottom: 1.5rem;
  padding: 0 0.5rem;
}

.modal__btn {
  min-width: 10rem;
}

.modal__btn:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.35);
}

.modal--open .modal__box {
  outline: none;
}

/* --- Spinner envío contacto --- */
.contacto__spinner-overlay {
  position: fixed;
  inset: 0;
  z-index: 1500;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-medium), visibility var(--transition-medium);
}

body.is-submitting-contacto .contacto__spinner-overlay {
  opacity: 1;
  visibility: visible;
}

.contacto__spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  padding: 2rem 2.5rem;
  border-radius: 1rem;
  background: radial-gradient(circle at top, #0a0a0a 0%, #000000 55%, #000000 100%);
  box-shadow: 0 16px 60px rgba(0, 0, 0, 0.5);
}

.contacto__spinner-circle {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 999px;
  border: 3px solid rgba(52, 211, 153, 0.2);
  border-top-color: var(--color-accent);
  animation: contactoSpinner 0.8s linear infinite;
}

.contacto__spinner-text {
  font-size: 0.98rem;
  color: #e5f5ee;
}

@keyframes contactoSpinner {
  to {
    transform: rotate(360deg);
  }
}

.btn--loading {
  position: relative;
  cursor: default;
  opacity: 0.8;
}


/* --- Reset --- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--bg-body);
  overflow-x: hidden;
  transition: background var(--transition-medium), color var(--transition-medium);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast), opacity var(--transition-fast);
}

ul {
  list-style: none;
}

/* --- Header --- */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 0.875rem 1.5rem;
  background: var(--bg-header);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(128, 128, 128, 0.15);
  transition: background var(--transition-medium), border-color var(--transition-medium);
}

.header__container {
  max-width: 75rem;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header__logo {
  font-family: var(--font-primary);
  font-weight: 700;
  font-size: 1.375rem;
  color: var(--text-hi);
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.header__logo-mark {
  flex-shrink: 0;
  display: block;
}

/* Animación triángulo: trazo fluyendo por el perímetro */
.logo-tri-stroke {
  stroke-dasharray: 15 38;
  stroke-dashoffset: 53;
  animation: logo-flow 3.2s linear infinite;
}

.logo-dot {
  animation: logo-dot-pulse 3.2s ease-in-out infinite;
}

@keyframes logo-flow {
  to { stroke-dashoffset: 0; }
}

@keyframes logo-dot-pulse {
  0%, 100% { opacity: 0.72; }
  50%       { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .logo-tri-stroke,
  .logo-dot {
    animation: none;
    stroke-dasharray: unset;
    stroke-dashoffset: unset;
  }
}

.header__toggle {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 1001;
}

.header__toggle-bar {
  width: 24px;
  height: 2px;
  background: var(--text-hi);
  border-radius: 2px;
  transition: transform var(--transition-medium), opacity var(--transition-medium);
}

.header__toggle.active .header__toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.header__toggle.active .header__toggle-bar:nth-child(2) {
  opacity: 0;
}

.header__toggle.active .header__toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.header__nav {
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  max-width: 20rem;
  height: 100vh;
  background: var(--bg-nav);
  padding: 5rem 2rem 2rem;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.4);
  transform: translateX(100%);
  transition: transform var(--transition-medium);
}

.header__nav.is-open {
  transform: translateX(0);
}

.header__nav-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.header__nav-link {
  display: block;
  padding: 0.75rem 1rem;
  font-weight: 500;
  color: var(--text-md);
  border-radius: 0.5rem;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.header__nav-link:hover,
.header__nav-link.active {
  background: rgba(52, 211, 153, 0.12);
  color: var(--text-hi);
}

/* Nav CTA button */
.header__nav-link--cta {
  color: var(--color-accent);
  border: 1px solid rgba(52, 211, 153, 0.3);
  background: rgba(52, 211, 153, 0.06);
}

.header__nav-link--cta:hover {
  background: rgba(52, 211, 153, 0.15);
  color: var(--text-hi);
  border-color: rgba(52, 211, 153, 0.5);
}

/* --- Main --- */
.main {
  position: relative;
  z-index: 0;
}

/* --- Sections base --- */
.section {
  min-height: 100vh;
  scroll-snap-align: start;
  scroll-snap-stop: normal;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 5rem 1.5rem 3rem;
  position: relative;
}

.section__inner {
  max-width: 75rem;
  margin: 0 auto;
  width: 100%;
}

.section__title {
  font-family: var(--font-primary);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  color: var(--text-hi);
  text-align: center;
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
}

.section__title::after {
  content: '';
  display: block;
  width: 2.5rem;
  height: 2px;
  background: var(--color-accent);
  margin: 0.875rem auto 0;
  border-radius: 1px;
}

.section__subtitle {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--text-md);
  text-align: center;
  max-width: 40rem;
  margin: 0 auto 3rem;
}

/* --- Hero --- */
.section--hero {
  padding: 0;
  justify-content: center;
  align-items: center;
}

.hero__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-body);
  z-index: 0;
  display: block;
}

.hero__content {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 2rem 1.5rem 2rem;
  max-width: 40rem;
  margin: 34vh auto 0;
}

.hero__content::before {
  content: '';
  position: absolute;
  inset: -4rem -6rem -3rem;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.6) 0%, transparent 70%);
  z-index: -1;
  pointer-events: none;
}

.hero__tagline {
  font-size: clamp(1.2rem, 2.8vw, 1.5rem);
  color: var(--text-hi);
  margin: 0 0 1.125rem;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.02em;
}

.hero__description {
  font-size: clamp(0.9rem, 1.8vw, 1.05rem);
  color: var(--text-md);
  margin: 0 auto 2rem;
  max-width: 30rem;
  line-height: 1.75;
}

/* Hero action buttons */
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

/* Hero stats bar */
.hero__stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.75rem;
  margin-top: 2rem;
  padding: 0.875rem 1.75rem;
  background: var(--bg-surface);
  border: 1px solid rgba(128, 128, 128, 0.12);
  border-radius: 999px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  white-space: nowrap;
}

.hero__stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
}

.hero__stat-number {
  font-family: var(--font-primary);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-accent);
  line-height: 1.1;
}

.hero__stat-label {
  font-size: 0.7rem;
  color: var(--text-lo);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hero__stat-sep {
  width: 1px;
  height: 2rem;
  background: rgba(128, 128, 128, 0.18);
  flex-shrink: 0;
}

.hero__scroll-indicator {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-xlo);
  font-size: 0.75rem;
  z-index: 1;
  letter-spacing: 0.03em;
}

.hero__scroll-arrow {
  width: 20px;
  height: 20px;
  border-right: 1.5px solid var(--text-xlo);
  border-bottom: 1.5px solid var(--text-xlo);
  transform: rotate(45deg);
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 100% { transform: rotate(45deg) translateY(0); }
  50% { transform: rotate(45deg) translateY(5px); }
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 1.875rem;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: 0.5rem;
  border: none;
  cursor: pointer;
  transition: background var(--transition-medium), transform var(--transition-fast), box-shadow var(--transition-medium), border-color var(--transition-fast);
  line-height: 1;
}

.btn svg {
  flex-shrink: 0;
  transition: transform var(--transition-fast);
}

.btn:hover svg {
  transform: translateX(3px);
}

.btn--primary {
  background: var(--color-accent);
  color: #052e16;
}

.btn--primary:hover {
  background: var(--color-accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(52, 211, 153, 0.25);
}

.btn--ghost {
  background: transparent;
  color: var(--text-hi);
  border: 1px solid rgba(128, 128, 128, 0.3);
}

.btn--ghost:hover {
  background: var(--bg-surface);
  border-color: rgba(128, 128, 128, 0.5);
  transform: translateY(-2px);
}

/* --- Servicios --- */
.section--servicios {
  background: var(--bg-body);
}

.servicios__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  max-width: 64rem;
  margin: 0 auto;
}

.servicio-card {
  background: var(--bg-surface);
  padding: 2rem;
  border-radius: 1rem;
  border: 1px solid rgba(128, 128, 128, 0.12);
  transition: transform var(--transition-medium), box-shadow var(--transition-medium), border-color var(--transition-medium);
  position: relative;
  overflow: hidden;
}

.servicio-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(52, 211, 153, 0.4), transparent);
  opacity: 0;
  transition: opacity var(--transition-medium);
}

.servicio-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(52, 211, 153, 0.15);
  border-color: rgba(52, 211, 153, 0.2);
}

.servicio-card:hover::before {
  opacity: 1;
}

.servicio-card__icon {
  width: 2.75rem;
  height: 2.75rem;
  margin-bottom: 1.25rem;
  color: var(--color-accent);
  background: rgba(52, 211, 153, 0.08);
  border-radius: 0.625rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
}

.servicio-card__icon svg {
  width: 100%;
  height: 100%;
}

.servicio-card__title {
  font-family: var(--font-primary);
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-hi);
  margin-bottom: 0.75rem;
}

.servicio-card__text {
  color: var(--text-md);
  font-size: 0.9375rem;
  line-height: 1.65;
}

/* --- Proceso --- */
.section--proceso {
  background: var(--bg-body);
}

.proceso__timeline {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  max-width: 56rem;
  margin: 0 auto;
}

.proceso__step {
  display: grid;
  grid-template-columns: minmax(0, 13rem) 3.5rem 1fr;
  gap: 1.5rem;
  align-items: center;
  padding: 1.5rem;
  border-radius: 0.875rem;
  border: 1px solid rgba(128, 128, 128, 0.1);
  background: var(--bg-surface);
  transition: border-color var(--transition-medium), background var(--transition-medium);
}

.proceso__step:hover {
  border-color: rgba(52, 211, 153, 0.15);
  background: rgba(255, 255, 255, 0.035);
}

.proceso__step-visual {
  margin: 0;
  border-radius: 0.625rem;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.proceso__canvas {
  display: block;
  width: 100%;
  height: 9rem;
}

.proceso__step-number {
  flex-shrink: 0;
  width: 3.5rem;
  height: 3.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(52, 211, 153, 0.1);
  border: 1px solid rgba(52, 211, 153, 0.25);
  color: var(--color-accent);
  font-family: var(--font-primary);
  font-weight: 700;
  font-size: 0.9375rem;
  border-radius: 0.625rem;
}

.proceso__step-content h3 {
  font-family: var(--font-primary);
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-hi);
  margin-bottom: 0.5rem;
}

.proceso__step-content p {
  color: var(--text-md);
  font-size: 0.9375rem;
  line-height: 1.65;
}

/* --- Beneficios --- */
.section--beneficios {
  background: var(--bg-body);
}

.beneficios__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

.beneficio-item {
  text-align: center;
  padding: 2rem 1.5rem;
  background: var(--bg-surface);
  border: 1px solid rgba(128, 128, 128, 0.12);
  border-radius: 1rem;
  position: relative;
  overflow: hidden;
  transition: transform var(--transition-medium), box-shadow var(--transition-medium), border-color var(--transition-medium);
}

.beneficio-item::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 0%, rgba(52, 211, 153, 0.06) 0%, transparent 60%);
  opacity: 0;
  transition: opacity var(--transition-medium);
}

.beneficio-item:hover {
  transform: translateY(-5px);
  border-color: rgba(52, 211, 153, 0.2);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

.beneficio-item:hover::before {
  opacity: 1;
}

.beneficio-item__icon {
  width: 3.5rem;
  height: 3.5rem;
  margin: 0 auto 1.25rem;
  color: var(--color-accent);
  background: rgba(52, 211, 153, 0.08);
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.625rem;
}

.beneficio-item__icon svg {
  width: 100%;
  height: 100%;
}

.beneficio-item h3 {
  font-family: var(--font-primary);
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-hi);
  margin-bottom: 0.75rem;
}

.beneficio-item p {
  color: var(--text-md);
  font-size: 0.9375rem;
  line-height: 1.65;
}

/* --- Contacto --- */
.section--contacto {
  background: var(--bg-body);
  color: var(--color-white);
}

.section--contacto .section__title {
  color: var(--text-hi);
}

.section--contacto .section__subtitle {
  color: var(--text-md);
}

.contacto__resolver-title,
.contacto__resolver-subtitle {
  min-height: 1.2em;
}

.section--contacto .section__inner {
  max-width: 100%;
  width: 100%;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.contacto__content {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  width: 100%;
  max-width: 52rem;
  margin: 0 auto;
}

/* Contact info panel */
.contacto__info-panel {
  display: flex;
  flex-direction: column;
}

.contacto__info-heading {
  font-family: var(--font-primary);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-lo);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
  padding-bottom: 0.875rem;
  border-bottom: 1px solid rgba(128, 128, 128, 0.15);
}

.contacto__info {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.contacto__item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.contacto__label {
  font-size: 0.8125rem;
  color: var(--text-lo);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  letter-spacing: 0.02em;
}

.contacto__item-icon {
  width: 1.125rem;
  height: 1.125rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-accent);
}

.contacto__item-icon svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.contacto__item a {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-hi);
  transition: color var(--transition-fast);
}

.contacto__item a:hover {
  color: var(--color-accent);
}

.contacto__form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
}

.contacto__form-row {
  display: grid;
  gap: 1rem;
}

.contacto__form-row--half {
  grid-template-columns: 1fr 1fr;
}

.contacto__form-row--full {
  grid-template-columns: 1fr;
}

.contacto__form-row--submit {
  margin-top: 0.25rem;
}

.contacto__form input,
.contacto__form textarea {
  padding: 0.875rem 1rem;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  border: 1px solid rgba(128, 128, 128, 0.2);
  border-radius: 0.5rem;
  background: var(--bg-input);
  color: var(--text-hi);
  transition: border-color var(--transition-fast), background var(--transition-fast), box-shadow var(--transition-fast);
  width: 100%;
}

.contacto__form input::placeholder,
.contacto__form textarea::placeholder {
  color: var(--text-xlo);
}

.contacto__form input:focus,
.contacto__form textarea:focus {
  outline: none;
  border-color: rgba(52, 211, 153, 0.5);
  background: rgba(255, 255, 255, 0.07);
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.12);
}

.contacto__form textarea {
  resize: vertical;
  min-height: 8rem;
}

/* --- Footer --- */
.footer {
  background: #07090e;
  color: #94a3b8;
  scroll-snap-align: start;
}

.footer__inner {
  max-width: 75rem;
  margin: 0 auto;
}

.footer__accent {
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(52, 211, 153, 0.4) 35%,
    rgba(52, 211, 153, 0.4) 65%,
    transparent 100%
  );
}

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

.footer__brand {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer__logo-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
}

.footer__logo-mark {
  flex-shrink: 0;
}

.footer__logo {
  font-family: var(--font-primary);
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-hi);
  letter-spacing: -0.02em;
}

.footer__tagline {
  font-size: 0.875rem;
  color: var(--text-lo);
  max-width: 22rem;
  line-height: 1.65;
}

.footer__col {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.footer__col-title {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-accent);
}

.footer__col-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.footer__col-link {
  font-size: 0.875rem;
  color: var(--text-lo);
  transition: color var(--transition-fast);
}

.footer__col-link:hover {
  color: var(--text-hi);
}

.footer__contact-link {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.footer__contact-link svg {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  color: #475569;
  transition: color var(--transition-fast);
}

.footer__contact-link:hover svg {
  color: var(--color-accent);
}

.footer__bottom {
  border-top: 1px solid rgba(128, 128, 128, 0.12);
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  text-align: center;
}

.footer__bottom p {
  font-size: 0.8125rem;
  color: var(--text-xlo);
}

.footer__bottom-tech {
  font-size: 0.75rem;
  color: #334155;
}

/* --- Animations --- */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(2rem);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

.animate-on-scroll[data-delay="1"] { transition-delay: 0.1s; }
.animate-on-scroll[data-delay="2"] { transition-delay: 0.2s; }
.animate-on-scroll[data-delay="3"] { transition-delay: 0.3s; }
.animate-on-scroll[data-delay="4"] { transition-delay: 0.4s; }

/* Hero initial animation */
.section--hero .animate-on-scroll {
  opacity: 0;
  transform: translateY(1.5rem);
}

.section--hero .animate-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Responsive: sm (576px) --- */
@media (min-width: 36rem) {
  .servicios__grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

/* --- Responsive: md (768px) --- */
@media (min-width: 48rem) {
  .header__toggle {
    display: none;
  }

  .header__nav {
    position: static;
    width: auto;
    max-width: none;
    height: auto;
    padding: 0;
    background: transparent;
    box-shadow: none;
    transform: none;
  }

  .header__nav-list {
    flex-direction: row;
    gap: 0.25rem;
    align-items: center;
  }

  .header__nav-link {
    padding: 0.5rem 0.875rem;
    font-size: 0.9375rem;
  }

  .header__nav-link--cta {
    padding: 0.5rem 1rem;
  }

  .contacto__content {
    grid-template-columns: 1fr 1.9fr;
    gap: 3rem;
    max-width: 68rem;
    align-items: start;
  }

  .footer__grid {
    grid-template-columns: 1.6fr 1fr 1.4fr;
    gap: 3rem;
    padding: 3rem 2rem 2.5rem;
  }

  .footer__bottom {
    flex-direction: row;
    justify-content: space-between;
    padding: 1.25rem 2rem;
    text-align: left;
  }
}

/* --- Proceso: móvil --- */
@media (max-width: 40rem) {
  .proceso__step {
    grid-template-columns: 3.5rem 1fr;
    grid-template-rows: auto auto;
  }

  .proceso__step-visual {
    grid-column: 1 / -1;
  }

  .proceso__canvas {
    height: 11rem;
  }

  .hero__stats {
    gap: 1rem;
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
  }

  .contacto__form-row--half {
    grid-template-columns: 1fr;
  }
}

/* --- Responsive: lg (992px) --- */
@media (min-width: 62rem) {
  .servicios__grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .beneficios__grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* --- Responsive: xl (1200px) --- */
@media (min-width: 75rem) {
  .section {
    padding: 6rem 2rem 4rem;
  }
}

/* --- Control de partículas: contenedor + menú + botón --- */
.particles-control {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 1001;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
  pointer-events: none;
}

.particles-menu {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.375rem;
  background: rgba(8, 12, 20, 0.94);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(52, 211, 153, 0.18);
  border-radius: 0.875rem;
  box-shadow:
    0 -6px 28px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.03);
  /* estado cerrado */
  opacity: 0;
  transform: translateY(0.5rem) scale(0.94);
  pointer-events: none;
  visibility: hidden;
  transition:
    opacity 0.22s ease,
    transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1),
    visibility 0s linear 0.22s;
  transform-origin: bottom right;
}

.particles-menu.is-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
  visibility: visible;
  transition:
    opacity 0.22s ease,
    transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1),
    visibility 0s linear 0s;
}

.particles-menu__option {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.625rem;
  padding: 0.45rem 0.875rem;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 0.5rem;
  color: rgba(160, 175, 200, 0.65);
  cursor: pointer;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.particles-menu__option::after {
  content: '';
  display: inline-block;
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  border: 1.5px solid rgba(52, 211, 153, 0.3);
  background: transparent;
  flex-shrink: 0;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.particles-menu__option:hover {
  background: rgba(52, 211, 153, 0.07);
  border-color: rgba(52, 211, 153, 0.18);
  color: rgba(110, 231, 183, 0.9);
}

.particles-menu__option.is-active {
  background: rgba(52, 211, 153, 0.1);
  border-color: rgba(52, 211, 153, 0.28);
  color: rgba(110, 231, 183, 1);
}

.particles-menu__option.is-active::after {
  background: rgba(52, 211, 153, 0.95);
  border-color: rgba(52, 211, 153, 0.95);
  box-shadow: 0 0 6px rgba(52, 211, 153, 0.5);
}

.particles-menu__option--off {
  margin-top: 0.2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 0.625rem;
  color: rgba(160, 175, 200, 0.45);
}

.particles-menu__option--off:hover {
  color: rgba(248, 113, 113, 0.85);
  background: rgba(248, 113, 113, 0.07);
  border-color: rgba(248, 113, 113, 0.2);
}

.particles-menu__option--off::after {
  border-color: rgba(248, 113, 113, 0.3);
}

.particles-menu__option--off.is-active {
  color: rgba(248, 113, 113, 0.9);
  background: rgba(248, 113, 113, 0.08);
  border-color: rgba(248, 113, 113, 0.25);
}

.particles-menu__option--off.is-active::after {
  background: rgba(248, 113, 113, 0.85);
  border-color: rgba(248, 113, 113, 0.85);
  box-shadow: 0 0 6px rgba(248, 113, 113, 0.4);
}

.particles-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  pointer-events: auto;
  background: rgba(4, 78, 59, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(52, 211, 153, 0.38);
  border-radius: 50%;
  color: rgba(110, 231, 183, 0.95);
  cursor: pointer;
  box-shadow: 0 0 18px rgba(52, 211, 153, 0.18), 0 2px 10px rgba(0, 0, 0, 0.4);
  transition:
    background 0.25s ease,
    border-color 0.25s ease,
    box-shadow 0.25s ease,
    transform 0.18s ease;
  user-select: none;
}

.particles-toggle svg {
  width: 1.125rem;
  height: 1.125rem;
}

.particles-toggle:hover {
  background: rgba(5, 105, 78, 0.95);
  border-color: rgba(52, 211, 153, 0.6);
  box-shadow: 0 0 28px rgba(52, 211, 153, 0.28), 0 2px 14px rgba(0, 0, 0, 0.45);
  transform: scale(1.08);
}

.particles-toggle:active {
  transform: scale(0.94);
}

.particles-toggle[aria-expanded="true"] {
  background: rgba(5, 110, 82, 0.92);
  border-color: rgba(52, 211, 153, 0.55);
  box-shadow: 0 0 24px rgba(52, 211, 153, 0.26), 0 2px 12px rgba(0, 0, 0, 0.4);
  transform: scale(1.05);
}

/* --- Control de tema: contenedor + menú + botón --- */
.theme-control {
  position: fixed;
  bottom: 1.5rem;
  right: calc(1.5rem + 2.75rem + 0.625rem);
  z-index: 1001;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
  pointer-events: none;
}

.theme-menu {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.375rem;
  background: rgba(8, 12, 20, 0.94);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0.875rem;
  box-shadow:
    0 -6px 28px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.03);
  opacity: 0;
  transform: translateY(0.5rem) scale(0.94);
  pointer-events: none;
  visibility: hidden;
  transition:
    opacity 0.22s ease,
    transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1),
    visibility 0s linear 0.22s;
  transform-origin: bottom right;
}

.theme-menu.is-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
  visibility: visible;
  transition:
    opacity 0.22s ease,
    transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1),
    visibility 0s linear 0s;
}

.theme-menu__option {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0.875rem 0.45rem 0.625rem;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 0.5rem;
  color: rgba(160, 175, 200, 0.65);
  cursor: pointer;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  width: 100%;
}

.theme-menu__swatch {
  width: 0.875rem;
  height: 0.875rem;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  background: var(--sw-bg);
  box-shadow: inset 0 0 0 2px var(--sw-ac);
}

.theme-menu__option[data-theme="dark"]     .theme-menu__swatch { --sw-bg: #000000; --sw-ac: #34d399; }
.theme-menu__option[data-theme="light"]    .theme-menu__swatch { --sw-bg: #f0f4f8; --sw-ac: #059669; }
.theme-menu__option[data-theme="midnight"] .theme-menu__swatch { --sw-bg: #0d0b1e; --sw-ac: #a78bfa; }
.theme-menu__option[data-theme="ocean"]    .theme-menu__swatch { --sw-bg: #050f1c; --sw-ac: #38bdf8; }
.theme-menu__option[data-theme="sunset"]   .theme-menu__swatch { --sw-bg: #100a06; --sw-ac: #fb923c; }
.theme-menu__option[data-theme="slate"]    .theme-menu__swatch { --sw-bg: #0a0d12; --sw-ac: #60a5fa; }

.theme-menu__option:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  color: rgba(220, 230, 245, 0.9);
}

.theme-menu__option.is-active {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
  color: rgba(220, 230, 245, 1);
}

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  pointer-events: auto;
  background: rgba(20, 20, 35, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  color: rgba(200, 215, 240, 0.9);
  cursor: pointer;
  box-shadow: 0 0 14px rgba(255, 255, 255, 0.06), 0 2px 10px rgba(0, 0, 0, 0.4);
  transition:
    background 0.25s ease,
    border-color 0.25s ease,
    box-shadow 0.25s ease,
    transform 0.18s ease;
  user-select: none;
}

.theme-toggle svg {
  width: 1.125rem;
  height: 1.125rem;
}

.theme-toggle:hover {
  background: rgba(30, 30, 50, 0.95);
  border-color: rgba(255, 255, 255, 0.35);
  box-shadow: 0 0 22px rgba(255, 255, 255, 0.1), 0 2px 14px rgba(0, 0, 0, 0.45);
  transform: scale(1.08);
}

.theme-toggle:active {
  transform: scale(0.94);
}

.theme-toggle[aria-expanded="true"] {
  background: rgba(30, 30, 50, 0.92);
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.08), 0 2px 12px rgba(0, 0, 0, 0.4);
  transform: scale(1.05);
}
