/* ═══════════════════════════════════════════════════════════════════════
 * Scionecx · Design Tokens v2 · scx-design-tokens-v2.css · v18.3
 *
 * Reusable utility classes for the most-duplicated inline style patterns
 * found across northstar.js, northstar-overrides.js, and 38 phase files.
 *
 * Audit found:
 *   - 76 instances of the monospace small-cap "label" pattern
 *   - 20 instances of the orange tang button pattern
 *   - 5 instances of the modal close-button pattern
 *   - 5 instances of the modal overlay pattern
 *
 * Future render-template updates can swap `style="…"` for class names
 * from this file to cut ~30% of the inline-style noise. Shipping the
 * stylesheet first; render-template migration is incremental and safe.
 *
 * Naming convention: scx-* — keeps these out of the way of any
 * existing class namespace.
 * ═══════════════════════════════════════════════════════════════════════ */

/* ─────────────────────────────────────────────────────────────────
 * MONOSPACE LABELS — the small-caps eyebrow text used everywhere
 * ───────────────────────────────────────────────────────────────── */
.scx-label,
.scx-label-tang {
  font-family: var(--fm), 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.66rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 0.4rem;
  line-height: 1.4;
}
.scx-label { color: var(--ink3, #71717A); }
.scx-label-tang { color: var(--tang, #FF4D1F); }
.scx-label-success { color: #0a8d3f; }
.scx-label-warn { color: #92400e; }

/* Slightly smaller variant used inside cards */
.scx-label-sm {
  font-family: var(--fm), 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 600;
}

/* ─────────────────────────────────────────────────────────────────
 * BUTTONS — the tang call-to-action button
 * ───────────────────────────────────────────────────────────────── */
.scx-btn-tang {
  background: var(--tang, #FF4D1F);
  border-color: var(--tang, #FF4D1F);
  color: #fff;
}
.scx-btn-tang:hover {
  background: var(--tang2, #E83E10);
  border-color: var(--tang2, #E83E10);
}

/* Full-width modal action row */
.scx-btn-row {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.scx-btn-row > .scx-btn,
.scx-btn-row > button {
  flex: 1;
  min-width: 160px;
  justify-content: center;
  display: flex;
}

/* ─────────────────────────────────────────────────────────────────
 * MODAL OVERLAY + CARD — the dark backdrop + center card pattern
 * ───────────────────────────────────────────────────────────────── */
.scx-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 6000;
  background: rgba(11, 13, 16, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.2rem;
  overflow-y: auto;
  animation: scx-fade-in 0.3s ease;
  backdrop-filter: blur(4px);
}
.scx-modal-card {
  background: var(--paper, #FAF8F3);
  max-width: 560px;
  width: 100%;
  border-radius: 18px;
  padding: 2.4rem 2.2rem;
  position: relative;
  max-height: 92vh;
  overflow-y: auto;
  animation: scx-card-in 0.4s var(--ease, cubic-bezier(0.16, 1, 0.3, 1));
  box-shadow: 0 30px 80px rgba(11, 13, 16, 0.45);
}
.scx-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bone, #F0EBE0);
  border: 1px solid var(--line, #E5DFD2);
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--ink, #0A0A0B);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 300;
  line-height: 1;
}
.scx-modal-close:hover {
  background: #fff;
  transform: scale(1.05);
}
.scx-modal-close:focus-visible {
  outline: 2px solid var(--tang, #FF4D1F);
  outline-offset: 2px;
}

/* Modal heading inside .scx-modal-card */
.scx-modal-h2 {
  font-family: var(--fd, Georgia, serif);
  font-size: 1.65rem;
  font-weight: 600;
  letter-spacing: -0.5px;
  margin-bottom: 0.5rem;
  color: var(--ink, #0A0A0B);
}
.scx-modal-h2 em {
  color: var(--tang, #FF4D1F);
  font-style: italic;
  font-weight: 300;
}

/* ─────────────────────────────────────────────────────────────────
 * STATUS CALLOUTS — the warn/info/success boxes
 * ───────────────────────────────────────────────────────────────── */
.scx-callout {
  border-radius: 8px;
  padding: 0.8rem 1rem;
  margin-bottom: 1.2rem;
  font-size: 0.82rem;
  line-height: 1.55;
}
.scx-callout-warn {
  background: #fef3c7;
  border: 1px solid #fde68a;
  color: #92400e;
}
.scx-callout-info {
  background: #dbeafe;
  border: 1px solid #93c5fd;
  color: #1e3a8a;
}
.scx-callout-success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #0a5f2f;
}
.scx-callout-tang {
  background: linear-gradient(135deg, var(--tang-soft, #FFF7ED), #fff5f0);
  border: 1.5px solid var(--tang-dim, #FFE5D6);
  color: var(--ink2, #404048);
}

/* ─────────────────────────────────────────────────────────────────
 * SCORE PILLS / METRIC CARDS — used in result panels
 * ───────────────────────────────────────────────────────────────── */
.scx-metric-card {
  background: var(--bone, #F0EBE0);
  border-radius: 12px;
  padding: 1.3rem 1.1rem;
  text-align: center;
}
.scx-metric-label {
  font-family: var(--fm), monospace;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  color: var(--ink3, #71717A);
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 0.5rem;
}
.scx-metric-value {
  font-family: var(--fd, Georgia, serif);
  font-size: 2.3rem;
  font-weight: 600;
  line-height: 1.05;
}
.scx-metric-value small {
  font-size: 0.95rem;
  color: var(--ink3, #71717A);
  font-weight: 400;
  margin-left: 0.1rem;
}

/* ─────────────────────────────────────────────────────────────────
 * SPINNER / LOADING — the rotating border pattern
 * ───────────────────────────────────────────────────────────────── */
.scx-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--tang, #FF4D1F);
  border-top-color: transparent;
  border-radius: 50%;
  animation: scx-spin 0.7s linear infinite;
  display: inline-block;
}
.scx-spinner-lg {
  width: 24px;
  height: 24px;
  border-width: 2.5px;
}

/* ─────────────────────────────────────────────────────────────────
 * SKILL CHIPS / TAG PILLS — used throughout result panels
 * ───────────────────────────────────────────────────────────────── */
.scx-chip {
  display: inline-block;
  padding: 0.38rem 0.85rem;
  background: var(--bone, #F0EBE0);
  border: 1px solid var(--line, #E5DFD2);
  border-radius: 100px;
  font-family: var(--fm), monospace;
  font-size: 0.85rem;
  color: var(--ink2, #404048);
  font-weight: 500;
}
.scx-chip-tang {
  background: var(--tang-soft, #FFF7ED);
  border-color: var(--tang-dim, #FFE5D6);
  color: var(--tang, #FF4D1F);
}
.scx-chip-warn {
  background: #fef3c7;
  border: 1px dashed #fde68a;
  color: #92400e;
}

/* ─────────────────────────────────────────────────────────────────
 * ANIMATIONS — scoped, won't collide with other definitions
 * ───────────────────────────────────────────────────────────────── */
@keyframes scx-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes scx-card-in {
  from { opacity: 0; transform: translateY(12px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes scx-spin {
  to { transform: rotate(360deg); }
}

/* ─────────────────────────────────────────────────────────────────
 * Respect reduced motion
 * ───────────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .scx-modal-overlay,
  .scx-modal-card {
    animation: none;
  }
}
