/* ============================================================================
   style.css — the page around the console

   Almost nothing lives here. The interface itself is painted into one canvas,
   so CSS only has to do three jobs: black out the page, fit the 1024x768
   console into whatever window it has been given without blurring it, and
   dress the boot gate.

   [hidden] is forced first, because an author `display` on an element beats
   the user-agent stylesheet's `[hidden] { display: none }` regardless of
   specificity — which means setting el.hidden = true silently does nothing and
   the element stays on screen while every probe reports it as hidden. That has
   cost real time on two previous projects; it is not going to cost any here.
   ========================================================================== */
[hidden] { display: none !important; }

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  height: 100%; width: 100%;
  background: #050607;
  overflow: hidden;
  font-family: "Lucida Console", "DejaVu Sans Mono", Consolas, monospace;
  -webkit-font-smoothing: antialiased;
}

#stage {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: #050607;
}

/* The console is 1024x768 and is scaled to fit. `pixelated` keeps the 1-bit
   type and the hard bevels crisp when it is enlarged, which is the normal
   case on any modern display. */
#screen {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  width: min(100vw, calc(100vh * 1.3333));
  height: min(100vh, calc(100vw / 1.3333));
  display: block;
  background: #000;
}

/* ---- boot gate ---------------------------------------------------------- */
#gate {
  position: fixed; inset: 0; z-index: 40;
  display: flex; align-items: flex-start; justify-content: center;
  overflow-y: auto;
  padding: max(16px, 4vh) 16px;
  background:
    repeating-linear-gradient(0deg, rgba(255,255,255,.012) 0 1px, transparent 1px 3px),
    #0a0c0d;
}
#gate .card {
  margin: auto;
  width: min(560px, 100%);
  background: #14181b;
  border: 1px solid #2b3238;
  border-top: 1px solid #4c565d;
  padding: 26px 28px 22px;
  color: #b9c3c9;
}
#gate .mast {
  font: 700 21px/1.1 "Lucida Console", monospace;
  letter-spacing: .22em; color: #e2e9ee;
}
#gate .sub {
  margin-top: 7px; font-size: 10px; letter-spacing: .20em; color: #6e7a81;
}
#gate .rule { height: 1px; background: #2b3238; margin: 16px 0 14px; }
#gate .lede { font-size: 12px; line-height: 1.65; color: #8d989f; margin: 0 0 18px; }

#gate .row { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; }
#gate label { font-size: 10px; letter-spacing: .18em; color: #6e7a81; width: 42px; }
#gate input {
  flex: 1; min-width: 0;
  background: #080a0b; border: 1px solid #333b41;
  color: #d8e0e4; font: 13px "Lucida Console", monospace;
  letter-spacing: .10em; padding: 7px 9px;
}
#gate input:focus { outline: 1px solid #e0a828; border-color: #e0a828; }

#gate button {
  background: #232a2f; color: #d8e0e4;
  border: 1px solid #3d464d; border-top-color: #59646c;
  font: 11px "Lucida Console", monospace; letter-spacing: .16em;
  padding: 8px 14px; cursor: pointer;
}
#gate button:hover { background: #2c343a; }
#gate button:active { background: #1b2125; border-top-color: #3d464d; }
#gate #start {
  width: 100%; margin-top: 4px; padding: 13px;
  background: #2d3a2f; border-color: #4a5c4d; border-top-color: #6d8471;
  color: #cfe3d2; letter-spacing: .26em; font-size: 12px;
}
#gate #start:hover { background: #38492c; }
#gate .foot {
  margin-top: 16px; display: flex; flex-direction: column; gap: 5px;
  font-size: 9.5px; letter-spacing: .10em; color: #5c666c;
}
#gate #warn { color: #8a6a3a; }

/* ---- the retrieval bar -------------------------------------------------- */
#boot {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  padding: 10px 14px;
  font: 10px "Lucida Console", monospace; letter-spacing: .14em;
  color: #6e7a81; background: #0a0c0d; border-top: 1px solid #20262a;
}

@media (max-width: 560px) {
  #gate .card { padding: 20px 18px 18px; }
  #gate .mast { font-size: 17px; letter-spacing: .16em; }
  #gate .lede { font-size: 11.5px; }
}


/* ---- the control strip ---------------------------------------------------
   Sits under the console, dims itself, and comes back on hover. It is not
   part of the piece and should not compete with it. */
#bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; align-items: center; gap: 6px;
  padding: 7px 10px;
  background: linear-gradient(0deg, rgba(5,6,7,.94), rgba(5,6,7,.72));
  opacity: .30; transition: opacity .18s;
}
#bar:hover, #bar:focus-within { opacity: 1; }
#bar button {
  background: #1a1f22; color: #b7c1c7;
  border: 1px solid #333c42; border-top-color: #4b565d;
  font: 10px "Lucida Console", monospace; letter-spacing: .14em;
  padding: 6px 10px; cursor: pointer;
}
#bar button:hover { background: #232a2e; color: #dbe3e8; }
#bar button:active { background: #12171a; border-top-color: #333c42; }
#bar button[disabled] { opacity: .35; cursor: default; }
#bar button.rec { background: #58201c; border-color: #8a3129; color: #f0d2ce; }
#bar button.off { color: #6a7176; }
#bar .sep { width: 1px; height: 18px; background: #2b3238; margin: 0 4px; }
#bar .grow { flex: 1; }
#bar #recNote {
  font: 10px "Lucida Console", monospace; color: #6e7a81; letter-spacing: .10em;
}

@media (max-width: 620px) {
  #bar { flex-wrap: wrap; gap: 4px; padding: 6px; opacity: .85; }
  #bar button { padding: 5px 7px; font-size: 9px; letter-spacing: .08em; }
  #bar .grow { display: none; }
}


/* ---- the drop target -----------------------------------------------------
   The whole page accepts images. The only feedback is a hairline, because a
   large overlay would cover the thing the images are about to be filed into. */
body.dropping #stage { outline: 1px solid #e0a828; outline-offset: -1px; }
body.dropping #stage::after {
  content: "FILE AS SPECIMEN PHOTOGRAPHY";
  position: absolute; left: 50%; top: 14px; transform: translateX(-50%);
  font: 10px "Lucida Console", monospace; letter-spacing: .18em;
  color: #0d0f11; background: #e0a828; padding: 5px 12px;
  pointer-events: none;
}
