/* ═══════════════════════════════════════════════════════════
   ADVENNT — Regulatory Intelligence
   Design tokens + base styles
   ═══════════════════════════════════════════════════════════ */

/* ── Tokens ── */
:root {
  /* Backgrounds */
  --bg:          #111315;
  --surface:     #171a1d;
  --card:        #1b1e22;
  --card-hover:  #1f2329;

  /* Borders */
  --line:        #2d343b;
  --line-subtle: #232a31;

  /* Text */
  --text:        #edf1f4;
  --text-muted:  #8b9bab;
  --text-faint:  #5a6a7a;

  /* Accents */
  --accent:      #58a6a6;
  --accent-dim:  rgba(88,166,166,0.13);
  --accent2:     #e0a94a;

  /* Status */
  --green:       #5dbb63;
  --amber:       #f0a63b;
  --red:         #e36a86;

  /* Typography */
  --sans: 'Inter', system-ui, -apple-system, sans-serif;
  --mono: 'IBM Plex Mono', 'Fira Code', monospace;

  /* Spacing */
  --max-w: 1280px;
  --px: clamp(16px, 3vw, 24px);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.6;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

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

.section { padding: 40px 0; }
.section + .section { padding-top: 0; }

/* ── Typography ── */
.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent2);
  margin-bottom: 8px;
}

h1 {
  font-size: clamp(28px, 4vw, 48px);
  font-weight: 700;
  line-height: 1.12;
  color: var(--text);
  margin-bottom: 16px;
}

h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
}

h3 {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 14px;
}

/* ── Cards ── */
.card {
  background: linear-gradient(180deg, var(--surface), var(--card));
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: clamp(20px, 2.5vw, 32px);
  overflow: hidden;
  transition: border-color 0.2s;
}

.card:hover {
  border-color: var(--accent);
}

.card--sm {
  border-radius: 12px;
  padding: 20px 24px;
}

/* ── Grid ── */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

@media (max-width: 768px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

/* ── Badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 999px;
  text-transform: capitalize;
}

.badge--green  { color: var(--green); border: 1px solid rgba(93,187,99,0.2);  background: rgba(93,187,99,0.08); }
.badge--amber  { color: var(--amber); border: 1px solid rgba(240,166,59,0.2); background: rgba(240,166,59,0.08); }
.badge--red    { color: var(--red);   border: 1px solid rgba(227,106,134,0.2);background: rgba(227,106,134,0.08); }

/* ── TLA Dot ── */
.tla-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.tla-dot--green { background: var(--green); }
.tla-dot--amber { background: var(--amber); }
.tla-dot--red   { background: var(--red); }

/* ── Score Bar ── */
.score-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 120px;
}

.score-bar__track {
  height: 6px;
  border-radius: 3px;
  background: var(--line);
  flex: 1;
  overflow: hidden;
}

.score-bar__fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s ease;
}

.score-bar__label {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-muted);
  min-width: 36px;
  text-align: right;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  padding: 11px 24px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}

.btn--primary {
  color: #fff;
  background: var(--accent);
}

.btn--primary:hover {
  background: #4d9696;
  text-decoration: none;
}

.btn--secondary {
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--line);
}

.btn--secondary:hover {
  border-color: var(--accent);
  color: var(--text);
  text-decoration: none;
}

/* ── Table ── */
.tracker-table {
  width: 100%;
  border-collapse: collapse;
}

.tracker-table th {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-faint);
  font-weight: 500;
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

.tracker-table td {
  padding: 14px 16px;
  vertical-align: middle;
  border-bottom: 1px solid var(--line-subtle);
}

.tracker-table tr:last-child td {
  border-bottom: none;
}

.tracker-table .jurisdiction-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tracker-table .jurisdiction-cell .flag {
  font-size: 22px;
  line-height: 1;
}

.tracker-table .jurisdiction-cell a {
  font-weight: 600;
  color: var(--text);
}

.tracker-table .jurisdiction-cell a:hover {
  color: var(--accent);
}

/* ── KPI Cards ── */
.kpi-value {
  font-size: 32px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.1;
}

.kpi-sub {
  font-size: 13px;
  color: var(--text-faint);
  margin-top: 4px;
}

/* ── Pipeline Steps ── */
.step {
  display: flex;
  gap: 12px;
  padding: 8px 0;
}

.step__num {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  min-width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--accent);
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 2px;
}

.step__title {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
}

.step__desc {
  font-size: 13px;
  color: var(--text-faint);
  margin-top: 2px;
}

/* ── List Items (audience, tiers) ── */
.list-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--line-subtle);
}

.list-item:last-child { border-bottom: none; }

.list-item__title {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
}

.list-item__title--accent {
  color: var(--accent);
}

.list-item__desc {
  font-size: 13px;
  color: var(--text-faint);
  margin-top: 2px;
}

/* ── Header / Nav ── */
.site-header {
  padding: 24px 0;
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.site-logo__text {
  line-height: 1;
}

.site-logo__name {
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.04em;
  color: var(--text);
}

.site-logo__sub {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-faint);
  margin-top: 1px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

.site-nav a {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 500;
}

.site-nav a:hover {
  color: var(--text);
  text-decoration: none;
}

/* ── Footer ── */
.site-footer {
  padding: 40px 0;
  border-top: 1px solid var(--line);
  text-align: center;
}

.site-footer__brand {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.03em;
  color: var(--text);
}

.site-footer__tagline {
  font-size: 13px;
  color: var(--text-faint);
  margin-top: 8px;
}

.site-footer__powered {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-faint);
  letter-spacing: 0.04em;
  margin-top: 6px;
}

/* ── Jurisdiction Page Specifics ── */
.jurisdiction-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.jurisdiction-flag {
  font-size: 48px;
  line-height: 1;
}

.jurisdiction-meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

.category-section {
  margin-bottom: 24px;
}

.category-section h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.indicator-card {
  background: var(--card);
  border: 1px solid var(--line-subtle);
  border-radius: 12px;
  padding: 16px;
}

.indicator-card__name {
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.indicator-card__value {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
}

.indicator-card__rationale {
  font-size: 12px;
  color: var(--text-faint);
  margin-top: 4px;
  line-height: 1.5;
}

/* ── Map Container ── */
#jurisdiction-map {
  width: 100%;
  height: 400px;
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 24px;
}

/* ── Responsive table scroll ── */
.table-scroll {
  overflow-x: auto;
}

/* ── Animated counter (JS progressive enhancement) ── */
[data-counter] {
  font-variant-numeric: tabular-nums;
}
