/* Suptech Hub — Modern fintech design system
   Tokens are locked. Never hard-code values; always reference a token. */

:root {
  /* ── Brand ── */
  --primary-900: #102234;
  --primary-700: #1e3a5f;
  --primary-600: #2d4a66;   /* brand primary  */
  --primary-500: #3a5f7d;   /* brand secondary */
  --primary-400: #5a7b96;
  --primary-100: #dbe5ee;
  --primary-50:  #eef3f8;

  /* ── Neutrals ── */
  --white:    #ffffff;
  --slate-50: #f8fafc;
  --slate-100:#f1f5f9;
  --slate-200:#e2e8f0;
  --slate-300:#cbd5e1;
  --slate-400:#94a3b8;
  --slate-500:#64748b;
  --slate-600:#475569;
  --slate-700:#334155;
  --slate-900:#0f172a;

  /* ── Semantic ── */
  --accent: #d4a04c;        /* signal-only (live, important) */
  --accent-soft: #fbf3e2;
  --up:     #16a34a;
  --up-soft:#dcfce7;
  --down:   #dc2626;
  --down-soft:#fee2e2;
  --warn:   #d97706;
  --warn-soft:#fef3c7;

  /* ── Surface / line ── */
  --bg:            var(--white);
  --bg-soft:       var(--slate-50);
  --bg-card:       var(--white);
  --border:        var(--slate-200);
  --border-strong: var(--slate-300);

  /* ── Text ── */
  --text:       var(--slate-900);
  --text-soft:  var(--slate-700);
  --text-mute:  var(--slate-500);
  --text-faint: var(--slate-400);
  --text-on-primary: var(--white);

  /* ── Type ── */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --fs-xs:  12px;
  --fs-sm:  14px;
  --fs-md:  16px;
  --fs-lg:  20px;
  --fs-xl:  24px;
  --fs-2xl: 32px;
  --fs-3xl: 40px;
  --fs-4xl: 56px;

  --lh-tight: 1.2;
  --lh-snug:  1.4;
  --lh-base:  1.55;

  /* ── Spacing (4 px base) ── */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;
  --sp-8: 64px;
  --sp-9: 96px;

  /* ── Radii ── */
  --r-chip: 4px;
  --r-md:   8px;
  --r-card: 12px;

  /* ── Shadows ── */
  --shadow:    0 1px 2px rgba(15,23,42,.04), 0 1px 3px rgba(15,23,42,.06);
  --shadow-lg: 0 4px 12px rgba(15,23,42,.08), 0 2px 4px rgba(15,23,42,.05);

  /* ── Layout ── */
  --container: 1200px;
  --gutter:    24px;
}

/* ── Reset ── */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-sans);
  font-size: var(--fs-md);
  line-height: var(--lh-base);
  color: var(--text);
  background: var(--bg);
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
button { font: inherit; cursor: pointer; background: none; border: 0; color: inherit; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; }

/* ── Layout primitives ── */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.section {
  padding: var(--sp-7) 0;
}
.section + .section {
  border-top: 1px solid var(--border);
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-4);
  margin-bottom: var(--sp-5);
  flex-wrap: wrap;
}
.section-head__title {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}
.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-mute);
}
.section-title {
  font-size: var(--fs-xl);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  line-height: var(--lh-tight);
}
.section-meta {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--text-mute);
}

/* ── Topbar ── */
.topbar {
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.85);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: saturate(180%) blur(8px);
  -webkit-backdrop-filter: saturate(180%) blur(8px);
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  gap: var(--sp-4);
}
.brand {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}
.brand-mark {
  width: 28px;
  height: 28px;
  color: var(--primary-600);
  flex-shrink: 0;
}
.brand-name {
  font-size: var(--fs-md);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
}
.brand-name span {
  color: var(--primary-500);
  font-weight: 600;
}
.last-updated {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--text-mute);
  white-space: nowrap;
}
.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--up);
  box-shadow: 0 0 0 2px var(--up-soft);
}

/* ── Markets — tile grid ── */
.markets-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-3);
}
@media (max-width: 960px) { .markets-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .markets-grid { grid-template-columns: 1fr; } }

.tile {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: var(--sp-4);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.tile:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
}
.tile-label {
  font-size: var(--fs-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-mute);
}
.tile-value {
  font-family: var(--font-mono);
  font-size: var(--fs-xl);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  color: var(--text);
  line-height: 1;
}
.tile-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
}
.tile-chg {
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.is-up   { color: var(--up); }
.is-down { color: var(--down); }
.is-flat { color: var(--text-mute); }
.tile-spark {
  opacity: 0.7;
}

.markets-asof {
  margin-top: var(--sp-4);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--text-faint);
  text-align: right;
}

/* ── Brief ── */
.brief {
  max-width: 760px;
  margin: 0 auto;
}
.brief-list {
  list-style: none;
  counter-reset: brief;
}
.brief-item {
  counter-increment: brief;
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: var(--sp-4);
  padding: var(--sp-4) 0;
  border-bottom: 1px solid var(--border);
  align-items: start;
}
.brief-item:last-child { border-bottom: none; }
.brief-num {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 500;
  color: var(--text-faint);
  padding-top: 4px;
}
.brief-num::before { content: counter(brief, decimal-leading-zero); }
.brief-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--primary-600);
  margin-bottom: 4px;
}
.brief-tag-region {
  color: var(--text-faint);
  margin-left: 6px;
}
.brief-text {
  font-size: var(--fs-md);
  line-height: 1.5;
  color: var(--text);
}
.brief-text-link {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color .15s;
}
.brief-text-link:hover { border-bottom-color: var(--primary-500); }

/* ── Dispatches — card grid ── */
.dispatch-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-4);
}
@media (max-width: 1000px) { .dispatch-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px)  { .dispatch-grid { grid-template-columns: 1fr; } }

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: var(--sp-5);
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease;
  text-align: left;
  width: 100%;
}
.card:hover {
  border-color: var(--primary-400);
  box-shadow: var(--shadow);
}
.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  align-items: center;
  margin-bottom: var(--sp-3);
}
.pill {
  display: inline-flex;
  align-items: center;
  font-size: var(--fs-xs);
  font-weight: 500;
  padding: 3px 8px;
  border-radius: var(--r-chip);
  white-space: nowrap;
}
.pill-region   { background: var(--primary-50);  color: var(--primary-700); }
.pill-type     { background: var(--slate-100);   color: var(--slate-700); }
.pill-impact-high { background: var(--accent-soft); color: var(--warn); }
.pill-impact-med  { background: var(--slate-100);   color: var(--slate-600); }

.card-title {
  font-size: var(--fs-md);
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.005em;
  color: var(--text);
  margin-bottom: var(--sp-2);
}
.card-summary {
  font-size: var(--fs-sm);
  line-height: 1.55;
  color: var(--text-soft);
  flex: 1;
  margin-bottom: var(--sp-3);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--text-mute);
  border-top: 1px solid var(--border);
  padding-top: var(--sp-3);
}
.card-source {
  font-weight: 600;
  color: var(--primary-600);
}

/* ── Drawer ── */
.drawer-scrim {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  z-index: 100;
  display: flex;
  justify-content: flex-end;
  animation: fade-in .15s ease;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.drawer {
  background: var(--bg);
  width: min(560px, 100%);
  height: 100%;
  overflow-y: auto;
  padding: var(--sp-7);
  box-shadow: -4px 0 24px rgba(15, 23, 42, 0.12);
  animation: slide-in .2s ease;
}
@keyframes slide-in { from { transform: translateX(20px); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer-close {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--text-mute);
  margin-bottom: var(--sp-5);
  padding: 4px 0;
}
.drawer-close:hover { color: var(--text); }
.drawer-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin-bottom: var(--sp-3);
}
.drawer-title {
  font-size: var(--fs-xl);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin-bottom: var(--sp-4);
}
.drawer-summary {
  font-size: var(--fs-md);
  color: var(--text-soft);
  line-height: 1.65;
  margin-bottom: var(--sp-6);
}
.drawer-kv {
  list-style: none;
  border-top: 1px solid var(--border);
  margin-bottom: var(--sp-6);
}
.drawer-kv li {
  display: flex;
  justify-content: space-between;
  gap: var(--sp-4);
  padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--border);
  font-size: var(--fs-sm);
}
.drawer-kv li > span:first-child {
  color: var(--text-mute);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.drawer-kv li > span:last-child {
  color: var(--text);
  font-weight: 500;
  text-align: right;
}
.drawer-link {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  background: var(--primary-600);
  color: var(--white);
  padding: var(--sp-3) var(--sp-5);
  border-radius: var(--r-md);
  font-size: var(--fs-sm);
  font-weight: 500;
  transition: background .15s ease;
}
.drawer-link:hover { background: var(--primary-700); }
.drawer-link[aria-disabled="true"] {
  background: var(--slate-300);
  pointer-events: none;
}

/* ── Footer ── */
.footer {
  border-top: 1px solid var(--border);
  background: var(--bg-soft);
  margin-top: var(--sp-8);
  padding: var(--sp-7) 0;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-5);
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--text-mute);
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-family: var(--font-sans);
  font-size: var(--fs-sm);
  color: var(--text-soft);
}
.footer-brand b {
  color: var(--text);
  font-weight: 600;
}
.footer-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-faint);
  margin-left: var(--sp-2);
  padding: 2px 6px;
  border: 1px solid var(--border);
  border-radius: var(--r-chip);
}

/* ── Empty / fallback ── */
.empty {
  padding: var(--sp-8) 0;
  text-align: center;
  color: var(--text-mute);
  font-size: var(--fs-sm);
}
