/*
  Estilos propios del sitio.
  Tailwind (CDN) cubre el layout; aquí van los componentes que se repiten,
  las animaciones y los detalles de accesibilidad.

  Paleta: negro de base, azul profundo para fondos y resplandores,
  dorado para acentos y botones, verde esmeralda solo para lo positivo.
*/

:root {
  --negro-950: #07080a;
  --negro-900: #0b0d10;
  --negro-800: #12151a;
  --negro-700: #1a1f27;
  --azul-950: #08142b;
  --azul-900: #0c1f45;
  --azul-700: #1c3f86;
  --azul-500: #2f62d0;
  --dorado-300: #e8cf8a;
  --dorado-400: #d4af55;
  --dorado-500: #c29a3d;
  --verde-300: #7fd8b0;
  --verde-400: #34b37e;
  --verde-600: #12805a;
  --claro: #eef1f5;
  --suave: #a3acba;
  --borde: rgba(255, 255, 255, 0.1);
  --radio: 0.75rem;
}

/* ---------- Accesibilidad ---------- */

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 100;
  padding: 0.75rem 1rem;
  border-radius: var(--radio);
  background: var(--dorado-400);
  color: var(--negro-950);
  font-weight: 600;
  transition: top 0.2s;
}
.skip-link:focus { top: 1rem; }

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

::selection { background: rgba(212, 175, 85, 0.35); color: #fff; }

/* Las anclas no quedan tapadas por el encabezado fijo */
section[id] { scroll-margin-top: 4.5rem; }

/* ---------- Encabezado ---------- */

#encabezado.is-scrolled,
#encabezado.menu-abierto {
  background: rgba(11, 13, 16, 0.92);
  box-shadow: 0 1px 0 var(--borde), 0 10px 30px -12px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(10px);
}

.nav-link { position: relative; transition: color 0.2s; }
.nav-link:hover { color: #fff; }
.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  height: 1px;
  width: 100%;
  background: var(--dorado-400);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}
.nav-link:hover::after { transform: scaleX(1); }

/* ---------- Botones ---------- */

.btn-dorado,
.btn-borde,
.btn-whatsapp {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1.4rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.2;
  transition: background-color 0.2s, color 0.2s, transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.btn-dorado {
  background: linear-gradient(135deg, var(--dorado-300), var(--dorado-500));
  color: var(--negro-950);
  box-shadow: 0 8px 24px -10px rgba(212, 175, 85, 0.6);
}
.btn-dorado:hover { transform: translateY(-1px); box-shadow: 0 12px 28px -10px rgba(212, 175, 85, 0.75); }
.btn-dorado[disabled] { opacity: 0.6; cursor: wait; }

.btn-borde { border: 1px solid rgba(255, 255, 255, 0.22); color: #fff; }
.btn-borde:hover { border-color: var(--dorado-300); color: var(--dorado-300); }

/* Verde oscuro de WhatsApp: mantiene contraste AA con texto blanco */
.btn-whatsapp { background: var(--verde-600); color: #fff; }
.btn-whatsapp:hover { background: #0f7050; transform: translateY(-1px); }

.wa-flotante {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 40;
  display: grid;
  place-items: center;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 999px;
  background: var(--verde-600);
  color: #fff;
  box-shadow: 0 10px 25px -8px rgba(0, 0, 0, 0.6);
  opacity: 0;
  transform: translateY(1rem);
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
}
.wa-flotante.visible { opacity: 1; transform: none; pointer-events: auto; }
@media (min-width: 1024px) { .wa-flotante { display: none; } }

/* ---------- Tipografía de secciones ---------- */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dorado-300);
}
.eyebrow::before {
  content: "";
  width: 1.75rem;
  height: 1px;
  background: currentColor;
}

.titulo-seccion {
  margin-top: 0.9rem;
  color: #fff;
  font-family: "Source Serif 4", Georgia, serif;
  font-weight: 600;
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  line-height: 1.15;
}

.enlace {
  color: var(--dorado-300);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.enlace:hover { color: #fff; }
.enlace-claro { text-decoration: underline; text-decoration-color: rgba(255, 255, 255, 0.25); text-underline-offset: 3px; }
.enlace-claro:hover { color: #fff; text-decoration-color: var(--dorado-300); }

/* ---------- Fondos de sección ---------- */

.hero {
  background:
    radial-gradient(60rem 40rem at 85% 30%, rgba(28, 63, 134, 0.45), transparent 60%),
    linear-gradient(180deg, var(--negro-900), var(--negro-900));
}

.seccion-azul {
  background:
    radial-gradient(50rem 30rem at 0% 0%, rgba(28, 63, 134, 0.35), transparent 60%),
    var(--azul-950);
  border-block: 1px solid var(--borde);
}

.contacto {
  background:
    radial-gradient(40rem 30rem at 100% 100%, rgba(18, 128, 90, 0.18), transparent 60%),
    radial-gradient(50rem 30rem at 0% 0%, rgba(28, 63, 134, 0.4), transparent 60%),
    var(--negro-900);
  border-top: 1px solid var(--borde);
}

/* ---------- Hero ---------- */

.curvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  color: var(--dorado-400);
  opacity: 0.1;
  pointer-events: none;
}

/* Resplandor azul con un toque verde detrás de la foto */
.halo {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: min(34rem, 110%);
  aspect-ratio: 1;
  transform: translateX(-50%);
  border-radius: 999px;
  background:
    radial-gradient(circle at 50% 45%, rgba(47, 98, 208, 0.55), transparent 62%),
    radial-gradient(circle at 70% 70%, rgba(18, 128, 90, 0.35), transparent 55%);
  filter: blur(8px);
}
.halo::after {
  /* Anillo dorado fino */
  content: "";
  position: absolute;
  inset: 12%;
  border-radius: inherit;
  border: 1px solid rgba(212, 175, 85, 0.35);
}

/* Escena con profundidad: main.js inclina la escena y mueve cada capa con "translate" */
.escena { transform-origin: 50% 60%; will-change: transform; }
.escena [data-profundidad] { will-change: translate; }

/* La foto se desvanece hacia abajo... */
.foto-hero {
  -webkit-mask-image: linear-gradient(180deg, #000 80%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 80%, transparent 100%);
}
/* ...y su contenedor le da luz de contorno: azul a la izquierda, dorada a la derecha */
.foto-luz {
  filter:
    drop-shadow(-4px -1px 16px rgba(47, 98, 208, 0.38))
    drop-shadow(4px -1px 16px rgba(212, 175, 85, 0.2))
    drop-shadow(0 30px 40px rgba(0, 0, 0, 0.6));
}

/* Base de luz bajo la figura: un óvalo dorado que la "asienta" en el piso */
.piso {
  position: absolute;
  left: 50%;
  bottom: 5%;
  width: 82%;
  height: 5rem;
  transform: translateX(-50%);
  border-radius: 50%;
  background:
    radial-gradient(closest-side, rgba(212, 175, 85, 0.45), transparent),
    radial-gradient(closest-side, rgba(47, 98, 208, 0.35), transparent 120%);
  filter: blur(6px);
}
.piso::after {
  /* Línea fina del borde del "escenario" */
  content: "";
  position: absolute;
  inset: 32% 6%;
  border-radius: 50%;
  border-top: 1px solid rgba(232, 207, 138, 0.55);
  filter: blur(0.5px);
}

.dato-flotante {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem 0.75rem 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 1rem;
  background: rgba(18, 21, 26, 0.78);
  backdrop-filter: blur(10px);
  box-shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.8);
  animation: flotar 6s ease-in-out infinite;
}
.dato-flotante + .dato-flotante { animation-delay: -3s; }
.dato-icono {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.65rem;
}
.dato-icono svg {
  width: 1.3rem;
  height: 1.3rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
@keyframes flotar {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* Franja de sectores con separadores dorados */
.franja li { display: inline-flex; align-items: center; }
.franja li:not(:last-child)::after {
  content: "";
  width: 4px;
  height: 4px;
  margin-left: 1.5rem;
  border-radius: 999px;
  background: var(--dorado-400);
}

/* ---------- Problemas ---------- */

.tarjeta-problema {
  padding: 1.9rem;
  border: 1px solid var(--borde);
  border-radius: 1rem;
  background: linear-gradient(180deg, var(--negro-800), var(--negro-900));
  transition: border-color 0.25s;
}
.tarjeta-problema:hover { border-color: rgba(212, 175, 85, 0.45); }
.tarjeta-problema .num {
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--dorado-400);
}
.tarjeta-problema h3 { margin-top: 0.75rem; font-size: 1.12rem; font-weight: 600; color: #fff; line-height: 1.4; }
.tarjeta-problema p:not(.num) { margin-top: 0.5rem; color: var(--suave); line-height: 1.6; }

/* ---------- Servicios ---------- */

.tarjeta-servicio {
  padding: 1.75rem;
  border: 1px solid var(--borde);
  border-radius: 1rem;
  background: rgba(11, 13, 16, 0.55);
  transition: border-color 0.25s, transform 0.25s, background-color 0.25s;
}
.tarjeta-servicio:hover {
  border-color: rgba(212, 175, 85, 0.5);
  background: rgba(11, 13, 16, 0.8);
  transform: translateY(-2px);
}
.tarjeta-servicio .icono {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.6rem;
  background: linear-gradient(135deg, var(--azul-700), var(--azul-900));
  color: var(--dorado-300);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.tarjeta-servicio .icono svg,
.check svg {
  width: 1.35rem;
  height: 1.35rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.tarjeta-servicio h3 {
  margin-top: 1.25rem;
  font-size: 1.08rem;
  font-weight: 600;
  line-height: 1.35;
  color: #fff;
}
.tarjeta-servicio p {
  margin-top: 0.5rem;
  color: var(--suave);
  line-height: 1.6;
}

/* ---------- Resultados ---------- */

.tarjeta-dato,
.tarjeta-grafica {
  padding: 2rem;
  border: 1px solid var(--borde);
  border-radius: 1rem;
  background: linear-gradient(160deg, var(--negro-800), var(--negro-900));
}
@media (min-width: 640px) { .tarjeta-dato, .tarjeta-grafica { padding: 2.5rem; } }
.tarjeta-grafica {
  background:
    radial-gradient(30rem 20rem at 100% 0%, rgba(28, 63, 134, 0.35), transparent 60%),
    var(--negro-800);
}

.check {
  display: grid;
  flex: none;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background: rgba(18, 128, 90, 0.2);
  color: var(--verde-300);
}
.check svg { width: 1rem; height: 1rem; stroke-width: 2.2; }

.barra { display: grid; gap: 5px; }
.barra span {
  display: block;
  height: 8px;
  border-radius: 999px;
  width: 0;
  transition: width 1.1s cubic-bezier(0.22, 1, 0.36, 1);
}
.barra-antes { background: rgba(255, 255, 255, 0.18); }
.barra-despues { background: linear-gradient(90deg, var(--verde-600), var(--verde-400)); transition-delay: 0.35s !important; }
.tarjeta-grafica.is-visible .barra span { width: var(--w); }

/* ---------- Proceso ---------- */

.paso { position: relative; }
.paso-num {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 999px;
  border: 1px solid var(--dorado-400);
  background: var(--azul-950);
  color: var(--dorado-300);
  font-family: "Source Serif 4", Georgia, serif;
  font-weight: 600;
  font-size: 1.1rem;
}
.paso h3 { margin-top: 1.25rem; font-size: 1.15rem; font-weight: 600; color: #fff; }
.paso p { margin-top: 0.5rem; color: var(--suave); line-height: 1.6; }

/* Línea que une los pasos: vertical en móvil, horizontal en escritorio */
.paso:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 1.375rem;
  top: 2.75rem;
  bottom: -2.5rem;
  width: 1px;
  background: linear-gradient(180deg, rgba(212, 175, 85, 0.5), rgba(212, 175, 85, 0.1));
}
@media (max-width: 767px) {
  .paso { padding-left: 4rem; }
  .paso-num { position: absolute; left: 0; top: 0; }
  .paso h3 { margin-top: 0.6rem; }
}
@media (min-width: 768px) {
  .paso:not(:last-child)::before {
    left: 3.25rem;
    right: -1.5rem;
    top: 1.375rem;
    bottom: auto;
    width: auto;
    height: 1px;
    background: linear-gradient(90deg, rgba(212, 175, 85, 0.5), rgba(212, 175, 85, 0.1));
  }
}

/* ---------- Sobre mí ---------- */

.retrato {
  position: relative;
  overflow: hidden;
  border-radius: 1.25rem;
  background:
    radial-gradient(circle at 50% 30%, rgba(47, 98, 208, 0.55), transparent 65%),
    linear-gradient(180deg, var(--azul-900), var(--negro-900));
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.9);
}
.marco-dorado {
  position: absolute;
  inset: 0;
  transform: translate(14px, 14px);
  border-radius: 1.25rem;
  border: 1px solid rgba(212, 175, 85, 0.6);
}
.etiqueta-ubicacion {
  position: absolute;
  left: 1rem;
  bottom: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(11, 13, 16, 0.75);
  backdrop-filter: blur(8px);
  font-size: 0.8rem;
  color: #fff;
}

/* ---------- Preguntas frecuentes ---------- */

.faq summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1.35rem 0;
  font-weight: 600;
  font-size: 1.05rem;
  color: #fff;
  cursor: pointer;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  flex: none;
  display: grid;
  place-items: center;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 999px;
  border: 1px solid rgba(212, 175, 85, 0.5);
  color: var(--dorado-300);
  font-weight: 400;
  font-size: 1.2rem;
  transition: transform 0.25s, background-color 0.25s;
}
.faq[open] summary::after { transform: rotate(45deg); background: rgba(212, 175, 85, 0.12); }
.faq p { padding: 0 2.5rem 1.4rem 0; color: var(--suave); line-height: 1.65; }

/* ---------- Formulario ---------- */

.formulario {
  padding: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 1.25rem;
  background: rgba(18, 21, 26, 0.85);
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.9);
}
@media (min-width: 640px) { .formulario { padding: 2.25rem; } }

.campo-label { display: block; margin-bottom: 0.4rem; font-size: 0.9rem; font-weight: 600; color: #fff; }
.campo {
  width: 100%;
  padding: 0.8rem 0.95rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 0.6rem;
  background: var(--negro-900);
  color: var(--claro);
  font: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.campo::placeholder { color: #7d8696; }
.campo:focus {
  outline: none;
  border-color: var(--dorado-400);
  box-shadow: 0 0 0 3px rgba(212, 175, 85, 0.2);
}
.campo[aria-invalid="true"] { border-color: #f08a7e; }
.estado-ok { color: var(--verde-300); }
.estado-error { color: #f5a59b; }

/* ---------- Animaciones al hacer scroll ---------- */

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.is-visible { opacity: 1; transform: none; }

/* Si el JS no carga, todo se ve igual */
.no-js .reveal { opacity: 1; transform: none; }
.no-js .barra span { width: var(--w); }

/* Respeta a quien prefiere menos movimiento */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal, .barra span, .tarjeta-servicio, .btn-dorado, .btn-whatsapp { transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  .barra span { width: var(--w); }
  .dato-flotante { animation: none; }
}
