/* Signal IQ — design system
   Vanilla CSS, no build step. Interactions follow the craft rules:
   ease-out entries, 160ms press feedback, transform/opacity only. */

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

/* ---- tokens ---- */
:root {
  /* surfaces */
  --bg: #0a0a0b;
  --surface: #121214;
  --surface-2: #18181b;
  --surface-3: #1e1e22;
  --border: #232327;
  --border-strong: #2f2f36;

  /* text */
  --text: #f4f4f5;
  --text-2: #a1a1aa;
  --text-3: #63636b;

  /* meaning — tiers are the only saturated colors */
  --hot: #ff7369;
  --warm: #e8b95c;
  --cold: #8b8b93;
  --ok: #4ade80;
  --warn: #e8b95c;
  --accent: #8ab4ff;

  /* motion */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --speed: 160ms;
  --radius: 12px;
  --radius-sm: 8px;

  --font: "Inter", -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background:
    radial-gradient(1200px 500px at 50% -200px, rgba(255, 115, 105, 0.05), transparent 60%),
    var(--bg);
  color: var(--text);
  font: 14px/1.55 var(--font);
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: #b5ccff; }
.mono { font-family: var(--mono); }

::selection { background: rgba(255, 115, 105, 0.25); }

/* ---- header ---- */
header {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 28px;
  padding: 0 28px; height: 56px;
  background: rgba(10, 10, 11, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
header h1 {
  margin: 0; font-size: 15px; font-weight: 600; letter-spacing: -0.01em;
  display: flex; align-items: center; gap: 8px;
}
header h1 .iq { color: var(--text-3); font-weight: 500; }
.live-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.5);
  animation: pulse 2.4s var(--ease-out) infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.45); }
  70% { box-shadow: 0 0 0 6px rgba(74, 222, 128, 0); }
  100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}
nav { display: flex; gap: 4px; }
nav a {
  color: var(--text-2); font-size: 13.5px; font-weight: 500;
  padding: 6px 12px; border-radius: 8px;
  transition: color var(--speed) ease, background var(--speed) ease;
}
nav a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
nav a.active { color: var(--text); background: var(--surface-2); }

.demo-banner {
  display: none; padding: 9px 28px;
  background: rgba(232, 185, 92, 0.08); color: var(--warm);
  border-bottom: 1px solid rgba(232, 185, 92, 0.2);
  font-size: 13px;
}
body.demo .demo-banner { display: block; }

/* ---- layout ---- */
main { max-width: 1060px; margin: 0 auto; padding: 32px 24px 96px; }

h2 {
  font-size: 13px; font-weight: 600; letter-spacing: 0.02em;
  color: var(--text-3); margin: 36px 0 14px;
}
h2:first-child { margin-top: 0; }

/* ---- entry motion ---- */
.card, tbody tr, .queue-item {
  animation: enter 320ms var(--ease-out) backwards;
}
@keyframes enter {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.stagger > *:nth-child(1) { animation-delay: 0ms; }
.stagger > *:nth-child(2) { animation-delay: 40ms; }
.stagger > *:nth-child(3) { animation-delay: 80ms; }
.stagger > *:nth-child(4) { animation-delay: 120ms; }
.stagger > *:nth-child(5) { animation-delay: 160ms; }
.stagger > *:nth-child(6) { animation-delay: 200ms; }
.stagger > *:nth-child(7) { animation-delay: 240ms; }
.stagger > *:nth-child(8) { animation-delay: 280ms; }
.stagger > *:nth-child(n + 9) { animation-delay: 300ms; }

/* ---- badges: dot + label, not uppercase pills ---- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 500; color: var(--text-2);
  white-space: nowrap;
}
.badge::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--cold);
}
.badge.hot { color: var(--hot); }
.badge.hot::before { background: var(--hot); box-shadow: 0 0 6px rgba(255, 115, 105, 0.6); }
.badge.warm { color: var(--warm); }
.badge.warm::before { background: var(--warm); }
.badge.cold { color: var(--cold); }
.badge.ok { color: var(--ok); }
.badge.ok::before { background: var(--ok); }
.badge.warn { color: var(--warn); }
.badge.warn::before { background: var(--warn); }
.badge.type { color: var(--text-2); }
.badge.type::before { display: none; }
.badge.type svg { width: 14px; height: 14px; stroke: var(--text-3); }

/* ---- cards ---- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px; margin-bottom: 10px;
  transition: border-color var(--speed) ease, background var(--speed) ease;
}
.card:hover { border-color: var(--border-strong); }
.card h3 { margin: 0 0 4px; font-size: 14px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.45; }
.card h3 a { color: var(--text); }
.card h3 a:hover { color: var(--accent); }
.card .meta { color: var(--text-3); font-size: 12.5px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.card .meta .sep { color: var(--border-strong); }

.quote {
  margin: 12px 0 0; padding: 10px 14px;
  border-left: 2px solid var(--border-strong);
  color: var(--text-2); font-size: 13px; font-style: italic;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* ---- table ---- */
.table-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 4px 0; overflow: hidden;
}
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left; color: var(--text-3); font-size: 11.5px; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.06em;
  padding: 10px 18px; border-bottom: 1px solid var(--border);
}
td { padding: 11px 18px; border-bottom: 1px solid var(--border); font-size: 13.5px; }
tbody tr:last-child td { border-bottom: none; }
tr.clickable { cursor: pointer; transition: background var(--speed) ease; }
tr.clickable:hover { background: rgba(255, 255, 255, 0.025); }
td.meta, .meta-td { color: var(--text-2); }
td.score { font-family: var(--mono); font-size: 13px; font-weight: 500; }
th.num, td.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---- score ---- */
.score {
  font-family: var(--mono); font-weight: 500; font-size: 13.5px;
  font-variant-numeric: tabular-nums;
}

/* ---- factor breakdown ---- */
.factors { list-style: none; padding: 0; margin: 14px 0 0; font-size: 13px; }
.factors li {
  display: flex; justify-content: space-between; gap: 16px;
  padding: 8px 0; border-bottom: 1px solid var(--border);
}
.factors li:last-child { border-bottom: none; }
.factors .note { color: var(--text-3); font-weight: 400; }
.factors span:last-child {
  font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap;
}
.factors .pos { color: var(--ok); }
.factors .neg { color: var(--hot); }

/* ---- drafts: email, not code ---- */
.draft-box {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin: 12px 0 0;
  overflow: hidden;
}
.draft-box .draft-subject {
  padding: 10px 16px; border-bottom: 1px solid var(--border);
  font-size: 13px; color: var(--text-2);
  display: flex; gap: 8px;
}
.draft-box .draft-subject strong { color: var(--text); font-weight: 600; }
.draft-box .draft-body {
  padding: 14px 16px; white-space: pre-wrap; font-size: 13.5px; line-height: 1.6;
  color: var(--text);
}

/* ---- buttons ---- */
.btn {
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border-strong);
  padding: 7px 14px; border-radius: 8px; cursor: pointer;
  font: 500 13px var(--font);
  transition: transform var(--speed) var(--ease-out), border-color var(--speed) ease, background var(--speed) ease;
}
.btn:hover { border-color: var(--text-3); background: var(--surface-3); }
.btn:active { transform: scale(0.97); }
.btn.primary { background: rgba(74, 222, 128, 0.1); border-color: rgba(74, 222, 128, 0.35); color: var(--ok); }
.btn.primary:hover { background: rgba(74, 222, 128, 0.16); border-color: rgba(74, 222, 128, 0.5); }
.btn.danger { background: rgba(255, 115, 105, 0.08); border-color: rgba(255, 115, 105, 0.3); color: var(--hot); }
.btn.danger:hover { background: rgba(255, 115, 105, 0.14); border-color: rgba(255, 115, 105, 0.45); }
.btn-row { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; }
.copy-flash { color: var(--ok) !important; border-color: rgba(74, 222, 128, 0.5) !important; }

/* ---- checks ---- */
.checks { font-size: 12px; color: var(--text-3); margin-top: 10px; display: flex; gap: 10px; flex-wrap: wrap; }
.checks .ok { color: var(--ok); }
.checks .warn { color: var(--warn); }

/* ---- empty states ---- */
.empty {
  color: var(--text-3); padding: 40px 20px; text-align: center;
  border: 1px dashed var(--border-strong); border-radius: var(--radius);
  font-size: 13.5px;
}

/* ---- account header ---- */
.acct-header { margin-bottom: 8px; }
.acct-header .back {
  color: var(--text-3); font-size: 13px; font-weight: 500;
  display: inline-flex; align-items: center; gap: 4px;
  transition: color var(--speed) ease;
}
.acct-header .back:hover { color: var(--text); }
.acct-header h2.acct-name {
  font-size: 24px; font-weight: 600; letter-spacing: -0.02em;
  color: var(--text); margin: 6px 0 4px;
}
.acct-header .acct-meta { color: var(--text-3); font-size: 13px; }

/* ---- hot strip ---- */
.hot-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.hot-strip .card { margin-bottom: 0; cursor: pointer; }
.hot-strip .card:hover { border-color: rgba(255, 115, 105, 0.45); }

/* ---- icons ---- */
.ic { width: 15px; height: 15px; flex-shrink: 0; vertical-align: -2px; stroke: var(--text-3); fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* ---- reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  .card, tbody tr, .queue-item { animation: none; }
  .live-dot { animation: none; }
  .btn, .btn:active { transition: none; transform: none; }
}
