/* Atlas gate styles. Glass card, blurred preview and motion adapted from the
   NT-X website gate (Xpitfire/nt-x-website server/gate/gate.css at 56e5d7d);
   palette and preview restyled for the Cortex atlas. IBM Plex Sans: SIL OFL 1.1
   via @fontsource/ibm-plex-sans. */
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/_gate/ibm-plex-sans-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/_gate/ibm-plex-sans-latin-500-normal.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/_gate/ibm-plex-sans-latin-600-normal.woff2") format("woff2");
}

:root {
  --accent: #8fb8ff;
  --accent-soft: #8fb8ff33;
  --ink: #e8eef6;
  --muted: #b3c0d0;
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  color: var(--ink);
  background: #0b1016;
  color-scheme: dark;
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 280px; overflow: hidden; }
button, input { font: inherit; -webkit-tap-highlight-color: transparent; }
::selection { background: var(--accent); color: #0b1016; }

/* Blurred, inert impression of the atlas behind the card. */
.preview, .diffusion { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.preview {
  background:
    radial-gradient(ellipse at 70% 20%, #2b4a7a55, transparent 60%),
    radial-gradient(ellipse at 15% 85%, #1e5b5a44, transparent 55%),
    #0d141c;
  filter: blur(5px);
  transform: scale(1.03);
  opacity: 0.9;
}
.preview-top {
  position: absolute; inset: 0 0 auto 0; height: 64px;
  display: flex; align-items: center; gap: 40px; padding: 0 32px;
  border-bottom: 1px solid #ffffff14; background: #111a24cc;
}
.preview-brand { font-size: 20px; font-weight: 600; letter-spacing: -0.01em; }
.preview-search { width: 320px; height: 34px; border-radius: 8px; background: #ffffff10; border: 1px solid #ffffff14; }
.preview-side {
  position: absolute; top: 64px; bottom: 0; left: 0; width: 260px;
  display: flex; flex-direction: column; gap: 18px; padding: 32px 28px;
  border-right: 1px solid #ffffff10; background: #0f1720aa;
}
.preview-side span { height: 10px; width: 80%; border-radius: 5px; background: #ffffff1c; }
.preview-side span.short { width: 55%; background: var(--accent-soft); }
.preview-diagram { position: absolute; top: 64px; left: 260px; right: 0; bottom: 0; width: calc(100% - 260px); height: calc(100% - 64px); }
.preview-diagram .links path { fill: none; stroke: #8fb8ff66; stroke-width: 2; }
.preview-diagram .nodes rect { fill: #1d3150; stroke: #8fb8ff88; stroke-width: 1.5; }

.diffusion {
  background:
    radial-gradient(ellipse at 55% 35%, #8fb8ff14, transparent 65%),
    linear-gradient(120deg, #05080c80, #0a121b4d 55%, #05080c99);
  -webkit-backdrop-filter: blur(12px) saturate(0.7);
  backdrop-filter: blur(12px) saturate(0.7);
}

.access-shell {
  position: fixed; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: max(32px, env(safe-area-inset-top)) 24px max(28px, env(safe-area-inset-bottom));
  overflow-y: auto; overscroll-behavior: contain;
}

.access-card {
  position: relative; isolation: isolate; flex-shrink: 0;
  width: min(100%, 460px);
  padding: 32px 36px 24px;
  border: 1px solid #eaf2ff3d;
  border-radius: 24px;
  background:
    radial-gradient(ellipse at 0 0, #eaf2ff1a, transparent 57%),
    linear-gradient(145deg, #eaf2ff12, #0f1d2e55 52%, #dbe8ff0c);
  box-shadow:
    inset 0 1px 0 #ffffff33,
    inset 1px 0 0 #ffffff12,
    inset 0 -1px 0 #00000040,
    0 30px 100px #02050a80,
    0 4px 20px #02050a40;
  -webkit-backdrop-filter: blur(36px) saturate(1.3);
  backdrop-filter: blur(36px) saturate(1.3);
  animation: arrive 650ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.access-card::before {
  content: ""; position: absolute; inset: -1px 20% auto 8%; height: 1px;
  background: linear-gradient(90deg, transparent, #dfeaffb3, transparent); pointer-events: none;
}

.card-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.wordmark { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.wordmark span { margin-left: 4px; color: var(--muted); font-weight: 400; font-size: 12px; }
.access-label { color: var(--muted); font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; }

.lock-mark {
  display: grid; place-items: center; width: 52px; height: 52px; margin-top: 40px;
  border: 1px solid #dfeaff38; border-radius: 16px;
  background: linear-gradient(140deg, #e5efff1a, #0b16281f);
  box-shadow: inset 0 1px 0 #ffffff26, 0 8px 22px #06111b1f;
  color: #d8e6ff;
}
svg { flex-shrink: 0; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.preview svg { stroke: none; }

h1 {
  margin: 24px 0 10px; font-size: clamp(26px, 5vw, 32px); line-height: 1.2;
  font-weight: 500; letter-spacing: -0.03em; text-wrap: balance;
}
.access-copy { margin: 0; color: #c9d4e2; font-size: 14px; line-height: 1.7; }

form { margin-top: 26px; }
label { display: block; margin-bottom: 9px; color: #dde6f1; font-size: 12px; font-weight: 600; }
.input-wrap { position: relative; }
.input-wrap svg { position: absolute; top: 18px; right: 17px; color: #b6c4d6; pointer-events: none; }
input {
  width: 100%; min-height: 54px; padding: 14px 48px 14px 16px;
  border: 1px solid #d8e6f63d; border-radius: 10px;
  color: #f2f6fb; background: #08111c4d;
  box-shadow: inset 0 2px 7px #0710181f;
  font-size: 16px; transition: border-color 160ms, background-color 160ms;
}
input::placeholder { color: #a7b5c6; font-size: 14px; opacity: 1; }
input:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; background: #08111c73; }
input[aria-invalid="true"] { border-color: #f4b4a6; }

.access-status { min-height: 34px; margin: 8px 0 0; color: #d0dcea; font-size: 12px; line-height: 1.5; }
.access-status[data-error="true"] { color: #ffcfc2; }

button {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; min-height: 52px; padding: 14px 19px;
  border: 1px solid #ffffff6b; border-radius: 10px;
  color: #0f1c2e; background: linear-gradient(115deg, #eef4ff, #c6d8f5);
  box-shadow: inset 0 1px 0 #ffffffa0, 0 3px 10px #09151e1a;
  cursor: pointer; font-size: 14px; font-weight: 600;
  touch-action: manipulation; transition: background-color 160ms, box-shadow 160ms;
}
button:hover:not(:disabled) { background: #f2f7ff; box-shadow: inset 0 1px 0 #ffffffa0, 0 3px 20px #8fb8ff33; }
button:focus-visible { outline: 2px solid #e1ecff; outline-offset: 4px; }
button:disabled { cursor: wait; opacity: 0.75; }

.card-footer {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  margin-top: 24px; padding-top: 18px; border-top: 1px solid #e2ecf71f;
  color: #b4c2d2; font-size: 11px;
}
.status-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px #8fb8ff88; }
.noscript-message { color: #ffcfc2; font-size: 12px; line-height: 1.6; }

/* Motion only, never opacity: a paused or throttled animation must not leave the card invisible. */
@keyframes arrive { from { transform: translateY(12px) scale(0.985); } to { transform: none; } }

@media (max-width: 700px) {
  .preview-side, .preview-search { display: none; }
  .preview-diagram { left: 0; width: 100%; }
  .access-shell { padding-right: 18px; padding-left: 18px; }
  .access-card { padding: 26px 24px 20px; border-radius: 20px; }
  .lock-mark { margin-top: 32px; }
}
@media (max-width: 360px) { .wordmark span { display: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media (forced-colors: active) { .access-card, input, button { border: 1px solid CanvasText; } }
