/* =============================================
   THE DIGITAL ECONOMY — Stylesheet
   Economist-inspired professional aesthetic
   ============================================= */

/* ---- RESET & ROOT ---- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --navy:       #0d1b2a;
  --navy-mid:   #1a2f45;
  --navy-light: #2a4a6b;
  --red:        #c0392b;
  --red-light:  #e74c3c;
  --gold:       #c9a84c;
  --gold-light: #e6c96e;
  --white:      #ffffff;
  --off-white:  #f7f5f0;
  --light-gray: #e8e4dd;
  --mid-gray:   #9b9690;
  --dark-gray:  #4a4540;
  --text:       #1a1814;
  --text-mid:   #3d3830;
  --accent-bg:  #f0ede6;

  --font-serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-sans:  'Inter', system-ui, -apple-system, sans-serif;
  --font-mono:  'IBM Plex Mono', 'Courier New', monospace;

  --max-width: 1180px;
  --section-gap: 5rem;
}

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

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

/* ---- SCROLLBAR ---- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--off-white); }
::-webkit-scrollbar-thumb { background: var(--navy-light); border-radius: 3px; }

/* ---- UTILITIES ---- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
}

.divider {
  border: none;
  border-top: 1px solid var(--light-gray);
  margin: 3rem 0;
}

/* =============================================
   TOP BAR
   ============================================= */
.top-bar {
  background: var(--red);
  color: var(--white);
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.45rem 2rem;
}

/* =============================================
   HEADER
   ============================================= */
.site-header {
  background: var(--navy);
  color: var(--white);
  padding: 5rem 2rem 3.5rem;
  position: relative;
  overflow: hidden;
}

.site-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 59px,
      rgba(255,255,255,0.025) 59px,
      rgba(255,255,255,0.025) 60px
    ),
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 59px,
      rgba(255,255,255,0.025) 59px,
      rgba(255,255,255,0.025) 60px
    );
  pointer-events: none;
}

.site-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--red) 0%, var(--gold) 100%);
}

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

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

.header-title {
  font-family: var(--font-serif);
  font-size: clamp(2.8rem, 6vw, 5.5rem);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--white);
  margin-bottom: 1.25rem;
}

.header-subtitle {
  font-size: clamp(1rem, 2vw, 1.2rem);
  font-weight: 300;
  color: rgba(255,255,255,0.72);
  max-width: 680px;
  line-height: 1.6;
  margin-bottom: 2rem;
}

.header-rule {
  width: 60px;
  height: 3px;
  background: var(--red);
  margin-bottom: 1.5rem;
}

.header-meta {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: rgba(255,255,255,0.55);
  letter-spacing: 0.04em;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.header-meta .dot { color: var(--gold); }

.header-scroll-hint {
  position: absolute;
  bottom: 1.5rem;
  right: 0;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: rgba(255,255,255,0.3);
  letter-spacing: 0.1em;
}

/* =============================================
   NAVIGATION
   ============================================= */
.site-nav {
  background: var(--white);
  border-bottom: 1px solid var(--light-gray);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  gap: 0;
  overflow-x: auto;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.nav-inner::-webkit-scrollbar { display: none; }

.nav-inner a {
  display: block;
  padding: 0.9rem 1.1rem;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dark-gray);
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.nav-inner a:hover,
.nav-inner a.active {
  color: var(--red);
  border-bottom-color: var(--red);
}

/* =============================================
   SECTIONS — BASE
   ============================================= */
.section {
  padding: var(--section-gap) 0;
}

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

.section-accent {
  background: var(--off-white);
}

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

.section-reading {
  background: var(--accent-bg);
}

.section-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 1rem;
}

.section-label.light { color: var(--gold-light); }

.section-title {
  font-family: var(--font-serif);
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.015em;
  color: var(--navy);
  margin-bottom: 1.5rem;
}

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

.section-future .section-title { color: var(--white); }
.section-future .section-label { color: var(--gold-light); }

.lead {
  font-size: 1.12rem;
  font-weight: 400;
  color: var(--dark-gray);
  max-width: 780px;
  margin-bottom: 2rem;
  line-height: 1.7;
}

.lead.light { color: rgba(255,255,255,0.75); }

p {
  margin-bottom: 1.1rem;
  color: var(--text-mid);
}

.text-light { color: rgba(255,255,255,0.72); }

.sub-heading {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--navy);
  margin: 2rem 0 0.75rem;
}

.sub-heading.light { color: var(--white); }

/* =============================================
   TWO-COLUMN LAYOUT
   ============================================= */
.two-col {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 4rem;
  align-items: start;
}

.col-main {}
.col-aside {}

/* =============================================
   ASIDE CARDS
   ============================================= */
.aside-card {
  background: var(--off-white);
  border-left: 3px solid var(--red);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.aside-card-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mid-gray);
  margin-bottom: 0.75rem;
}

.aside-card blockquote {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-style: italic;
  color: var(--navy);
  line-height: 1.6;
  margin-bottom: 0.75rem;
}

.aside-card cite {
  font-size: 0.78rem;
  color: var(--mid-gray);
  font-style: normal;
  font-family: var(--font-mono);
}

.aside-card-stat {
  background: var(--navy);
  border-left-color: var(--gold);
}

.big-stat {
  font-family: var(--font-serif);
  font-size: 3.2rem;
  font-weight: 700;
  color: var(--gold-light);
  line-height: 1;
  margin-bottom: 0.5rem;
}

.big-stat-label {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.65);
  line-height: 1.5;
}

/* =============================================
   PILLARS GRID
   ============================================= */
.pillars-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 1.5px;
  background: rgba(255,255,255,0.08);
  margin-top: 2.5rem;
  border: 1px solid rgba(255,255,255,0.08);
}

.pillar-card {
  background: rgba(13,27,42,0.85);
  padding: 2rem 1.75rem;
  transition: background 0.25s;
}

.pillar-card:hover {
  background: var(--navy-light);
}

.pillar-num {
  font-family: var(--font-serif);
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--gold);
  opacity: 0.4;
  line-height: 1;
  margin-bottom: 1rem;
}

.pillar-card h3 {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 0.75rem;
}

.pillar-card p {
  font-size: 0.88rem;
  color: rgba(255,255,255,0.6);
  line-height: 1.6;
  margin: 0;
}

/* =============================================
   METRICS GRID
   ============================================= */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1px;
  background: var(--light-gray);
  border: 1px solid var(--light-gray);
  margin-bottom: 3.5rem;
}

.metric-card {
  background: var(--white);
  padding: 2rem 1.75rem;
  transition: background 0.2s;
}

.metric-card:hover {
  background: var(--off-white);
}

.metric-card.highlight {
  background: var(--navy);
}

.metric-card.highlight .metric-value { color: var(--gold-light); }
.metric-card.highlight .metric-name { color: rgba(255,255,255,0.85); }
.metric-card.highlight .metric-note { color: rgba(255,255,255,0.4); }

.metric-value {
  font-family: var(--font-serif);
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1;
  margin-bottom: 0.5rem;
}

.metric-name {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-mid);
  margin-bottom: 0.4rem;
  line-height: 1.4;
}

.metric-note {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--mid-gray);
  letter-spacing: 0.04em;
}

/* =============================================
   BAR CHART
   ============================================= */
.chart-section {
  background: var(--off-white);
  padding: 2.5rem;
  border: 1px solid var(--light-gray);
}

.chart-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--mid-gray);
  margin-bottom: 2rem;
}

.bar-chart {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.bar-row {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.bar-country {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--dark-gray);
  width: 130px;
  flex-shrink: 0;
  text-align: right;
}

.bar-outer {
  flex: 1;
  height: 28px;
  background: var(--light-gray);
  position: relative;
}

.bar-fill {
  height: 100%;
  width: var(--pct);
  background: linear-gradient(90deg, var(--navy) 0%, var(--navy-light) 100%);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 0.5rem;
  transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.bar-fill .bar-val {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--white);
  white-space: nowrap;
  position: absolute;
  right: -3rem;
  color: var(--dark-gray);
}

.chart-source {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--mid-gray);
  margin-top: 1.5rem;
  letter-spacing: 0.04em;
}

/* =============================================
   STAT LIST
   ============================================= */
.stat-list {
  background: var(--white);
  border: 1px solid var(--light-gray);
  margin-bottom: 1.5rem;
}

.stat-list-item {
  display: flex;
  flex-direction: column;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--light-gray);
}

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

.stat-list-val {
  font-family: var(--font-serif);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1;
  margin-bottom: 0.35rem;
}

.stat-list-label {
  font-size: 0.8rem;
  color: var(--dark-gray);
  line-height: 1.4;
}

/* =============================================
   CALLOUT BOX
   ============================================= */
.callout-box {
  background: var(--navy);
  color: rgba(255,255,255,0.75);
  padding: 1.5rem;
  font-size: 0.88rem;
  line-height: 1.65;
  border-left: 3px solid var(--gold);
}

.callout-box.light {
  background: rgba(255,255,255,0.06);
  border-color: var(--gold-light);
}

.callout-box strong {
  display: block;
  color: var(--white);
  font-family: var(--font-serif);
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

/* =============================================
   FINANCE GRID
   ============================================= */
.finance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1px;
  background: var(--light-gray);
  border: 1px solid var(--light-gray);
  margin-top: 2.5rem;
}

.finance-card {
  background: var(--white);
  padding: 2rem 1.75rem;
  transition: background 0.2s;
}

.finance-card:hover { background: var(--off-white); }

.finance-icon {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--red);
  margin-bottom: 1rem;
  font-weight: 500;
}

.finance-card h3 {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 0.75rem;
}

.finance-card p {
  font-size: 0.88rem;
  color: var(--dark-gray);
  line-height: 1.65;
  margin: 0;
}

/* =============================================
   LABOUR SECTION
   ============================================= */
.labour-stats {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  padding: 2rem;
  margin-bottom: 1.5rem;
}

.labour-stat-row {
  margin-bottom: 1.5rem;
}

.labour-stat-row:last-child { margin-bottom: 0; }

.labour-stat-label {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.6);
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.labour-progress {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.labour-bar {
  height: 10px;
  width: var(--w);
  background: linear-gradient(90deg, var(--gold) 0%, var(--red) 100%);
  flex-shrink: 0;
  transition: width 1.2s ease;
}

.labour-progress span {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: rgba(255,255,255,0.55);
  white-space: nowrap;
}

/* =============================================
   GLOBAL SECTION
   ============================================= */
.global-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1px;
  background: var(--light-gray);
  border: 1px solid var(--light-gray);
  margin: 2.5rem 0;
}

.global-region {
  background: var(--white);
  padding: 2rem 1.75rem;
  transition: background 0.2s;
}

.global-region:hover { background: var(--off-white); }

.region-flag {
  font-size: 2rem;
  margin-bottom: 0.75rem;
  line-height: 1;
}

.region-name {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 0.25rem;
}

.region-role {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 1rem;
}

.global-region p {
  font-size: 0.87rem;
  color: var(--dark-gray);
  line-height: 1.65;
  margin: 0;
}

/* =============================================
   FUTURE GRID
   ============================================= */
.future-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 2px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.06);
  margin-top: 2.5rem;
}

.future-item {
  background: rgba(26,47,69,0.5);
  padding: 2.25rem 2rem;
  transition: background 0.25s;
}

.future-item:hover {
  background: rgba(42,74,107,0.6);
}

.future-num {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  color: var(--gold-light);
  margin-bottom: 1rem;
}

.future-item h3 {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 0.75rem;
}

.future-item p {
  font-size: 0.87rem;
  color: rgba(255,255,255,0.62);
  line-height: 1.65;
  margin: 0;
}

/* =============================================
   READING SECTION
   ============================================= */
.reading-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 3rem;
  margin-top: 2.5rem;
}

.reading-cat {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 1.25rem;
  font-weight: 500;
}

.reading-list {
  list-style: none;
  padding: 0;
}

.reading-list li {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--light-gray);
  font-size: 0.88rem;
  color: var(--text-mid);
  line-height: 1.5;
}

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

.reading-list em {
  color: var(--navy);
  font-style: italic;
}

.reading-author {
  font-weight: 600;
  color: var(--dark-gray);
}

/* =============================================
   FOOTER
   ============================================= */
.site-footer {
  background: var(--navy);
  color: rgba(255,255,255,0.65);
  padding: 3.5rem 0 2rem;
  position: relative;
}

.site-footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--red) 0%, var(--gold) 100%);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 3rem;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
}

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

.footer-sub {
  font-size: 0.82rem;
  max-width: 400px;
  line-height: 1.6;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  align-items: flex-end;
}

.footer-links a {
  font-size: 0.78rem;
  font-family: var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.45);
  text-decoration: none;
  transition: color 0.2s;
}

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

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 1.5rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  color: rgba(255,255,255,0.3);
}

/* =============================================
   SCROLL ANIMATIONS
   ============================================= */
.animate-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 900px) {
  .two-col {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .footer-links { align-items: flex-start; }

  .footer-inner {
    flex-direction: column;
    gap: 2rem;
  }

  .header-scroll-hint { display: none; }
}

@media (max-width: 600px) {
  :root { --section-gap: 3.5rem; }

  .site-header { padding: 3.5rem 1.25rem 2.5rem; }

  .container { padding: 0 1.25rem; }

  .top-bar { padding: 0.45rem 1.25rem; }

  .bar-country { width: 90px; font-size: 0.75rem; }

  .pillars-grid,
  .metrics-grid,
  .finance-grid,
  .global-grid,
  .future-grid {
    grid-template-columns: 1fr;
  }

  .nav-inner a { padding: 0.75rem 0.75rem; font-size: 0.72rem; }

  .reading-grid { grid-template-columns: 1fr; gap: 2rem; }
}

/* =============================================
   PRINT
   ============================================= */
@media print {
  .site-nav,
  .top-bar,
  .header-scroll-hint { display: none; }

  .section-dark,
  .section-future { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
