/* Early-access gate (src/access.html, assets/gate.js). Same look as the site: black, white type, small mono labels,
   with the logo's blue routes as the only colour. A few night-ops touches: the routes glow like neon, a reticle locks
   onto the iris, tracked units carry call signs, the horizon line runs across the screen, faint scanlines. */
:root {
  --bg: #000; --fg: #f5f5f3; --dim: #8b8f96; --faint: #4a4e55; --line: #22252a;
  --blue: #1e9be0; --ice: #cfefff; --sky: #6cb8ff; --amber: #e8a33d; --neon: #3fd4ff;
  --display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --body: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --gl: max(20px, env(safe-area-inset-left, 0px)); --gr: max(20px, env(safe-area-inset-right, 0px));
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; min-height: 100svh; background: var(--bg); color: var(--fg); font: 400 17px/1.55 var(--body);
  -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--fg); outline-offset: 3px; }

.g-field { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }

/* top bar */
.g-top { position: fixed; top: 0; left: 0; right: 0; z-index: 4; display: flex; align-items: center; justify-content: space-between;
  padding: 18px var(--gr) 18px var(--gl); pointer-events: none; }
.g-top > * { pointer-events: auto; }
.g-brand { display: block; color: var(--fg); }
.g-brand svg { display: block; height: 17px; width: auto; }
.g-pill { display: inline-flex; align-items: center; gap: 8px; font: 500 11px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase;
  color: var(--dim); border: 1px solid var(--line); padding: 8px 11px; background: rgb(0 0 0 / .5); }
.g-pill i { width: 6px; height: 6px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 10px var(--blue); animation: g-pulse 2.4s ease-in-out infinite; }
@keyframes g-pulse { 50% { opacity: .35; } }

/* the eye */
.g-main { position: relative; z-index: 2; min-height: 100vh; min-height: 100svh; display: grid; justify-items: center; align-content: center;
  grid-template-columns: minmax(0, 1fr); overflow-x: clip; gap: clamp(14px, 3vh, 34px); padding: 64px var(--gr) 48px var(--gl); }
.g-stage { position: relative; width: min(780px, 92vw, calc((100vh - 430px) * 1.613)); width: min(780px, 92vw, calc((100svh - 430px) * 1.613)); min-width: min(300px, 92vw); aspect-ratio: 100 / 62;
  --ix: 0px; --iy: 0px; }
.g-hud { position: absolute; left: 49.08%; top: 53.2%; width: 128%; aspect-ratio: 1; translate: -50% -50%; overflow: visible;
  pointer-events: none; opacity: 0; transition: opacity 1.4s ease .9s;
  /* the instruments fade out below the eye so they never cross the words */
  -webkit-mask-image: linear-gradient(to bottom, #000 58%, transparent 76%); mask-image: linear-gradient(to bottom, #000 58%, transparent 76%); }
.g-on .g-hud { opacity: 1; }
.g-hud-ring { fill: none; stroke: rgb(108 184 255 / .2); stroke-width: .25; }
.g-hud-ring.r2 { stroke-dasharray: .6 1.6; stroke: rgb(108 184 255 / .22); }
.g-hud-ticks { transform-origin: 0 0; animation: g-spin 90s linear infinite; }
.g-hud-ticks line { stroke: rgb(108 184 255 / .3); stroke-width: .22; }
.g-hud-ticks line.major { stroke: rgb(207 239 255 / .5); stroke-width: .3; }
.g-hud-sweep { fill: rgb(108 184 255 / .07); transform-origin: 0 0; animation: g-spin 7s linear infinite; opacity: .55; }
.g-hud-labels text { font: 500 3.3px var(--mono); letter-spacing: .18em; fill: rgb(139 143 150 / .85); transition: fill .3s; }
.g-hud-labels text.l { text-anchor: end; }
.g-hud-labels text.hit { fill: var(--ice); }
@keyframes g-spin { to { transform: rotate(360deg); } }

.g-eye { position: absolute; inset: 0; transform-origin: 49.08% 53.2%; }
.g-lids { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.g-lid { fill: var(--fg); }
.g-lids { filter: drop-shadow(0 0 1px rgb(207 239 255 / .7)) drop-shadow(0 0 14px rgb(30 155 224 / .35)); }
.g-horizon { opacity: 0; }
.g-iris { position: absolute; left: 26.71%; top: 17.15%; width: 44.74%; height: 72.16%; transform: translate(var(--ix), var(--iy)); }
.g-globe { position: absolute; inset: 6.64%; width: 86.72%; height: 86.72%; border-radius: 50%; }
.g-ring { position: absolute; inset: 0; width: 100%; height: 100%; color: var(--fg); overflow: visible; }
.g-flat { fill: var(--fg); transition: opacity 1.2s ease; }
.g-scan { fill: var(--sky); opacity: 0; filter: drop-shadow(0 0 1.5px var(--sky)); }

/* opening: a glowing horizon line, then the eye opens */
.js .g-eye { transform: scaleY(.012); }
.js .g-lid { opacity: 0; }
.js .g-horizon { opacity: 1; }
.js .g-iris { opacity: 0; }
.g-open .g-eye { transform: none; transition: transform .9s cubic-bezier(.2, .9, .1, 1); }
.g-open .g-lid { opacity: 1; transition: opacity .25s ease; }
.g-open .g-horizon { opacity: 0; transition: opacity .6s ease .2s; }
.g-open .g-iris { opacity: 1; transition: opacity .5s ease .35s; }
.g-live .g-flat { opacity: 0; }
.g-eye.blink { transform: scaleY(.06); transition: transform .09s ease-in; }

/* checking the key */
.verifying .g-scan { animation: g-scan 1s ease-in-out infinite alternate; }
@keyframes g-scan { from { opacity: .9; transform: translateY(0); } to { opacity: .9; transform: translateY(43.5px); } }
.denied .g-iris { animation: g-no .5s ease; }
@keyframes g-no { 20% { translate: -2.2% 0; } 45% { translate: 2% 0; } 70% { translate: -1.2% 0; } 100% { translate: 0 0; } }
.granted .g-stage { transform: scale(var(--zoom, 18)); transition: transform 1.15s cubic-bezier(.7, 0, .84, 0); transform-origin: 49.08% 53.2%; }
.granted .g-copy, .granted .g-top, .granted .g-foot { opacity: 0; transition: opacity .35s ease; }
.g-flash { position: fixed; inset: 0; z-index: 9; pointer-events: none; opacity: 0; background: radial-gradient(circle at var(--fx, 50%) var(--fy, 45%), var(--ice), var(--blue) 30%, #000 75%); }
.granted .g-flash { opacity: 1; transition: opacity .5s ease .75s; }

/* copy and the key */
.g-copy { width: min(780px, 100%); text-align: center; display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 14px; }
.js .g-copy > * { opacity: 0; transform: translateY(14px); }
.g-on .g-copy > * { opacity: 1; transform: none; transition: opacity .7s ease, transform .7s cubic-bezier(.2, .8, .2, 1); }
.g-on .g-copy > :nth-child(2) { transition-delay: .08s; }
.g-on .g-copy > :nth-child(3) { transition-delay: .16s; }
.g-on .g-copy > :nth-child(4) { transition-delay: .24s; }
.g-on .g-copy > :nth-child(5) { transition-delay: .32s; }
.g-label { margin: 0; font: 500 12px/1.4 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--sky); }
.g-label .cur { display: inline-block; width: .55em; height: 1.05em; margin-left: 4px; vertical-align: -.18em; background: var(--sky); animation: g-caret 1.05s steps(1) infinite; }
.tw-box { position: relative; display: inline-block; }
.tw-full { visibility: hidden; }
.tw-type { position: absolute; left: 0; top: 0; white-space: nowrap; }
.g-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.g-title { margin: 0; font: 500 clamp(30px, 3.6vw, 48px)/1.02 var(--display); letter-spacing: -0.035em; text-wrap: balance; }
.g-sub { margin: 0; color: var(--dim); font-size: clamp(15px, 1.3vw, 18px); line-height: 1.5; max-width: 62ch; text-wrap: pretty; }
.g-key { width: min(460px, 100%); margin-top: 6px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; text-align: left; }
.g-key-label { font: 500 11px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }
.g-key-row { position: relative; display: flex; border: 1px solid #3a3e45; background: rgb(11 12 14 / .85); transition: border-color .2s, box-shadow .3s; }
.g-key-row:focus-within { border-color: var(--neon); box-shadow: 0 0 0 1px rgb(63 212 255 / .3), 0 0 34px -8px rgb(63 212 255 / .7); }
.g-prompt { align-self: center; padding-left: 14px; font: 500 16px/1 var(--mono); color: var(--neon); text-shadow: 0 0 8px rgb(63 212 255 / .8); user-select: none; }
.g-prompt::after { content: "_"; margin-left: 1px; animation: g-caret 1.05s steps(1) infinite; }
.g-key-row:focus-within .g-prompt::after { visibility: hidden; }
@keyframes g-caret { 50% { opacity: 0; } }
.g-key input[type=password], .g-key input[type=text] { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--fg);
  font: 500 16px/1 var(--mono); letter-spacing: .12em; padding: 15px 14px 15px 10px; outline: none; caret-color: var(--neon); }
.g-key input::placeholder { color: var(--faint); letter-spacing: .04em; font-family: var(--body); font-weight: 400; }
.g-key button { border: 0; background: var(--fg); color: #000; font-weight: 500; padding: 0 20px; cursor: pointer; white-space: nowrap; }
.g-key button:hover { background: #d9d9d6; }
.g-key button span { font-family: var(--mono); }
.verifying .g-key button { background: var(--sky); }
.g-msg { min-height: 1.4em; margin: 0; font: 400 13px/1.4 var(--mono); color: var(--dim); }
.g-msg.bad { color: var(--amber); }
.g-msg.good { color: var(--ice); }
.g-ask { margin: 0; color: var(--dim); font-size: 15px; }
.g-req-open { border: 0; background: none; padding: 0; color: var(--fg); text-decoration: underline; text-underline-offset: 4px;
  text-decoration-color: var(--faint); cursor: pointer; }
.g-req-open:hover { text-decoration-color: var(--fg); }

.g-foot { position: relative; z-index: 2; display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; padding: 0 var(--gr) 16px var(--gl);
  margin-top: -36px; font: 400 12px/1.4 var(--mono); color: var(--faint); }
.g-foot a { color: var(--dim); text-decoration: none; }
.g-foot a:hover { color: var(--fg); }

/* request access */
.g-req { position: fixed; inset: 0; z-index: 8; display: grid; place-items: center; padding: 20px; }
.g-req[hidden] { display: none; }
.g-req-scrim { position: absolute; inset: 0; background: rgb(0 0 0 / .72); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: g-fade .25s ease; }
.g-req-panel { position: relative; width: min(620px, 100%); max-height: calc(100svh - 40px); overflow: auto; background: #0b0c0e; border: 1px solid var(--line);
  border-top: 2px solid var(--blue); padding: 28px clamp(20px, 4vw, 36px) 26px; display: grid; gap: 12px;
  box-shadow: 0 30px 90px rgb(0 0 0 / .7), 0 0 60px -20px rgb(30 155 224 / .5); animation: g-rise .35s cubic-bezier(.2, .8, .2, 1); }
@keyframes g-fade { from { opacity: 0; } }
@keyframes g-rise { from { opacity: 0; transform: translateY(18px); } }
.g-req-panel h2 { margin: 0; font: 500 clamp(26px, 3.4vw, 38px)/1.05 var(--display); letter-spacing: -0.03em; }
.g-req-note { margin: 0; color: var(--dim); font-size: 14px; }
.g-req-x { position: absolute; top: 10px; right: 12px; border: 0; background: none; font-size: 26px; line-height: 1; color: var(--dim); cursor: pointer; padding: 6px 8px; }
.g-req-x:hover { color: var(--fg); }
.g-req-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; margin-top: 6px; }
.g-req-grid label { display: grid; gap: 6px; font: 500 11px/1.3 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--dim); }
.g-req-grid label.wide { grid-column: 1 / -1; }
.g-req-grid .opt { color: var(--faint); letter-spacing: .06em; }
.g-req-grid input, .g-req-grid select, .g-req-grid textarea { font: 400 16px/1.3 var(--body); letter-spacing: 0; text-transform: none; color: var(--fg);
  background: #000; border: 1px solid #33373e; padding: 11px 12px; width: 100%; outline: none; border-radius: 0; }
.g-req-grid textarea { resize: vertical; }
.g-req-grid :is(input, select, textarea):focus { border-color: var(--sky); }
.g-req-send { justify-self: start; margin-top: 6px; border: 1px solid var(--fg); background: var(--fg); color: #000; font-weight: 500; padding: 13px 20px; cursor: pointer; }
.g-req-send:hover { background: #d9d9d6; }
.g-req-send span { font-family: var(--mono); }
.g-req-done { margin: 0; min-height: 1.3em; font: 400 13px/1.45 var(--mono); color: var(--ice); }

/* ---------- night-ops touches ---------- */
/* a hairline reticle locks onto the iris once the eye opens; it tightens while the key is checked */
.g-ret { fill: none; stroke: var(--ice); stroke-width: .35; stroke-linecap: square; opacity: 0; transform-box: fill-box; transform-origin: center; }
.g-on .g-ret { opacity: .85; animation: g-lock 1.2s cubic-bezier(.2, .9, .2, 1) both; }
@keyframes g-lock { 0% { opacity: 0; transform: scale(1.5); } 55% { opacity: .85; transform: scale(.97); } 68% { opacity: .2; } 80% { opacity: .85; } 100% { transform: none; } }
.verifying .g-ret { animation: g-hunt .45s ease-in-out infinite alternate; stroke: var(--neon); }
@keyframes g-hunt { from { transform: none; } to { transform: scale(.93); } }
.denied .g-ret { stroke: var(--amber); }
.granted .g-ret { stroke: var(--neon); }

/* RGB ghosts of the lids for the short glitch on opening, on a wrong key and on entry */
.g-ghost { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; opacity: 0; pointer-events: none; mix-blend-mode: screen; filter: none; }
.g-ghost .g-lid { opacity: 1; }
.g-ghost.c .g-lid { fill: #00e5ff; }
.g-ghost.m .g-lid { fill: #ff3b6b; }
.denied .g-ghost.c .g-lid, .denied .g-ghost.m .g-lid { fill: var(--amber); }
.glitch .g-ghost { opacity: .9; }

/* very faint scanlines and a vignette */
.g-crt { position: fixed; inset: 0; z-index: 3; pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgb(255 255 255 / .022) 0 1px, transparent 1px 3px),
    radial-gradient(ellipse at 50% 45%, transparent 60%, rgb(0 0 0 / .5)); }

@media (max-width: 360px) {
  .g-key input::placeholder { font-size: 13.5px; letter-spacing: 0; }
  .g-key button { padding: 0 14px; }
  .g-prompt { padding-left: 11px; }
  .g-key input[type=password] { padding-left: 8px; padding-right: 8px; }
}
@media (max-width: 560px) {
  .g-main { padding-top: 70px; gap: 16px; align-content: start; }
  .g-stage { width: 100%; margin-top: 4vh; }
  .g-hud { width: 118%; }
  .g-title { font-size: 31px; }
  .g-req-grid { grid-template-columns: 1fr; }
  .g-foot { margin-top: 0; }
}
@media (max-height: 640px) and (min-width: 561px) {
  .g-stage { width: min(560px, 80vw); }
}
@media (prefers-reduced-motion: reduce) {
  .g-hud-ticks, .g-hud-sweep, .g-pill i, .g-prompt::after, .g-label .cur, .g-on .g-ret, .verifying .g-ret { animation: none; }
  .g-ghost { display: none; }
  .js .g-eye, .js .g-lid, .js .g-iris, .js .g-copy > * { transform: none; opacity: 1; transition: none; }
  .js .g-horizon { opacity: 0; }
  .granted .g-stage { transform: none; }
  .verifying .g-scan, .denied .g-iris { animation: none; }
}
