/* Lagoon Residences · maqueta virtual */
@font-face { font-family: "Cormorant"; src: url("fuentes/cormorant.woff2") format("woff2"); font-weight: 500 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Montserrat"; src: url("fuentes/montserrat.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }

:root {
  --petroleo: #06262d;
  --petroleo-2: #0d3941;
  --crema: #ece5d6;
  --tinta: rgba(236, 229, 214, .95);
  --tenue: rgba(236, 229, 214, .68);
  --linea: rgba(236, 229, 214, .2);
  --vidrio: rgba(6, 38, 45, .52);
  --serif: "Cormorant", "Cormorant Garamond", Didot, "Bodoni 72", Georgia, serif;
  --sans: "Montserrat", "Avenir Next", Avenir, "Helvetica Neue", Arial, sans-serif;
  --suave: cubic-bezier(.22, .61, .36, 1);
  --margen: clamp(16px, 2.8vw, 40px);
  --arriba: max(20px, env(safe-area-inset-top));
  --fondo: max(20px, env(safe-area-inset-bottom));
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--petroleo); color: var(--tinta); font-family: var(--sans); font-weight: 400; overflow: hidden; overscroll-behavior: none; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; touch-action: manipulation; }
button:focus-visible { outline: 2px solid var(--crema); outline-offset: 3px; }
p, h1, h2, ul { margin: 0; }
[hidden] { display: none !important; }

/* ── Escenario ─────────────────────────────────────────────────────────── */
#escena { position: fixed; inset: 0; overflow: hidden; isolation: isolate; background: var(--petroleo); touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
#escena.pan { cursor: grab; }
#escena.arrastrando { cursor: grabbing; }
.vista { position: absolute; left: 0; top: 0; z-index: 1; transform-origin: 0 0; visibility: hidden; opacity: 0; backface-visibility: hidden; }
.vista.activa, .vista.sale { visibility: visible; opacity: 1; }
.vista.entra { visibility: visible; z-index: 2; }
.vista img { position: absolute; left: 0; top: 0; width: 100%; height: 100%; display: block; opacity: 0; transition: opacity 1.5s var(--suave); pointer-events: none; -webkit-user-drag: none; }
.vista img[data-luz="dia"] { opacity: 1; }
.vista img.activa { opacity: 1; }
.vista.sin-t img { transition: none; }
#clip { position: absolute; z-index: 3; left: 0; top: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; pointer-events: none; transition: opacity .4s linear; background: transparent; }
#clip.activa { opacity: 1; transition: none; }          /* aparece de golpe: su primer cuadro es la imagen que ya se ve */
.velo { position: absolute; inset: 0; z-index: 4; pointer-events: none; background:
    linear-gradient(180deg, rgba(4, 24, 29, .6) 0%, rgba(4, 24, 29, .18) 14%, rgba(4, 24, 29, 0) 26%),
    linear-gradient(0deg, rgba(4, 24, 29, .88) 0%, rgba(4, 24, 29, .52) 18%, rgba(4, 24, 29, 0) 46%); transition: opacity .8s var(--suave); }

/* Puntos sobre la imagen */
.punto { position: absolute; width: 0; height: 0; z-index: 2; transition: opacity .5s var(--suave); }
.punto::before { content: ""; position: absolute; left: -24px; top: -24px; width: 48px; height: 48px; border-radius: 50%; }
.punto .aro { position: absolute; left: -9px; top: -9px; width: 18px; height: 18px; border-radius: 50%; background: var(--crema); box-shadow: 0 0 0 6px rgba(236, 229, 214, .24), 0 6px 18px rgba(0, 0, 0, .4); transition: transform .3s var(--suave); }
.punto .aro::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 1px solid rgba(236, 229, 214, .85); animation: pulso 2.6s var(--suave) infinite; }
@keyframes pulso { from { transform: scale(.7); opacity: .9; } to { transform: scale(2.4); opacity: 0; } }
.punto .rotulo { position: absolute; left: 26px; top: 0; transform: translateY(-50%); font-size: 11px; font-weight: 600; letter-spacing: .15em; text-transform: uppercase; line-height: 1; padding: 11px 15px 10px; border-radius: 999px; color: var(--tinta); background: var(--vidrio); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border: 1px solid var(--linea); white-space: nowrap; transition: background .25s, color .25s; }
.punto.izq .rotulo { left: auto; right: 26px; }
.punto .rotulo .breve { display: none; }
@media (hover: hover) { .punto:hover .rotulo { background: rgba(236, 229, 214, .95); color: var(--petroleo); } .punto:hover .aro { transform: scale(1.15); } }
.punto:focus-visible { outline: none; }
.punto:focus-visible .rotulo { background: rgba(236, 229, 214, .95); color: var(--petroleo); }
body.en-vuelo .punto, body.cargando .punto { opacity: 0; pointer-events: none; }

/* ── Portada de carga ──────────────────────────────────────────────────── */
#portada { position: fixed; inset: 0; z-index: 40; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 26px; background: radial-gradient(120% 90% at 50% 40%, #0d3941 0%, #06262d 62%, #041c22 100%); transition: opacity 1s var(--suave), visibility 0s linear 1s; }
#portada p { font-size: 10.5px; font-weight: 500; letter-spacing: .42em; text-transform: uppercase; color: var(--tenue); }
#portada .barra { width: 132px; height: 1px; background: var(--linea); overflow: hidden; }
#portada .barra span { display: block; width: 40%; height: 100%; background: var(--crema); animation: barra 1.5s ease-in-out infinite; }
@keyframes barra { from { transform: translateX(-110%); } to { transform: translateX(270%); } }
body.lista #portada { opacity: 0; visibility: hidden; pointer-events: none; }

/* ── Marca y cabecera ──────────────────────────────────────────────────── */
.marca { line-height: 1; }
.marca b { display: block; font-family: var(--serif); font-weight: 500; font-size: clamp(25px, 2.35vw, 34px); letter-spacing: .26em; margin-right: -.26em; color: var(--crema); }
.marca i { display: block; font-style: normal; font-weight: 500; font-size: clamp(8.5px, .72vw, 10.5px); letter-spacing: .58em; margin-top: 9px; color: var(--tenue); text-transform: uppercase; }
.marca.grande { text-align: center; }
.marca.grande b { font-size: clamp(38px, 6vw, 64px); }
.marca.grande i { font-size: clamp(10px, 1.1vw, 13px); margin-top: 14px; margin-right: -.58em; }

header { position: fixed; z-index: 10; left: 0; right: 0; top: 0; padding: var(--arriba) var(--margen) 0; display: flex; justify-content: space-between; align-items: flex-start; pointer-events: none; }
header .derecha { display: flex; align-items: center; gap: 16px; pointer-events: auto; }
.sello { text-align: right; font-size: 10px; font-weight: 500; letter-spacing: .24em; text-transform: uppercase; color: var(--tenue); line-height: 1.75; }
.sello strong { color: var(--crema); font-weight: 600; }
.redondo { width: 46px; height: 46px; flex: none; border-radius: 50%; display: grid; place-items: center; color: var(--tinta); background: var(--vidrio); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border: 1px solid var(--linea); transition: background .25s, color .25s, transform .25s var(--suave); }
.redondo svg { width: 19px; height: 19px; }
@media (hover: hover) { .redondo:hover { background: var(--crema); color: var(--petroleo); } }
.redondo:active { transform: scale(.94); }

/* ── Controles de abajo ────────────────────────────────────────────────── */
#abajo { position: fixed; z-index: 10; left: 0; right: 0; bottom: 0; padding: 0 var(--margen) var(--fondo); display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); grid-template-areas: "ficha luz secciones"; align-items: end; gap: 18px 22px; pointer-events: none; }
#abajo > * { pointer-events: auto; }

/* Ficha de la vista */
#ficha { grid-area: ficha; justify-self: start; max-width: min(420px, 100%); padding: 20px 24px 19px; border-radius: 20px; background: rgba(6, 38, 45, .5); -webkit-backdrop-filter: blur(16px) saturate(1.1); backdrop-filter: blur(16px) saturate(1.1); border: 1px solid var(--linea); box-shadow: 0 18px 50px rgba(0, 0, 0, .28); }
#ficha > * { transition: opacity .45s var(--suave), transform .45s var(--suave); }
#ficha.cambia > * { opacity: 0; transform: translateY(8px); }
#ficha .lugar, #acerca .lugar { font-size: 10px; font-weight: 600; letter-spacing: .3em; text-transform: uppercase; color: var(--tenue); }
#ficha h1 { font-family: var(--serif); font-weight: 500; font-size: clamp(30px, 3vw, 46px); line-height: 1.02; letter-spacing: .005em; margin: 9px 0 10px; color: var(--crema); text-wrap: balance; }
#ficha .texto { font-size: 14px; line-height: 1.6; color: var(--tinta); max-width: 40ch; text-wrap: pretty; }
#ficha .origen { margin-top: 13px; font-size: 9.5px; font-weight: 500; letter-spacing: .14em; line-height: 1.5; text-transform: uppercase; color: var(--tenue); }
#volver { display: inline-flex; align-items: center; gap: 9px; min-height: 40px; margin: -6px 0 10px -4px; padding: 6px 13px 6px 9px; border-radius: 999px; font-size: 10.5px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--tinta); border: 1px solid var(--linea); transition: background .25s, color .25s; }
#volver svg { width: 15px; height: 15px; }
@media (hover: hover) { #volver:hover { background: var(--crema); color: var(--petroleo); } }

/* Selector de luz */
#luz { grid-area: luz; display: flex; align-items: center; gap: 10px; }
.segmentos { position: relative; display: flex; padding: 5px; border-radius: 999px; background: var(--vidrio); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border: 1px solid var(--linea); }
.segmentos .pastilla { position: absolute; top: 5px; bottom: 5px; left: 5px; width: calc((100% - 10px) / 3); border-radius: 999px; background: var(--crema); transition: transform .55s var(--suave); }
body[data-luz="atardecer"] .pastilla { transform: translateX(100%); }
body[data-luz="noche"] .pastilla { transform: translateX(200%); }
.segmentos button { position: relative; z-index: 1; width: 122px; height: 44px; display: flex; align-items: center; justify-content: center; gap: 9px; font-size: 11px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--tinta); transition: color .4s; border-radius: 999px; }
.segmentos button[aria-pressed="true"] { color: var(--petroleo); }
.segmentos button.espera span { animation: late 1s ease-in-out infinite alternate; }
@keyframes late { from { opacity: 1; } to { opacity: .35; } }
.segmentos svg { width: 17px; height: 17px; flex: none; }
#ciclo { width: 54px; height: 54px; }
#ciclo .pausa { display: none; }
body.en-ciclo #ciclo .play { display: none; }
body.en-ciclo #ciclo .pausa { display: block; }

/* Secciones */
#secciones { grid-area: secciones; justify-self: end; display: flex; gap: 10px; }
#secciones button { width: 86px; text-align: left; opacity: .74; transition: opacity .3s, transform .3s var(--suave); }
#secciones button[aria-current="true"] { opacity: 1; }
@media (hover: hover) { #secciones button:hover { opacity: 1; transform: translateY(-2px); } }
#secciones .mini { display: block; width: 100%; aspect-ratio: 86 / 60; border-radius: 10px; background-size: cover; background-position: center; border: 1px solid var(--linea); box-shadow: 0 10px 26px rgba(0, 0, 0, .35); transition: border-color .3s, box-shadow .3s; }
#secciones button[aria-current="true"] .mini { border-color: var(--crema); box-shadow: 0 0 0 1px var(--crema), 0 10px 26px rgba(0, 0, 0, .35); }
#secciones .n { display: block; margin-top: 8px; font-size: 9px; font-weight: 600; letter-spacing: .13em; text-transform: uppercase; color: var(--tinta); line-height: 1.35; }
#secciones .n .breve { display: none; }

/* Pista para arrastrar */
#pista { position: fixed; z-index: 9; left: 50%; top: 46%; transform: translate(-50%, -50%); padding: 12px 18px 11px; border-radius: 999px; font-size: 10.5px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; white-space: nowrap; color: var(--tinta); background: var(--vidrio); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border: 1px solid var(--linea); opacity: 0; pointer-events: none; transition: opacity .6s var(--suave); }
body.con-pista:not(.en-vuelo):not(.cargando) #pista { opacity: 1; }

/* Aparición de la interfaz */
header, #abajo { transition: opacity .9s var(--suave), transform .9s var(--suave); }
body.cargando header, body.cargando #abajo { opacity: 0; pointer-events: none; }
body.cargando #abajo { transform: translateY(14px); }
body.cargando #abajo > * { pointer-events: none; }
body.en-vuelo #ficha { opacity: 0; transform: translateY(8px); pointer-events: none; }
#ficha { transition: opacity .5s var(--suave), transform .5s var(--suave); }

/* ── Diálogo ───────────────────────────────────────────────────────────── */
#acerca { width: min(560px, calc(100vw - 32px)); max-height: min(86dvh, 720px); padding: 34px 34px 30px; border-radius: 22px; color: var(--tinta); background: rgba(6, 38, 45, .9); -webkit-backdrop-filter: blur(22px); backdrop-filter: blur(22px); border: 1px solid var(--linea); box-shadow: 0 30px 80px rgba(0, 0, 0, .5); overflow: auto; }
#acerca::backdrop { background: rgba(3, 18, 22, .55); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
#acerca h2 { font-family: var(--serif); font-weight: 500; font-size: 34px; line-height: 1.05; margin: 10px 0 16px; color: var(--crema); }
#acerca .cuerpo p { font-size: 14px; line-height: 1.65; margin-bottom: 12px; }
#acerca .origenes { list-style: none; padding: 16px 0 0; margin-top: 18px; border-top: 1px solid var(--linea); display: grid; gap: 9px; }
#acerca .origenes li { display: grid; grid-template-columns: 132px 1fr; gap: 14px; font-size: 12px; line-height: 1.5; color: var(--tenue); }
#acerca .origenes b { font-weight: 600; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--tinta); padding-top: 2px; }
#acerca .arriba { position: sticky; top: 0; height: 0; display: flex; justify-content: flex-end; }
#acerca .cerrar { margin: -14px -14px 0 0; width: 42px; height: 42px; }

/* ── Menos de 1500 px: la luz sube encima de las secciones, a la derecha ── */
@media (max-width: 1499px) {
  #abajo { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "ficha luz" "ficha secciones"; gap: 14px 22px; }
  #luz { justify-self: end; }
  #ficha { align-self: end; }
}
@media (max-width: 1000px) and (min-width: 761px) {
  #secciones button { width: 72px; }
  .segmentos button { width: 104px; }
}

/* ── Celular y pantallas angostas ──────────────────────────────────────── */
@media (max-width: 760px) {
  :root { --margen: 16px; }
  .sello { display: none; }
  .redondo { width: 44px; height: 44px; }
  #abajo { grid-template-columns: minmax(0, 1fr); grid-template-areas: "ficha" "secciones" "luz"; gap: 14px; padding-bottom: max(14px, env(safe-area-inset-bottom)); }
  #ficha { max-width: none; padding: 0 2px; border-radius: 0; background: none; -webkit-backdrop-filter: none; backdrop-filter: none; border: 0; box-shadow: none; text-shadow: 0 1px 14px rgba(3, 18, 22, .7); }
  #ficha h1 { font-size: clamp(31px, 9vw, 38px); margin: 7px 0 7px; }
  #ficha .texto { font-size: 13.5px; line-height: 1.5; max-width: 34ch; }
  #ficha .origen { margin-top: 8px; font-size: 8.5px; letter-spacing: .12em; }
  #volver { margin: 0 0 12px -2px; background: var(--vidrio); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); text-shadow: none; }
  #secciones { justify-self: stretch; gap: 8px; }
  #secciones button { flex: 1 1 0; width: auto; min-width: 0; opacity: .8; }
  #secciones .mini { aspect-ratio: 1 / .78; border-radius: 9px; }
  #secciones .n { margin-top: 6px; font-size: 8.5px; letter-spacing: .1em; text-align: center; white-space: nowrap; }
  #secciones .n .largo { display: none; }
  #secciones .n .breve { display: inline; }
  #luz { justify-self: stretch; gap: 8px; }
  .segmentos { flex: 1 1 auto; }
  .segmentos button { flex: 1 1 0; width: auto; height: 42px; font-size: 10.5px; letter-spacing: .1em; gap: 7px; }
  .segmentos svg { width: 15px; height: 15px; }
  #ciclo { width: 52px; height: 52px; }
  .velo { background:
      linear-gradient(180deg, rgba(4, 24, 29, .62) 0%, rgba(4, 24, 29, .2) 12%, rgba(4, 24, 29, 0) 22%),
      linear-gradient(0deg, rgba(4, 24, 29, .94) 0%, rgba(4, 24, 29, .78) 22%, rgba(4, 24, 29, .34) 40%, rgba(4, 24, 29, 0) 56%); }
  .punto .rotulo { font-size: 10px; padding: 10px 13px 9px; }
  .punto .rotulo .largo { display: none; }
  .punto .rotulo .breve { display: inline; }
  #acerca { padding: 28px 22px 24px; }
  #acerca h2 { font-size: 29px; }
  #acerca .origenes li { grid-template-columns: 1fr; gap: 2px; }
}
@media (max-width: 480px) { .segmentos svg { display: none; } }
@media (max-width: 760px) and (max-height: 700px) { #ficha .texto { display: none; } #ficha h1 { margin-bottom: 0; } }

/* Pantallas bajas en horizontal (celular acostado) */
@media (max-height: 520px) and (orientation: landscape) {
  #abajo { grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: "ficha luz secciones"; gap: 12px; padding-bottom: max(10px, env(safe-area-inset-bottom)); }
  #ficha { padding: 12px 16px; border-radius: 16px; }
  #ficha h1 { font-size: 24px; margin: 4px 0 0; }
  #ficha .texto, #ficha .origen { display: none; }
  #volver { margin-bottom: 6px; }
  #secciones button { width: 58px; }
  #secciones .n { display: none; }
  .segmentos button { width: 46px; height: 40px; }
  .segmentos button span { display: none; }
  #ciclo { width: 48px; height: 48px; }
  .sello { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .punto .aro::after, #portada .barra span { animation: none; }
  .vista img { transition-duration: .5s; }
}
body.demo, body.demo * { cursor: none !important; }
body.demo #pista { display: none; }
body.arranque *, body.arranque *::before, body.arranque *::after { transition: none !important; }

/* Para pruebas (?prueba): sin interfaz ni velo, para comparar capturas del escenario */
body.prueba header, body.prueba #abajo, body.prueba #pista, body.prueba .velo, body.prueba .punto, body.prueba #portada { display: none !important; }
