/* Pase de diseño sobre tareas 1-3: atmósfera aurora, vidrio,
   bento, micro-interacciones y revelado al hacer scroll. */

:root {
  --bg-1: #0b1220;
  --bg-2: #111a2b;
  --text: #e8edf5;
  --text-muted: #b7c2d6;
  --accent-cyan: #2fa8dc;
  --accent-cyan-hover: #4cc0ef;
  --accent-violet: #7a5cf0;
  --border: rgba(232, 237, 245, 0.12);
  --glass: rgba(17, 26, 43, 0.55);
  --radius: 10px;
  --container-max: 1200px;
  --section-gap: 6rem;
  --font-title: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.4, 0.64, 1);
  --header-h: 4.25rem;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1rem);
  scrollbar-color: var(--accent-cyan) var(--bg-1);
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text);
  background-color: var(--bg-1);
  overflow-x: clip;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-title);
  line-height: 1.2;
  margin: 0 0 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

p {
  margin: 0 0 1rem;
}

a {
  color: inherit;
}

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

::selection {
  background: var(--accent-cyan);
  color: #06121c;
}

::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: var(--bg-1);
}
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--accent-cyan), var(--accent-violet));
  border-radius: 8px;
  border: 2px solid var(--bg-1);
}

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

section {
  position: relative;
  padding-top: var(--section-gap);
  padding-bottom: var(--section-gap);
  scroll-margin-top: var(--header-h);
}

/* 1. Fondo con atmósfera: aurora + grano */
.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background:
    radial-gradient(60rem 30rem at 85% 30%, rgba(122, 92, 240, 0.12), transparent 60%),
    var(--bg-1);
}

.bg-aurora {
  position: absolute;
  inset: -10%;
}

.bg-aurora::before,
.bg-aurora::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  will-change: transform;
}

.bg-aurora::before {
  width: 55vmax;
  height: 55vmax;
  left: -15vmax;
  top: -18vmax;
  background: radial-gradient(circle, rgba(47, 168, 220, 0.28), transparent 62%);
  animation: drift-a 26s var(--ease-out) infinite alternate;
}

.bg-aurora::after {
  width: 50vmax;
  height: 50vmax;
  right: -14vmax;
  top: 22vh;
  background: radial-gradient(circle, rgba(122, 92, 240, 0.26), transparent 62%);
  animation: drift-b 32s var(--ease-out) infinite alternate;
}

@keyframes drift-a {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(6vmax, 4vmax) scale(1.12); }
}

@keyframes drift-b {
  from { transform: translate(0, 0) scale(1.05); }
  to { transform: translate(-5vmax, 6vmax) scale(0.95); }
}

.bg-grain {
  position: absolute;
  inset: 0;
  opacity: 0.06;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.6'/%3E%3C/svg%3E");
}

/* Indicador de progreso de lectura */
.progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 60;
  background: transparent;
}

.progress span {
  display: block;
  height: 100%;
  width: 100%;
  transform-origin: 0 50%;
  transform: scaleX(0);
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-violet));
}

/* Header con vidrio esmerilado */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background-color: transparent;
  border-bottom: 1px solid transparent;
  transition:
    background-color 220ms var(--ease-out),
    border-color 220ms var(--ease-out),
    box-shadow 220ms var(--ease-out);
}

.site-header.scrolled {
  background-color: rgba(11, 18, 32, 0.6);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  backdrop-filter: blur(16px) saturate(150%);
  border-bottom-color: rgba(232, 237, 245, 0.09);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 12px 32px rgba(0, 0, 0, 0.35);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--header-h);
}

.logo {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 1.25rem;
  text-decoration: none;
  letter-spacing: 0.01em;
  transition: text-shadow 200ms var(--ease-out);
}

.logo:hover {
  text-shadow: 0 0 24px rgba(47, 168, 220, 0.65);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  position: relative;
  text-decoration: none;
  color: var(--text-muted);
  font-weight: 500;
  padding: 0.25rem 0;
  transition: color 200ms var(--ease-out);
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  height: 2px;
  width: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-violet));
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform 220ms var(--ease-out);
}

.nav-links a:hover {
  color: var(--text);
}

.nav-links a:hover::after {
  transform: scaleX(1);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0.6rem;
  background: var(--glass);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 200ms var(--ease-out), transform 200ms var(--ease-spring);
}

.nav-toggle:hover {
  border-color: var(--accent-cyan);
}

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

.nav-toggle span {
  display: block;
  height: 2px;
  width: 100%;
  background-color: var(--text);
  border-radius: 2px;
  transition: transform 220ms var(--ease-out), opacity 200ms var(--ease-out);
}

/* Hero */
.hero {
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding-top: calc(var(--header-h) + 3rem);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 3rem;
  align-items: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
  background: var(--glass);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(232, 237, 245, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  padding: 0.45rem 1rem;
  margin-bottom: 1.5rem;
}

.hero-badge-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 12px var(--accent-cyan);
  animation: pulse 2.4s var(--ease-out) infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(0.8); }
}

.hero-text h1 {
  font-size: clamp(2.9rem, 7vw, 5.2rem);
  line-height: 1.05;
  letter-spacing: -0.025em;
  text-wrap: balance;
  margin-bottom: 1.25rem;
}

.hero-text h1 .grad {
  background: linear-gradient(92deg, var(--accent-cyan) 10%, var(--accent-violet) 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-lead {
  color: var(--text-muted);
  font-size: clamp(1.02rem, 1rem + 0.6vw, 1.22rem);
  line-height: 1.7;
  max-width: 34rem;
  margin-bottom: 2rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.hero-media {
  position: relative;
  margin: 0;
  border-radius: var(--radius);
  transform: perspective(1100px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform 300ms var(--ease-out);
  will-change: transform;
}

.hero-media img {
  width: 100%;
  height: 100%;
  aspect-ratio: 1 / 1;
  max-height: 560px;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid rgba(232, 237, 245, 0.14);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 24px 60px rgba(0, 0, 0, 0.45),
    0 0 80px rgba(47, 168, 220, 0.12);
}

.hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  background: linear-gradient(
    to top,
    rgba(11, 18, 32, 0.6) 0%,
    rgba(11, 18, 32, 0.12) 45%,
    rgba(11, 18, 32, 0) 70%
  );
  pointer-events: none;
}

.hero-chip {
  position: absolute;
  left: 1rem;
  bottom: 1rem;
  z-index: 2;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
  background: rgba(11, 18, 32, 0.55);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(232, 237, 245, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  padding: 0.5rem 1rem;
}

/* Servicios: encabezado + grilla bento */
.kicker {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-cyan);
  border: 1px solid rgba(47, 168, 220, 0.35);
  background: rgba(47, 168, 220, 0.08);
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  margin-bottom: 1rem;
}

.section-head {
  max-width: 46rem;
  margin-bottom: 2.5rem;
}

.section-head h2 {
  font-size: clamp(2rem, 4.5vw, 3rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  text-wrap: balance;
  margin-bottom: 0.75rem;
}

.section-head p {
  color: var(--text-muted);
  font-size: clamp(1.02rem, 1rem + 0.5vw, 1.15rem);
  line-height: 1.7;
  margin: 0;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1.25rem;
}

.service-card {
  grid-column: span 2;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.015)),
    var(--glass);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  border: 1px solid rgba(232, 237, 245, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  padding: 1.75rem;
  transition:
    transform 220ms var(--ease-out),
    border-color 220ms var(--ease-out),
    box-shadow 220ms var(--ease-out);
}

.service-card.wide {
  grid-column: span 4;
}

.service-card.wide h3 {
  font-size: clamp(1.3rem, 1.2rem + 0.8vw, 1.6rem);
}

/* Foco de luz que sigue al cursor */
.service-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    340px circle at var(--mx, 50%) var(--my, 50%),
    rgba(47, 168, 220, 0.16),
    rgba(122, 92, 240, 0.08) 45%,
    transparent 65%
  );
  opacity: 0;
  transition: opacity 250ms var(--ease-out);
  pointer-events: none;
}

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

.service-card:hover {
  transform: translateY(-4px);
  border-color: rgba(47, 168, 220, 0.55);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 16px 40px rgba(0, 0, 0, 0.4),
    0 0 32px rgba(47, 168, 220, 0.12);
}

.service-card > * {
  position: relative;
  z-index: 1;
}

.service-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: var(--radius);
  color: var(--accent-cyan);
  background: rgba(47, 168, 220, 0.1);
  border: 1px solid rgba(47, 168, 220, 0.3);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 0 20px rgba(47, 168, 220, 0.15);
  margin-bottom: 1.25rem;
  transition: transform 220ms var(--ease-spring), box-shadow 220ms var(--ease-out);
}

.service-card:hover .service-icon {
  transform: translateY(-2px) scale(1.05);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 0 28px rgba(47, 168, 220, 0.3);
}

.service-icon svg {
  width: 1.5rem;
  height: 1.5rem;
}

.service-card h3 {
  font-size: 1.15rem;
  line-height: 1.25;
  margin-bottom: 0.6rem;
}

.service-card p {
  color: var(--text-muted);
  margin: 0;
}

/* 3. Revelado al hacer scroll, escalonado */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition:
    opacity 700ms var(--ease-out) var(--rd, 0ms),
    transform 700ms var(--ease-out) var(--rd, 0ms);
  will-change: opacity, transform;
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* Botones con micro-interacciones propias */
.btn {
  position: relative;
  overflow: hidden;
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1rem;
  line-height: 1;
  padding: 0.9rem 1.6rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color 200ms var(--ease-out),
    border-color 200ms var(--ease-out),
    transform 200ms var(--ease-spring),
    box-shadow 200ms var(--ease-out);
}

.btn:active {
  transform: translateY(0) scale(0.98);
}

.btn-solid {
  background: linear-gradient(180deg, #45b6e6, var(--accent-cyan));
  border-color: rgba(255, 255, 255, 0.18);
  color: #06121c;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    0 8px 28px rgba(47, 168, 220, 0.35);
}

.btn-solid::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -60%;
  width: 40%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.5), transparent);
  transform: skewX(-20deg) translateX(-150%);
}

.btn-solid:hover {
  transform: translateY(-2px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    0 12px 36px rgba(47, 168, 220, 0.5);
}

.btn-solid:hover::after {
  transform: skewX(-20deg) translateX(450%);
  transition: transform 600ms var(--ease-out);
}

.btn-outline {
  background: var(--glass);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-color: rgba(47, 168, 220, 0.5);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.btn-outline:hover {
  transform: translateY(-2px);
  border-color: var(--text);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 10px 28px rgba(0, 0, 0, 0.35);
}

/* Accesibilidad: foco visible con el tabulador */
a:focus-visible,
button:focus-visible,
.btn:focus-visible {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 3px;
}

/* Tarea 4 — Cómo trabajamos: pasos conectados por una línea que se ilumina */
.steps {
  --lp: 0;
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  list-style: none;
  margin: 2.5rem 0 0;
  padding: 0;
}

.steps::before,
.steps::after {
  content: "";
  position: absolute;
  top: 2rem;
  left: 11%;
  right: 11%;
  height: 2px;
  border-radius: 2px;
}

.steps::before {
  background: var(--border);
}

.steps::after {
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-violet));
  box-shadow: 0 0 16px rgba(47, 168, 220, 0.5);
  transform: scaleX(var(--lp));
  transform-origin: 0 50%;
}

.step {
  position: relative;
}

.step-num {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-muted);
  background: var(--glass);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  margin-bottom: 1.25rem;
  transition:
    color 220ms var(--ease-out),
    border-color 220ms var(--ease-out),
    box-shadow 220ms var(--ease-out),
    transform 220ms var(--ease-spring);
}

.step:hover .step-num {
  transform: translateY(-2px);
}

.step.active .step-num {
  color: var(--text);
  border-color: rgba(47, 168, 220, 0.65);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 0 28px rgba(47, 168, 220, 0.35);
}

.step h3 {
  font-size: 1.15rem;
  line-height: 1.25;
  margin-bottom: 0.4rem;
}

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

/* Tarea 5 — Planes (sin precios: se cotiza por consulta) */
.plans {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  align-items: stretch;
}

.plan {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.015)),
    var(--glass);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  border: 1px solid rgba(232, 237, 245, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  padding: 2rem;
  transition:
    transform 220ms var(--ease-out),
    border-color 220ms var(--ease-out),
    box-shadow 220ms var(--ease-out);
}

.plan::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    340px circle at var(--mx, 50%) var(--my, 50%),
    rgba(47, 168, 220, 0.16),
    rgba(122, 92, 240, 0.08) 45%,
    transparent 65%
  );
  opacity: 0;
  transition: opacity 250ms var(--ease-out);
  pointer-events: none;
}

.plan:hover::before {
  opacity: 1;
}

.plan:hover {
  transform: translateY(-4px);
  border-color: rgba(47, 168, 220, 0.55);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 16px 40px rgba(0, 0, 0, 0.4),
    0 0 32px rgba(47, 168, 220, 0.12);
}

.plan > * {
  position: relative;
  z-index: 1;
}

.plan.featured {
  border-color: rgba(47, 168, 220, 0.6);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 16px 48px rgba(0, 0, 0, 0.45),
    0 0 40px rgba(47, 168, 220, 0.18);
}

.plan-tag {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #06121c;
  background: linear-gradient(180deg, #45b6e6, var(--accent-cyan));
  box-shadow: 0 4px 16px rgba(47, 168, 220, 0.45);
  border-radius: 999px;
  padding: 0.3rem 0.8rem;
}

.plan h3 {
  font-size: clamp(1.3rem, 1.2rem + 0.6vw, 1.5rem);
  margin-bottom: 0.75rem;
}

.plan-desc {
  color: var(--text-muted);
  flex: 1;
  margin-bottom: 1.5rem;
}

.plans-note {
  margin-top: 2rem;
  margin-bottom: 0;
  text-align: center;
  color: var(--text-muted);
}

.plans-note a {
  color: var(--accent-cyan);
  font-weight: 600;
  text-decoration: none;
  transition: color 200ms var(--ease-out);
}

.plans-note a:hover {
  color: var(--text);
}

/* Tarea 6 — Galería mosaico + lightbox */
.g-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 200px;
  grid-auto-flow: dense;
  gap: 1rem;
  margin-top: 2.5rem;
}

.g-item {
  margin: 0;
  border-radius: var(--radius);
  overflow: hidden;
}

.g-item:nth-child(1) {
  grid-column: span 2;
  grid-row: span 2;
}

.g-item:nth-child(6),
.g-item:nth-child(9) {
  grid-column: span 2;
}

.g-btn {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 1px solid rgba(232, 237, 245, 0.12);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-2);
  cursor: zoom-in;
  transition:
    border-color 220ms var(--ease-out),
    transform 220ms var(--ease-out),
    box-shadow 220ms var(--ease-out);
}

.g-btn:hover {
  border-color: rgba(47, 168, 220, 0.55);
  box-shadow:
    0 12px 32px rgba(0, 0, 0, 0.4),
    0 0 28px rgba(47, 168, 220, 0.15);
}

.g-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 350ms var(--ease-out), filter 250ms var(--ease-out);
}

.g-btn:hover img {
  transform: scale(1.05);
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  visibility: hidden;
  opacity: 0;
  transition:
    opacity 250ms var(--ease-out),
    visibility 0ms 250ms;
}

.lightbox.open {
  visibility: visible;
  opacity: 1;
  transition: opacity 250ms var(--ease-out);
}

.lightbox[hidden] {
  display: none;
}

.lb-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 9, 18, 0.8);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.lb-figure {
  position: relative;
  margin: 0;
  max-width: min(880px, 100%);
  max-height: 82vh;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid rgba(232, 237, 245, 0.16);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 32px 80px rgba(0, 0, 0, 0.6),
    0 0 60px rgba(47, 168, 220, 0.12);
  transform: scale(0.94) translateY(10px);
  transition: transform 280ms var(--ease-spring);
}

.lightbox.open .lb-figure {
  transform: none;
}

.lb-figure img {
  display: block;
  width: 100%;
  max-height: 82vh;
  object-fit: contain;
  background: #05090f;
}

.lb-close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  color: var(--text);
  background: var(--glass);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(232, 237, 245, 0.2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition:
    border-color 200ms var(--ease-out),
    transform 200ms var(--ease-spring);
}

.lb-close:hover {
  border-color: var(--accent-cyan);
  transform: scale(1.06);
}

.lb-close svg {
  width: 1.2rem;
  height: 1.2rem;
}

body.lb-open {
  overflow: hidden;
}

/* Tarea 7 — Contacto y footer */
.contact-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 3rem;
  align-items: start;
}

.contact-info h2 {
  font-size: clamp(2rem, 4.5vw, 3rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.contact-info p {
  color: var(--text-muted);
  font-size: clamp(1.02rem, 1rem + 0.5vw, 1.15rem);
  line-height: 1.7;
}

.contact-mail {
  display: inline-block;
  margin-top: 0.5rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  border: 1px solid rgba(47, 168, 220, 0.35);
  background: rgba(47, 168, 220, 0.08);
  border-radius: 999px;
  padding: 0.5rem 1.1rem;
}

.contact-form {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.015)),
    var(--glass);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  border: 1px solid rgba(232, 237, 245, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  padding: 2rem;
  display: grid;
  gap: 1.25rem;
}

.field {
  position: relative;
  display: grid;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--text);
  background: rgba(5, 9, 18, 0.45);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem 1rem 0.55rem;
  transition:
    border-color 200ms var(--ease-out),
    box-shadow 200ms var(--ease-out);
}

.field textarea {
  resize: vertical;
  min-height: 7.5rem;
}

.field select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 2.5rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%232FA8DC' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
}

.field.static label {
  top: 0.55rem;
  font-size: 0.78rem;
  color: var(--accent-cyan);
}

.field label {
  position: absolute;
  left: 1rem;
  top: 1rem;
  color: var(--text-muted);
  font-size: 1rem;
  pointer-events: none;
  transition:
    top 200ms var(--ease-out),
    font-size 200ms var(--ease-out),
    color 200ms var(--ease-out);
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: var(--accent-cyan);
  box-shadow:
    0 0 0 3px rgba(47, 168, 220, 0.22),
    0 0 24px rgba(47, 168, 220, 0.15);
}

.field input:focus + label,
.field input:not(:placeholder-shown) + label,
.field textarea:focus + label,
.field textarea:not(:placeholder-shown) + label {
  top: 0.45rem;
  font-size: 0.78rem;
  color: var(--accent-cyan);
}

.field input[aria-invalid="true"],
.field textarea[aria-invalid="true"],
.field select[aria-invalid="true"] {
  border-color: #ff8f9d;
  box-shadow: 0 0 0 3px rgba(255, 143, 157, 0.18);
}

.field-error {
  margin: 0.4rem 0 0;
  font-size: 0.85rem;
  color: #ffa3ae;
}

.field-error[hidden] {
  display: none;
}

.form-success {
  margin: 0;
  font-weight: 500;
  color: var(--text);
  border: 1px solid rgba(47, 168, 220, 0.45);
  background: rgba(47, 168, 220, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  padding: 0.9rem 1.1rem;
}

.form-success[hidden] {
  display: none;
}

.form-error {
  margin: 0;
  font-size: 0.9rem;
  color: #ffa3ae;
}

.form-error[hidden] {
  display: none;
}

.form-error a {
  color: var(--accent-cyan);
}

/* Honeypot anti-spam: oculto a la vista sin sacarlo del flujo accesible */
.hp {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: 0;
  border: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
}

.btn.is-sending {
  cursor: wait;
  opacity: 0.8;
  transform: none;
}

.btn.is-sending::before {
  content: "";
  display: inline-block;
  width: 1em;
  height: 1em;
  margin-right: 0.6rem;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-top-color: transparent;
  vertical-align: -0.15em;
  animation: spin 0.8s linear infinite;
}

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

footer {
  border-top: 1px solid var(--border);
  padding-top: 3rem;
  padding-bottom: 2rem;
  background: rgba(5, 9, 18, 0.5);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 2rem;
  align-items: start;
}

.footer-brand p {
  color: var(--text-muted);
  margin: 0.75rem 0 0;
  max-width: 24rem;
}

.footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 200ms var(--ease-out);
}

.footer-links a:hover {
  color: var(--text);
}

.footer-contact p {
  color: var(--text-muted);
  margin: 0 0 0.5rem;
  overflow-wrap: anywhere;
}

.footer-contact a {
  color: inherit;
  text-decoration: none;
  transition: color 200ms var(--ease-out);
}

.footer-contact a:hover {
  color: var(--text);
}

.footer-bottom {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

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

@media (max-width: 960px) {
  .plans {
    grid-template-columns: 1fr;
    max-width: 28rem;
    margin-left: auto;
    margin-right: auto;
  }
}

@media (max-width: 860px) {
  .steps {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .steps::before,
  .steps::after {
    top: 0.5rem;
    bottom: 0.5rem;
    left: 2rem;
    right: auto;
    width: 2px;
    height: auto;
  }

  .steps::after {
    background: linear-gradient(180deg, var(--accent-cyan), var(--accent-violet));
    transform: scaleY(var(--lp));
    transform-origin: 50% 0;
  }

  .step {
    padding-left: 5.5rem;
    min-height: 4rem;
  }

  .step-num {
    position: absolute;
    left: 0;
    top: 0;
    margin-bottom: 0;
  }
}

@media (max-width: 960px) {
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .service-card {
    grid-column: span 1;
  }

  .service-card.wide {
    grid-column: span 2;
  }
}

@media (max-width: 860px) {
  .nav-toggle {
    display: flex;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background-color: rgba(11, 18, 32, 0.92);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    backdrop-filter: blur(16px) saturate(140%);
    border-bottom: 1px solid var(--border);
    padding: 0.5rem 1.5rem 1rem;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    display: block;
    padding: 0.75rem 0;
  }

  .hero {
    min-height: auto;
    padding-top: calc(var(--header-h) + 2rem);
  }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .hero-media img {
    max-height: 420px;
  }

  .contact-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .g-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 160px;
    gap: 0.75rem;
  }

  .g-item:nth-child(1) {
    grid-column: span 2;
    grid-row: span 1;
  }

  .g-item:nth-child(6),
  .g-item:nth-child(9) {
    grid-column: span 1;
  }

  .services-grid {
    grid-template-columns: 1fr;
  }

  .service-card,
  .service-card.wide {
    grid-column: span 1;
  }
}

/* Modo claro: se mantiene la atmósfera en baja opacidad */
@media (prefers-color-scheme: light) {
  :root {
    --bg-1: #f4f6fa;
    --bg-2: #ffffff;
    --text: #0b1220;
    --text-muted: #3f4c63;
    --border: rgba(11, 18, 32, 0.14);
    --glass: rgba(255, 255, 255, 0.6);
  }

  .bg {
    background:
      radial-gradient(60rem 30rem at 85% 30%, rgba(122, 92, 240, 0.1), transparent 60%),
      var(--bg-1);
  }

  .bg-aurora::before {
    background: radial-gradient(circle, rgba(47, 168, 220, 0.2), transparent 62%);
  }

  .bg-aurora::after {
    background: radial-gradient(circle, rgba(122, 92, 240, 0.18), transparent 62%);
  }

  .btn-solid {
    color: #ffffff;
  }

  .site-header.scrolled {
    background-color: rgba(244, 246, 250, 0.7);
  }

  .nav-links {
    background-color: rgba(244, 246, 250, 0.95);
  }

  .service-card {
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.55)),
      var(--glass);
    border-color: rgba(11, 18, 32, 0.1);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  }

  .step-num {
    background: var(--glass);
    border-color: rgba(11, 18, 32, 0.12);
  }

  .plan {
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.55)),
      var(--glass);
    border-color: rgba(11, 18, 32, 0.1);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  }

  .plan.featured {
    border-color: rgba(47, 168, 220, 0.6);
  }

  .contact-form {
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.55)),
      var(--glass);
    border-color: rgba(11, 18, 32, 0.1);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  }

  .field input,
  .field textarea,
  .field select {
    background: rgba(255, 255, 255, 0.7);
  }

  .field-error,
  .form-error {
    color: #b42336;
  }

  .form-error a {
    color: #0a6c9c;
  }

  .field input[aria-invalid="true"],
  .field textarea[aria-invalid="true"],
  .field select[aria-invalid="true"] {
    border-color: #b42336;
    box-shadow: 0 0 0 3px rgba(180, 35, 54, 0.15);
  }

  @media (min-width: 861px) {
    .nav-links {
      background-color: transparent;
    }
  }
}

/* 9. Movimiento reducido: se apaga todo */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .reveal {
    opacity: 1 !important;
    transform: none !important;
  }

  .bg-aurora::before,
  .bg-aurora::after {
    animation: none;
  }
}
