/* ==================================================================== */
/*  Signal Run — Design System                                          */
/*  Tokens + utility classes. This file is the styling contract: every  */
/*  component class and CSS custom property referenced by the library   */
/*  is defined here, so importing it is sufficient to render the kit.   */
/* ==================================================================== */

@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap");

:root {
  /* Surfaces */
  --graphite: #1a1a1a;
  --elev-1: #202022;
  --elev-2: #26262a;
  --border: #2e2e33;
  --border-strong: #3a3a40;
  --code-bg: #0f0f10;

  /* Text */
  --paper: #f5f5f2;
  --text-2: #a6a6a0;
  --text-3: #6b6b66;

  /* Accent (olive) */
  --midnight: #3c4a2e;
  --midnight-bright: #566b45;
  --olive: #3c4a2e;

  /* Signal status */
  --positive: #6fae6f;
  --caution: #c99a4b;
  --negative: #b85c5c;

  /* Type families */
  --sans: "Inter", "Inter Display", "GT America", system-ui, sans-serif;
  --mono: "JetBrains Mono", "IBM Plex Mono", ui-monospace, monospace;
}

/* ---- Base canvas (dark-first design system) ----------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--graphite);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 20px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01", "cv11";
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
}

/* ---- Type helpers ------------------------------------------------- */
.mono {
  font-family: var(--mono);
  font-feature-settings: "tnum";
}
.tnum {
  font-variant-numeric: tabular-nums;
}

.h-display {
  font-size: 72px;
  line-height: 1.05;
  letter-spacing: -0.02em;
  font-weight: 600;
}
.h-display-sm {
  font-size: 56px;
  line-height: 1.05;
  letter-spacing: -0.02em;
  font-weight: 600;
}
.h2 {
  font-size: 32px;
  line-height: 1.15;
  letter-spacing: -0.01em;
  font-weight: 600;
}
.h3 {
  font-size: 20px;
  line-height: 1.3;
  font-weight: 500;
  letter-spacing: -0.005em;
}
.eyebrow {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-2);
  font-family: var(--mono);
  font-weight: 500;
}
.fig-caption {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-3);
  letter-spacing: 0.02em;
}
.stat {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-2);
  letter-spacing: 0.02em;
}
.inst-label {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-3);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

/* ---- Buttons ------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
  background: transparent;
  color: var(--paper);
  transition:
    background-color 120ms ease,
    border-color 120ms ease,
    color 120ms ease;
  border-radius: 2px;
}
.btn-primary {
  background: var(--paper);
  color: var(--graphite);
}
.btn-primary:hover {
  background: #ffffff;
}
.btn-outline {
  border-color: var(--border-strong);
}
.btn-outline:hover {
  border-color: var(--paper);
  background: var(--elev-1);
}
.btn-ghost {
  padding: 0;
  height: auto;
}
.btn-ghost:hover {
  color: var(--paper);
}
.btn:disabled {
  opacity: 0.5;
  cursor: default;
}

/* ---- Rules / dividers --------------------------------------------- */
.rule {
  height: 1px;
  background: var(--border);
  width: 100%;
}
.rule-strong {
  height: 1px;
  background: var(--border-strong);
  width: 100%;
}

/* ---- Card --------------------------------------------------------- */
.card {
  background: var(--elev-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  /* Set color explicitly so card text stays legible even when the kit is
     embedded in a host that overrides the body color. */
  color: var(--paper);
  transition:
    border-color 160ms ease,
    background-color 160ms ease;
}
.card:hover {
  border-color: var(--border-strong);
  background: #2a2a2e;
}

/* ---- Surface (root canvas) ---------------------------------------- */
.sr-surface {
  background: var(--graphite);
  color: var(--paper);
  font-family: var(--sans);
}

/* ---- Code block --------------------------------------------------- */
.code {
  background: var(--code-bg);
  border: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-2);
  padding: 12px 14px;
  border-radius: 3px;
  white-space: pre;
  overflow-x: auto;
}

/* ---- Status dots -------------------------------------------------- */
.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}
.dot.pos {
  background: var(--positive);
}
.dot.cau {
  background: var(--caution);
}
.dot.neg {
  background: var(--negative);
}
.dot.idle {
  background: var(--text-3);
}

/* ---- Motion ------------------------------------------------------- */
@keyframes livePulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}
.live-pulse {
  animation: livePulse 1.8s ease-in-out infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---- Focus ring --------------------------------------------------- */
/* One contract-level rule covers every focusable element in the kit —
   Button, Toggle, and the clickable Wordmark — with a high-contrast ring
   on the dark surfaces. */
:focus-visible {
  outline: 1px solid var(--paper);
  outline-offset: 2px;
}

/* ---- Selection ---------------------------------------------------- */
::selection {
  background: var(--midnight-bright);
  color: var(--paper);
}
