/* The back door in the alley: the sign-in. The stage is the plate's own 1536x1024 pixels, fitted like `cover` and
   scaled by door.js, so the hatch, the eyes and the words sit exactly where the picture has them. */

#door { position: fixed; inset: 0; z-index: 10; overflow: hidden; background: var(--soot); }
#door .stage {
  position: absolute; left: 0; top: 0; width: 1536px; height: 1024px; transform-origin: 0 0;
  will-change: transform;
}
#door .layer { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity .9s var(--ease); user-select: none; -webkit-user-drag: none; }
#door .layer.on { opacity: 1; }
#door .layer.eyes { transition-duration: .28s; }
#door .layer.open { transition-duration: 1.2s; }
#door .fog {   /* the alley's own darkness at the edges, deeper than the plate's vignette */
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(70% 80% at 50% 45%, transparent 40%, rgba(4, 3, 2, .55) 80%, rgba(4, 3, 2, .92));
}
#door .warm {  /* the light from the hall as the door opens */
  position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 1.4s var(--ease);
  background: radial-gradient(28% 40% at 50% 47%, rgba(255, 196, 120, .38), transparent 70%);
  mix-blend-mode: screen;
}
#door.opening .warm { opacity: 1; }
#door .black { position: absolute; inset: 0; background: #050302; opacity: 1; pointer-events: none; transition: opacity 1.6s var(--ease); z-index: 5; }
#door.lit .black { opacity: 0; }
#door.through .black { opacity: 1; transition-duration: 1.1s; }

#door .hit { position: absolute; cursor: pointer; border-radius: 3px; border: 0; padding: 0; background: transparent; -webkit-tap-highlight-color: transparent; }
#door .hit:focus-visible { outline: 2px solid rgba(255, 207, 138, .7); outline-offset: 4px; }

/* the words: the man behind the hatch, and yours */
#door .talk {
  position: absolute; left: 50%; bottom: max(7vh, 46px); transform: translateX(-50%);
  width: min(640px, calc(100vw - 32px)); text-align: center; z-index: 4; pointer-events: none;
}
#door .say {
  min-height: 1.4em; margin: 0 0 14px;
  font: italic 30px/1.25 var(--f-body); color: #f3e3c4;
  text-shadow: 0 2px 4px #000, 0 0 22px rgba(0,0,0,.9);
  transition: opacity .45s var(--ease), transform .45s var(--ease);
}
#door .say.out { opacity: 0; transform: translateY(6px); }
#door .say q { quotes: '“' '”'; }
#door .hint {
  font: 14px/1.4 var(--f-typed); letter-spacing: .3em; text-transform: uppercase; color: rgba(227, 197, 140, .85);
  text-shadow: 0 1px 3px #000; transition: opacity .6s var(--ease);
  animation: hint-breathe 3.2s ease-in-out infinite;
}
#door .hint.gone { animation: none; opacity: 0 !important; }
@keyframes hint-breathe { 50% { opacity: .45; } }
#door .whisper {
  display: inline-flex; align-items: center; gap: 12px; pointer-events: auto;
  opacity: 0; transform: translateY(8px); transition: opacity .5s var(--ease), transform .5s var(--ease);
}
#door.asking .whisper { opacity: 1; transform: none; }
#door .whisper label { font: italic 20px var(--f-body); color: rgba(236, 226, 204, .75); text-shadow: 0 1px 3px #000; }
#door .whisper input {
  width: 260px; padding: 6px 4px 5px; border: 0; border-bottom: 1px solid rgba(227, 197, 140, .65);
  background: transparent; color: #f6e8cc; text-align: center;
  font: 26px/1.1 var(--f-typed); letter-spacing: .35em; caret-color: var(--gas);
  text-shadow: 0 1px 3px #000;
}
#door .whisper input:focus { outline: none; border-bottom-color: var(--gas); }
#door .whisper input::placeholder { color: rgba(236, 226, 204, .28); letter-spacing: .1em; font-size: 18px; }

#door .shudder { animation: shudder .32s linear; }
@keyframes shudder { 20% { translate: 2px 0; } 40% { translate: -2px 0; } 60% { translate: 1px 0; } 80% { translate: -1px 0; } }

/* "And who's asking?" */
#door .who {
  position: absolute; z-index: 6; left: 50%; top: 50%; translate: -50% -50%;
  width: min(620px, calc(100vw - 28px)); max-height: calc(100dvh - 40px); overflow: auto;
  padding: 26px 30px 24px; rotate: -.6deg;
  animation: memo-in .7s var(--ease-out) both;
}
#door .who.out { animation: memo-out .4s ease-in both; }
#door .who h2 { font: 400 34px/1.1 var(--f-title); margin: 4px 0 4px; }
#door .who .sub { margin: 0 0 16px; color: var(--ink-soft); font-style: italic; }
#door .who .names { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin: 0 0 18px; }
#door .who .name {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; text-align: left; cursor: pointer;
  border: 1px solid rgba(40, 28, 18, .25); background: rgba(255, 250, 238, .35); border-radius: 2px;
  font: 22px/1.1 var(--f-hand); font-weight: 600; color: var(--ink);
  transition: background .2s var(--ease), transform .2s var(--ease), box-shadow .2s var(--ease);
}
#door .who .name:hover, #door .who .name:focus-visible { background: rgba(255, 250, 238, .75); transform: translateY(-1px) rotate(-.4deg); box-shadow: 0 4px 10px -4px rgba(0,0,0,.4); outline: none; }
#door .who .name img { width: 34px; height: 44px; object-fit: cover; filter: sepia(.6) contrast(1.05); box-shadow: 0 1px 2px rgba(0,0,0,.5); }
#door .who .name small { display: block; font: 11px var(--f-typed); letter-spacing: .12em; color: var(--ink-soft); text-transform: uppercase; }
#door .who .newface { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
#door .who .newface .field { flex: 1 1 240px; margin: 0; }

@media (max-width: 640px) {
  #door .say { font-size: 24px; }
  #door .whisper { flex-direction: column; gap: 6px; }
  #door .whisper input { width: min(260px, 80vw); }
  #door .who { padding: 20px 18px; }
}
