:root {
  --bg-deep: #061325;
  --bg-section-alt: #081931;
  --bg-card: #0c2240;
  --bg-subpanel: #102a4e;
  --border-subtle: rgba(148, 197, 255, 0.16);
  --border-accent: rgba(251, 191, 36, 0.35);

  --text-primary: #f3f7fd;
  --text-body: #dde8f6;
  --text-muted: #adc4e2;

  --accent-gold: #fbbf24;
  --accent-cyan: #38bdf8;
  --accent-emerald: #34d399;

  --font-display: "Playfair Display", Georgia, serif;
  --font-sans: "Be Vietnam Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --measure: 720px;
  --info-measure: 940px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  background-color: var(--bg-deep);
  color: var(--text-body);
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1.125rem;
  line-height: 1.82;
  background-color: var(--bg-deep);
  color: var(--text-body);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

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

/* =========================================
   HERO SECTION
   ========================================= */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4.5rem 1.5rem 3.5rem;
  overflow: hidden;
  text-align: center;
}

.hero-media {
  position: absolute;
  inset: -8% 0;
  z-index: 0;
  will-change: transform;
}

.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.9) brightness(0.65);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 42%, rgba(12, 34, 64, 0.42) 0%, rgba(6, 19, 37, 0.85) 75%),
    linear-gradient(180deg, rgba(6, 19, 37, 0.55) 0%, rgba(6, 19, 37, 0.72) 60%, var(--bg-deep) 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 880px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-rule {
  width: 72px;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--accent-gold), transparent);
  margin-bottom: 2rem;
}

.hero-title {
  margin: 0 0 2rem;
  font-family: var(--font-display);
  font-size: clamp(2.15rem, 4.8vw, 3.85rem);
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: -0.015em;
  color: #ffffff;
  text-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}

.hero-sapo {
  margin: 0;
  max-width: 740px;
  font-size: clamp(1.0625rem, 1.5vw, 1.3125rem);
  line-height: 1.75;
  font-weight: 400;
  color: #e6effb;
}

.scroll-cue {
  margin-top: 3rem;
  width: 48px;
  height: 48px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(12, 34, 64, 0.55);
  color: var(--accent-gold);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: transform 0.25s ease, border-color 0.25s ease, background-color 0.25s ease;
  animation: floatCue 2.4s ease-in-out infinite;
}

.scroll-cue:hover,
.scroll-cue:focus-visible {
  border-color: var(--accent-gold);
  background: rgba(251, 191, 36, 0.14);
  transform: translateY(3px);
  outline: none;
}

@keyframes floatCue {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(6px);
  }
}

/* =========================================
   CHAPTERS & ARTICLE BODY
   ========================================= */
.chapter {
  padding: 5.5rem 1.5rem;
  position: relative;
}

.chapter-2 {
  background: linear-gradient(180deg, var(--bg-deep) 0%, var(--bg-section-alt) 15%, var(--bg-section-alt) 85%, var(--bg-deep) 100%);
}

.article-container {
  max-width: var(--measure);
  margin: 0 auto;
}

.chapter-head {
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.chapter-num {
  display: inline-block;
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--accent-gold);
  margin-bottom: 0.65rem;
}

.chapter-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3.2vw, 2.5rem);
  font-weight: 700;
  line-height: 1.24;
  color: #ffffff;
}

.article-container p {
  margin: 0 0 1.65rem;
  font-size: 1.125rem;
  line-height: 1.85;
  color: var(--text-body);
}

.article-container p.lead-para {
  font-size: 1.25rem;
  line-height: 1.78;
  color: #f4f8ff;
  font-weight: 500;
}

/* =========================================
   EDITORIAL IMAGES
   ========================================= */
.editorial-figure {
  margin: 2.75rem -2.5rem;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  box-shadow: 0 24px 48px rgba(2, 9, 20, 0.5);
}

.figure-frame {
  overflow: hidden;
  aspect-ratio: 16 / 9;
  will-change: transform;
}

.figure-frame img {
  width: 100%;
  height: 112%;
  object-fit: cover;
  transform: translateY(-6%);
}

/* =========================================
   INFOGRAPHICS (MIN 18PX EVERYWHERE, BALANCED)
   ========================================= */
.infographic-wrap {
  max-width: var(--info-measure);
  margin: 3.5rem auto;
}

.infographic-card {
  background: linear-gradient(155deg, rgba(16, 42, 78, 0.92), rgba(10, 28, 54, 0.98));
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 20px;
  padding: 2.25rem;
  box-shadow: 0 24px 60px rgba(2, 8, 20, 0.55);
}

.info-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem 1.5rem;
  margin-bottom: 1.75rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
}

.info-badge {
  font-size: 1.25rem; /* 20px */
  font-weight: 700;
  color: var(--accent-gold);
}

.info-loc {
  font-size: 1.125rem; /* 18px */
  font-weight: 500;
  color: var(--accent-cyan);
}

/* Balanced KPI Grids */
.kpi-grid {
  display: grid;
  gap: 1.25rem;
}

.kpi-grid-2x2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.kpi-grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.kpi-box {
  background: rgba(6, 19, 37, 0.55);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 1.5rem 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.kpi-box:hover {
  transform: translateY(-2px);
  border-color: var(--border-accent);
}

.kpi-icon {
  color: var(--accent-cyan);
  display: inline-flex;
  align-items: center;
}

.kpi-value {
  font-size: clamp(1.625rem, 2.5vw, 2.125rem); /* >= 26px */
  font-weight: 700;
  line-height: 1.2;
  color: #ffffff;
  font-variant-numeric: tabular-nums;
}

.kpi-label {
  font-size: 1.125rem; /* 18px minimum */
  line-height: 1.45;
  color: var(--text-muted);
}

/* Subpanels inside infographics */
.info-subpanel {
  background: rgba(6, 19, 37, 0.55);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.info-flow-panel,
.shift-panel {
  margin-top: 1.25rem;
}

.subpanel-title {
  font-size: 1.25rem; /* 20px */
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 1.25rem;
}

/* Infographic 1 Flow */
.flow-grid-3 {
  display: grid;
  grid-template-columns: 1fr 64px 1fr 64px 1fr;
  align-items: center;
  gap: 0.75rem;
}

.flow-step {
  background: rgba(16, 42, 78, 0.75);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 12px;
  padding: 1.15rem;
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  height: 100%;
}

.flow-dot {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: rgba(251, 191, 36, 0.18);
  border: 1px solid var(--accent-gold);
  color: var(--accent-gold);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem; /* 18px */
  font-weight: 700;
}

.flow-text {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.flow-text strong {
  font-size: 1.1875rem; /* 19px */
  color: #ffffff;
  line-height: 1.3;
}

.flow-text span {
  font-size: 1.125rem; /* 18px */
  color: var(--text-muted);
  line-height: 1.4;
}

.flow-connector {
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
}

.svg-arrow {
  width: 100%;
  height: 24px;
}

/* Balanced Dual Panel Grid */
.dual-panel-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
  margin-top: 1.25rem;
}

/* Infographic 2 Network Diagram */
.network-diagram {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.network-svg {
  width: 100%;
  max-height: 140px;
}

.market-tags {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.market-tag {
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 10px;
  padding: 0.65rem 0.9rem;
  text-align: center;
  font-size: 1.125rem; /* 18px */
  font-weight: 600;
  color: #ffffff;
}

/* Animated Bar Charts (Infographic 2 & 3) */
.chain-bars {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.chain-item {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.chain-name {
  font-size: 1.125rem; /* 18px */
  font-weight: 500;
  color: #f1f6fd;
  line-height: 1.35;
}

.chain-track {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: rgba(148, 197, 255, 0.12);
  overflow: hidden;
}

.chain-fill {
  width: 0%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-gold));
  transition: width 1.1s cubic-bezier(0.22, 1, 0.36, 1);
}

.chain-fill-emerald {
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-emerald));
}

.is-visible .chain-fill {
  width: var(--fill);
}

/* Infographic 3: 2x2 Pillar Sub-grid */
.pillar-2x2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.pillar-item {
  background: rgba(16, 42, 78, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.6rem;
  color: var(--accent-gold);
}

.pillar-item span {
  font-size: 1.125rem; /* 18px */
  font-weight: 600;
  color: #ffffff;
  line-height: 1.35;
}

/* Infographic 3: Transformation Pairs */
.shift-rows {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.shift-pair {
  display: grid;
  grid-template-columns: 1fr 64px 1fr;
  align-items: center;
  gap: 0.85rem;
}

.shift-from,
.shift-to {
  border-radius: 10px;
  padding: 0.9rem 1.15rem;
  font-size: 1.125rem; /* 18px */
  line-height: 1.4;
}

.shift-from {
  background: rgba(148, 197, 255, 0.08);
  border: 1px solid rgba(148, 197, 255, 0.2);
  color: var(--text-muted);
}

.shift-to {
  background: rgba(52, 211, 153, 0.14);
  border: 1px solid rgba(52, 211, 153, 0.4);
  color: #ffffff;
  font-weight: 600;
}

.shift-arrow {
  color: var(--accent-emerald);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* SVG line animation */
.anim-line {
  stroke-dashoffset: 40;
  transition: stroke-dashoffset 1.2s ease;
}

.is-visible .anim-line {
  stroke-dashoffset: 0;
}

/* =========================================
   BYLINE
   ========================================= */
.byline {
  margin-top: 3.5rem;
  padding-top: 2rem;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.85rem;
}

.byline-rule {
  width: 64px;
  height: 2px;
  background: var(--accent-gold);
}

.byline-name {
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.02em;
}

/* =========================================
   SCROLL REVEAL ANIMATIONS
   ========================================= */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-hero {
  animation: heroFadeUp 0.9s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.hero-sapo.reveal-hero {
  animation-delay: 0.16s;
}

@keyframes heroFadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* =========================================
   RESPONSIVE: TABLET & MOBILE
   ========================================= */
@media (max-width: 900px) {
  .editorial-figure {
    margin: 2.25rem 0;
  }

  .kpi-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .flow-grid-3 {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .flow-connector {
    transform: rotate(90deg);
    height: 36px;
  }

  .svg-arrow {
    width: 48px;
  }
}

@media (max-width: 720px) {
  body {
    font-size: 1rem; /* 16px minimum */
  }

  .hero {
    padding: 3.5rem 1.25rem 3rem;
  }

  .chapter {
    padding: 3.75rem 1.25rem;
  }

  .article-container p {
    font-size: 1.0625rem; /* 17px on mobile, >= 16px */
    line-height: 1.78;
  }

  .article-container p.lead-para {
    font-size: 1.125rem; /* 18px */
  }

  .infographic-card {
    padding: 1.35rem;
    border-radius: 16px;
  }

  .kpi-grid-2x2,
  .kpi-grid-3,
  .dual-panel-grid,
  .pillar-2x2,
  .market-tags {
    grid-template-columns: 1fr;
  }

  .shift-pair {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .shift-arrow {
    transform: rotate(90deg);
    height: 32px;
  }

  /* Keep infographic typography >= 18px on mobile */
  .kpi-label,
  .flow-text span,
  .market-tag,
  .chain-name,
  .pillar-item span,
  .shift-from,
  .shift-to,
  .info-loc {
    font-size: 1.125rem; /* 18px */
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
