/* ===========================================================================
   Authsy theme bridge

   Re-points the shared portal.css custom properties at the same palette the
   shadcn SPA and the landing page use, so RoDecomp and the remaining legacy
   pages read as one product instead of three.

   This is a token layer only. It touches no layout, no component structure
   and none of the decompiler's Monaco / WASM / 3D logic — those keep working
   exactly as they do today.

   Load it AFTER portal.css (and after decompiler.css) so it wins on order:
       <link rel="stylesheet" href="/theme-authsy.css">
   =========================================================================== */

/* No @font-face for Griaste on purpose — it is licensed per-deployment and
   gitignored, so those URLs 404ed on every page load. 'Griaste' stays at the
   head of --font-display below, which honours a locally installed copy and
   falls through to Space Grotesk otherwise. The SPA wordmark no longer needs
   the face at all (see scripts/make-wordmark.mjs). */

/* decompiler.css redefines these same variables on `.dc` and
   `body.dc-body-shell`. Custom properties resolve from the nearest ancestor
   that defines them, so a `:root` block alone is shadowed for everything
   inside the decompiler no matter how late it loads. Targeting those
   selectors too is what actually makes the reskin apply. */
:root,
.dc,
body.dc-body-shell {
  /* --- surfaces: Authsy near-black rather than zinc --- */
  --bg: #080807;
  --surface: #131211;
  --surface-2: #181715;
  --surface-3: #232120;

  --border: #2a2724;
  --border-strong: #524d47;

  /* --- text --- */
  --text: #e8e8e3;
  --text-muted: #938f8a;
  --text-faint: #6b645c;

  /* --- accent ---
     RoDecomp keeps its green. shadcn's own approach is a neutral base with a
     single accent, and the green is this product's identity — swapping it for
     beige would make the decompiler indistinguishable from the licensing
     portal. Neutrals do the unifying work instead. */
  --accent: #5ee88a;
  --accent-2: #37c96b;
  --accent-ink: #04210f;
  --cream: #e8e8e3;
  --focus: #5ee88a;

  --success: #5ad07a;
  --danger: #f87171;
  --warning: #e0b341;
  --info: #8fc7ff;

  /* --- type: matches the SPA and landing page --- */
  --font-sans: 'Inter Tight', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --font-display: 'Griaste', 'Space Grotesk', 'Inter Tight', sans-serif;

  /* --- shape: shadcn sits much tighter than the 12px this used --- */
  --radius: 0.5rem;
  --radius-sm: 0.35rem;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  /* --- elevation: shadcn leans on borders, not drop shadows --- */
  --hard: 0 1px 2px 0 rgb(0 0 0 / 0.35);
  --hard-sm: 0 1px 1px 0 rgb(0 0 0 / 0.28);
  --hard-light: 0 1px 2px rgb(94 232 138 / 0.12);
  --glow: 0 0 0 1px rgb(94 232 138 / 0.22);
}

/* The wordmark, wherever these pages render it */
.brand,
.logo,
.brand-name,
[data-brand] {
  font-family: var(--font-display);
  letter-spacing: 0;
}

/* Inputs and buttons in the legacy pages predate the token set and hardcode a
   few greys; nudge the common ones onto the palette. */
body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
}

input,
select,
textarea {
  font-family: inherit;
}

::selection {
  background-color: var(--text);
  color: var(--bg);
}

/* Monaco reads its own theme from JS, but the frame around it should match */
.monaco-editor,
.monaco-editor-background {
  --vscode-editor-background: var(--surface);
}
