/* ==========================================================================
   Escritorio fotográfico
   El escenario mide lo mismo que la foto (1536 x 1024) y escena.js lo escala
   y lo desplaza. Todo lo de adentro usa píxeles de la foto.
   ========================================================================== */

.escena {
  position: fixed; left: 0; right: 0; top: 0;
  bottom: calc(var(--barra) + env(safe-area-inset-bottom, 0px));
  overflow: hidden;
  /* La misma foto (ya precargada) de fondo: si el escenario aún no se pinta,
     se ve el escritorio y nunca una pantalla negra. */
  background: #22262c url("../assets/img/escritorio.webp?v=2") center / cover no-repeat;
  background-image: image-set(url("../assets/img/escritorio.avif?v=2") type("image/avif"), url("../assets/img/escritorio.webp?v=2") type("image/webp"));
  z-index: 0;
}
/* Con la escena ya armada, el fondo sobra: se quita para no duplicar la foto en memoria */
.escena-lista .escena { background-image: none; }
/* Si la pantalla es tan baja que la foto completa (cordillera a libreta) deja
   bordes a los lados, se rellenan con la misma foto difuminada. */
.con-bordes .escena::before {
  content: ""; position: absolute; inset: -40px;
  background: url("../assets/img/escritorio.webp?v=2") center / cover;
  filter: blur(28px) brightness(.6);
}
[data-disposicion="retrato"] .escena {
  overflow-x: auto; overflow-y: hidden;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
[data-disposicion="retrato"] .escena::-webkit-scrollbar { display: none; }
.escena-fija .escena { overflow: hidden !important; }

.respira { position: relative; width: 100%; height: 100%; overflow: hidden; }
.escenario { position: absolute; left: 0; top: 0; width: 1536px; height: 1024px; transform-origin: 0 0; }
.camara-en-movimiento .escenario { will-change: transform; }

.foto, .foto img, .foto-tarde img { display: block; width: 1536px; height: 1024px; max-width: none; }
.foto-tarde { position: absolute; inset: 0; opacity: 0; pointer-events: none; }

/* Luz cálida de la lámpara sobre los libros y el escritorio */
.luz-lampara {
  position: absolute; width: 840px; height: 640px;
  opacity: 0; pointer-events: none;
  mix-blend-mode: screen;
  background:
    radial-gradient(ellipse 130px 70px at 420px 205px, rgba(255, 232, 175, .9), rgba(255, 228, 170, 0)),
    radial-gradient(ellipse 290px 190px at 575px 455px, rgba(255, 196, 120, .75), rgba(255, 196, 120, 0)),
    radial-gradient(circle 460px at 470px 380px, rgba(255, 180, 100, .3), rgba(255, 180, 100, 0));
}

/* Vapor de la taza */
.vapor { position: absolute; width: 64px; height: 120px; pointer-events: none; }
.vapor span {
  position: absolute; left: 50%; bottom: 0;
  width: 22px; height: 54px; margin-left: -11px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 255, 255, .5), rgba(255, 255, 255, 0));
  filter: blur(5px);
  opacity: 0;
  animation: vapor 6s ease-in-out infinite;
}
.vapor span:nth-child(2) { animation-delay: 2s; --deriva: -10px; }
.vapor span:nth-child(3) { animation-delay: 4s; --deriva: 12px; }
@keyframes vapor {
  0%   { opacity: 0; transform: translate(0, 10px) scale(.6, .7); }
  30%  { opacity: .6; }
  100% { opacity: 0; transform: translate(var(--deriva, 6px), -78px) scale(1.5, 1.7); }
}

/* ---------- Pantallas en perspectiva ---------- */
.pantalla { position: absolute; left: 0; top: 0; transform-origin: 0 0; pointer-events: none; z-index: 3; }
.pantalla a, .pantalla button { pointer-events: auto; }

.pantalla--monitor { width: 960px; height: 470px; }
.monitor {
  position: relative; width: 100%; height: 100%; overflow: hidden;
  color: var(--papel-claro);
  background:
    radial-gradient(120% 90% at 28% 18%, #2f4a78 0%, #1B2A41 55%, #111a29 100%);
  box-shadow: inset 0 0 70px rgba(120, 170, 255, .2);
  /* franja de sangrado (3 px de la foto = 6 px aquí) del color del marco del monitor */
  border: 6px solid #08090d;
}
.monitor::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, rgba(255, 255, 255, .07) 0 32%, rgba(255, 255, 255, 0) 32%);
}
.monitor__diapo {
  position: absolute; inset: 0 0 96px 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 40px 90px 0; text-align: center;
  opacity: 0; transition: opacity .6s ease;
}
/* Dos tiempos: la frase actual se va por completo y recién entonces entra la siguiente */
.monitor__diapo.es-activa { opacity: 1; transition: opacity .7s ease .65s; }
.monitor__sello { display: block; width: 230px; color: var(--laton-claro); }
.monitor__sello svg { width: 100%; height: auto; }
.monitor__marca { font-family: var(--serif); font-size: 58px; margin-top: 18px; }
.monitor__frase { font-family: var(--serif); font-size: 50px; line-height: 1.18; max-width: 790px; text-wrap: balance; }
.monitor__frase--servicios { color: var(--laton-claro); font-size: 54px; }
.monitor__boton {
  position: absolute; left: 50%; bottom: 36px; transform: translateX(-50%);
  padding: 14px 34px; border-radius: 4px;
  background: var(--verde); color: var(--papel-claro);
  font: 600 26px/1.2 var(--sans); text-decoration: none; white-space: nowrap;
}
.monitor__boton:hover { background: #3a7562; }
.monitor__puntos { position: absolute; right: 40px; bottom: 52px; display: flex; gap: 12px; }
.monitor__puntos button { width: 14px; height: 14px; padding: 0; border: 0; border-radius: 50%; background: rgba(246, 240, 225, .3); cursor: pointer; }
.monitor__puntos button.es-activo { background: var(--laton-claro); }

.pantalla--notebook { width: 420px; height: 340px; }
.notebook {
  width: 100%; height: 100%; padding: 22px 24px;
  color: #e9eef6;
  background: radial-gradient(120% 100% at 25% 15%, #2f4a78, #1B2A41 60%, #111a29);
  box-shadow: inset 0 0 50px rgba(120, 170, 255, .2);
  font: 500 27px/1.1 var(--sans);
}
.notebook__titulo {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--serif); font-size: 34px; color: var(--laton-claro);
  padding-bottom: 10px; margin-bottom: 8px;
  border-bottom: 2px solid rgba(214, 188, 134, .35);
}
.notebook__cursor { width: 14px; height: 30px; background: var(--laton-claro); animation: cursor 1.1s steps(1) infinite; }
@keyframes cursor { 50% { opacity: 0; } }
.notebook ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; column-gap: 10px; }
.notebook a { display: block; padding: 11px 8px; border-radius: 3px; color: inherit; text-decoration: none; white-space: nowrap; }
.notebook a:hover { background: rgba(214, 188, 134, .22); color: #fff; }
/* Acercada a la libreta, la palabra "Cotiza" del notebook se asomaría cortada junto al logo */
[data-enfocado="cotiza"] .notebook a[data-zona-destino="cotiza"] { visibility: hidden; }

/* ---------- Zonas clickeables ---------- */
.zonas { position: absolute; left: 0; top: 0; overflow: visible; z-index: 2; }
.zona { cursor: pointer; }
/* Resaltado fino: la capa se mezcla en "screen", así solo aclara la foto (nunca la tapa)
   y deja un contorno cálido de 1,5 px con un resplandor difuso que sigue la forma. */
.zonas { mix-blend-mode: screen; }
.zona polygon {
  fill: rgba(255, 244, 228, 0);
  stroke: none;
  transition: fill .35s ease;
}
.zona polygon.zona__borde {
  fill: none;
  stroke: rgba(255, 220, 160, 0);
  stroke-width: calc(1.5px / var(--s, 1));
  stroke-linejoin: round;
  filter: url(#zona-brillo);
  pointer-events: none;
  transition: stroke .35s ease;
}
.zona:hover polygon, .zona:focus-visible polygon, .zona--activa polygon { fill: rgba(255, 244, 228, .07); }
.zona:hover polygon.zona__borde, .zona:focus-visible polygon.zona__borde, .zona--activa polygon.zona__borde {
  fill: none; stroke: rgba(255, 220, 160, .85);
}
.zona:focus-visible { box-shadow: none; outline: none; }
.zona:focus-visible polygon.zona__borde { stroke: rgba(255, 246, 230, .95); stroke-width: calc(2px / var(--s, 1)); }

.etiqueta {
  position: absolute; z-index: 4;
  transform: translate(-50%, -100%);
  padding: calc(5px / var(--s, 1)) calc(10px / var(--s, 1));
  border-radius: calc(3px / var(--s, 1));
  font: 600 calc(13.5px / var(--s, 1)) / 1.2 var(--sans);
  white-space: nowrap;
  color: var(--papel-claro);
  background: var(--tinta);
  box-shadow: 0 calc(6px / var(--s, 1)) calc(16px / var(--s, 1)) rgba(0, 0, 0, .45);
  opacity: 0; pointer-events: none;
  transition: opacity .25s ease;
}
.etiqueta--izquierda { transform: translate(-100%, -50%); }
.etiqueta--vista { opacity: 1; }
[data-disposicion="retrato"] .etiqueta { opacity: 1; background: rgba(27, 42, 65, .88); font-size: calc(12px / var(--s, 1)); }
[data-enfocado] .etiqueta { opacity: 0 !important; }
.etiqueta--libros { display: none; }
[data-disposicion="retrato"] .etiqueta--izquierda { display: none; }
[data-disposicion="retrato"] .etiqueta--libros { display: block; }

/* ---------- Notas de la portada (sobre el respaldo de la silla) ---------- */
.notas {
  position: fixed; z-index: 20;
  bottom: calc(var(--barra) + 14px);
  left: 50%; width: min(30rem, calc(100vw - 2rem));
  min-height: 8rem;
  transition: opacity .4s;
}
[data-disposicion="retrato"] .notas { left: 12px; right: 12px; width: auto; bottom: calc(var(--barra) + 1.4rem); min-height: 0; }
.nota {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: .95rem 1.2rem 1rem;
  background:
    linear-gradient(to bottom, rgba(46, 94, 78, .55) 0 2px, transparent 2px),
    linear-gradient(to bottom, var(--papel-claro), #efe6d1);
  color: var(--tinta);
  border-radius: 2px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .7) inset, 0 18px 30px -14px rgba(0, 0, 0, .75), 0 2px 5px rgba(0, 0, 0, .3);
  opacity: 0; visibility: hidden;
  transform: translateY(40px) rotate(1.5deg);
  transition: opacity .5s ease, transform .6s cubic-bezier(.2, .7, .2, 1), visibility 0s .6s;
}
[data-disposicion="retrato"] .nota { position: relative; display: none; }
[data-disposicion="retrato"] .nota--actual { display: block; }
.nota--actual { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
/* Una nota que no es la actual (o que se está desvaneciendo) no recibe clics: no tapa el escritorio */
.nota:not(.nota--actual) { pointer-events: none; }
.nota--vista { opacity: 1; visibility: visible; height: 4.5rem; overflow: hidden; transform: translate(-6px, -9px) rotate(-1.8deg); filter: brightness(.94); transition-delay: 0s; }
.nota--vista:nth-child(2n) { transform: translate(5px, -6px) rotate(1.4deg); }
.nota--vista > * { visibility: hidden; }

.nota h1 { font-size: clamp(1.2rem, .85rem + .9vw, 1.6rem); margin-bottom: .4rem; }
.nota h2 { font-size: var(--t3); margin-bottom: .35rem; }
.nota__grande { font-family: var(--serif); font-size: clamp(1.15rem, .9rem + .75vw, 1.5rem); line-height: 1.22; }
.nota p + p { margin-top: .4rem; }
.nota__pista { font-size: .9rem; color: var(--tinta-suave); }
.nota__marca { display: flex; align-items: center; gap: .5rem; margin-bottom: .5rem; color: var(--verde); font-size: .82rem; font-weight: 600; }
.nota__marca svg { width: 2.2rem; height: auto; }
.nota__servicios { display: flex; flex-wrap: wrap; gap: .2rem .25rem; font-family: var(--serif); font-size: clamp(1.15rem, .9rem + .75vw, 1.5rem); line-height: 1.3; }
.nota__servicios a { text-decoration: none; border-bottom: 1px solid rgba(46, 94, 78, .45); }
.nota__servicios a:hover { color: var(--verde); border-bottom-color: currentColor; }
.nota__servicios span { color: var(--laton); }
.nota__acciones { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: .8rem; }
[data-disposicion="retrato"] .nota h1 { font-size: 1.2rem; }
[data-disposicion="retrato"] .nota__marca { display: none; }
[data-disposicion="retrato"] .nota__grande, [data-disposicion="retrato"] .nota__servicios { font-size: 1.1rem; }
[data-disposicion="retrato"] .nota { padding: .8rem 1rem .9rem; }
[data-disposicion="retrato"] .nota__acciones .boton { flex: 1 1 auto; }

.notas__paginador {
  display: none;
  position: absolute; right: .25rem; top: -2.6rem;
  align-items: center; gap: .35rem;
  font-size: .8rem; font-weight: 600; color: var(--tinta);
}
.notas__paginador button, .notas__paginador span {
  border: 0; padding: .4rem .7rem; border-radius: 3px;
  background: rgba(246, 240, 225, .92); font-size: .8rem; font-weight: 600;
  box-shadow: 0 4px 12px -6px rgba(0, 0, 0, .5);
}
.notas__paginador button { cursor: pointer; }
.notas__paginador button:disabled { opacity: .45; cursor: default; }
.sin-recorrido .notas__paginador { display: flex; }
[data-disposicion="retrato"] .notas__paginador { position: static; justify-content: flex-end; margin-bottom: .4rem; }

/* Al acercar la vista o abrir una sección, las notas desaparecen por completo
   (las tarjetas heredan el "oculto" del contenedor en vez de quedar visibles). */
[data-enfocado] .notas, .saliendo .notas, .scroll-bloqueado .notas { opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .3s, visibility 0s .3s; }
[data-enfocado] .notas *, .saliendo .notas *, .scroll-bloqueado .notas * { visibility: inherit !important; }

/* El recorrido da altura a la portada para que el scroll haga avanzar el día */
.recorrido { height: 420vh; }
.sin-recorrido .recorrido { display: none; }
.scroll-bloqueado, .scroll-bloqueado body { overflow: hidden; }

/* Pista de scroll (computador) */
.pista-scroll {
  position: fixed; z-index: 19; right: 1.4rem; bottom: calc(var(--barra) + 1.2rem);
  width: 1.4rem; height: 2.1rem; border: 2px solid rgba(246, 240, 225, .8); border-radius: 1rem;
  transition: opacity .4s;
}
.pista-scroll::after { content: ""; position: absolute; left: 50%; top: .35rem; width: 3px; height: .45rem; margin-left: -1.5px; border-radius: 2px; background: rgba(246, 240, 225, .9); animation: pista 1.8s ease-in-out infinite; }
@keyframes pista { 0% { transform: translateY(0); opacity: 1; } 70% { transform: translateY(.6rem); opacity: 0; } 100% { opacity: 0; } }
.recorrido-iniciado .pista-scroll, .sin-recorrido .pista-scroll, [data-enfocado] .pista-scroll, [data-disposicion="retrato"] .pista-scroll { opacity: 0; pointer-events: none; }

/* Indicación discreta de la portada */
.pista-portada {
  position: fixed; z-index: 29; left: 50%; top: 1.35rem;
  transform: translateX(-50%);
  max-width: min(30rem, calc(100vw - 2rem));
  padding: .3rem .75rem; border-radius: 999px;
  background: rgba(27, 42, 65, .55);
  color: var(--papel-claro);
  font-size: .78rem; line-height: 1.3; text-align: center;
  pointer-events: none;
  transition: opacity .6s ease, visibility 0s .6s;
}
.pista-portada--fuera { opacity: 0; visibility: hidden; }
[data-enfocado] .pista-portada { opacity: 0; }
@media (max-width: 52rem) { .pista-portada { top: 4.4rem; } }

/* Pista de paneo (celular) */
.pista-deslizar {
  position: fixed; z-index: 21; left: 50%; top: 42%;
  transform: translate(-50%, -50%);
  display: flex; align-items: center; gap: .6rem;
  padding: .65rem 1.1rem; border-radius: 999px;
  background: rgba(27, 42, 65, .88); color: var(--papel-claro);
  font-size: .9rem; font-weight: 600; white-space: nowrap;
  pointer-events: none;
  transition: opacity .5s;
}
.pista-deslizar svg { flex: none; width: 2rem; height: 1rem; color: var(--laton-claro); animation: deslizar 1.6s ease-in-out infinite; }
.pista-deslizar--fuera { opacity: 0; }
@keyframes deslizar { 0%, 100% { transform: translateX(-4px); } 50% { transform: translateX(4px); } }

/* ---------- Modo de ajuste (?ajustar=1) ---------- */
.ajuste { pointer-events: none; }
.ajuste__zona { fill: rgba(255, 0, 180, .14); stroke: #ff2bd6; stroke-width: 2; }
.ajuste circle { fill: #ff2bd6; }
.ajuste text { font: 700 16px var(--sans); fill: #fff; paint-order: stroke; stroke: #000; stroke-width: 3px; }
.ajuste__pantalla { fill: none; stroke: #00e5ff; stroke-width: 2; }
.ajuste__encuadre { fill: none; stroke: #ffe600; stroke-width: 1.5; stroke-dasharray: 8 6; }
.ajuste__notas { fill: none; stroke: #6dff6d; stroke-width: 2; stroke-dasharray: 10 6; }
.ajuste-lector {
  position: fixed; z-index: 60; left: 50%; top: 4.5rem; transform: translateX(-50%);
  padding: .5rem .9rem; border-radius: 4px;
  background: #000; color: #fff; font: 600 .95rem var(--sans);
}

/* ---------- Pausa y versión quieta ---------- */
.pausado *, .pausado *::before, .pausado *::after { animation-play-state: paused !important; }
[data-movimiento="no"] .vapor { display: none; }
[data-movimiento="no"] .notebook__cursor,
[data-movimiento="no"] .pista-scroll::after,
[data-movimiento="no"] .pista-deslizar svg { animation: none; }
[data-movimiento="no"] .nota, [data-movimiento="no"] .monitor__diapo { transition: none; }
