/* lab visualización — sitio 2026 */

@font-face { font-family: "Futo Sans"; src: url("fonts/FutoSans-Light.woff") format("woff"), url("fonts/FutoSans-Light.ttf") format("truetype"); font-weight: 300; font-display: swap; }
@font-face { font-family: "Futo Sans"; src: url("fonts/FutoSans-Regular.woff") format("woff"), url("fonts/FutoSans-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Futo Sans"; src: url("fonts/FutoSans-Medium.woff") format("woff"), url("fonts/FutoSans-Medium.ttf") format("truetype"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Futo Sans"; src: url("fonts/FutoSans-Bold.woff") format("woff"), url("fonts/FutoSans-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }

:root {
  --papel: #e8e8e6;
  --blanco: #f6f6f4;
  --tinta: #39393b;
  --gris: #6e6e70;
  --verde: #8cc63f;
  --verde-hondo: #6fa626;
  --borde: 20px;
  --suave: cubic-bezier(.2, .7, .1, 1);
  --corte: cubic-bezier(.7, 0, .2, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

html, body { height: 100%; overflow: hidden; overscroll-behavior: none; }

body {
  background: var(--papel);
  color: var(--tinta);
  font: 400 15px/1.5 "Futo Sans", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

::selection { background: var(--verde); color: var(--tinta); }

button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; }
svg { display: block; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: square; }

:focus-visible { outline: 2px solid var(--tinta); outline-offset: 4px; }

/* ───────── barra ───────── */

.barra {
  position: fixed; inset: 0 0 auto 0; z-index: 20;
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px calc(var(--borde) + 4px);
  background: var(--blanco);
}

.sello { display: block; width: 46px; height: 46px; color: var(--verde-hondo); transition: transform .6s var(--suave); }
.sello:hover { transform: rotate(60deg); }
.sello .fino { stroke-width: 1; }
.sello .grueso { stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.sello .punteado { stroke-width: 1; stroke-dasharray: 2 2.4; }

.menu { display: flex; gap: 6px; }
.filtros { display: flex; gap: 2px; margin: 0 auto 0 18px; }
.filtros sup { font-size: 10px; font-weight: 400; color: var(--gris); margin-left: 3px; font-variant-numeric: tabular-nums; }
.filtros button { color: var(--gris); transition: color .2s; }
.filtros button[aria-pressed="true"], .filtros button:hover { color: var(--tinta); }
.filtros button[aria-pressed="true"]::after { transform: scaleX(1); }
.menu button, .filtros button {
  position: relative; padding: 10px 14px; font-weight: 500; letter-spacing: .01em;
}
.menu button::after, .filtros button::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: 6px; height: 5px;
  background: var(--verde); transform: scaleX(0); transform-origin: left;
  transition: transform .35s var(--suave);
}
.menu button:hover::after, .menu button:focus-visible::after, .filtros button:focus-visible::after { transform: scaleX(1); }

/* ───────── plano ───────── */

.plano {
  position: fixed; inset: 0; overflow: hidden;
  touch-action: none; user-select: none; -webkit-user-select: none;
  cursor: grab;
}
.plano.arrastra { cursor: grabbing; }

.fichas { position: absolute; inset: 0; z-index: 1; }

.ficha {
  position: absolute; left: 0; top: 0; display: block;
  will-change: transform; transform-origin: 50% 50%;
  background: #d9d9d6; overflow: visible;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .09);
  transition: opacity .45s ease, filter .45s ease;
  cursor: pointer;
}
.ficha > span { display: block; width: 100%; height: 100%; overflow: hidden; }
.ficha picture { display: contents; }
.ficha img {
  display: block; width: 100%; height: 100%; object-fit: cover;
  pointer-events: none; -webkit-user-drag: none;
  scale: 1.12; translate: var(--ix, 0) var(--iy, 0);
  transition: scale .7s var(--suave);
}
.ficha::after {
  content: attr(data-nombre);
  position: absolute; left: 0; top: calc(100% + 8px);
  font-size: 13px; font-weight: 500; white-space: nowrap; color: var(--tinta);
  opacity: 0; transform: translateY(-4px);
  transition: opacity .3s ease, transform .3s var(--suave);
}
.ficha::before {
  content: ""; position: absolute; left: 0; bottom: 0; z-index: 1;
  width: 100%; height: 6px; background: var(--verde);
  transform: scaleX(0); transform-origin: left;
  transition: transform .45s var(--suave);
}
.ficha.activa::before, .ficha:focus-visible::before { transform: scaleX(1); }
.ficha.activa::after, .ficha:focus-visible::after { opacity: 1; transform: none; }
.ficha.activa img { scale: 1.2; }
.ficha.activa, .ficha:focus-visible { z-index: 4; }
.fichas.enfoca .ficha:not(.activa) { opacity: .28; filter: grayscale(1); }

/* texto técnico, por detrás de las imágenes */
.ficha-tecnica {
  position: absolute; left: var(--marco-x); bottom: var(--marco-abajo); z-index: 0;
  font: 400 12px/1.55 ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  letter-spacing: .04em; text-transform: uppercase; color: var(--tinta);
  pointer-events: none;
}
.entra .ficha-tecnica { animation: aparece-medio 1.2s ease .5s both; }

/* velo inferior: desenfoca lo que va quedando atrás */
.velo {
  position: absolute; left: 0; right: 0; bottom: 0; height: 22vh; z-index: 2;
  pointer-events: none;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  background: linear-gradient(to bottom, rgba(232, 232, 230, 0), rgba(232, 232, 230, .38));
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 85%);
  mask-image: linear-gradient(to bottom, transparent, #000 85%);
}

/* marca: el logo original, por detrás de las imágenes */

.marca {
  position: absolute; left: 50%; top: 50%; z-index: 0;
  translate: -50% -50%; pointer-events: none;
}
.marca img { display: block; width: clamp(260px, 30vw, 470px); height: auto; }
.entra .marca { animation: aparece 1.2s ease both; }
@keyframes aparece { from { opacity: 0; } }
@keyframes aparece-medio { from { opacity: 0; } to { opacity: .5; } }
@keyframes traza { from { transform: scaleX(0); } }

/* visor: cubo + coordenadas */

.visor {
  position: fixed; left: var(--borde); bottom: var(--borde); z-index: 20;
  display: flex; align-items: flex-end; gap: 12px;
}
.cubo { width: 64px; height: 64px; color: var(--tinta); border-radius: 50%; transition: color .2s; }
.cubo:hover { color: var(--verde-hondo); }
.cubo line { stroke-width: 1.5; stroke-linecap: round; }
.cubo line.oculta { stroke-width: 1; stroke-dasharray: 2 3; opacity: .7; }
.coords {
  display: grid; font-size: 12px; line-height: 1.35; color: var(--gris);
  font-variant-numeric: tabular-nums; padding-bottom: 12px; min-width: 7ch;
}

.pista, .version {
  position: absolute; z-index: 0; pointer-events: none;
  font: 400 12px/1.55 ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  letter-spacing: .04em; text-transform: uppercase; color: var(--tinta);
}
.plano { --marco-x: clamp(20px, 5.5vw, 110px); --marco-arriba: 14vh; --marco-abajo: 21vh; }
.pista, .version, .ficha-tecnica { opacity: .5; }
.pista {
  right: var(--marco-x); top: calc((100vh + var(--marco-arriba) - var(--marco-abajo)) / 2);
  writing-mode: vertical-rl; translate: 0 -50%; line-height: 1;
}
.version { right: var(--marco-x); top: var(--marco-arriba); line-height: 1; }
.entra .pista, .entra .version { animation: aparece-medio 1.2s ease .5s both; }

.salto {
  position: fixed; right: 0; bottom: 0; z-index: 20;
  width: 84px; height: 12vh; min-height: 84px; background: var(--tinta); color: var(--blanco);
  display: grid; place-items: center;
  transition: background .2s;
}
.salto svg { width: 26px; height: 26px; transition: transform .45s var(--suave); }
.salto:hover svg { transform: translate(4px, -4px); }
.salto:hover { background: #1f1f21; }

/* ───────── proyecto ───────── */

.proyecto {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(255, 255, 255, .8);
  -webkit-backdrop-filter: blur(22px); backdrop-filter: blur(22px);
  opacity: 0; visibility: hidden;
  transition: opacity .45s ease, visibility 0s linear .45s;
  overflow: hidden;
}
.proyecto.abierto { opacity: 1; visibility: visible; transition: opacity .45s ease, visibility 0s; }

.p-info {
  position: absolute; left: 0; top: 0; bottom: 0; width: 36%;
  padding: 104px 0 0 calc(var(--borde) + 28px);
  display: flex; flex-direction: column; z-index: 2;
}
.p-orden { font-size: 13px; font-weight: 500; color: var(--gris); font-variant-numeric: tabular-nums; }
.p-nombre {
  font-weight: 700; line-height: .9; letter-spacing: -.012em;
  margin: 14px 0 18px -.04em; font-size: 96px;
  overflow-wrap: normal;
}
.p-datos { font-size: 15px; font-weight: 500; color: var(--gris); }
.p-desc { margin-top: 14px; max-width: 34ch; font-size: 17px; font-weight: 300; line-height: 1.45; color: var(--tinta); text-wrap: pretty; }

.p-orden, .p-nombre, .p-datos, .p-desc { opacity: 0; transform: translateY(18px); }
.abierto .p-orden, .abierto .p-nombre, .abierto .p-datos, .abierto .p-desc {
  opacity: 1; transform: none;
  transition: opacity .7s ease .25s, transform .8s var(--suave) .25s;
}
.abierto .p-nombre { transition-delay: .32s; }
.abierto .p-datos { transition-delay: .4s; }
.abierto .p-desc { transition-delay: .48s; }

.p-pie { margin-top: auto; }
.p-puntos { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 22px; max-width: 300px; }
.p-puntos button { width: 18px; height: 18px; display: grid; place-items: center; }
.p-puntos button::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; background: #b9b9b6;
  transition: background .2s, transform .3s var(--suave);
}
.p-puntos button:hover::before { background: var(--tinta); }
.p-puntos button[aria-current="true"]::before { background: var(--verde-hondo); transform: scale(1.7); }

.p-mando {
  height: 24vh; margin-bottom: 9vh;
  display: flex; align-items: center; gap: 8px;
}
.p-mando button {
  width: 56px; height: 56px; display: grid; place-items: center;
  background: var(--tinta); color: var(--blanco);
  transition: background .2s;
}
.p-mando button:hover { background: #1f1f21; }
.p-mando svg { width: 22px; height: 22px; transition: transform .35s var(--suave); }
#p-ant:hover svg { transform: translateX(-4px); }
#p-sig:hover svg { transform: translateX(4px); }
.p-cuenta { display: grid; margin-left: 16px; font-weight: 500; line-height: 1.3; font-variant-numeric: tabular-nums; }
.p-cuenta span + span { font-weight: 300; }

.p-foto {
  position: absolute; right: 108px; bottom: 0; z-index: 1;
  background: #d9d9d6 center / cover no-repeat;
  overflow: hidden;
  transition: width .6s var(--corte), height .6s var(--corte);
  cursor: pointer;
}
.p-foto img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

.p-cerrar, .panel-cerrar {
  position: absolute; top: var(--borde); right: calc(var(--borde) + 4px); z-index: 5;
  padding: 10px 14px; font-weight: 500;
}
.p-cerrar::before, .panel-cerrar::before {
  content: ""; display: inline-block; width: 11px; height: 11px; margin-right: 9px;
  background: linear-gradient(45deg, transparent 44%, currentColor 44% 56%, transparent 56%),
              linear-gradient(-45deg, transparent 44%, currentColor 44% 56%, transparent 56%);
  transition: transform .4s var(--suave);
}
.p-cerrar:hover::before, .panel-cerrar:hover::before { transform: rotate(90deg); }

.p-otro {
  position: absolute; right: 0; bottom: 0; z-index: 3;
  width: 84px; height: 24vh; min-height: 150px; margin-bottom: 9vh;
  background: var(--tinta); color: var(--blanco);
  display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  padding: 16px 0 18px;
  transition: background .2s;
}
.p-otro:hover { background: #1f1f21; }
.p-otro span { writing-mode: vertical-rl; font-size: 13px; font-weight: 500; white-space: nowrap; }
.p-otro svg { width: 22px; height: 22px; transition: transform .4s var(--suave); }
.p-otro:hover svg { transform: translateY(4px); }

.fantasma { position: fixed; z-index: 60; object-fit: cover; pointer-events: none; }

/* ───────── paneles ───────── */

.panel {
  position: fixed; inset: 0; z-index: 50; overflow: hidden auto;
  transform: translateY(101%); visibility: hidden;
  transition: transform .75s var(--corte), visibility 0s linear .75s;
}
.panel.abierto { transform: none; visibility: visible; transition: transform .75s var(--corte), visibility 0s; }

.estudio { background: rgba(255, 255, 255, .8); -webkit-backdrop-filter: blur(22px); backdrop-filter: blur(22px); }
.patron.visto {
  background-image: url("brand/patron.png");
}
.patron {
  position: absolute; right: -14vw; top: 50%; width: min(118vh, 66vw); aspect-ratio: 2463 / 2252;
  background: center / contain no-repeat;
  translate: 0 -50%; opacity: .55;
  transform: translate(var(--px, 0), var(--py, 0));
  pointer-events: none;
}
.e-texto {
  position: relative; max-width: 660px; min-height: 100%;
  padding: 92px calc(var(--borde) + 28px) 48px;
  display: flex; flex-direction: column; justify-content: center;
}
.e-texto h2 {
  font-size: clamp(36px, 4.3vw, 62px); line-height: 1; font-weight: 700; letter-spacing: -.012em;
  margin-bottom: 24px; text-wrap: balance; max-width: 13ch;
}
.e-texto p { font-size: 18px; font-weight: 300; line-height: 1.55; max-width: 54ch; }
.e-lista { list-style: none; margin: 26px 0 30px; border-top: 2px solid var(--tinta); max-width: 440px; }
.e-lista li {
  padding: 10px 0; border-bottom: 1px solid #cfcfcc; font-weight: 500;
  display: flex; align-items: center; gap: 14px;
}
.e-lista li::before { content: ""; width: 22px; height: 7px; background: var(--verde); }
.e-enlace {
  align-self: flex-start; padding: 16px 22px; background: var(--tinta); color: var(--blanco); font-weight: 500;
  transition: background .2s, color .2s;
}
.e-enlace:hover { background: var(--verde); color: var(--tinta); }

.contacto {
  display: grid; place-items: center; padding: 20px;
  background: rgba(57, 57, 59, .14);
  transform: none; opacity: 0;
  transition: opacity .4s ease, visibility 0s linear .4s;
}
.contacto.abierto { opacity: 1; transition: opacity .4s ease, visibility 0s; }
.c-tarjeta {
  position: relative; width: min(680px, 100%);
  padding: 64px 44px 36px;
  background: rgba(255, 255, 255, .8);
  -webkit-backdrop-filter: blur(22px); backdrop-filter: blur(22px);
  transform: translateY(28px); transition: transform .6s var(--suave);
}
.contacto.abierto .c-tarjeta { transform: none; }
.c-tarjeta h2 { font-size: 17px; font-weight: 500; margin-bottom: 14px; }
.c-correo {
  display: inline-block; font-size: clamp(17px, 4.6vw, 34px); font-weight: 700; line-height: 1.1; letter-spacing: -.012em;
  text-decoration: none; white-space: nowrap;
  background: linear-gradient(var(--verde), var(--verde)) left bottom / 0 .14em no-repeat;
  padding-bottom: .16em; transition: background-size .6s var(--corte);
}
.c-correo:hover, .c-correo:focus-visible { background-size: 100% .14em; }
.c-fila { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }
.c-fila > * {
  padding: 13px 20px; border: 2px solid var(--tinta); font-weight: 500; text-decoration: none;
  transition: background .2s, color .2s;
}
.c-fila > *:hover { background: var(--tinta); color: var(--blanco); }
.c-logo { display: block; width: 190px; height: auto; margin: 44px 0 0 -8px; }

/* ───────── cursor ───────── */

.cursor {
  position: fixed; left: 0; top: 0; z-index: 100; pointer-events: none;
  width: 76px; height: 76px; margin: -38px 0 0 -38px; border-radius: 50%;
  display: none; place-items: center;
}
.cursor::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: var(--verde); transform: scale(.14);
  transition: transform .4s var(--suave);
}
.cursor span { position: relative; font-size: 13px; font-weight: 700; opacity: 0; transition: opacity .2s; }
.cursor.ver::before { transform: scale(1); }
.cursor.ver span { opacity: 1; transition-delay: .1s; }
.cursor.aprieta::before { transform: scale(.34); }

@media (hover: hover) and (pointer: fine) {
  .cursor { display: grid; }
  .plano, .plano.arrastra, .ficha { cursor: none; }
}

/* ───────── pantallas pequeñas ───────── */

@media (max-width: 820px) {
  :root { --borde: 14px; }
  .barra { flex-wrap: wrap; }
  .filtros { order: 3; width: 100%; margin: 2px 0 0 -8px; }
  .filtros button { padding: 8px 7px; font-size: 13px; }
  .filtros button::after { left: 7px; right: 7px; bottom: 3px; height: 4px; }
  .marca img { width: 62vw; }
  .plano { --marco-abajo: 17vh; }
  .ficha-tecnica { font-size: 11px; }
  .barra { padding: 8px var(--borde) 4px; }
  .pista { display: none; }
  .salto { width: 64px; height: 84px; min-height: 0; }
  .coords { display: none; }

  .proyecto { overflow-y: auto; display: flex; flex-direction: column; }
  .p-foto { position: relative; right: auto; order: 1; margin: 72px auto 0; flex: none; }
  .p-info { position: relative; width: auto; order: 2; padding: 22px var(--borde) 0; flex: 1 0 auto; }
  .p-nombre { margin: 8px 0 12px; }
  .p-pie { margin-top: auto; padding-top: 26px; }
  .p-puntos { margin-bottom: 14px; }
  .p-mando {
    position: sticky; bottom: 0; height: 88px; margin: 0 calc(var(--borde) * -1);
    padding: 0 76px 0 var(--borde); background: rgba(255, 255, 255, .92);
  }
  .p-mando button { width: 52px; height: 52px; }
  .p-otro { position: fixed; height: 88px; min-height: 0; width: 64px; margin-bottom: 0; padding: 8px 0 10px; }
  .p-otro span { font-size: 11px; max-height: 46px; overflow: hidden; }
  .p-otro svg { width: 18px; height: 18px; }
  .p-cuenta { margin-left: 12px; font-size: 14px; }

  .patron { width: 120vw; right: -50vw; opacity: .22; }
  .e-texto { padding-top: 96px; }
  .contacto { padding: 14px; }
  .c-tarjeta { padding: 60px 22px 26px; }
  .c-correo { font-size: 4.5vw; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
}
