/* Vitri: landing. Todos los colores son tokens de :root; pruebas/comprobar.py
   verifica su contraste (WCAG AA) y que no haya colores literales fuera de :root. */
:root {
  --petroleo: #063b3f;
  --petroleo-medio: #0e5a5f;
  --petroleo-hondo: #042a2d;
  --menta: #6fe3c1;
  --agua: #bff7e9;
  --blanco-hielo: #f4fffb;
  --blanco: #ffffff;
  --cabecera: rgba(6, 59, 63, 0.82);
  --vidrio: rgba(191, 247, 233, 0.08);
  --vidrio-borde: rgba(191, 247, 233, 0.34);
  --vidrio-borde-fuerte: rgba(191, 247, 233, 0.6);
  --cabecera-clara: rgba(244, 255, 251, 0.78);
  --halo: rgba(111, 227, 193, 0.35);
  --halo-suave: rgba(111, 227, 193, 0.12);
  --linea-clara: rgba(6, 59, 63, 0.12);
  --sombra: rgba(4, 42, 45, 0.18);
  --sombra-honda: rgba(2, 20, 22, 0.45);
  --cristal-claro: rgba(255, 255, 255, 0.58);
  --cristal-borde-claro: rgba(255, 255, 255, 0.75);
  --cristal-oscuro: rgba(4, 42, 45, 0.5);
  --capsula: rgba(4, 42, 45, 0.84);
  --reflejo: rgba(255, 255, 255, 0.35);
  --brillo: rgba(255, 255, 255, 0.9);
  --brillo-oscuro: rgba(191, 247, 233, 0.28);
  --mancha-menta: rgba(111, 227, 193, 0.55);
  --mancha-agua: rgba(191, 247, 233, 0.9);
  --mancha-petroleo: rgba(14, 90, 95, 0.14);
  --radio: 26px;
  --radio-grande: 36px;
  --ancho: 1160px;
  --curva: cubic-bezier(0.2, 0.8, 0.2, 1);
  --muelle: linear(0, 0.55 12%, 1.04 30%, 0.99 45%, 1);
  --fuente: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 72px; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--fuente);
  font-size: 1.0625rem;
  line-height: 1.55;
  color: var(--blanco-hielo);
  background: var(--petroleo);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img, svg { display: block; max-width: 100%; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

h1, h2, h3 { margin: 0; line-height: 1.08; letter-spacing: -0.025em; font-weight: 700; text-wrap: balance; }
h1 { font-size: clamp(2.5rem, 6.4vw, 4.6rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(2rem, 4.4vw, 3.25rem); margin-bottom: 0.5em; letter-spacing: -0.018em; }
h3 { font-size: 1.1875rem; margin: 0.9rem 0 0.35rem; letter-spacing: -0.01em; }
p { margin: 0; }

a { color: inherit; }

:focus-visible { outline: 3px solid var(--menta); outline-offset: 3px; border-radius: 8px; }
.seccion--clara :focus-visible { outline-color: var(--petroleo-medio); }

.contenedor { width: min(100% - 32px, var(--ancho)); margin-inline: auto; }
.contenedor--estrecho { width: min(100% - 32px, 820px); }

.saltar {
  position: absolute; left: 16px; top: -100px; z-index: 20;
  padding: 10px 16px; border-radius: 12px;
  background: var(--menta); color: var(--petroleo); font-weight: 600; text-decoration: none;
}
.saltar:focus { top: 12px; }

/* Cabecera */
.cabecera {
  position: sticky; top: 0; z-index: 10;
  background: var(--cabecera);
  -webkit-backdrop-filter: saturate(160%) blur(18px);
  backdrop-filter: saturate(160%) blur(18px);
  border-bottom: 0.5px solid var(--vidrio-borde);
}
.cabecera__fila { display: flex; align-items: center; gap: 24px; min-height: 64px; }
.marca { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.25rem; letter-spacing: -0.02em; text-decoration: none; }
.marca img { border-radius: 8px; }
.navegacion { display: flex; gap: 28px; margin-left: auto; font-size: 0.9375rem; }
.navegacion a { text-decoration: none; color: var(--agua); padding: 12px 0; }
.navegacion a:hover { color: var(--blanco-hielo); }
/* Selector de idioma: enlaces a la otra versión; la actual va marcada con aria-current. */
.idiomas { display: flex; gap: 14px; font-size: 0.875rem; }
.idiomas a { text-decoration: none; color: var(--agua); padding: 12px 0; min-height: 44px; display: inline-flex; align-items: center; }
.idiomas a:hover { color: var(--blanco-hielo); }
.idiomas a[aria-current="page"] { color: var(--blanco-hielo); font-weight: 600; text-decoration: underline; text-underline-offset: 4px; }

/* Botones */
.boton {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 26px; border-radius: 999px; border: 0;
  background: var(--menta); color: var(--petroleo);
  font: 600 1.0625rem/1 var(--fuente); text-decoration: none; cursor: pointer;
  box-shadow: 0 10px 30px -10px var(--halo);
  transition: transform 380ms var(--muelle), box-shadow 160ms var(--curva), opacity 180ms var(--curva);
}
.boton:hover { transform: translateY(-1px); box-shadow: 0 14px 36px -10px var(--halo); }
.boton:active { transform: scale(0.96); transition-duration: 120ms; }
.boton--pequeno { min-height: 44px; padding: 0 18px; font-size: 0.9375rem; box-shadow: none; }
.boton--secundario { background: transparent; color: var(--blanco-hielo); box-shadow: inset 0 0 0 1px var(--vidrio-borde); }
.boton--secundario:hover { background: var(--vidrio); box-shadow: inset 0 0 0 1px var(--agua); }
.boton--vidrio {
  min-height: 44px; padding: 0 20px; font-size: 0.9375rem;
  background: var(--vidrio); color: var(--blanco-hielo);
  box-shadow: inset 0 0 0 0.5px var(--vidrio-borde);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.boton--vidrio:hover { background: var(--halo-suave); box-shadow: inset 0 0 0 0.5px var(--agua); }

.icono { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.icono--grande { width: 32px; height: 32px; stroke-width: 1.5; }
.icono--relleno { fill: currentColor; stroke: none; }

/* Héroe */
.heroe {
  position: relative; overflow: hidden;
  padding: clamp(24px, 8vw, 96px) 0 clamp(56px, 9vw, 112px);
  background:
    radial-gradient(60% 55% at 78% 38%, var(--halo-suave), transparent 70%),
    radial-gradient(50% 60% at 0% 100%, var(--halo-suave), transparent 70%),
    linear-gradient(180deg, var(--petroleo) 0%, var(--petroleo-hondo) 100%);
}
.heroe__rejilla { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: clamp(32px, 5vw, 72px); align-items: center; }
.etiqueta { font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--menta); margin-bottom: 18px; }
.etiqueta--clara { color: var(--petroleo-medio); }
.resalte { color: var(--menta); white-space: nowrap; }
.entrada { font-size: clamp(1.125rem, 1.6vw, 1.3125rem); color: var(--agua); margin-top: 22px; max-width: 34em; text-wrap: pretty; }
.entrada--seccion { margin: -8px 0 40px; }
.acciones { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 36px; }

/* Escena 3D */
.escena { margin: 0; }
.escena__vidrio {
  position: relative; aspect-ratio: 1; border-radius: var(--radio-grande);
  background: linear-gradient(160deg, var(--vidrio), transparent 60%), var(--petroleo-hondo);
  box-shadow: inset 0 0 0 0.5px var(--vidrio-borde), 0 40px 80px -40px var(--sombra);
  overflow: hidden;
}
.escena__halo {
  position: absolute; inset: 18% 14% 10%; border-radius: 50%;
  background: radial-gradient(closest-side, var(--halo), transparent);
  animation: respirar 6s ease-in-out infinite;
}
.escena__vidrio { aspect-ratio: 4 / 5; cursor: grab; }
.escena__vidrio:active { cursor: grabbing; }
/* El póster solo se ve mientras no hay modelo dibujado; se funde al cargar el 3D. */
.escena__poster {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain;
  transition: opacity 240ms var(--curva), visibility 0s linear 0s;
}
.escena__poster.oculto { opacity: 0; visibility: hidden; transition: opacity 240ms var(--curva), visibility 0s linear 240ms; }
.escena__visor { position: absolute; inset: 0; opacity: 0; transition: opacity 240ms var(--curva); -webkit-user-select: none; user-select: none; }
.escena__visor.listo { opacity: 1; }
.escena__visor model-viewer { width: 100%; height: 100%; --poster-color: transparent; background: transparent; touch-action: pan-y; cursor: grab; }
.escena__visor model-viewer:active { cursor: grabbing; }
.sin-pan { pointer-events: none; }
.escena__capsula {
  position: absolute; top: 14px; left: 50%; z-index: 2; margin: 0; padding: 7px 14px; border-radius: 999px;
  white-space: nowrap; font-size: 0.8125rem; font-weight: 600; color: var(--blanco-hielo); pointer-events: none;
  background: var(--capsula); box-shadow: inset 0 0 0 0.5px var(--vidrio-borde);
  -webkit-backdrop-filter: blur(14px) saturate(160%); backdrop-filter: blur(14px) saturate(160%);
  opacity: 0; transform: translate(-50%, -4px); transition: opacity 300ms var(--curva), transform 300ms var(--curva);
}
.escena__capsula.visible { opacity: 1; transform: translate(-50%, 0); }
.escena__capsula.cargando::before {
  content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 8px; vertical-align: -1px;
  border: 1.5px solid var(--agua); border-top-color: transparent; border-radius: 50%; animation: girar 0.9s linear infinite;
}
@keyframes girar { to { transform: rotate(360deg); } }
.escena__pie { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-top: 18px; }
.escena__nota { font-size: 0.875rem; color: var(--agua); }
.escena__nota[hidden] { display: none; }
/* Sin AR (escritorio): pastilla de vidrio con el QR, abajo a la derecha, donde en el
   teléfono está «Ver en tu espacio». Nunca a la vez que el botón AR. */
.qr-mesa {
  position: absolute; z-index: 2; display: flex; align-items: center; gap: 14px;
  right: 14px; bottom: 14px; max-width: calc(100% - 86px); padding: 8px 18px 8px 8px; border-radius: 22px;
  background: var(--capsula); box-shadow: inset 0 0 0 0.5px var(--vidrio-borde), 0 18px 40px -20px var(--sombra-honda);
  -webkit-backdrop-filter: blur(14px) saturate(160%); backdrop-filter: blur(14px) saturate(160%);
  cursor: default; animation: aparecer 220ms var(--curva) both;
}
.qr-mesa__codigo { flex: none; width: 80px; height: 80px; border-radius: 14px; }
.qr-mesa__texto { display: flex; flex-direction: column; gap: 3px; max-width: 12.5em; font-size: 0.8125rem; line-height: 1.3; color: var(--agua); }
.qr-mesa__texto strong { font-size: 0.9375rem; font-weight: 600; color: var(--blanco-hielo); letter-spacing: -0.01em; }
@keyframes aparecer { from { opacity: 0; transform: translateY(6px); } }
@media (max-width: 420px) { .qr-mesa__texto span { display: none; } }
.selector { display: inline-flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--vidrio); box-shadow: inset 0 0 0 0.5px var(--vidrio-borde); }
.chip {
  position: relative; min-height: 36px; padding: 0 16px; border: 0; border-radius: 999px; cursor: pointer;
  background: transparent; color: var(--blanco-hielo); font: 600 0.875rem/1 var(--fuente);
  transition: background-color 160ms var(--curva), color 160ms var(--curva);
}
.chip::before { content: ""; position: absolute; inset: -4px; }
.chip:hover { background: var(--halo-suave); }
.chip:active { transform: scale(0.96); }
.chip[aria-pressed="true"] { background: var(--menta); color: var(--petroleo); }
.pie a { color: var(--blanco-hielo); text-underline-offset: 3px; }
.boton-ar {
  position: absolute; left: auto; top: auto; z-index: 2;
  right: max(14px, env(safe-area-inset-right)); bottom: max(14px, env(safe-area-inset-bottom));
  min-height: 44px; height: 44px; padding: 0 16px; gap: 8px; font-size: 0.9375rem; white-space: nowrap;
}
.boton-ar .icono { width: 18px; height: 18px; }
/* Pausar o reanudar el giro automático: cristal, 44 px, abajo a la izquierda. */
.boton-giro {
  position: absolute; z-index: 2; left: max(14px, env(safe-area-inset-left)); bottom: max(14px, env(safe-area-inset-bottom));
  width: 44px; min-height: 44px; height: 44px; padding: 0;
}
.boton-giro .icono { width: 18px; height: 18px; }
.boton-ar .ar-corto { display: none; }
@media (max-width: 360px) {
  .boton-ar .ar-largo { display: none; }
  .boton-ar .ar-corto { display: inline; }
}

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

/* Secciones */
.seccion { padding: clamp(64px, 10vw, 128px) 0; }
.seccion--clara { background: var(--blanco-hielo); color: var(--petroleo); }
.seccion--borde { border-top: 1px solid var(--linea-clara); }
.seccion--media { background: var(--petroleo-medio); }
.seccion--clara p { color: var(--petroleo-medio); }

.pasos { list-style: none; margin: 40px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.tarjeta {
  position: relative; padding: 28px; border-radius: var(--radio);
  background: var(--blanco); box-shadow: 0 0 0 1px var(--linea-clara), 0 18px 40px -28px var(--sombra);
}
.tarjeta .icono { color: var(--petroleo-medio); }
.pasos__numero {
  position: absolute; top: 24px; right: 26px;
  font-size: 2.75rem; font-weight: 700; line-height: 1; letter-spacing: -0.04em; color: var(--linea-clara);
}
.tarjeta--oscura { background: var(--vidrio); box-shadow: inset 0 0 0 0.5px var(--vidrio-borde); }
.tarjeta--oscura .icono { color: var(--menta); }
.tarjeta--oscura p { color: var(--agua); }

.rejilla { list-style: none; margin: 0; padding: 0; display: grid; gap: 20px; }
.rejilla--cuatro { grid-template-columns: repeat(4, 1fr); }
.rejilla--tres { grid-template-columns: repeat(3, 1fr); gap: 44px 40px; margin-top: 40px; }
.beneficios .icono { color: var(--petroleo-medio); }

/* Preguntas */
.preguntas { margin-top: 32px; border-top: 1px solid var(--linea-clara); }
.preguntas details { border-bottom: 1px solid var(--linea-clara); }
.preguntas summary {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  min-height: 64px; padding: 16px 0; cursor: pointer; list-style: none;
  font-size: 1.125rem; font-weight: 600; letter-spacing: -0.01em;
}
.preguntas summary::-webkit-details-marker { display: none; }
.preguntas summary::after {
  content: ""; flex: none; width: 10px; height: 10px; margin-right: 6px;
  border-right: 2px solid var(--petroleo-medio); border-bottom: 2px solid var(--petroleo-medio);
  transform: rotate(45deg) translateY(-3px); transition: transform 180ms var(--curva);
}
.preguntas details[open] summary::after { transform: rotate(-135deg) translateY(-3px); }
.preguntas details p { padding: 0 40px 22px 0; max-width: 42em; }

/* Llamada a la acción */
.seccion--llamada {
  text-align: center;
  background:
    radial-gradient(50% 70% at 50% 0%, var(--halo-suave), transparent 70%),
    var(--petroleo-hondo);
}
.llamada { display: flex; flex-direction: column; align-items: center; }
.llamada__icono { border-radius: 22px; margin-bottom: 28px; box-shadow: 0 20px 60px -20px var(--halo); }
.llamada .entrada { margin: 0 0 32px; }

/* Pie */
.pie { background: var(--petroleo-hondo); border-top: 0.5px solid var(--vidrio-borde); padding: 28px 0 calc(28px + env(safe-area-inset-bottom)); font-size: 0.875rem; color: var(--agua); }
.pie__fila { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; }
.pie__fila p:last-child { margin-left: auto; }
.marca--pie { font-size: 1rem; color: var(--blanco-hielo); }
.marca--pie img { border-radius: 6px; }

/* Aparición al desplazarse (solo con JS y sin preferencia de movimiento reducido) */
.js .revelar { opacity: 0; transform: translateY(18px); transition: opacity 600ms var(--curva), transform 600ms var(--curva); }
.js .revelar.visible { opacity: 1; transform: none; }

/* Adaptación */
@media (max-width: 960px) {
  .heroe__rejilla { grid-template-columns: 1fr; }
  .escena { max-width: 520px; width: 100%; margin-inline: auto; }
  .rejilla--cuatro { grid-template-columns: repeat(2, 1fr); }
  .rejilla--tres { grid-template-columns: repeat(2, 1fr); }
  .pasos { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .navegacion { display: none; }
  .cabecera .boton--pequeno { margin-left: auto; transition: opacity 180ms var(--curva), transform 180ms var(--curva), visibility 0s linear 0s; }
  .cabecera--sin-cta .boton--pequeno { opacity: 0; transform: scale(0.96); visibility: hidden; pointer-events: none; transition-delay: 0s, 0s, 180ms; }
}
@media (max-width: 560px) {
  .rejilla--tres { grid-template-columns: 1fr; }
  .rejilla--cuatro { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .rejilla--cuatro .tarjeta { padding: 18px 16px; }
  .rejilla--cuatro h3 { font-size: 1rem; margin-top: 0.7rem; }
  .rejilla--cuatro p { font-size: 0.875rem; line-height: 1.45; }
  .rejilla--tres { gap: 32px; }
  .acciones .boton { width: 100%; }
  .pie__fila p:last-child { margin-left: 0; }
  .preguntas details p { padding-right: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .revelar { opacity: 1; transform: none; }
}
/* Sin salida de AR (ar-fallo.js): cuando el navegador de Android no abre Scene Viewer. Mismos tokens que .qr-mesa. */
.aviso-sin-ar {
  position: absolute; z-index: 3; display: flex; flex-direction: column; gap: 8px;
  left: 14px; right: 14px; bottom: 14px; padding: 14px 16px; border-radius: 22px;
  font-size: 0.8125rem; line-height: 1.35; color: var(--blanco-hielo); background: var(--capsula);
  box-shadow: inset 0 0 0 0.5px var(--vidrio-borde), 0 18px 40px -20px var(--sombra-honda);
  -webkit-backdrop-filter: blur(14px) saturate(160%); backdrop-filter: blur(14px) saturate(160%);
  animation: aparecer 220ms var(--curva) both;
}
.aviso-sin-ar strong { font-size: 0.9375rem; font-weight: 600; letter-spacing: -0.01em; }
.aviso-sin-ar__acciones { display: flex; flex-wrap: wrap; gap: 8px; }
.aviso-sin-ar__enlace { color: var(--blanco-hielo); text-underline-offset: 3px; }
.aviso-sin-ar__texto:empty { display: none; }
