/* ==========================================================================
   PUERTA DEL EDIFICIO LEÓN 11 (portada de Inversores)
   La fachada es la hoja de una puerta con cerradura inteligente (lector con
   luz, roseta y manilla). Al pulsar: luz verde, la manilla baja, la puerta se
   abre en 3D hacia dentro y se entra en leon-11/index.html (puerta-leon.js).
   ========================================================================== */
.leon-door {
  --ld-ease: cubic-bezier(.7, 0, .2, 1);
  --ld-green: #3fd17a;
  position: relative;
  display: block;
  width: 100%;
  max-width: 440px;
  justify-self: end;
  aspect-ratio: 5 / 6;
  border-radius: 18px;
  perspective: 1800px;
  color: #fff;
  text-decoration: none;
  background: #090a09;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08), 0 40px 80px -40px rgba(0, 0, 0, .9);
  -webkit-tap-highlight-color: transparent;
  outline: none;
}
.leon-door:focus-visible { box-shadow: 0 0 0 2px var(--inv-bg, #0f100f), 0 0 0 4px var(--ld-green); }

/* Lo que hay detrás de la puerta: luz cálida y el salón */
.ld-inside {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: inherit;
  display: grid;
  place-items: center;
}
/* La foto va en una capa propia para poder acercarla sin salirse de la tarjeta */
.ld-inside::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(rgba(20, 14, 6, .25), rgba(20, 14, 6, .55)), url(../../leon-11/img/salon-cocina.jpg) center / cover;
  transform: scale(1.08);
  filter: brightness(.55);
  transition: transform 1.3s var(--ld-ease), filter 1.3s var(--ld-ease);
}
.ld-inside-text { position: relative; }
.ld-inside-text {
  font-size: 15px;
  line-height: 1.2;
  text-align: center;
  letter-spacing: .02em;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .6s ease .5s, transform .6s ease .5s;
}
.ld-inside-text b { display: block; font-family: var(--font-display, inherit); font-weight: 500; font-size: 40px; letter-spacing: -.02em; }

/* La hoja de la puerta: la fachada */
.ld-leaf {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: inherit;
  transform-origin: 0 50%;
  transform-style: preserve-3d;
  backface-visibility: hidden;
  transition: transform .5s var(--ld-ease), box-shadow .5s;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1);
}
.ld-photo {
  position: absolute;
  inset: 0;
  background: url(../../leon-11/img/fachada.jpg) 47% 50% / cover;
  transition: transform 1.2s var(--ld-ease);
}
.ld-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0, 0, 0, .28), transparent 26%, transparent 52%, rgba(0, 0, 0, .78));
}
.ld-chip {
  position: absolute;
  top: 18px;
  left: 18px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px 6px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .02em;
  color: var(--tinta, #1c1e1b);
  background: rgba(255, 255, 255, .92);
}
.ld-chip i { width: 6px; height: 6px; border-radius: 50%; background: var(--encina, #0c5f3a); }
.ld-info {
  position: absolute;
  left: 24px;
  right: 96px;
  bottom: 22px;
  display: grid;
  gap: 4px;
}
.ld-kicker { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: rgba(255, 255, 255, .7); }
.ld-title { font-family: var(--font-display, inherit); font-size: clamp(28px, 3vw, 38px); font-weight: 500; line-height: 1.05; letter-spacing: -.025em; }
.ld-hint { margin-top: 6px; font-size: 14px; color: rgba(255, 255, 255, .78); }
.ld-hint span { display: inline-block; transition: transform .3s; }

/* Cerradura inteligente */
.ld-lock {
  position: absolute;
  right: 22px;
  top: 50%;
  width: 46px;
  height: 156px;
  margin-top: -78px;
  border-radius: 14px;
  background: linear-gradient(180deg, #2c2f2d, #151716);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), inset 0 -1px 0 rgba(0, 0, 0, .6), 0 14px 28px -10px rgba(0, 0, 0, .75);
}
.ld-reader {
  position: absolute;
  left: 8px;
  right: 8px;
  top: 9px;
  height: 52px;
  border-radius: 9px;
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, .05) 0 1px, transparent 1px 5px),
    #0b0c0c;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, .8);
}
.ld-led {
  position: absolute;
  left: 50%;
  bottom: 7px;
  width: 6px;
  height: 6px;
  margin-left: -3px;
  border-radius: 50%;
  background: #e2a93b;
  box-shadow: 0 0 6px rgba(226, 169, 59, .8);
  transition: background .25s, box-shadow .25s;
}
.ld-rose {
  position: absolute;
  left: 50%;
  bottom: 22px;
  width: 30px;
  height: 30px;
  margin-left: -15px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #f2f2ef, #9d9f9b 55%, #5f625e);
  box-shadow: 0 2px 4px rgba(0, 0, 0, .6), 0 0 0 0 rgba(63, 209, 122, 0);
  transition: box-shadow .35s;
}
/* Manilla: sale de la roseta hacia la izquierda y gira desde ella */
.ld-lever {
  position: absolute;
  right: 23px;
  bottom: 31px;
  width: 70px;
  height: 12px;
  border-radius: 7px;
  background: linear-gradient(180deg, #f4f4f1, #b8bab6 45%, #6d706c);
  box-shadow: 0 6px 10px -3px rgba(0, 0, 0, .7);
  transform-origin: calc(100% - 6px) 50%;
  transition: transform .45s cubic-bezier(.34, 1.4, .64, 1);
}

/* Ratón encima: la manilla cede un poco y la puerta se entreabre */
@media (hover: hover) and (pointer: fine) {
  .leon-door:hover .ld-lever { transform: rotate(-9deg); }
  .leon-door:hover .ld-leaf { transform: rotateY(-4deg); }
  .leon-door:hover .ld-hint span { transform: translateX(4px); }
  .leon-door:hover .ld-photo { transform: scale(1.02); }
}

/* 1 · Desbloqueo: luz verde, roseta iluminada, manilla abajo */
.leon-door.is-unlocking .ld-led { background: var(--ld-green); box-shadow: 0 0 10px var(--ld-green), 0 0 22px rgba(63, 209, 122, .6); }
.leon-door.is-unlocking .ld-rose { box-shadow: 0 2px 4px rgba(0, 0, 0, .6), 0 0 0 3px rgba(63, 209, 122, .9), 0 0 24px 4px rgba(63, 209, 122, .55); }
.leon-door.is-unlocking .ld-lever { transform: rotate(-38deg); transition-duration: .35s; transition-timing-function: cubic-bezier(.3, 0, .2, 1); }

/* 2 · Apertura: la hoja gira hacia dentro y se ve el interior */
.leon-door.is-open .ld-leaf {
  transform: rotateY(-102deg);
  transition: transform 1.15s var(--ld-ease), box-shadow 1.15s;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1), 30px 0 60px rgba(0, 0, 0, .6);
}
.leon-door.is-open .ld-inside::before { transform: scale(1); filter: brightness(1); }
.leon-door.is-open .ld-inside-text { opacity: 1; transform: none; }

/* 3 · Fundido al entrar en la landing */
.ld-veil {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #0b0b0b;   /* el mismo negro de la entrada de León 11 */
  opacity: 0;
  pointer-events: none;
  transition: opacity .45s ease;
}
.ld-veil.is-on { opacity: 1; }

@media only screen and (max-width: 1024px) {
  .leon-door { justify-self: center; }
}
@media only screen and (max-width: 640px) {
  .leon-door { aspect-ratio: 4 / 5; border-radius: 16px; }
  .ld-info { left: 18px; right: 84px; bottom: 18px; }
  .ld-lock { right: 16px; transform: scale(.9); }
}
@media (prefers-reduced-motion: reduce) {
  .ld-leaf, .ld-lever, .ld-photo, .ld-inside::before, .ld-inside-text { transition: none; }
}
