/* Portada clara con el portátil 3D realista (Three.js, en portada3d.js). Se activa con class="v2" en <body> y "v2-root" en <html>. */

/* Los colores claros de la portada, la cabecera y los botones están en styles.css (bloque MODERNO). */
.v2 .hero-stage { isolation: isolate; }

/* Bokeh: manchas de luz desenfocadas que se mueven muy despacio */
.bokeh { position: absolute; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.bokeh i {
  position: absolute; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.95) 0%, rgba(255,255,255,0) 70%);
  filter: blur(8px);
  animation: deriva 18s ease-in-out infinite alternate;
}
.bokeh i:nth-child(1) { width: 380px; height: 380px; left: 52%; top: 6%; }
.bokeh i:nth-child(2) { width: 220px; height: 220px; left: 84%; top: 58%; animation-duration: 22s; }
.bokeh i:nth-child(3) { width: 160px; height: 160px; left: 8%; top: 12%; animation-duration: 26s; background: radial-gradient(circle, rgba(196,213,243,.9) 0%, rgba(196,213,243,0) 70%); }
.bokeh i:nth-child(4) { width: 90px; height: 90px; left: 44%; top: 74%; animation-duration: 15s; }
.bokeh i:nth-child(5) { width: 520px; height: 520px; left: -10%; top: 55%; animation-duration: 30s; background: radial-gradient(circle, rgba(205,220,246,.8) 0%, rgba(205,220,246,0) 70%); }
/* Burbujas pequeñas con borde, como pompas de cristal */
.bokeh b {
  position: absolute; border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.9), inset 0 0 12px rgba(255,255,255,.6);
  animation: deriva 20s ease-in-out infinite alternate;
}
.bokeh b:nth-child(6) { width: 34px; height: 34px; left: 77%; top: 13%; }
.bokeh b:nth-child(7) { width: 22px; height: 22px; left: 61%; top: 80%; animation-duration: 24s; }
.bokeh b:nth-child(8) { width: 16px; height: 16px; left: 90%; top: 36%; animation-duration: 17s; }
.bokeh b:nth-child(9) { width: 26px; height: 26px; left: 38%; top: 20%; animation-duration: 28s; }
@keyframes deriva { to { transform: translate3d(30px, -24px, 0); } }

/* Aro fino detrás del portátil */
.aro {
  position: absolute; left: 50%; top: 50%; width: min(620px, 92%); aspect-ratio: 1;
  translate: -50% -50%; border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(255,255,255,.95), 0 0 0 1px rgba(28,63,148,.06) inset;
  pointer-events: none;
}

/* ---------- El portátil ---------- */
.v2 .hero-art { position: relative; }
.l3r {
  position: relative; width: 100%;
  height: min(calc(100svh - var(--header) - 40px), 760px);
  touch-action: pan-y; cursor: grab;
  -webkit-user-select: none; user-select: none;
}
.l3r.is-drag { cursor: grabbing; }
.l3r canvas { display: block; width: 100%; height: 100%; opacity: 0; transition: opacity .8s ease; }
.l3r.listo canvas { opacity: 1; }

/* Cotas de las piezas: etiquetas de cristal por encima del 3D */
.cotas { position: absolute; inset: 0; pointer-events: none; opacity: 0; }
.cota {
  position: absolute; left: 0; top: 0;
  display: flex; align-items: center; gap: 8px;
  padding: 6px 12px 6px 8px; border-radius: 999px;
  background: rgba(255,255,255,.72); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 1px 0 rgba(255,255,255,.9) inset, 0 6px 20px rgba(17,24,39,.08);
  font: 500 13px var(--sans); color: var(--ink); white-space: nowrap;
}
.cota::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--bp); box-shadow: 0 0 0 3px rgba(28,63,148,.15); }

.l3r-ayuda {
  position: absolute; left: 0; right: 0; bottom: 4px; text-align: center;
  font: 500 12px var(--mono); color: var(--muted); pointer-events: none; transition: opacity .3s ease;
}

/* ---------- Titular: entra desenfocado y se enfoca ---------- */
.js.v2-root .hero-copy > * { animation: enfoca 1100ms var(--ease) both; }
.js.v2-root .hero h1 > span { display: block; animation: enfoca 1200ms var(--ease) both; }
.js.v2-root .hero h1 > span:nth-child(2) { animation-delay: 120ms; }
.js.v2-root .hero h1 > span:nth-child(3) { animation-delay: 240ms; }
.js.v2-root .hero h1 > span:nth-child(4) { animation-delay: 420ms; }
@keyframes enfoca { from { opacity: 0; filter: blur(14px); transform: translateY(10px); } }

@media (max-width: 1000px) {
  .l3r { height: 54svh; }
  .aro { width: 80%; }
}
@media (max-width: 720px) {
  .l3r { height: 48svh; }
  .cota { font-size: 12px; padding: 4px 10px 4px 6px; }
  .bokeh i:nth-child(1) { width: 240px; height: 240px; }
}
@media (prefers-reduced-motion: reduce) {
  .bokeh i, .bokeh b { animation: none; }
  .js.v2-root .hero-copy > *, .js.v2-root .hero h1 > span { animation: fade 300ms ease both; }
}
