/* The Door — speakeasy entrance with a night-cockpit transponder */
body.door-page {
  overflow-x: hidden; overflow-y: auto;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(127,191,122,0.16), transparent 50%),
    repeating-linear-gradient(0deg, #141917 0 22px, #0e1110 22px 24px),
    #0e1110;
  min-height: 100vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 16px;
}

.marquee { text-align: center; margin-bottom: 1.4rem; position: relative; z-index: 2; }
.marquee h1 {
  font-family: var(--brand); text-transform: none; font-weight: 400;
  font-size: clamp(2.2rem, 8vw, 4rem); margin: 0; color: var(--accent);
  letter-spacing: 0.18em;
  text-shadow: 0 0 18px rgba(127,191,122,0.55), 0 0 2px #eaffea;
  animation: sign-buzz 7s infinite;
}
.marquee p { margin: 0.3rem 0 0; font-family: var(--head); font-weight: 600; letter-spacing: 0.3em; font-size: 0.95rem; color: var(--muted); }
@keyframes sign-buzz { 0%, 92%, 100% { opacity: 1; } 93% { opacity: 0.55; } 94% { opacity: 1; } 96% { opacity: 0.7; } }

/* Door + frame */
.doorway {
  position: relative; z-index: 2; perspective: 1400px;
  width: min(460px, 100%); aspect-ratio: 460 / 600; max-height: 72vh;
  border: 10px solid var(--trim);
  border-image: linear-gradient(180deg, var(--accent), var(--trim) 40%, #2f4a2d) 1;
  box-shadow: 0 0 0 3px #000, 0 30px 70px rgba(0,0,0,0.8);
  background: radial-gradient(ellipse at 50% 60%, #eaffe6 0%, #9fd49a 30%, #2e4a33 75%, #121a15 100%);
}
.doorway::after { /* warm light spill when the door opens */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(circle at 50% 55%, rgba(200,255,200,0.85), transparent 65%);
  opacity: 0; transition: opacity 1.4s ease 0.4s;
}
.doorway.open::after { opacity: 1; }

.leaf {
  position: absolute; top: 0; bottom: 0; width: 50%;
  background:
    repeating-linear-gradient(90deg, rgba(0,0,0,0.0) 0 10px, rgba(0,0,0,0.18) 10px 11px),
    linear-gradient(180deg, #3a423e, #222825);
  transition: transform 1.6s cubic-bezier(.6,.05,.25,1);
  z-index: 1;
}
.leaf.left { left: 0; transform-origin: left center; border-right: 1px solid #000; }
.leaf.right { right: 0; transform-origin: right center; border-left: 1px solid #000; }
.doorway.open .leaf.left { transform: rotateY(-105deg); }
.doorway.open .leaf.right { transform: rotateY(105deg); }

/* Art deco sunburst inlays */
.leaf .inlay {
  position: absolute; left: 14%; right: 14%; top: 7%; height: 26%;
  border: 2px solid var(--trim);
  background:
    repeating-conic-gradient(from -90deg at 50% 100%, rgba(127,191,122,0.55) 0 4deg, transparent 4deg 12deg);
  -webkit-mask: linear-gradient(#000, #000);
}
.leaf.left .inlay { left: 18%; right: 10%; }
.leaf.right .inlay { left: 10%; right: 18%; }
.leaf .inlay.low { top: auto; bottom: 7%; height: 18%; background:
    repeating-linear-gradient(45deg, rgba(127,191,122,0.35) 0 2px, transparent 2px 12px),
    repeating-linear-gradient(-45deg, rgba(127,191,122,0.35) 0 2px, transparent 2px 12px); }
.leaf .handle { position: absolute; top: 52%; width: 10px; height: 70px; border-radius: 5px; background: linear-gradient(90deg, #7a1f1a, var(--signal), #7a1f1a); }
.leaf.left .handle { right: 10px; }
.leaf.right .handle { left: 10px; }

/* Transponder mounted on the door */
.xpdr {
  position: absolute; z-index: 3; left: 50%; top: 56%; transform: translate(-50%, -50%);
  width: min(330px, 86%);
  background: linear-gradient(180deg, #2a2d33, #16181c);
  border: 2px solid #050505; border-radius: 6px;
  box-shadow: 0 0 0 3px var(--trim), 0 12px 30px rgba(0,0,0,0.75), inset 0 1px 0 rgba(255,255,255,0.08);
  padding: 10px 12px 12px;
  transition: opacity 0.5s ease, transform 0.6s ease;
}
.doorway.open .xpdr { opacity: 0; transform: translate(-50%, -45%) scale(0.95); pointer-events: none; }
.xpdr-top { display: flex; justify-content: space-between; font-family: var(--head); font-weight: 600; font-size: 0.75rem; letter-spacing: 0.12em; color: #a3a6ab; margin-bottom: 6px; }
.lcd {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: #031008; border: 2px inset #000; border-radius: 3px; padding: 6px 10px;
  font-family: var(--mono);
}
.lcd .mode { font-size: 0.7rem; color: var(--signal); letter-spacing: 0.1em; text-shadow: 0 0 6px rgba(255,92,80,0.6); }
.lcd .code { font-size: 2.3rem; letter-spacing: 0.28em; color: var(--avi-green); text-shadow: 0 0 10px rgba(61,255,143,0.75); min-width: 5.4ch; text-align: right; }
.lcd .code .cur { animation: blink 1s steps(1) infinite; }
.lcd .reply { width: 12px; height: 12px; border-radius: 50%; background: #1b2a1f; border: 1px solid #000; }
.lcd .reply.on { background: var(--signal); box-shadow: 0 0 10px var(--signal); }
@keyframes blink { 50% { opacity: 0; } }

.keys { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-top: 10px; }
.key {
  font-family: var(--mono); font-size: 1.05rem; color: #e9e9e9; cursor: pointer;
  padding: 8px 0; border-radius: 3px; border: 1px solid #000;
  background: linear-gradient(180deg, #45484f, #26282d);
  box-shadow: 0 2px 0 #000, inset 0 1px 0 rgba(255,255,255,0.12);
}
.key:active, .key.pressed { transform: translateY(2px); box-shadow: 0 0 0 #000, inset 0 1px 0 rgba(255,255,255,0.12); }
.key:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.key.clr { font-size: 0.75rem; color: #ffa59c; }
.key.ident { grid-column: span 2; font-size: 0.85rem; letter-spacing: 0.2em; color: #fff; background: linear-gradient(180deg, #c8352a, #861a14); }
.hint { text-align: center; font-family: var(--head); font-weight: 600; font-size: 0.8rem; color: #9a9da3; margin-top: 8px; letter-spacing: 0.12em; }

/* ─── Overlays for special codes ──────────────────────────────── */
.overlay { position: fixed; inset: 0; z-index: 20; pointer-events: none; opacity: 0; transition: opacity 0.3s; display: flex; align-items: center; justify-content: center; flex-direction: column; text-align: center; padding: 16px; }
.overlay.show { opacity: 1; }
.overlay .msg { font-family: var(--mono); letter-spacing: 0.18em; font-size: clamp(1rem, 3.5vw, 1.5rem); }

/* 7700 */
.ov-7700 { background: radial-gradient(ellipse at center, transparent 30%, rgba(255,30,20,0.55) 100%); animation: red-pulse 0.6s ease-in-out infinite alternate; }
@keyframes red-pulse { from { box-shadow: inset 0 0 80px rgba(255,0,0,0.4); } to { box-shadow: inset 0 0 220px rgba(255,0,0,0.85); } }
.master-caution { font-family: var(--head); font-weight: 700; padding: 0.6rem 1.2rem; border: 3px solid var(--avi-red); color: #fff; background: var(--avi-red); letter-spacing: 0.25em; animation: blink 0.5s steps(1) infinite; margin-bottom: 1.2rem; }
.ov-7700 .msg { color: #fff; text-shadow: 0 0 10px #000; }
body.flicker .doorway { animation: flicker 0.18s steps(2) 8; }
@keyframes flicker { 50% { filter: brightness(0.35) sepia(1) hue-rotate(-40deg) saturate(4); } }

/* 7600 */
.ov-7600 { background: rgba(0,0,0,0.55); }
.ov-7600 canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0.45; mix-blend-mode: screen; }
.ov-7600 .msg { color: #cfd3da; position: relative; }
.light-gun { position: relative; width: 70px; height: 70px; border-radius: 50%; margin-bottom: 1.2rem; background: #1a1a1a; border: 4px solid #333; transition: background 0.3s, box-shadow 0.3s; }
.light-gun.green { background: #43ff7a; box-shadow: 0 0 40px 10px rgba(67,255,122,0.8); border-color: #9cffbb; }

/* 7500 */
.ov-7500 { background: #000; }
.ov-7500 .spot { position: absolute; width: 340px; height: 340px; border-radius: 50%; background: radial-gradient(circle, rgba(255,250,220,0.35), transparent 65%); top: 30%; left: -30%; }
.ov-7500.show .spot { animation: sweep 1.6s ease-in-out 2 alternate; }
@keyframes sweep { to { left: 85%; } }
.stamp { position: relative; font-family: var(--head); font-weight: 700; font-size: clamp(1.6rem, 7vw, 3.2rem); color: var(--avi-red); border: 6px double var(--avi-red); padding: 0.4rem 1.2rem; transform: rotate(-9deg) scale(3); opacity: 0; letter-spacing: 0.08em; }
.stamp.slam { animation: slam 0.35s cubic-bezier(.3,1.6,.6,1) forwards; }
@keyframes slam { to { transform: rotate(-9deg) scale(1); opacity: 0.95; } }
.ov-7500 .msg { color: var(--text); margin-top: 1.4rem; opacity: 0; transition: opacity 0.6s; position: relative; }
.ov-7500 .msg.show { opacity: 1; }
body.shake .doorway { animation: shake 0.4s; }
@keyframes shake { 20% { transform: translateX(-8px); } 40% { transform: translateX(7px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(3px); } }

/* Normal IDENT */
.xpdr.ident-glow { box-shadow: 0 0 0 3px var(--accent), 0 0 40px rgba(61,255,143,0.5), 0 12px 30px rgba(0,0,0,0.75); }

.footnote { margin-top: 1rem; font-family: var(--head); font-weight: 600; font-size: 0.85rem; color: #7d877f; letter-spacing: 0.2em; text-align: center; }

@media (max-height: 640px) {
  .marquee { margin-bottom: 0.6rem; } .marquee p { display: none; }
  .doorway { max-height: none; height: calc(100vh - 110px); min-height: 300px; width: auto; }
  .xpdr { width: 300px; max-width: 92%; padding: 6px 8px 8px; }
  .lcd .code { font-size: 1.7rem; } .key { padding: 5px 0; } .hint { display: none; }
}

/* ─── Hawk banner tow ────────────────────────────────────────── */
.hawk-tow {
  position: fixed; left: 0; top: 6vh; z-index: 1; pointer-events: none;
  width: min(560px, 85vw);
  transform: translateX(-105%);
  filter: drop-shadow(0 6px 6px rgba(0,0,0,0.45));
}
.hawk-tow.flying { animation: hawk-cross 15s linear forwards; }
@keyframes hawk-cross {
  from { transform: translateX(-105%); }
  to   { transform: translateX(100vw); }
}
.hawk-tow svg { display: block; width: 100%; height: auto; overflow: visible; }
.hawk-tow .banner text {
  font-family: var(--head); font-weight: 700; font-size: 30px; letter-spacing: 5px; fill: #1b201e;
}
.hawk-tow .hawk { animation: hawk-bob 1.6s ease-in-out infinite; }
.hawk-tow .banner, .hawk-tow .rope { animation: hawk-bob 1.6s ease-in-out -0.35s infinite; }
@keyframes hawk-bob { 50% { transform: translateY(4px); } }
.hawk-tow .wing { transform-box: view-box; transform-origin: 505px 41px; animation: hawk-flap 0.55s ease-in-out infinite alternate; }
.hawk-tow .wing.far { animation-delay: -0.08s; }
@keyframes hawk-flap { from { transform: scaleY(1); } to { transform: scaleY(-0.55); } }
