/* Pursuit IQ demo suite — shared design tokens + base styles.
   Flat, native, finance-professional. Light + dark via prefers-color-scheme. */

:root {
  --bg-primary: #ffffff;
  --bg-secondary: #f5f6f7;
  --bg-inset: #eef0f2;
  --text-primary: #1a1d21;
  --text-secondary: #5c6670;
  --text-success: #1a7f37;
  --text-warning: #955f00;
  --text-danger: #b42318;
  --bg-success: #e8f3ec;
  --bg-warning: #faf2df;
  --bg-danger: #fbeae9;
  --accent: #235d8c;
  --discover: #7a4fd0;
  --bg-discover: #f2ecfb;
  --bg-accent: #e9f0f6;
  --border: #d9dee3;
  /* Text/icon color for use on top of --accent fills (additive token). */
  --on-accent: #ffffff;
  /* "Hot"/urgent emphasis a step past danger-in-meaning but distinct in hue
     (e.g. front-burner status). Replaces hardcoded #c2410c, which has no
     dark-mode variant. Additive tokens. */
  --text-hot: #c2410c;
  --bg-hot: #fbeee4;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-primary: #191c1f;
    --bg-secondary: #121416;
    --bg-inset: #202428;
    --text-primary: #e7eaec;
    --text-secondary: #9aa4ad;
    --text-success: #5cb87a;
    --text-warning: #d2a53f;
    --text-danger: #e2726a;
    --bg-success: #1c2b21;
    --bg-warning: #2b2517;
    --bg-danger: #2e1d1b;
    --accent: #7cb0d9;
    --discover: #b79bec;
    --bg-discover: #261f33;
    --bg-accent: #1c2733;
    --border: #333a40;
    --on-accent: #0e1b26;
    --text-hot: #e08f62;
    --bg-hot: #2e2318;
  }
}

* { box-sizing: border-box; }

/* Respect the OS "reduce motion" setting everywhere — calm is a core value.
   Near-zero (not 0) so any animation end-state still resolves. JS-driven
   motion (e.g. the 3D auto-rotate) checks the same query separately. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  background: var(--bg-secondary);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
}

.container { max-width: 860px; margin: 0 auto; padding: 28px 20px 72px; }

.demo-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.demo-header h1 { font-size: 21px; font-weight: 600; margin: 6px 0 4px; }
.demo-header .subtitle { color: var(--text-secondary); font-size: 14px; margin: 0; max-width: 56ch; }
.back-link { font-size: 13px; color: var(--text-secondary); text-decoration: none; }
.back-link:hover { color: var(--text-primary); }

.card {
  background: var(--bg-primary);
  border: 0.5px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 14px;
}

.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 18px; }
.metric-card { background: var(--bg-primary); border: 0.5px solid var(--border); border-radius: 10px; padding: 16px 18px; }
.metric-value { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; }
.metric-label { font-size: 12.5px; color: var(--text-secondary); margin-top: 2px; }
@media (max-width: 560px) { .metrics { grid-template-columns: 1fr; } }

.badge {
  display: inline-block; font-size: 11.5px; font-weight: 500;
  padding: 2px 9px; border-radius: 999px; white-space: nowrap;
}
.badge-high { background: var(--bg-success); color: var(--text-success); }
.badge-medium { background: var(--bg-accent); color: var(--accent); }
.badge-low { background: var(--bg-warning); color: var(--text-warning); }
.badge-neutral { background: var(--bg-inset); color: var(--text-secondary); }

.btn {
  appearance: none; font: inherit; font-size: 13.5px; font-weight: 500;
  padding: 7px 14px; border-radius: 6px; cursor: pointer;
  border: 0.5px solid var(--border);
  background: var(--bg-primary); color: var(--text-primary);
}
.btn:hover { background: var(--bg-inset); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.btn-success { background: var(--text-success); border-color: var(--text-success); color: #ffffff; }
.btn-success:hover { background: var(--text-success); opacity: 0.88; }
/* Dark mode lightens --text-success to #5cb87a; white text on it fails
   contrast (~2.4:1). Dark ink on the light-green fill keeps the primary
   CTA legible at night. */
@media (prefers-color-scheme: dark) {
  .btn-success { color: #0f1a13; }
}
.btn-danger { background: var(--bg-primary); border-color: var(--border); color: var(--text-danger); }
.btn-danger:hover { background: var(--bg-danger); }
.btn-reset { background: transparent; color: var(--text-secondary); }
.btn-reset:hover { background: var(--bg-inset); color: var(--text-primary); }
.nav .btn-reset { padding: 10px 14px; border: 0.5px solid var(--border); }
.btn:disabled { opacity: 0.45; cursor: default; }

.progress-track { background: var(--bg-inset); border-radius: 999px; height: 8px; overflow: hidden; }
.progress-fill { background: var(--accent); height: 100%; border-radius: 999px; }
.progress-fill.success { background: var(--text-success); }

.trail { font-size: 13px; color: var(--text-secondary); }
.trail-line { padding: 7px 0; border-bottom: 0.5px solid var(--border); }
.trail-line:last-child { border-bottom: none; }

.section-label {
  font-size: 12px; font-weight: 600; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--text-secondary); margin: 22px 0 10px;
}

.ai-note {
  background: var(--bg-inset); border-radius: 6px; padding: 10px 12px;
  font-size: 13.5px; color: var(--text-secondary);
}

.stamp { font-size: 13px; color: var(--text-success); }
.stamp.override { color: var(--text-warning); }

.empty-state { text-align: center; padding: 40px 20px; }
.empty-state h2 { font-size: 17px; font-weight: 600; margin: 0 0 6px; }
.empty-state p { color: var(--text-secondary); font-size: 14px; margin: 0 0 18px; }

table.lines { width: 100%; border-collapse: collapse; font-size: 14px; }
table.lines th { text-align: left; font-size: 12px; font-weight: 600; color: var(--text-secondary); padding: 6px 8px; border-bottom: 0.5px solid var(--border); }
table.lines td { padding: 8px; border-bottom: 0.5px solid var(--border); }
table.lines tr:last-child td { border-bottom: none; }
table.lines td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.lines th.num { text-align: right; }

.thread-link { display: inline-block; font-size: 12.5px; color: var(--accent); text-decoration: none; margin-top: 10px; }
.thread-link:hover { text-decoration: underline; }

/* ---- Additive utilities (design pass, Jul 2026). New class names only;
   nothing above is changed. Safe to adopt incrementally. ---- */

/* Colored status edge for cards/rows — status reads before any text. */
.edge-accent { border-left: 3px solid var(--accent); }
.edge-hot { border-left: 3px solid var(--text-hot); }
.edge-danger { border-left: 3px solid var(--text-danger); }
.edge-warning { border-left: 3px solid var(--text-warning); }
.edge-success { border-left: 3px solid var(--text-success); }

/* Small neutral label chip (passion/life tags, category labels). */
.tag {
  display: inline-block; font-size: 11px; font-weight: 600;
  color: var(--text-secondary); background: var(--bg-inset);
  border-radius: 999px; padding: 2px 8px; white-space: nowrap;
}
.tag-success { color: var(--text-success); background: var(--bg-success); }
.tag-accent { color: var(--accent); background: var(--bg-accent); }

/* Comfortable touch-target button variant (~44px tall). Use on mobile-first
   surfaces instead of shrinking .btn padding below tappable size. */
.btn-lg { padding: 11px 16px; font-size: 14px; }

/* Section label with a right-aligned glanceable summary
   (e.g. "3 need you · 2 steady", "4 blocks held"). */
.label-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.label-row .sum { font-weight: 500; letter-spacing: 0; text-transform: none; font-size: 12.5px; color: var(--text-secondary); }

/* Quieter, deliberate footer disclaimer. */
.footnote {
  font-size: 12px; color: var(--text-secondary); text-align: center;
  max-width: 62ch; margin: 30px auto 0;
  border-top: 0.5px solid var(--border); padding-top: 14px;
}
.footnote a { color: var(--accent); text-decoration: none; }
.footnote a:hover { text-decoration: underline; }
.footnote a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
