/* ============================================================
   EMERGING ECONOMIES — Professional Economist Stylesheet
   ============================================================ */

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

:root {
  --navy:       #0f1f3d;
  --navy-mid:   #162442;
  --navy-light: #1e3260;
  --gold:       #b8902a;
  --gold-light: #d4a843;
  --cream:      #f4efe6;
  --cream-dark: #e8e1d4;
  --white:      #ffffff;
  --gray-100:   #f7f7f5;
  --gray-200:   #e8e6e1;
  --gray-400:   #9b9589;
  --gray-600:   #625f58;
  --gray-800:   #2a2926;
  --positive:   #1a7a4a;
  --risk-low:   #2d7a4f;
  --risk-mod:   #a07820;
  --risk-high:  #a0311a;

  --font-serif: 'Playfair Display', 'Georgia', serif;
  --font-sans:  'Inter', 'Helvetica Neue', sans-serif;
  --font-mono:  'IBM Plex Mono', 'Courier New', monospace;

  --max-w: 1280px;
  --section-pad: 6rem 2rem;
}

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font-sans);
  background: var(--cream);
  color: var(--gray-800);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* ── Navigation ── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(15, 31, 61, 0.97);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(184, 144, 42, 0.3);
}

.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.nav-logo {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  color: var(--gold-light);
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 2rem;
}

.nav-links a {
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  text-transform: uppercase;
  transition: color 0.2s;
}

.nav-links a:hover { color: var(--gold-light); }

/* ── Hero ── */
.hero {
  background: var(--navy);
  padding: 8rem 2rem 5rem;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(184,144,42,0.08) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(30,50,96,0.6) 0%, transparent 50%);
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.hero-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  position: relative;
}

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  color: var(--gold-light);
  text-transform: uppercase;
  margin-bottom: 1.25rem;
}

.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(3rem, 6vw, 5.5rem);
  font-weight: 700;
  color: var(--white);
  line-height: 1.1;
  margin-bottom: 1.5rem;
  letter-spacing: -0.02em;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: rgba(255,255,255,0.65);
  max-width: 580px;
  line-height: 1.75;
  margin-bottom: 3.5rem;
  font-weight: 300;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 4px;
  overflow: hidden;
}

.stat-card {
  background: rgba(255,255,255,0.04);
  padding: 1.75rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: background 0.2s;
}

.stat-card:hover { background: rgba(255,255,255,0.07); }

.stat-value {
  font-family: var(--font-serif);
  font-size: 2.25rem;
  font-weight: 600;
  color: var(--gold-light);
  line-height: 1;
}

.stat-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.5);
  text-transform: uppercase;
  line-height: 1.4;
}

/* ── Sections ── */
.section {
  padding: var(--section-pad);
}

.section-dark {
  background: var(--navy);
  color: var(--white);
}

.section-dark p { color: rgba(255,255,255,0.75); }
.section-dark .prose p { color: rgba(255,255,255,0.75); }

.section-inner {
  max-width: var(--max-w);
  margin: 0 auto;
}

.section-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.section-label::after {
  content: '';
  flex: 1;
  max-width: 80px;
  height: 1px;
  background: var(--gold);
  opacity: 0.4;
}

.section-title {
  font-family: var(--font-serif);
  font-size: clamp(1.75rem, 3vw, 2.75rem);
  font-weight: 700;
  color: var(--navy);
  line-height: 1.2;
  margin-bottom: 2.5rem;
  letter-spacing: -0.01em;
}

.section-dark .section-title { color: var(--white); }

.section-intro {
  color: var(--gray-600);
  margin-bottom: 2rem;
  max-width: 700px;
  font-size: 0.95rem;
}

/* ── Two Column ── */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
}

@media (max-width: 768px) {
  .two-col { grid-template-columns: 1fr; gap: 2rem; }
}

/* ── Prose ── */
.prose p {
  color: var(--gray-600);
  margin-bottom: 1.25rem;
  font-size: 0.97rem;
}

.prose p strong { color: var(--gray-800); font-weight: 600; }

.subheading {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 1rem;
}

.feature-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.feature-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 0.92rem;
  color: var(--gray-600);
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--gray-200);
}

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

.feature-icon {
  color: var(--gold);
  font-size: 0.65rem;
  margin-top: 0.35rem;
  flex-shrink: 0;
}

/* ── Framework Cards ── */
.framework-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.framework-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-top: 3px solid var(--gold);
  padding: 2rem;
  border-radius: 2px;
  transition: background 0.2s;
}

.framework-card:hover { background: rgba(255,255,255,0.07); }

.framework-tag {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-light);
  margin-bottom: 0.75rem;
}

.framework-title {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 0.5rem;
}

.framework-members {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: rgba(255,255,255,0.5);
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
  line-height: 1.5;
}

.framework-desc {
  font-size: 0.88rem;
  color: rgba(255,255,255,0.65);
  line-height: 1.7;
}

/* ── Data Table ── */
.table-wrapper {
  overflow-x: auto;
  border-radius: 4px;
  border: 1px solid var(--gray-200);
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  background: var(--white);
}

.data-table thead {
  background: var(--navy);
}

.data-table thead th {
  padding: 1rem 1.25rem;
  text-align: left;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.6);
  font-weight: 500;
  white-space: nowrap;
}

.data-table tbody tr {
  border-bottom: 1px solid var(--gray-200);
  transition: background 0.15s;
}

.data-table tbody tr:last-child { border-bottom: none; }
.data-table tbody tr:hover { background: var(--gray-100); }

.data-table tbody td {
  padding: 0.9rem 1.25rem;
  color: var(--gray-800);
  white-space: nowrap;
}

.country-cell {
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.country-flag { font-size: 1.1rem; }

.positive {
  color: var(--positive);
  font-weight: 600;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.risk-badge {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  padding: 0.25rem 0.6rem;
  border-radius: 2px;
  font-weight: 500;
  text-transform: uppercase;
}

.risk-low  { background: rgba(45,122,79,0.12);  color: var(--risk-low);  }
.risk-mod  { background: rgba(160,120,32,0.12); color: var(--risk-mod);  }
.risk-high { background: rgba(160,49,26,0.12);  color: var(--risk-high); }

.table-note {
  font-size: 0.75rem;
  color: var(--gray-400);
  margin-top: 1rem;
  font-style: italic;
}

/* ── Charts ── */
.chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(440px, 1fr));
  gap: 1.5rem;
}

@media (max-width: 960px) {
  .chart-grid { grid-template-columns: 1fr; }
}

.chart-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  padding: 2rem;
  border-radius: 2px;
}

.chart-title {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 0.3rem;
}

.chart-subtitle {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.4);
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}

.chart-container {
  position: relative;
  height: 280px;
}

.chart-container--small {
  height: 240px;
}

/* ── Drivers Grid ── */
.drivers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.driver-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-top: 3px solid var(--gold);
  padding: 2rem;
  border-radius: 2px;
  transition: box-shadow 0.2s, transform 0.2s;
}

.driver-card:hover {
  box-shadow: 0 8px 24px rgba(15,31,61,0.1);
  transform: translateY(-2px);
}

.driver-number {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  color: var(--gold);
  margin-bottom: 0.75rem;
  font-weight: 500;
}

.driver-title {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 0.75rem;
}

.driver-desc {
  font-size: 0.88rem;
  color: var(--gray-600);
  line-height: 1.7;
  margin-bottom: 1.25rem;
}

.driver-stat {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  background: var(--cream);
  border-left: 3px solid var(--gold);
  padding: 0.6rem 0.75rem;
  color: var(--gray-600);
  line-height: 1.4;
}

.driver-stat strong { color: var(--navy); }

/* ── Challenges ── */
.challenge-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 3rem;
}

@media (max-width: 960px) {
  .challenge-layout { grid-template-columns: 1fr; }
}

.challenge-item {
  border-bottom: 1px solid rgba(255,255,255,0.1);
  padding-bottom: 2rem;
  margin-bottom: 2rem;
}

.challenge-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.challenge-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.challenge-icon {
  color: var(--gold-light);
  font-size: 1rem;
  flex-shrink: 0;
}

.challenge-title {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--white);
}

.challenge-item p {
  font-size: 0.9rem;
  line-height: 1.75;
  color: rgba(255,255,255,0.65);
}

.aside-card {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  padding: 1.5rem;
  border-radius: 2px;
  margin-bottom: 1.5rem;
}

.aside-title {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold-light);
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.debt-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  gap: 1rem;
}

.debt-stat:last-of-type { border-bottom: none; }

.debt-label {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.55);
  line-height: 1.3;
}

.debt-value {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--gold-light);
  white-space: nowrap;
}

.aside-note {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: rgba(255,255,255,0.3);
  margin-top: 1rem;
}

.risk-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  font-size: 0.82rem;
  color: rgba(255,255,255,0.65);
}

.risk-row:last-child { border-bottom: none; }

.risk-pill {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  padding: 0.2rem 0.5rem;
  border-radius: 2px;
  text-transform: uppercase;
  font-weight: 500;
}

.risk-pill.high { background: rgba(160,49,26,0.25); color: #e07060; }
.risk-pill.mod  { background: rgba(160,120,32,0.25); color: #d4a843; }

/* ── Outlook ── */
.outlook-grid {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 4rem;
  margin-bottom: 3rem;
}

@media (max-width: 960px) {
  .outlook-grid { grid-template-columns: 1fr; gap: 2rem; }
}

.lead-text {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  line-height: 1.75;
  color: var(--navy);
  margin-bottom: 1.25rem;
  font-weight: 400;
}

.outlook-intro p:not(.lead-text) {
  font-size: 0.92rem;
  color: var(--gray-600);
  line-height: 1.75;
}

.outlook-themes {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.theme-item {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--gray-200);
}

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

.theme-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 500;
  display: block;
  margin-bottom: 0.6rem;
}

.theme-text {
  font-size: 0.9rem;
  color: var(--gray-600);
  line-height: 1.72;
}

/* ── Projection Box ── */
.projection-box {
  background: var(--navy);
  padding: 2.5rem;
  border-radius: 2px;
  border-top: 3px solid var(--gold);
}

.projection-title {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 2rem;
}

.projection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.proj-item {
  background: var(--navy-mid);
  padding: 1.5rem;
  transition: background 0.2s;
}

.proj-item:hover { background: var(--navy-light); }

.proj-metric {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.45);
  margin-bottom: 0.5rem;
}

.proj-value {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 700;
  color: var(--gold-light);
  margin-bottom: 0.4rem;
  line-height: 1;
}

.proj-note {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.45);
}

.projection-source {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: rgba(255,255,255,0.3);
  letter-spacing: 0.08em;
}

/* ── Footer ── */
.footer {
  background: var(--navy);
  border-top: 1px solid rgba(184,144,42,0.25);
}

.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 3.5rem 2rem;
  display: grid;
  grid-template-columns: 220px 1fr 280px;
  gap: 3rem;
}

@media (max-width: 960px) {
  .footer-inner { grid-template-columns: 1fr; gap: 2rem; }
}

.footer-title {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--white);
  display: block;
  margin-bottom: 0.4rem;
}

.footer-sub {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.35);
  display: block;
}

.footer-sources-title {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold-light);
  margin-bottom: 1rem;
}

.footer-sources {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.footer-sources li {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.45);
  padding-left: 1rem;
  position: relative;
}

.footer-sources li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--gold);
  opacity: 0.6;
}

.footer-disclaimer {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.3);
  line-height: 1.6;
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.07);
  padding: 1.25rem 2rem;
  max-width: var(--max-w);
  margin: 0 auto;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.25);
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--cream); }
::-webkit-scrollbar-thumb { background: var(--gray-400); border-radius: 3px; }

/* ── Selection ── */
::selection { background: rgba(184,144,42,0.25); color: var(--navy); }

/* ── Responsive ── */
@media (max-width: 640px) {
  :root { --section-pad: 4rem 1.25rem; }
  .nav-links { display: none; }
  .hero { padding: 6rem 1.25rem 3.5rem; }
  .hero-stats { grid-template-columns: 1fr 1fr; }
}
