:root {
  --bg: #f7fbfb;
  --surface: rgba(255, 255, 255, 0.92);
  --surface-soft: #eef7f6;
  --text: #17313a;
  --muted: #5f767d;
  --line: #d7e7e5;
  --teal: #177a74;
  --teal-strong: #11655f;
  --teal-soft: #dff3f0;
  --shadow: 0 16px 36px rgba(23, 49, 58, 0.08);
  --radius: 24px;
  --max: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Aptos", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  line-height: 1.68;
  background:
    radial-gradient(circle at top right, rgba(58, 169, 162, 0.12), transparent 22%),
    linear-gradient(180deg, #fbfefd 0%, #f7fbfb 100%);
  overflow-x: hidden;
}

code {
  background: rgba(23, 122, 116, 0.08);
  padding: 0 4px;
  border-radius: 4px;
  font-size: 0.92em;
  word-break: break-word;
  overflow-wrap: anywhere;
}

a {
  color: inherit;
  text-decoration: none;
}

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

button {
  font: inherit;
}

.shell {
  width: min(var(--max), calc(100% - 28px));
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(247, 251, 251, 0.9);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(23, 49, 58, 0.06);
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 14px 0;
}

.brand {
  font-weight: 700;
  letter-spacing: 0.02em;
}

.navlinks {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  color: var(--muted);
  font-size: 0.95rem;
}

.navlinks a:hover {
  color: var(--teal);
}

.hero {
  padding: 64px 0 28px;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
  gap: 22px;
  align-items: start;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 16px;
}

.eyebrow::before {
  content: "";
  width: 28px;
  height: 1px;
  background: linear-gradient(90deg, var(--teal), transparent);
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  letter-spacing: -0.03em;
}

h1 {
  font-size: clamp(2.7rem, 5.3vw, 4.8rem);
  line-height: 0.95;
  max-width: 11ch;
}

.subtitle {
  margin: 18px 0 0;
  max-width: 40ch;
  font-size: clamp(1.06rem, 1.9vw, 1.22rem);
  color: #27464d;
}

.hero-copy {
  margin-top: 18px;
  max-width: 66ch;
  color: var(--muted);
}

.actions,
.facts,
.regime-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.actions {
  margin-top: 24px;
}

.btn,
.fact,
.regime-button {
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
}

.btn {
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  padding: 0 16px;
  font-weight: 600;
  box-shadow: 0 8px 18px rgba(23, 49, 58, 0.05);
}

.btn:hover {
  color: var(--teal);
  border-color: #b7d7d2;
}

.btn.primary {
  background: linear-gradient(135deg, var(--teal) 0%, #249f97 100%);
  border-color: transparent;
  color: #ffffff;
}

.btn.primary:hover {
  color: #ffffff;
}

.facts {
  margin-top: 18px;
}

.fact {
  padding: 10px 14px;
  color: #254249;
  font-size: 0.92rem;
}

.card,
.figure-card {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.card {
  padding: 22px;
}

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

.lead-grid,
.two-col,
.figure-grid {
  display: grid;
  gap: 18px;
}

.lead-grid {
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
}

main section {
  padding: 28px 0;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
  margin-bottom: 16px;
}

.section-head p {
  margin: 0;
  max-width: 60ch;
  color: var(--muted);
}

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

.takeaway {
  padding: 18px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff 0%, #f5fbfa 100%);
}

.takeaway strong {
  display: block;
  margin-bottom: 6px;
}

.regime-toolbar {
  padding: 16px 18px;
}

.toolbar-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.toolbar-copy {
  color: var(--muted);
  font-size: 0.96rem;
}

.regime-button {
  padding: 10px 14px;
  color: #254249;
  font-weight: 600;
  cursor: pointer;
}

.regime-button.active {
  color: #ffffff;
  border-color: transparent;
  background: linear-gradient(135deg, var(--teal) 0%, #249f97 100%);
  box-shadow: 0 10px 20px rgba(23, 122, 116, 0.16);
}

.figure-grid {
  grid-template-columns: minmax(0, 1.12fr) minmax(280px, 0.88fr);
}

.figure-card {
  padding: 20px;
}

.figure-card.chart-card {
  padding: 16px 18px 20px;
  box-shadow: 0 8px 22px rgba(23, 49, 58, 0.05);
}

.figure-card.chart-card h3 {
  font-size: 1.08rem;
  line-height: 1.3;
  margin-bottom: 10px;
  letter-spacing: -0.015em;
}

.figure-frame {
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid #ddebe8;
  background: #ffffff;
}

.figure-frame img {
  width: 100%;
}

.figure-caption {
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.94rem;
}

.figure-comment {
  margin-top: 10px;
  padding-top: 12px;
  border-top: 1px solid #e3efec;
  color: #315057;
}

.chart-lede {
  margin: 18px 0 10px;
  padding: 16px 18px 16px 20px;
  border-left: 4px solid var(--teal);
  border-radius: 8px 14px 14px 8px;
  background: linear-gradient(
    180deg,
    rgba(223, 243, 240, 0.6) 0%,
    rgba(255, 255, 255, 0.94) 100%
  );
  color: #102a32;
  font-size: 1.08rem;
  font-weight: 500;
  line-height: 1.6;
}

.chart-lede em {
  color: var(--teal-strong);
  font-style: normal;
  font-weight: 700;
}

.chart-lede strong {
  color: var(--teal-strong);
}

.chart-howto {
  margin: 4px 2px 0;
  padding: 12px 16px;
  border-left: 3px solid #c6d7d4;
  border-radius: 4px 12px 12px 4px;
  background: rgba(238, 247, 246, 0.55);
  color: #3a545b;
  font-size: 0.95rem;
  line-height: 1.6;
}

.chart-howto strong {
  color: #254249;
}

.chart-note {
  margin: 4px 2px 0;
  padding: 12px 16px;
  border-left: 3px solid #c6d7d4;
  border-radius: 4px 12px 12px 4px;
  background: rgba(238, 247, 246, 0.55);
  color: #3a545b;
  font-size: 0.95rem;
  line-height: 1.6;
  font-style: normal;
}

.chart-label {
  display: inline-block;
  margin-right: 10px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  vertical-align: 0.12em;
}

.chart-lede .chart-label {
  background: var(--teal);
  color: #ffffff;
}

.chart-howto .chart-label,
.chart-note .chart-label {
  background: #e1ece9;
  color: #3a5a61;
}

.section-intro {
  margin: 6px 0 18px;
  color: #274a51;
  max-width: 72ch;
  line-height: 1.65;
}

.table-subtitle {
  margin: -2px 2px 12px;
  color: #5b6a72;
  font-size: 0.92rem;
  font-style: italic;
}

.coef-table-wrap {
  margin: 6px 0 14px;
  overflow-x: auto;
  border: 1px solid #d6e2e0;
  border-radius: 12px;
  background: #ffffff;
}

.coef-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.96rem;
  color: #1f3a40;
}

.coef-table thead th {
  padding: 12px 14px;
  background: #f3faf8;
  border-bottom: 2px solid #c6d7d4;
  text-align: left;
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #3a5a61;
  white-space: nowrap;
}

.coef-table th[scope="row"] {
  padding: 12px 14px;
  text-align: left;
  font-weight: 600;
  color: #102a32;
  white-space: nowrap;
}

.coef-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #ecf2f0;
}

.coef-table tbody tr:last-child th,
.coef-table tbody tr:last-child td {
  border-bottom: none;
}

.coef-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.coef-table thead th.num {
  text-align: right;
}

.coef-table .z-tag {
  color: #6b7c83;
  font-weight: 400;
  font-size: 0.85em;
}

.coef-table tr.sig {
  background: rgba(36, 117, 99, 0.06);
}

.coef-table tr.sig th[scope="row"],
.coef-table tr.sig td {
  color: #102a32;
}

.coef-table tr.sig td.p-val,
.coef-table tr.row-baseline td.p-val {
  color: var(--teal-strong);
  font-weight: 700;
}

.coef-table tr.row-baseline th[scope="row"] {
  color: var(--teal-strong);
  font-weight: 700;
}

.coef-legend {
  margin: 10px 14px 14px;
  color: #5b6a72;
  font-size: 0.85rem;
}

.coef-legend .sig-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 8px;
  border-radius: 50%;
  background: rgba(36, 117, 99, 0.32);
  vertical-align: -1px;
}

.chart-stack {
  display: grid;
  gap: 20px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.metric {
  padding: 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff 0%, #f7fbfb 100%);
}

.metric span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.77rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.metric strong {
  font-size: 1.18rem;
  line-height: 1.2;
}

.callout {
  margin-top: 12px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid #d3e8e4;
  background: linear-gradient(180deg, rgba(223, 243, 240, 0.84) 0%, rgba(255, 255, 255, 0.95) 100%);
}

.callout strong {
  display: block;
  margin-bottom: 6px;
}

.detail-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.detail-list div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding-top: 10px;
  border-top: 1px solid #e2efec;
}

.detail-list div:first-child {
  padding-top: 0;
  border-top: 0;
}

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

.references {
  display: grid;
  gap: 14px;
}

.references li {
  color: #27464d;
}

.references a {
  color: var(--teal-strong);
}

.references a:hover {
  text-decoration: underline;
}

.foot {
  padding: 28px 0 48px;
  color: var(--muted);
  font-size: 0.94rem;
  border-top: 1px solid rgba(23, 49, 58, 0.06);
  margin-top: 24px;
}

.foot-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding-top: 24px;
}

.foot-link {
  color: var(--teal-strong);
  font-weight: 600;
}

.foot-link:hover {
  text-decoration: underline;
}

.copyright {
  color: var(--muted);
}

.plot-frame {
  padding: 8px 8px 4px;
  min-height: 420px;
  position: relative;
}

.plot-target {
  width: 100%;
  min-height: 420px;
}

.plot-status {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.96rem;
  padding: 20px;
  text-align: center;
  pointer-events: none;
  background: rgba(255, 255, 255, 0.6);
}

.plot-status--error {
  color: #a33;
  background: rgba(255, 236, 236, 0.85);
  pointer-events: auto;
}

.plot-retry {
  margin-left: 10px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid #a33;
  background: #ffffff;
  color: #a33;
  font-weight: 600;
  cursor: pointer;
}

.plot-retry:hover {
  background: #a33;
  color: #ffffff;
}

.placeholder-card {
  border-style: dashed;
  background: linear-gradient(180deg, rgba(223, 243, 240, 0.42) 0%, rgba(255, 255, 255, 0.9) 100%);
}

@media (max-width: 980px) {
  .hero,
  .lead-grid,
  .figure-grid,
  .takeaways,
  .two-col {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .navlinks {
    gap: 10px;
    font-size: 0.9rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
    width: 100%;
    padding-bottom: 4px;
  }
  .navlinks a {
    flex: 0 0 auto;
  }
  .navlinks a[href$=".pdf"] {
    display: none; /* keep overflow menu clean on small screens */
  }
}

@media (max-width: 700px) {
  .shell {
    width: min(var(--max), calc(100% - 18px));
  }

  .nav {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 10px 0;
  }

  .hero {
    padding: 32px 0 16px;
    gap: 14px;
  }

  main section {
    padding: 20px 0;
  }

  h1 {
    font-size: clamp(2rem, 8vw, 2.8rem);
    max-width: 22ch;
  }

  .section-head {
    margin-bottom: 10px;
  }

  .figure-card,
  .card {
    border-radius: 18px;
  }

  .figure-card.chart-card {
    padding: 12px 12px 16px;
  }

  .figure-card.chart-card h3 {
    font-size: 1rem;
  }

  .plot-frame {
    min-height: 340px;
    padding: 4px 2px 2px;
  }

  .plot-target {
    min-height: 340px;
  }

  .chart-lede {
    font-size: 1rem;
    padding: 12px 14px;
    margin: 14px 0 8px;
  }

  .chart-howto,
  .chart-note {
    font-size: 0.9rem;
    padding: 10px 12px;
  }

  .chart-label {
    font-size: 0.64rem;
    padding: 2px 8px;
  }

  .metrics {
    grid-template-columns: 1fr;
  }

  .detail-list div {
    flex-direction: column;
    gap: 4px;
  }

  .regime-toolbar {
    padding: 12px 14px;
  }

  .regime-button {
    padding: 8px 12px;
    font-size: 0.9rem;
  }

  .toolbar-top {
    flex-direction: column;
    align-items: flex-start;
  }

  .actions {
    flex-direction: column;
    align-items: stretch;
  }

  .btn {
    justify-content: center;
  }

  .foot-row {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 420px) {
  .plot-frame,
  .plot-target {
    min-height: 300px;
  }
  .chart-lede {
    font-size: 0.98rem;
    line-height: 1.55;
  }
}
