/* ---------- Her desk at night: the password is typed on the laptop ---------- */
/* The room is one 1200 x 1000 drawing, scaled to cover the screen (lock.js). Everything that moves is
   its own small layer animating only transform or opacity, so the browser never repaints the room. */
#lock { padding: 0; margin: 0; max-width: none; min-height: 100%; }
.lf-wrap { position: fixed; inset: 0; overflow: hidden; background: #1d1327; transition: opacity .6s ease; }
.lf-wrap.lf-fade { opacity: 0; }
.lf-stage { position: absolute; left: 0; top: 0; width: 1200px; height: 1000px; transform-origin: 0 0; }
.lf-stage > * { position: absolute; }
.lf-art { left: 0; top: 0; display: block; }
.lf-stage svg { display: block; overflow: visible; }

/* the dive into the laptop screen */
.lf-stage.zooming { will-change: transform; transition: transform 1.8s cubic-bezier(.6, 0, .3, 1); }

/* the window: twinkling stars, rain running down the glass, fairy lights */
.lf-stars { left: 252px; top: 42px; width: 696px; height: 288px; animation: lfTwinkle 3.2s ease-in-out infinite alternate; }
.lf-rain { left: 252px; top: 42px; width: 696px; height: 288px; overflow: hidden; opacity: .3; }
.lf-rain i { position: absolute; left: 0; top: -288px; width: 100%; height: 576px; background-size: 232px 288px; background-repeat: repeat; animation: lfRain .8s linear infinite; }
.lf-halos { left: 190px; top: 10px; width: 820px; height: 100px; animation: lfTwinkle 2.4s ease-in-out -1s infinite alternate; }
@keyframes lfTwinkle { from { opacity: 1; } to { opacity: .45; } }
@keyframes lfRain { to { transform: translateY(288px); } }

/* the cat asleep on the sill */
.lf-cat { left: 300px; top: 268px; width: 140px; height: 70px; transform-origin: 50% 100%; animation: lfBreathe 3.6s ease-in-out infinite; }
@keyframes lfBreathe { 50% { transform: scale(1.02, 1.06); } }

/* the lamp's warm light breathes a little */
.lf-glow {
  left: 620px; top: 360px; width: 580px; height: 320px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 196, 120, .2), rgba(255, 196, 120, 0));
  animation: lfGlow 5s ease-in-out infinite alternate;
}
@keyframes lfGlow { from { opacity: .7; } to { opacity: 1; } }

/* steam off the mug */
.lf-steam { left: 821px; top: 446px; width: 40px; height: 66px; }
.lf-steam i {
  position: absolute; bottom: 0; left: 14px; width: 12px; height: 30px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(251, 239, 228, .5), rgba(251, 239, 228, 0));
  opacity: 0; animation: lfSteam 3s ease-out infinite;
}
.lf-steam i:nth-child(2) { left: 4px; animation-delay: -1s; }
.lf-steam i:nth-child(3) { left: 24px; animation-delay: -2s; }
@keyframes lfSteam {
  0% { opacity: 0; transform: translateY(0) scale(.8, 1); }
  30% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-46px) scale(1.7, 1.3); }
}

/* music notes drifting up from her headphones */
.lf-notes { left: 436px; top: 600px; width: 120px; height: 140px; }
.lf-notes i {
  position: absolute; left: 0; bottom: 0; font: 700 28px var(--body); font-style: normal; color: #f3a6bd;
  opacity: 0; animation: lfNote 5.4s ease-out infinite;
}
.lf-notes i:nth-child(2) { left: 26px; font-size: 22px; animation-delay: -1.8s; }
.lf-notes i:nth-child(3) { left: 10px; font-size: 18px; color: #c58ae0; animation-delay: -3.6s; }
@keyframes lfNote {
  0% { opacity: 0; transform: translate(0, 0) rotate(-8deg); }
  15% { opacity: .9; }
  100% { opacity: 0; transform: translate(60px, -120px) rotate(12deg); }
}

/* her: the hoodie stays put, her head nods to the music */
.lf-body { left: 145px; top: 560px; width: 400px; height: 440px; }
.lf-head { left: 215px; top: 565px; width: 260px; height: 330px; transform-origin: 50% 85%; animation: lfNod .82s ease-in-out infinite alternate; }
@keyframes lfNod { from { transform: translateY(0) rotate(0deg); } to { transform: translateY(5px) rotate(-1.2deg); } }

/* ---------- the laptop screen: the password ---------- */
.lf-screen {
  left: 430px; top: 360px; width: 340px; height: 210px; border-radius: 4px; overflow: hidden;
  background: linear-gradient(160deg, #3a2758, #5a3468 55%, #7a3e66); color: var(--cream);
}
.lf-screen::before {   /* a soft sheen across the glass */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(120deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, 0) 40%);
}
.lf-screen::after {    /* fades the screen to the room's night colour as we dive in */
  content: ""; position: absolute; inset: 0; background: #1d1327; opacity: 0; pointer-events: none;
  transition: opacity .9s ease .75s;
}
.lf-stage.zooming .lf-screen::after { opacity: 1; }
.lf-bar {
  display: flex; align-items: center; gap: 5px; height: 20px; padding: 0 8px;
  background: rgba(20, 12, 30, .45); font: 600 11px var(--body); color: var(--muted);
}
.lf-bar i { width: 7px; height: 7px; border-radius: 50%; background: #ee8aa4; }
.lf-bar i:nth-child(2) { background: #e7bd4c; }
.lf-bar i:nth-child(3) { background: #63bf93; }
.lf-bar span { margin-left: auto; }
.lf-ui {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px;
  height: 190px; padding: 0 16px 4px; text-align: center;
  transition: opacity .35s ease, transform .35s ease;
}
.lf-hint { margin: 0; font: 400 30px/1.05 var(--display); color: var(--cream); text-shadow: 0 2px 0 rgba(29, 19, 39, .6); text-wrap: balance; }
.lock-form { display: flex; gap: 6px; width: 100%; max-width: 290px; }
.lock-form input {
  flex: 1 1 6rem; min-width: 0;
  font: 600 18px var(--body); color: var(--cream);   /* 16px or more, so a phone doesn't zoom in on it */
  background: rgba(29, 19, 39, .75); border: 1.5px solid rgba(197, 138, 224, .5); border-radius: 999px;
  padding: 6px 12px; text-align: center; letter-spacing: .12em;
}
.lock-form input::placeholder { color: var(--muted); letter-spacing: .04em; }
.lock-form .btn { padding: 6px 14px; font-size: 15px; box-shadow: none; }
.lock-form.wrong { animation: lockShake .42s; }
@keyframes lockShake { 0%, 100% { transform: none; } 20% { transform: translateX(-7px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }
.lf-msg { margin: 0; min-height: 1.3em; font-size: 12px; color: var(--cream); opacity: .85; }
/* return visits only: a quiet text button under the message */
.lock-skip {
  margin-top: -4px; padding: 0 6px; border: 0; background: none; cursor: pointer;
  font: 600 12px var(--body); color: var(--cream); opacity: .85; text-decoration: underline; text-underline-offset: 2px;
}
.lock-skip:hover, .lock-skip:focus-visible { opacity: 1; }
.lock-skip[hidden] { display: none; }

/* the right password: the form steps back and a heart pops up on the screen */
#lock.unlocking .lf-ui { opacity: 0; transform: scale(.94); pointer-events: none; }
.lf-open {
  position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none;
  font-size: 54px; color: #ee8aa4; text-shadow: 0 0 18px rgba(238, 138, 164, .6);
  opacity: 0; transform: scale(.5);
  transition: opacity .35s ease .2s, transform .5s cubic-bezier(.3, 1.6, .5, 1) .2s;
}
#lock.unlocking .lf-open { opacity: 1; transform: none; }
