/* talvi hub — the explorable front door (v9.0).
 *
 * The power-app front door is a small 3D world you move through like Google
 * Earth: drag to look, scroll to zoom, click a building (or its floating
 * label) to open an app. The blade stays flat chrome on top. The same
 * instrument language as green and the 3d study — near-black ground, one green
 * phosphor, box interiors never black, fill-not-hue hierarchy, monospace
 * console voice — plus the worn-film stack (.leak/.grain/.wear) above the
 * canvas, verbatim from talvi's page (A5c).
 *
 * A real .css file, not a JS template literal. scripts/build-assets.mjs reads
 * it and JSON.stringify()s it into src/generated/assets.js. Served at /h.css.
 * NOT inlined: the CSP is `style-src 'self'` — no inline <style> block is
 * allowed; that constraint is the reason this file exists.
 *
 * Dark-only, like green. Tokens on :root so a palette call stays reversible.
 */

:root {
  color-scheme: dark;

  /* Ground — near-black with a teal bias, never neutral grey. */
  --void: #05060b;
  --deep: #0b0d1c;
  --raise: #12142a;

  /* Sign colours — magenta and cyan against each other, amber for focus only. */
  --magenta: #ff2e88;
  --cyan: #22e8ff;
  --amber: #ffb648;

  /* Phosphor — the whole interface voice. */
  --phosphor: #7dffc4;
  --phosphor-dim: #35d998;
  --hud-line: rgba(61, 224, 160, 0.58);
  --hud-line-soft: rgba(61, 224, 160, 0.24);
  --hud-fill: rgba(18, 43, 40, 0.55);
  --hud-fill-lit: rgba(28, 66, 60, 0.7);

  --text-hi: #eaf2ff;
  --text-lo: #8e9bbe;
  --text-dim: #5d6689;

  --rule: #1e2340;
  --rule-lit: #2d3660;

  --glow-cyan: 0 0 8px rgba(34, 232, 255, 0.55), 0 0 26px rgba(34, 232, 255, 0.2);

  --font-display: "Bahnschrift", "DIN Alternate", "Oswald",
    "Avenir Next Condensed", "Roboto Condensed", "Arial Narrow", system-ui,
    sans-serif;
  --font-console: ui-monospace, "SF Mono", "Menlo", "Cascadia Mono",
    "Roboto Mono", "Consolas", monospace;

  /* Blade geometry — collapsed is a narrow icon rail, expanded shows labels.
     The <a> list is plain markup; retraction is a class toggle (client.js),
     so the blade works with JS disabled and with no inline handlers. */
  --blade-collapsed: 3.75rem;
  --blade-expanded: 15rem;

  --soft: 0.35px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--void);
  touch-action: none;
  overscroll-behavior: none;
}

body {
  margin: 0;
  height: 100vh;
  height: 100dvh;
  overflow: hidden; /* the world is the whole viewport; wheel = zoom, not scroll */
  touch-action: none;
  overscroll-behavior: none;
  background: transparent;
  color: var(--text-hi);
  font-family: var(--font-console);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

/* The whole world. Fixed, behind everything, sized by the renderer. */
#scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
  touch-action: none;
  -ms-touch-action: none;
}

/* The cube nameplates are 3D objects in the world — fixed to their
   cubes, faced toward the world centre, so orbiting walks around them. No DOM
   labels here; the blade is the keyboard navigation path. */

/* The HUD: the terminal prompt (echoes a hovered cube) and the hint of
   controls. Pointer-events none — it reads, it never blocks the world. */
.hud {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 1.25rem;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 clamp(1.25rem, 4vw, 2.5rem);
  z-index: 5;
  pointer-events: none;
}

.view-reset {
  pointer-events: auto;
  margin: 0;
  padding: 0.2rem 0.55rem;
  border: 1px solid var(--hud-line-soft);
  border-radius: 0.25rem;
  background: var(--hud-fill);
  color: var(--phosphor-dim);
  font-family: var(--font-console);
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
  touch-action: manipulation;
}

.view-reset:hover,
.view-reset:focus-visible {
  color: var(--phosphor);
  border-color: var(--hud-line);
  outline: none;
}

/* The world's prompt — just the terminal mark, `>_`, with a glitching
   intermittent caret. main.js writes "open <app>" into .prompt__text while a
   building is hovered; idle, it is blank. */
.prompt {
  margin: 0;
  font-family: var(--font-console);
  font-size: clamp(1.3rem, 3.6vw, 2rem);
  line-height: 1;
  color: var(--phosphor);
  text-shadow:
    0 0 2px rgba(198, 255, 232, 0.5),
    0 0 10px rgba(107, 255, 168, 0.4),
    0 0 26px rgba(53, 217, 152, 0.25);
  filter: blur(var(--soft));
}

.prompt__gt {
  color: var(--phosphor-dim);
}

.prompt__text {
  white-space: pre;
}

.prompt__caret {
  display: inline-block;
  margin-left: 0.15em;
  animation: caret-glitch 4.5s steps(1, end) infinite;
}

.hint {
  margin: 0 0 0.15rem;
  font-family: var(--font-console);
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-dim);
}

@keyframes caret-glitch {
  0%,
  74%,
  100% {
    opacity: 1;
  }
  75% {
    opacity: 0.1;
    transform: translateX(1px);
  }
  76% {
    opacity: 1;
    transform: none;
  }
  84% {
    opacity: 0;
  }
  85%,
  93% {
    opacity: 1;
  }
  94% {
    opacity: 0.35;
    transform: translateY(2px);
  }
  95% {
    opacity: 1;
    transform: none;
  }
}

/* One focus ring for the whole page — amber is the one sign colour no resting
   state uses, so it stays legible against both phosphor and the world. */
:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}

/* ---------------------------------------------------------------------------
 * The blade — flat chrome over the world (blueprint A2). Fixed rail on the
 * left, above the film overlays so it stays crisp; the collapsed rail shows
 * icons, expanded shows labels.
 * ------------------------------------------------------------------------- */

.blade {
  position: fixed;
  top: 50%;
  left: clamp(1rem, 3vw, 2rem);
  transform: translateY(-50%);
  width: var(--blade-collapsed);
  z-index: 5;
  /* v2: soft chrome over the world — no hard corners, no hard border. A
     translucent fill + backdrop blur so it sits IN the scene the way the
     frosted app panels do (P2), with a faint inner highlight for edge. */
  border: none;
  border-radius: 1.1rem;
  background: rgba(10, 16, 24, 0.55);
  -webkit-backdrop-filter: blur(16px) saturate(120%);
  backdrop-filter: blur(16px) saturate(120%);
  box-shadow:
    0 0 22px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(125, 255, 196, 0.08);
  display: flex;
  flex-direction: column;
  touch-action: manipulation;
  transition: width 160ms ease;
}

/* Expanded state toggled by client.js. */
.blade.is-open {
  width: var(--blade-expanded);
}

/* Entrance: the rail fades in as a whole, then its items "assemble" — each
   pops in a beat after the last (staggered), then the foot controls follow.
   Opacity-only on the container because the hub's blade is vertically centred
   with transform: translateY(-50%). Reduced motion kills the whole thing. */
.blade {
  animation: blade-in 400ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.blade__item {
  animation: blade-item-in 280ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.blade__item:nth-child(2) {
  animation-delay: 70ms;
}
.blade__item:nth-child(3) {
  animation-delay: 140ms;
}
.blade__item:nth-child(4) {
  animation-delay: 210ms;
}

.blade__toggle,
.blade__login {
  animation: blade-item-in 280ms cubic-bezier(0.16, 1, 0.3, 1) 300ms both;
}

@keyframes blade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes blade-item-in {
  from {
    opacity: 0;
    transform: translateX(-6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.blade__nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.75rem 0.5rem 0.5rem;
  flex: 1;
  overflow: hidden;
}

/* Each item: a plain <a> row. Collapsed, the glyph is centred in the rail;
   expanded, glyph + label read left to right. Keyboard-reachable for free. */
.blade__item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.5rem 0.4rem;
  border-radius: 0.7rem;
  color: var(--text-lo);
  text-decoration: none;
  white-space: nowrap;
}

.blade.is-open .blade__item {
  justify-content: flex-start;
}

.blade__item:hover,
.blade__item:focus-visible {
  color: var(--phosphor);
  background: rgba(28, 66, 60, 0.45);
}

.blade__item:visited {
  color: var(--text-dim);
}

.blade__item:hover:visited,
.blade__item:focus-visible:visited {
  color: var(--phosphor);
}

.blade__item:active {
  background: rgba(18, 43, 40, 0.55);
}

/* The glyph carries the world's own green (the lede colour), not a second
   accent — the rail blends with the scene instead of fighting it. */
.blade__glyph {
  text-align: center;
  font-size: 1.15rem;
  line-height: 1;
  color: var(--phosphor);
  text-shadow: 0 0 6px rgba(125, 255, 196, 0.35);
}

/* The label lives only in the expanded rail; the collapsed rail is pure
   icons. */
.blade__label {
  display: none;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.blade.is-open .blade__label {
  display: block;
  animation: blade-label-in 140ms ease both;
}

.blade__item:focus-visible .blade__label {
  display: block;
}

@keyframes blade-label-in {
  from {
    opacity: 0;
    transform: translateX(-4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* The agent slot (PR2): the old disabled "future app" span became a REAL
   <button> that opens the agent panel. It must be clickable and look like the
   rail items — the default button chrome (grey fill, outset border) and the
   old slot's `pointer-events: none` must not apply. */
.blade__item.is-slot {
  background: none;
  border: none;
  color: var(--text-dim);
  font-family: inherit;
  font-size: 1rem;
  cursor: pointer;
  opacity: 0.55;
}

.blade__item.is-slot:hover,
.blade__item.is-slot:focus-visible {
  color: var(--phosphor);
  background: rgba(28, 66, 60, 0.45);
  opacity: 1;
}

/* Icon controls at the blade's foot: the retract toggle and the login (an
   icon link). Icon-only — the aria-label carries the words; the collapsed
   rail is pure glyphs. */
.blade__toggle,
.blade__login {
  margin: 0.25rem 0.4rem;
  padding: 0.35rem 0.4rem;
  background: transparent;
  color: var(--text-dim);
  border: none;
  border-radius: 0.6rem;
  font-family: var(--font-console);
  font-size: 0.95rem;
  line-height: 1;
  cursor: pointer;
  text-decoration: none; /* the login is an <a> — never underline it */
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.blade__toggle:hover,
.blade__toggle:focus-visible,
.blade__login:hover,
.blade__login:focus-visible {
  color: var(--phosphor);
  background: rgba(28, 66, 60, 0.45);
}

.blade__login {
  margin-bottom: 0.5rem;
}

.blade__login:visited {
  color: var(--text-dim);
}

.blade__login:hover:visited,
.blade__login:focus-visible:visited {
  color: var(--phosphor);
}

/* Signed in: the power glyph is lit — the session is "on". */
.blade__login.is-in {
  color: var(--phosphor);
  text-shadow: 0 0 8px rgba(125, 255, 196, 0.5);
}

/* ========================================================== wear and film */

/* Same three layers and blend modes as talvi's style.css, above the canvas:
     .leak  — uneven backlight, SCREEN (adds light)
     .grain — emulsion grain, OVERLAY (adds tooth without shifting colour)
     .wear  — scratches and dust, MULTIPLY (removes light)
   All pointer-events: none and aria-hidden. */

.leak,
.grain,
.wear {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.leak {
  z-index: 2;
  mix-blend-mode: screen;
  opacity: 0.7;
  background:
    radial-gradient(120% 45% at 50% -8%, rgba(150, 152, 92, 0.5), transparent 70%),
    radial-gradient(120% 45% at 50% 108%, rgba(150, 152, 92, 0.42), transparent 70%),
    radial-gradient(60% 40% at 30% 40%, rgba(120, 140, 96, 0.16), transparent 75%),
    linear-gradient(
      to bottom,
      rgba(140, 146, 88, 0.22) 0 6%,
      transparent 12% 84%,
      rgba(140, 146, 88, 0.18) 92% 100%
    );
}

.grain {
  z-index: 3;
  mix-blend-mode: overlay;
  opacity: 0.72;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/></filter><rect width='180' height='180' filter='url(%23n)' opacity='0.55'/></svg>");
  animation: grainshift 0.45s steps(3, end) infinite;
}

@keyframes grainshift {
  0% {
    transform: translate3d(0, 0, 0);
  }
  33% {
    transform: translate3d(-6px, 3px, 0);
  }
  66% {
    transform: translate3d(4px, -5px, 0);
  }
  100% {
    transform: translate3d(0, 0, 0);
  }
}

.wear {
  z-index: 4;
  mix-blend-mode: multiply;
  opacity: 0.9;
  background-image:
    linear-gradient(to right, transparent 11.3%, rgba(0, 0, 0, 0.5) 11.35%, transparent 11.4%),
    linear-gradient(to right, transparent 28.7%, rgba(0, 0, 0, 0.32) 28.73%, transparent 28.78%),
    linear-gradient(to right, transparent 46.1%, rgba(0, 0, 0, 0.22) 46.14%, transparent 46.2%),
    linear-gradient(to right, transparent 63.9%, rgba(0, 0, 0, 0.4) 63.95%, transparent 64%),
    linear-gradient(to right, transparent 81.4%, rgba(0, 0, 0, 0.28) 81.44%, transparent 81.5%),
    radial-gradient(circle at 18% 24%, rgba(0, 0, 0, 0.55) 0 1px, transparent 2px),
    radial-gradient(circle at 72% 61%, rgba(0, 0, 0, 0.5) 0 1px, transparent 2px),
    radial-gradient(circle at 41% 78%, rgba(0, 0, 0, 0.45) 0 1px, transparent 2px),
    radial-gradient(circle at 88% 33%, rgba(0, 0, 0, 0.4) 0 1px, transparent 2px),
    radial-gradient(circle at 55% 12%, rgba(0, 0, 0, 0.5) 0 1px, transparent 2px),
    linear-gradient(to right, transparent 6.2%, rgba(0, 0, 0, 0.35) 6.24%, transparent 6.3%),
    linear-gradient(to right, transparent 35.8%, rgba(0, 0, 0, 0.45) 35.83%, transparent 35.9%),
    linear-gradient(to right, transparent 52.4%, rgba(0, 0, 0, 0.3) 52.44%, transparent 52.5%),
    linear-gradient(to right, transparent 74.6%, rgba(0, 0, 0, 0.5) 74.63%, transparent 74.7%),
    linear-gradient(to right, transparent 93.1%, rgba(0, 0, 0, 0.35) 93.15%, transparent 93.2%),
    radial-gradient(ellipse 22% 9% at 12% 18%, rgba(0, 0, 0, 0.45), transparent 70%),
    radial-gradient(ellipse 16% 14% at 84% 72%, rgba(0, 0, 0, 0.4), transparent 70%),
    radial-gradient(ellipse 30% 7% at 58% 92%, rgba(0, 0, 0, 0.35), transparent 70%),
    radial-gradient(ellipse 12% 18% at 33% 55%, rgba(0, 0, 0, 0.3), transparent 75%),
    radial-gradient(110% 90% at 50% 50%, transparent 45%, rgba(0, 0, 0, 0.88) 100%);
}

/* ========================================================== reduced motion */

/* The WebGL scene freezes its own autonomous motion in JS (scene/main.js).
   Here we freeze the one CSS animation the film stack carries — grain stays
   as texture but stops crawling, exactly as on talvi's page. */
@media (prefers-reduced-motion: reduce) {
  .grain {
    animation: none;
  }
  .blade,
  .blade.is-open {
    transition: none;
  }
  /* The entrance is removed outright — the rail and its items are simply
     visible (the `both` fill on a cancelled animation would strand them). */
  .blade,
  .blade__item,
  .blade__toggle,
  .blade__login {
    animation: none;
    opacity: 1;
    transform: none;
  }
  .blade__label {
    transition: none;
  }
  /* The caret keeps reading as a prompt but stops faulting. */
  .prompt__caret {
    animation: none;
  }
  .blade__label {
    animation: none;
  }
}

/* ================================================================== mobile */

/* The blade becomes a horizontal rail pinned to the top on a phone; content
   clears it with top padding. The retract toggle is hidden — on a phone the
   blade is always just the icon row, there is no side rail to open. */
@media (max-width: 40rem) {
  .blade {
    top: 0.5rem;
    left: 0.5rem;
    right: 0.5rem;
    width: auto;
    transform: none;
    flex-direction: row;
    align-items: center;
  }
  .blade.is-open {
    width: auto;
  }
  .blade__nav {
    flex-direction: row;
    padding: 0.4rem;
    gap: 0.15rem;
  }
  .blade__item {
    padding: 0.4rem;
  }
  .blade__label {
    display: none;
  }
  .blade__item:focus-visible .blade__label {
    display: none;
  }
  .blade__toggle {
    display: none;
  }
  .blade__login {
    margin: 0 0.4rem 0 0;
  }
  /* The HUD hugs the bottom on a phone; the prompt stays on the left. */
  .hud {
    bottom: 0.9rem;
    padding: 0 0.9rem;
  }
}

/* The agent panel (blueprint PR2) — the agent's chat front door, toggled by
   the MORE blade button. Sits above the world like the HUD but BELOW the film
   overlays (.leak/.grain/.wear, which stay last in DOM order = on top). Flat
   instrument panel: framed, mono, phosphor on the near-black ground — same
   voice as the rest of the hub. */
.agent {
  position: fixed;
  right: clamp(1.25rem, 4vw, 2.5rem);
  bottom: clamp(3.5rem, 8vh, 5rem);
  width: min(24rem, calc(100vw - 2.5rem));
  max-height: 60vh;
  display: flex;
  flex-direction: column;
  background: rgba(9, 12, 26, 0.88);
  border: 1px solid var(--rule-lit);
  box-shadow: var(--glow-cyan);
  z-index: 6;
  font-family: var(--font-console);
  touch-action: manipulation;
}

.agent[hidden] {
  display: none;
}

.agent__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 0.7rem;
  border-bottom: 1px solid var(--rule);
  background: var(--hud-fill);
}

.agent__title {
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  color: var(--phosphor);
  text-shadow: 0 0 8px rgba(107, 255, 168, 0.5);
}

.agent__status {
  font-size: 0.6rem;
  letter-spacing: 0.14em;
  color: var(--text-dim);
}

.agent__log {
  overflow-y: auto;
  touch-action: pan-y;
  flex: 1;
  min-height: 6rem;
  max-height: 38vh;
  padding: 0.55rem 0.7rem;
  font-size: 0.72rem;
  line-height: 1.5;
  color: var(--text-lo);
  white-space: pre-wrap;
  word-break: break-word;
}

.agent__line {
  margin: 0 0 0.15rem;
}

.agent__compose {
  display: flex;
  border-top: 1px solid var(--rule);
}

.agent__input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 0;
  outline: none;
  color: var(--text-hi);
  font-family: var(--font-console);
  font-size: 0.72rem;
  padding: 0.5rem 0.7rem;
}

.agent__input::placeholder {
  color: var(--text-dim);
}

.agent__send {
  background: transparent;
  border: 0;
  border-left: 1px solid var(--rule);
  color: var(--phosphor);
  font-size: 0.85rem;
  padding: 0 0.9rem;
  cursor: pointer;
}

.agent__send:hover,
.agent__send:focus-visible {
  background: var(--hud-fill-lit);
}

/* Focus stays visible (keyboard-first, like the blade). */
.agent__input:focus-visible {
  box-shadow: inset 0 0 0 1px var(--hud-line);
}

/* Phones: the panel hugs the bottom like the HUD. */
@media (max-width: 40rem) {
  .agent {
    right: 0.6rem;
    bottom: 3.2rem;
    width: calc(100vw - 1.2rem);
  }
}

/* ===========================================================================
 * Sign-in pages on the app root (/sign-in, /sso-callback) — the instrument
 * theme, ported from the relay so the Clerk form reads as part of the machine.
 * Uses the hub's own variables; the CSS variables already exist above.
 * ========================================================================= */
@keyframes sweep {
  to { transform: translateY(calc(100vh + 38vh)); }
}
@keyframes lightup {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.scan {
  position: fixed;
  left: 0;
  right: 0;
  height: 38vh;
  top: -38vh;
  pointer-events: none;
  z-index: 0;
  background: linear-gradient(to bottom,
    rgba(107, 255, 168, 0) 0%,
    rgba(107, 255, 168, 0.035) 55%,
    rgba(107, 255, 168, 0.07) 80%,
    rgba(107, 255, 168, 0) 100%);
  animation: sweep 7.5s linear infinite;
}

.frame {
  position: relative;
  z-index: 1;
  transform: rotate(-0.09deg);
  box-shadow: 0 0 18px rgba(61, 224, 160, 0.09), inset 0 0 60px rgba(0, 0, 0, 0.35);
  border: 1px solid var(--hud-line);
  padding: clamp(1rem, 3vw, 2.25rem);
  min-height: calc(100vh - 2 * clamp(0.75rem, 3vw, 2rem));
  display: flex;
  flex-direction: column;
  gap: clamp(1rem, 3vw, 2rem);
}
.frame::before,
.frame::after {
  content: "";
  position: absolute;
  top: 12%;
  bottom: 12%;
  width: 10px;
  border: 1px solid var(--hud-line);
  pointer-events: none;
}
.frame::before {
  left: -1px;
  border-right: 0;
  border-radius: 3px 0 0 3px;
  background: linear-gradient(to bottom,
    transparent 0 18%, var(--void) 18% 26%, transparent 26% 74%,
    var(--void) 74% 82%, transparent 82%);
}
.frame::after {
  right: -1px;
  border-left: 0;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(to bottom,
    transparent 0 18%, var(--void) 18% 26%, transparent 26% 74%,
    var(--void) 74% 82%, transparent 82%);
}

.wrap {
  position: relative;
  z-index: 1;
  max-width: 44rem;
  margin: 0;
}
.head { animation: lightup 0.45s ease-out both; }
.stack { animation: lightup 0.45s ease-out 0.18s both; }

.sign {
  display: flex;
  align-items: baseline;
  gap: 0.9rem;
  margin: 0 0 0.4rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(3.2rem, 13vw, 5.5rem);
  line-height: 0.85;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--phosphor);
  text-shadow: 0 0 2px rgba(255, 255, 255, 0.55),
    0 0 18px rgba(125, 255, 196, 0.6), 0 0 46px rgba(61, 224, 160, 0.3);
}
.sign__link { color: inherit; text-decoration: none; }
.sign__link:focus-visible { outline: 2px solid var(--amber); outline-offset: 6px; }

.tagline {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: -0.55rem;
  padding-left: 0.6rem;
  z-index: 2;
}
.tagline__box {
  border: 1px solid var(--hud-line);
  background: var(--void);
  padding: 0.1rem 0.5rem;
  font-family: var(--font-console);
  font-size: 0.55rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--phosphor-dim);
  white-space: nowrap;
}

.box {
  border: 1px solid var(--hud-line-soft);
  background: var(--hud-fill);
  padding: 0.95rem 1rem 0.85rem;
}
.lede {
  margin: 0;
  max-width: 34rem;
  font-family: var(--font-console);
  font-size: 0.86rem;
  line-height: 1.7;
  color: var(--phosphor);
  text-shadow: 0 0 2px rgba(198, 255, 232, 0.5),
    0 0 7px rgba(107, 255, 168, 0.4), 0 0 18px rgba(53, 217, 152, 0.25);
}
.lede::before { content: "> "; color: var(--phosphor-dim); }

.stack {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 1.5rem;
  min-width: 0;
}
.panel {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.25rem;
  border: 1px solid var(--rule);
  background: rgba(18, 43, 40, 0.62);
  padding: 1.4rem;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.6rem;
  border: 1px solid var(--phosphor);
  background: var(--hud-fill-lit);
  color: var(--phosphor);
  font-family: var(--font-console);
  font-size: 0.92rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 0 12px rgba(61, 224, 160, 0.18);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.btn:hover { background: var(--phosphor); color: #04140d; box-shadow: 0 0 16px rgba(125, 255, 196, 0.5); }
.btn:active { filter: brightness(0.92); transform: translateY(1px); }
.btn[disabled] { border-color: var(--hud-line-soft); background: transparent; color: rgba(61, 224, 160, 0.35); box-shadow: none; cursor: not-allowed; }
.btn--ghost {
  padding: 0.55rem 1rem;
  background: transparent;
  border: 1px solid var(--cyan);
  color: var(--cyan);
  font-size: 0.85rem;
  box-shadow: none;
}
.btn--ghost:hover { background: rgba(34, 232, 255, 0.1); filter: none; box-shadow: var(--glow-cyan); }

.msg {
  margin: 0;
  padding: 0.9rem 1.1rem;
  border-left: 3px solid var(--amber);
  background: var(--raise);
  color: var(--phosphor);
  font-family: var(--font-console);
  font-size: 0.82rem;
  line-height: 1.65;
}
.msg::before { content: "> "; color: var(--phosphor-dim); }
.msg--bad { border-left-color: var(--magenta); }
.hidden { display: none; }
.chat__optional {
  font-family: var(--font-console);
  font-size: 0.5rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--phosphor-dim);
  opacity: 0.7;
}

/* The sign-in pages — a quiet night around the instrument. The film overlays
   give texture; this gives depth (a soft phosphor-cyan haze so the ground is
   not flat black, matching the depth the other pages get from their world). */
body.signin {
  background:
    radial-gradient(95% 75% at 80% 6%, rgba(125, 255, 196, 0.07), transparent 62%),
    radial-gradient(70% 55% at 6% 92%, rgba(34, 232, 255, 0.06), transparent 62%),
    var(--void);
}

.si__label {
  display: block;
  margin-bottom: 0.25rem;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.si__field {
  display: block;
  width: 100%;
  margin-bottom: 1.1rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--hud-line-soft);
  border-radius: 0;
  background: var(--void);
  color: var(--text-hi);
  font-family: var(--font-console);
  font-size: 0.95rem;
  line-height: 1.4;
}
.si__field::placeholder { color: var(--hud-line-soft); }
.si__field:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
#si-form { display: flex; flex-direction: column; align-items: stretch; }
#si-form .btn { align-self: flex-start; }
.si__code { margin-bottom: 1.1rem; }
.si__alt {
  margin-top: 0.25rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--rule);
}
.si__or {
  font-family: var(--font-console);
  font-size: 0.6rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 0 0 0.6rem;
}
.si__row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.si__row .btn--ghost { flex: 1 1 9rem; justify-content: center; }
