/* =========================================================
   MODERN DATA-JOURNALISM E-MAGAZINE STYLESHEET
   - Base text >= 16px across entire page
   - Infographic text >= 18px across all viewports
   - No navbar, no TOC, no progress bar, no header chrome
========================================================= */

:root {
  --bg-page: #faf9f5;
  --bg-surface: #ffffff;
  --bg-tint: #f1f4ee;
  --bg-soft-amber: #fdf7ec;

  --ink-primary: #14221b;
  --ink-body: #223029;
  --ink-muted: #45574d;

  --accent-emerald: #166534;
  --accent-emerald-bright: #15803d;
  --accent-emerald-soft: #e3efe6;
  --accent-amber: #b45309;
  --accent-amber-soft: #faecd8;
  --accent-alert: #b91c1c;

  --border-hairline: #dde3da;
  --border-strong: #c3cdc0;

  --font-sans: 'Be Vietnam Pro', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-serif: 'Newsreader', Georgia, 'Times New Roman', serif;

  --shadow-card: 0 12px 32px -12px rgba(20, 34, 27, 0.08);
  --shadow-photo: 0 20px 44px -16px rgba(20, 34, 27, 0.16);
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background-color: var(--bg-page);
  color: var(--ink-body);
  font-family: var(--font-sans);
  font-size: 1.1875rem; /* 19px */
  line-height: 1.78;
  overflow-x: hidden;
}

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

button {
  font-family: inherit;
  cursor: pointer;
}

/* Containers */
.container-narrow {
  width: min(720px, calc(100% - 2.5rem));
  margin-inline: auto;
}

.container-wide {
  width: min(1080px, calc(100% - 2.5rem));
  margin-inline: auto;
}

/* =========================================================
   HERO COVER (Full-bleed editorial opening, no header bar)
========================================================= */
.cover {
  position: relative;
  min-height: 88vh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background-color: #102018;
}

.cover-media {
  position: absolute;
  inset: -6% 0;
  will-change: transform;
}

.cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 42%;
}

.cover-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(12, 24, 18, 0.18) 0%,
    rgba(12, 24, 18, 0.45) 45%,
    rgba(12, 24, 18, 0.90) 88%,
    rgba(12, 24, 18, 0.96) 100%
  );
}

.cover-content {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: clamp(3.5rem, 8vw, 6.5rem) 1.25rem clamp(3rem, 6vw, 5rem);
}

.cover-inner {
  width: min(860px, 100%);
  margin-inline: auto;
  color: #f8faf7;
}

.cover-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 1rem; /* 16px min */
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #d7ebd9;
  margin-bottom: 1.25rem;
}

.kicker-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #4ade80;
  flex-shrink: 0;
}

.cover-title {
  margin: 0 0 1.75rem;
  font-family: var(--font-serif);
  font-size: clamp(2.25rem, 5.2vw, 4rem);
  font-weight: 700;
  line-height: 1.14;
  letter-spacing: -0.015em;
  color: #ffffff;
}

.cover-lead {
  border-left: 3px solid #4ade80;
  padding-left: 1.35rem;
  display: grid;
  gap: 0.95rem;
}

.cover-lead p {
  margin: 0;
  font-size: clamp(1.125rem, 1.8vw, 1.3125rem); /* 18px - 21px */
  line-height: 1.68;
  color: rgba(248, 250, 247, 0.94);
}

/* =========================================================
   ARTICLE PARTS & PROSE
========================================================= */
.story {
  padding-top: clamp(3rem, 6vw, 5rem);
}

.part {
  padding-block: clamp(2.25rem, 5vw, 4rem);
}

.part + .part {
  border-top: 1px solid var(--border-hairline);
}

.part-intro {
  margin-bottom: 2rem;
}

.part-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}

.part-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  height: 2.5rem;
  padding-inline: 0.6rem;
  border-radius: 999px;
  background-color: var(--accent-emerald);
  color: #ffffff;
  font-weight: 700;
  font-size: 1rem; /* 16px */
}

.part-label {
  font-size: 1rem; /* 16px */
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-emerald);
}

.part-title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(1.85rem, 3.6vw, 2.75rem);
  font-weight: 700;
  line-height: 1.22;
  color: var(--ink-primary);
}

.prose p {
  margin: 0 0 1.45rem;
  font-size: clamp(1.0625rem, 1.4vw, 1.1875rem); /* 17px - 19px */
  line-height: 1.82;
  color: var(--ink-body);
}

.prose p:last-child {
  margin-bottom: 0;
}

.prose p.dropcap::first-letter {
  float: left;
  font-family: var(--font-serif);
  font-size: 3.9rem;
  line-height: 0.86;
  font-weight: 700;
  padding-right: 0.65rem;
  padding-top: 0.25rem;
  color: var(--accent-emerald);
}

/* =========================================================
   EDITORIAL PHOTOGRAPHY (Simple JPG, Subtle Parallax)
========================================================= */
.editorial-photo {
  margin-block: clamp(2rem, 4.5vw, 3.25rem);
}

.photo-frame {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-photo);
  background-color: #dce2d8;
  aspect-ratio: 16 / 9;
}

.photo-frame img {
  width: 100%;
  height: 112%;
  object-fit: cover;
  transform: translate3d(0, -6%, 0);
  transition: transform 0.2s ease-out;
}

/* =========================================================
   DATA-JOURNALISM INFOGRAPHICS
   STRICT REQUIREMENT: ALL TEXT >= 18px (1.125rem)
   STRICT REQUIREMENT: BALANCED GRIDS (No orphan cells)
========================================================= */
.infographic-wrap {
  margin-block: clamp(2.25rem, 5vw, 3.5rem);
}

.infographic {
  background-color: var(--bg-tint);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 3.5vw, 2.5rem);
  box-shadow: var(--shadow-card);
  font-size: 1.125rem; /* 18px baseline inside infographic */
}

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

.info-tag {
  display: inline-block;
  font-size: 1.125rem; /* 18px */
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-emerald);
  margin-bottom: 0.35rem;
}

.info-title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 2.6vw, 2rem); /* 24px - 32px */
  font-weight: 700;
  line-height: 1.25;
  color: var(--ink-primary);
}

.info-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  background-color: var(--bg-surface);
  padding: 0.35rem;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
}

.info-tab {
  border: 0;
  background: transparent;
  color: var(--ink-muted);
  font-size: 1.125rem; /* 18px */
  font-weight: 600;
  padding: 0.5rem 1.15rem;
  border-radius: 999px;
  transition: background-color 0.22s ease, color 0.22s ease;
}

.info-tab:hover {
  color: var(--ink-primary);
}

.info-tab.is-active {
  background-color: var(--accent-emerald);
  color: #ffffff;
}

.info-tab:focus-visible,
.matrix-card:focus-visible {
  outline: 3px solid var(--accent-amber);
  outline-offset: 2px;
}

/* Shared 2-Column Balanced Grid */
.info-grid-2col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
  align-items: stretch;
}

.info-panel {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  padding: clamp(1.25rem, 2.5vw, 1.75rem);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.35rem;
  transition: opacity 0.28s ease, transform 0.28s ease, border-color 0.28s ease;
}

.info-panel.is-dimmed {
  opacity: 0.45;
}

.info-panel.is-highlighted {
  border-color: var(--accent-emerald);
  box-shadow: 0 0 0 2px rgba(22, 101, 52, 0.14);
}

/* ---------- Infographic 1: Donut + 2x2 KPIs ---------- */
.chart-panel {
  align-items: center;
}

.donut-stage {
  position: relative;
  width: 220px;
  height: 220px;
  display: grid;
  place-items: center;
}

.donut-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.donut-track {
  fill: none;
  stroke: #e4eae2;
  stroke-width: 20;
}

.donut-ring {
  fill: none;
  stroke: var(--accent-emerald);
  stroke-width: 20;
  stroke-linecap: round;
  stroke-dasharray: 527.79;
  stroke-dashoffset: 527.79;
  transition: stroke-dashoffset 1.1s cubic-bezier(0.22, 1, 0.36, 1), stroke 0.3s ease;
}

.donut-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1rem;
}

.donut-value {
  font-size: 2.35rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--ink-primary);
}

.donut-caption {
  font-size: 1.125rem; /* 18px */
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink-muted);
  margin-top: 0.25rem;
}

.chart-legend-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-hairline);
}

.legend-item {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
}

.legend-swatch {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  margin-top: 0.45rem;
  flex-shrink: 0;
}

.swatch-primary {
  background-color: var(--accent-emerald);
}

.swatch-secondary {
  background-color: var(--accent-amber);
}

.legend-copy {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.legend-label {
  font-size: 1.125rem; /* 18px */
  line-height: 1.35;
  color: var(--ink-muted);
}

.legend-num {
  font-size: 1.25rem; /* 20px */
  font-weight: 700;
  line-height: 1.3;
  color: var(--ink-primary);
}

/* Balanced 2x2 KPI Grid */
.kpi-grid-2x2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.kpi-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  padding: 1.35rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.5rem;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px -12px rgba(20, 34, 27, 0.14);
}

.kpi-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background-color: var(--accent-emerald-soft);
  color: var(--accent-emerald);
  display: grid;
  place-items: center;
  margin-bottom: 0.25rem;
}

.kpi-icon svg {
  width: 22px;
  height: 22px;
}

.kpi-card.accent-amber .kpi-icon {
  background-color: var(--accent-amber-soft);
  color: var(--accent-amber);
}

.kpi-value {
  font-size: clamp(1.85rem, 2.8vw, 2.35rem);
  font-weight: 800;
  line-height: 1.15;
  color: var(--ink-primary);
}

.kpi-card.accent-amber .kpi-value {
  color: var(--accent-amber);
}

.kpi-label {
  font-size: 1.125rem; /* 18px */
  font-weight: 500;
  line-height: 1.4;
  color: var(--ink-muted);
}

/* ---------- Infographic 2: Scale, Timeline & Credit Bars ---------- */
.panel-header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.panel-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background-color: var(--accent-emerald-soft);
  color: var(--accent-emerald);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.panel-icon.icon-amber {
  background-color: var(--accent-amber-soft);
  color: var(--accent-amber);
}

.panel-icon svg {
  width: 22px;
  height: 22px;
}

.panel-heading {
  margin: 0;
  font-size: 1.3125rem; /* 21px */
  font-weight: 700;
  line-height: 1.3;
  color: var(--ink-primary);
}

.bar-compare-list {
  display: grid;
  gap: 1rem;
}

.bar-row-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  font-size: 1.125rem; /* 18px */
  margin-bottom: 0.45rem;
}

.bar-row-meta span {
  color: var(--ink-muted);
}

.bar-row-meta strong {
  color: var(--ink-primary);
  font-weight: 700;
  white-space: nowrap;
}

.bar-track {
  width: 100%;
  height: 14px;
  border-radius: 999px;
  background-color: #e6ebe3;
  overflow: hidden;
}

.bar-fill {
  width: 0;
  height: 100%;
  border-radius: 999px;
  transition: width 1s cubic-bezier(0.22, 1, 0.36, 1);
}

.fill-emerald {
  background-color: var(--accent-emerald);
}

.fill-amber {
  background-color: var(--accent-amber);
}

/* SVG Timeline */
.timeline-viz {
  padding-top: 0.25rem;
}

.timeline-svg {
  width: 100%;
  height: 34px;
  display: block;
}

.tl-base {
  stroke: #dde3da;
  stroke-width: 4;
  stroke-linecap: round;
}

.tl-progress {
  stroke: var(--accent-emerald);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 380;
  stroke-dashoffset: 380;
  transition: stroke-dashoffset 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.tl-dot {
  stroke: #ffffff;
  stroke-width: 2.5;
}

.dot-green { fill: var(--accent-emerald); }
.dot-amber { fill: var(--accent-amber); }
.dot-alert { fill: var(--accent-alert); }

.timeline-labels {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-top: 0.35rem;
  font-size: 1.125rem; /* 18px */
  font-weight: 700;
  line-height: 1.3;
  color: var(--ink-primary);
}

.timeline-labels span:nth-child(2) {
  text-align: center;
}

.timeline-labels span:nth-child(3) {
  text-align: right;
  color: var(--accent-alert);
}

.timeline-labels small {
  font-size: 1.125rem; /* 18px */
  font-weight: 500;
  color: var(--ink-muted);
}

/* Credit Bar Chart */
.credit-chart {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  gap: 1rem;
  padding-top: 0.5rem;
}

.credit-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
}

.credit-val {
  font-size: 1.5rem; /* 24px */
  font-weight: 800;
  color: var(--ink-muted);
  text-align: center;
}

.credit-val.val-highlight {
  font-size: 2rem; /* 32px */
  color: var(--accent-emerald);
}

.credit-bar-wrap {
  width: 100%;
  max-width: 120px;
  height: 140px;
  background-color: #eef2eb;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.credit-bar {
  width: 100%;
  height: 0;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  transition: height 1s cubic-bezier(0.22, 1, 0.36, 1);
}

.bar-muted {
  background-color: #93a398;
}

.bar-emerald {
  background: linear-gradient(180deg, #16a34a 0%, #166534 100%);
}

.credit-lbl {
  font-size: 1.125rem; /* 18px */
  font-weight: 600;
  line-height: 1.35;
  color: var(--ink-muted);
  text-align: center;
}

.credit-arrow {
  align-self: center;
  color: var(--accent-amber);
  width: 46px;
}

.mini-stat-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-hairline);
}

.mini-stat {
  background-color: var(--bg-tint);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.mini-stat strong {
  font-size: 1.3125rem; /* 21px */
  font-weight: 800;
  line-height: 1.25;
  color: var(--ink-primary);
}

.mini-stat span {
  font-size: 1.125rem; /* 18px */
  line-height: 1.35;
  color: var(--ink-muted);
}

/* ---------- Infographic 3: Semi Gauge + 2x3 Matrix ---------- */
.gauge-stage {
  position: relative;
  width: 100%;
  max-width: 280px;
  margin-inline: auto;
}

.gauge-svg {
  width: 100%;
  height: auto;
  display: block;
}

.gauge-track {
  fill: none;
  stroke: #e4eae2;
  stroke-width: 22;
  stroke-linecap: round;
}

.gauge-arc {
  fill: none;
  stroke: var(--accent-amber);
  stroke-width: 22;
  stroke-linecap: round;
  stroke-dasharray: 314.16;
  stroke-dashoffset: 314.16;
  transition: stroke-dashoffset 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.gauge-center {
  position: relative;
  text-align: center;
  margin-top: -2.85rem;
}

.gauge-num {
  display: block;
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--accent-amber);
}

.gauge-sub {
  display: block;
  font-size: 1.125rem; /* 18px */
  font-weight: 600;
  color: var(--ink-muted);
  margin-top: 0.25rem;
}

/* 2x3 Balanced Competency Matrix */
.matrix-panel {
  justify-content: space-between;
}

.matrix-grid-2x3 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.matrix-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-align: left;
  padding: 0.95rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background-color: var(--bg-page);
  color: var(--ink-primary);
  font-size: 1.125rem; /* 18px */
  font-weight: 600;
  line-height: 1.35;
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.matrix-card:hover {
  border-color: var(--accent-emerald);
  transform: translateY(-1px);
}

.matrix-card.is-active {
  background-color: var(--accent-emerald);
  border-color: var(--accent-emerald);
  color: #ffffff;
}

.matrix-idx {
  font-size: 1.125rem; /* 18px */
  font-weight: 800;
  opacity: 0.75;
  flex-shrink: 0;
}

.matrix-name {
  font-size: 1.125rem; /* 18px */
}

.matrix-detail-bar {
  background-color: var(--bg-soft-amber);
  border: 1px solid #f3d7ad;
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.matrix-detail-bar strong {
  font-size: 1.1875rem; /* 19px */
  color: var(--accent-amber);
}

.matrix-detail-bar span {
  font-size: 1.125rem; /* 18px */
  line-height: 1.5;
  color: var(--ink-primary);
}

/* =========================================================
   BYLINE FOOTER
========================================================= */
.byline-footer {
  padding-block: 2.5rem 5rem;
  text-align: right;
}

.byline-rule {
  width: 80px;
  height: 3px;
  background-color: var(--accent-emerald);
  margin-left: auto;
  margin-bottom: 0.9rem;
}

.byline-author {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.375rem; /* 22px */
  font-weight: 700;
  font-style: italic;
  color: var(--ink-primary);
}

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

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

/* =========================================================
   RESPONSIVE: TABLET & MOBILE
========================================================= */
@media (max-width: 960px) {
  .info-grid-2col {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .container-narrow,
  .container-wide {
    width: calc(100% - 1.75rem);
  }

  .cover {
    min-height: 78vh;
  }

  .cover-lead {
    padding-left: 1rem;
  }

  .prose p.dropcap::first-letter {
    font-size: 3.3rem;
  }

  .kpi-grid-2x2,
  .chart-legend-grid,
  .mini-stat-pair,
  .matrix-grid-2x3 {
    grid-template-columns: 1fr;
  }

  .credit-chart {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .credit-arrow {
    transform: rotate(90deg);
  }

  .timeline-labels {
    grid-template-columns: 1fr;
    text-align: left;
    gap: 0.5rem;
  }

  .timeline-labels span:nth-child(2),
  .timeline-labels span:nth-child(3) {
    text-align: left;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

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

  .donut-ring,
  .bar-fill,
  .tl-progress,
  .credit-bar,
  .gauge-arc,
  .photo-frame img {
    transition: none;
  }
}
