/* Chexi's own brand: the frame around every owner's site. Tokens, the wordmark and a handful of
   components shared by chexi.app, /login, the editor chrome and anything else Chexi draws itself.
   An owner's site never reads these; its look comes from site/studio/styles/. See BRAND.md.

   Every name starts with --cx- or .cx- so it can sit beside a site's own tokens (the editor does).
   Dark is home. Light is the mirror: set data-theme="light" on <html>, or add .cx-light to a box. */

:root, .cx-dark {
  /* Fixed brand colours */
  --cx-night: #0B0B0C; --cx-graphite: #141416; --cx-slate: #1E1E21; --cx-rule: #2C2C31;
  --cx-ash: #9A9A9E; --cx-bone: #EDEDEA;
  --cx-paper: #F2F2EF; --cx-mist: #E6E6E1; --cx-hair: #D5D5CF; --cx-stone: #6B6B70; --cx-char: #121213;
  --cx-signal: #FF4F00; --cx-signal-hi: #FF6A26; --cx-ember: #C23C00;
  --cx-good: #3ccf8e; --cx-bad: #ff6b5e;

  /* Roles (dark) */
  --cx-bg: var(--cx-night); --cx-surface: var(--cx-graphite); --cx-raised: var(--cx-slate);
  --cx-line: var(--cx-rule); --cx-text: var(--cx-bone); --cx-muted: var(--cx-ash); --cx-faint: #6f6f75;
  --cx-accent: var(--cx-signal); --cx-accent-hover: var(--cx-signal-hi); --cx-on-accent: var(--cx-night);
  --cx-accent-text: var(--cx-signal-hi); --cx-wash: #2A160C; --cx-shadow: var(--cx-slate);
  --cx-field: var(--cx-night);

  --cx-display: "Space Grotesk", Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --cx-ui: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --cx-mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  --cx-r-ctl: 10px; --cx-r-card: 14px; --cx-stroke: 1.5px;
}
:root[data-theme="light"], .cx-light {
  --cx-bg: var(--cx-paper); --cx-surface: #fff; --cx-raised: var(--cx-mist);
  --cx-line: var(--cx-hair); --cx-text: var(--cx-char); --cx-muted: var(--cx-stone); --cx-faint: #8a8a8f;
  --cx-accent-text: var(--cx-ember); --cx-wash: #FFEDE3; --cx-shadow: var(--cx-hair);
  --cx-field: #fff; --cx-good: #11845a; --cx-bad: #c8231b;
}

/* The wordmark: lowercase chexi and the cursor. <span class="cx-wordmark">chexi<i class="cx-cursor"></i></span> */
.cx-wordmark { display: inline-flex; align-items: baseline; font: 700 1em/1 var(--cx-display); letter-spacing: -.045em; color: inherit; white-space: nowrap; }
.cx-cursor { display: inline-block; width: .42em; height: .6em; margin-left: .1em; background: var(--cx-signal); font-style: normal; }
.cx-cursor.is-blinking { animation: cx-blink 1.1s steps(1) infinite; }
@keyframes cx-blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .cx-cursor.is-blinking { animation: none; } }

/* Buttons: text on orange is always Night. */
.cx-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 20px;
  border: 0; border-radius: var(--cx-r-ctl); background: var(--cx-accent); color: var(--cx-on-accent);
  font: 600 15px/1 var(--cx-ui); text-decoration: none; cursor: pointer; white-space: nowrap; transition: background .15s, transform .15s;
}
.cx-btn:hover { background: var(--cx-accent-hover); }
.cx-btn:active { transform: translateY(1px); }
.cx-btn[disabled] { opacity: .55; cursor: default; }
.cx-btn-ghost { background: transparent; color: var(--cx-text); box-shadow: inset 0 0 0 var(--cx-stroke) var(--cx-line); }
.cx-btn-ghost:hover { background: var(--cx-raised); }
.cx-btn-quiet { background: none; color: var(--cx-muted); font-weight: 500; }
.cx-btn-quiet:hover { background: none; color: var(--cx-text); }

/* Fields */
.cx-label { display: block; font: 500 13px/1.3 var(--cx-ui); color: var(--cx-muted); margin: 0 0 6px; }
.cx-input {
  width: 100%; min-height: 44px; padding: 10px 13px; border-radius: var(--cx-r-ctl); border: var(--cx-stroke) solid var(--cx-line);
  background: var(--cx-field); color: var(--cx-text); font: 15px/1.4 var(--cx-ui);
}
.cx-input:focus { outline: none; border-color: var(--cx-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--cx-signal) 24%, transparent); }

/* A card drawn like a window: line, corners, and a hard offset shadow instead of a blur. */
.cx-card { background: var(--cx-surface); border: var(--cx-stroke) solid var(--cx-line); border-radius: var(--cx-r-card); box-shadow: 6px 6px 0 var(--cx-shadow); }

/* Small parts */
.cx-eyebrow { font: 500 12px/1.4 var(--cx-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--cx-muted); }
.cx-pin { display: inline-grid; place-items: center; flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--cx-signal); color: var(--cx-night); font: 700 11px/1 var(--cx-mono); }
.cx-pro { display: inline-block; font: 600 10.5px/1 var(--cx-mono); letter-spacing: .06em; color: var(--cx-accent-text); border: var(--cx-stroke) solid currentColor; border-radius: 4px; padding: 3px 5px; vertical-align: middle; white-space: nowrap; }
.cx-toast { display: inline-flex; align-items: center; gap: 10px; background: var(--cx-bone); color: var(--cx-night); border-radius: var(--cx-r-ctl); padding: 10px 14px; font: 500 14px/1.3 var(--cx-ui); }

/* "Made with Chexi": the same small Night pill on every site and every style. */
.cx-badge {
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 11px; border-radius: 99px;
  background: #0B0B0C; color: #EDEDEA; font: 600 12px/1 Inter, system-ui, -apple-system, "Segoe UI", sans-serif; text-decoration: none;
  box-shadow: 0 6px 16px -8px rgba(0, 0, 0, .55);
}
.cx-badge .cx-cursor { width: 5px; height: 9px; margin: 0; }
