/* Investor gate — the password form and the lock/unlock overlay.
   Page styles for templates/gate.html; tokens + reset live in tokens.css. */

html, body { height: 100%; }
body { overflow: hidden; }

.gate {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: calc(32px + var(--safe-t)) calc(32px + var(--safe-r)) calc(32px + var(--safe-b)) calc(32px + var(--safe-l));
  z-index: 10;
}

/* Faint field behind the lock so the page doesn't read as an error state. */
.gate::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 50% 42%, rgba(58, 91, 255, 0.10), rgba(8, 8, 10, 0) 70%);
  pointer-events: none;
}

.gate-inner {
  position: relative;
  width: 100%;
  max-width: 380px;
  text-align: left;
}

.gate img.mark {
  height: 52px;
  width: auto;
  display: block;
  margin: 0 0 40px;
}

.gate h1 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 40px;
  line-height: 1.05;
  letter-spacing: -0.025em;
  margin: 0 0 14px;
}

.gate .sub {
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--fg-3);
  margin: 0 0 32px;
  max-width: 42ch;
}

.field { position: relative; }

.field label {
  display: block;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-3);
  margin-bottom: 10px;
}

input[type="password"] {
  width: 100%;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--fg-4);
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 16px;
  letter-spacing: 0.18em;
  padding: 10px 0 12px;
  outline: none;
  transition: border-color .25s;
}

input[type="password"]:focus { border-bottom-color: var(--accent); }

button.go {
  margin-top: 28px;
  width: 100%;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 14px 16px;
  cursor: pointer;
  transition: border-color .25s, background .25s, color .25s;
}

button.go:hover:not(:disabled) {
  border-color: var(--accent);
  background: rgba(58, 91, 255, 0.1);
}

button.go:disabled { color: var(--fg-4); cursor: default; }

.msg {
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.6;
  margin-top: 18px;
  min-height: 18px;
  color: var(--fg-4);
}

.msg.err { color: #e66767; }

.gate .foot {
  margin-top: 44px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 10.5px;
  line-height: 1.7;
  color: var(--fg-4);
}

.gate .foot a { color: var(--fg-3); text-decoration: none; }
.gate .foot a:hover { color: var(--fg); }

@media (max-width: 480px) {
  .gate h1 { font-size: 32px; }
}

/* Unlock / lock transitions: an overlay carrying the mark over a blank
   field, driven frame by frame from playUnlock(), playLock() and
   playRelock(). Until playRelock() takes over, a relocking gate stays
   hidden, so it can never flash up without the mark on top of it. */
.relock .gate { visibility: hidden; }

/* color is the mark's ink: the pieces are filled with currentColor. */
.unlock {
  position: fixed;
  inset: 0;
  z-index: 1000;
  overflow: hidden;
  color: var(--fg);
}

/* Hides the brief while it mounts; fading it out is the brief's fade-in. */
.unlock .field {
  position: absolute;
  inset: 0;
  background: var(--bg);
}

/* A 1920x1080 stage, scaled to the viewport, so every position below is in
   the units the sting was authored in. */
.unlock .stage {
  position: absolute;
  left: 0;
  top: 0;
  width: 1920px;
  height: 1080px;
  transform-origin: 0 0;
  will-change: transform;
}

.unlock .spin {
  position: absolute;
  inset: 0;
  transform-origin: 50% 52%;
}

.unlock .piece {
  position: absolute;
  left: 580px;
  top: 160px;
  width: 760px;
  height: 760px;
  opacity: 0;
  will-change: transform, opacity;
}

.unlock svg { display: block; width: 100%; height: 100%; overflow: visible; }
