:root {
  --navy-950: #07131f;
  --navy-900: #0b1b2a;
  --navy-800: #10283c;
  --navy-700: #173d59;
  --ink: #14202b;
  --muted: #657384;
  --line: #d9e0e6;
  --paper: #f4f1eb;
  --white: #fffefa;
  --blue: #2b6cb0;
  --teal: #277a78;
  --amber: #b97825;
  --red: #a54a4a;
  --slate: #76889b;
  --shadow: 0 12px 35px rgba(12, 29, 43, 0.08);
  --radius: 3px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Segoe UI", "Aptos", Arial, sans-serif;
  font-variant-numeric: tabular-nums;
}

button,
select {
  font: inherit;
}

.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 30;
  height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px 0 22px;
  background: #000;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.brand img {
  display: block;
  width: 250px;
  max-height: 52px;
  object-fit: contain;
}

.topbar-meta,
.status-line {
  display: flex;
  align-items: center;
  gap: 12px;
}

.status-line {
  color: #dbe5ec;
  font-size: 12px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 0 4px rgba(185, 120, 37, 0.15);
}

.status-dot.pass {
  background: #66b89c;
  box-shadow: 0 0 0 4px rgba(102, 184, 156, 0.15);
}

.language-button {
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  background: transparent;
  padding: 7px 10px;
  cursor: pointer;
}

.sidebar {
  position: fixed;
  inset: 74px auto 0 0;
  z-index: 20;
  width: 230px;
  display: flex;
  flex-direction: column;
  padding: 28px 18px 22px;
  background: var(--navy-950);
  color: #fff;
  overflow-y: auto;
}

.sidebar-eyebrow,
.eyebrow {
  margin: 0 0 14px;
  color: #7fa0b7;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

#primary-nav {
  display: grid;
  gap: 3px;
}

#primary-nav a {
  color: #b9c7d1;
  text-decoration: none;
  padding: 9px 11px;
  border-left: 2px solid transparent;
  font-size: 13px;
}

#primary-nav a:hover,
#primary-nav a.active {
  color: #fff;
  border-left-color: #73a8c9;
  background: rgba(255, 255, 255, 0.06);
}

.sidebar-footer {
  margin-top: auto;
  padding: 18px 10px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  color: #71899a;
  font-size: 10px;
  line-height: 1.35;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

#app {
  min-height: 100vh;
  margin-left: 230px;
  padding-top: 74px;
}

.page-shell {
  max-width: 1440px;
  margin: 0 auto;
  padding: 48px 48px 72px;
}

.page-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 32px;
  align-items: end;
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid #c9d1d8;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 950px;
  margin-bottom: 10px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(38px, 5vw, 68px);
  font-weight: 400;
  line-height: 0.98;
  letter-spacing: -0.035em;
}

h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 27px;
  font-weight: 400;
}

h3 {
  font-size: 13px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.dek {
  max-width: 850px;
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.55;
}

.as-of-card {
  min-width: 205px;
  padding: 12px 0 2px 24px;
  border-left: 1px solid #aeb9c2;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.as-of-card strong {
  display: block;
  color: var(--ink);
  font-size: 13px;
}

.hero-thesis {
  margin-bottom: 24px;
  padding: 30px 34px;
  background: var(--navy-900);
  color: #fff;
  box-shadow: var(--shadow);
}

.hero-thesis .eyebrow {
  color: #8fb4cb;
}

.hero-thesis h2 {
  max-width: 1040px;
  font-size: clamp(27px, 3vw, 42px);
  line-height: 1.17;
}

.hero-thesis p:last-child {
  max-width: 980px;
  margin-bottom: 0;
  color: #c9d6de;
  line-height: 1.6;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0 28px;
}

.metric-card,
.panel,
.research-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.metric-card {
  min-height: 146px;
  padding: 18px;
  border-top: 3px solid var(--slate);
}

.metric-card.growth {
  border-top-color: var(--teal);
}

.metric-card.inflation {
  border-top-color: var(--amber);
}

.metric-card.liquidity {
  border-top-color: var(--blue);
}

.metric-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.metric-value {
  margin: 10px 0 7px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 30px;
}

.metric-detail {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.two-column,
.three-column {
  display: grid;
  gap: 16px;
  margin: 18px 0;
}

.two-column {
  grid-template-columns: minmax(0, 1.5fr) minmax(300px, 0.8fr);
}

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

.panel {
  min-width: 0;
  padding: 22px;
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.panel-heading p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.chart {
  min-height: 360px;
}

.chart.compact {
  min-height: 280px;
}

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

.research-card {
  padding: 22px;
}

.research-card header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.research-card h3 {
  margin-bottom: 5px;
  color: var(--navy-800);
}

.research-card .module-axis {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.module-number {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 28px;
}

.module-copy {
  min-height: 68px;
  color: #43505c;
  font-size: 13px;
  line-height: 1.55;
}

.module-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.module-meta span {
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
}

.module-meta strong {
  display: block;
  margin-top: 3px;
  color: var(--ink);
  font-size: 12px;
}

.pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 4px 8px;
  border-radius: 99px;
  color: #fff;
  background: var(--slate);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.pill.positive {
  background: var(--teal);
}

.pill.negative {
  background: var(--red);
}

.pill.neutral {
  background: var(--slate);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.data-table th,
.data-table td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

.data-table th {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.data-table tbody tr:hover {
  background: #f4f7f8;
}

.table-wrap {
  overflow-x: auto;
}

.change-list,
.watch-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.change-list li,
.watch-list li {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  line-height: 1.45;
}

.change-list time,
.watch-list strong {
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
}

.heatmap-grid {
  overflow-x: auto;
}

.heatmap-table {
  border-collapse: separate;
  border-spacing: 2px;
  font-size: 10px;
}

.heatmap-table td {
  min-width: 13px;
  height: 13px;
  padding: 0;
}

.heatmap-table th {
  position: sticky;
  left: 0;
  z-index: 2;
  min-width: 170px;
  padding-right: 10px;
  background: var(--white);
  text-align: left;
  font-weight: 500;
}

.state-bullish {
  background: var(--blue);
}

.state-neutral {
  background: #c2cbd2;
}

.state-bearish {
  background: var(--red);
}

.state-pending {
  background: repeating-linear-gradient(
    135deg,
    #e1e5e8,
    #e1e5e8 4px,
    #f5f6f7 4px,
    #f5f6f7 8px
  );
}

.download-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 13px;
  border: 1px solid var(--navy-800);
  color: var(--navy-800);
  background: transparent;
  text-decoration: none;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.button-link:hover {
  color: #fff;
  background: var(--navy-800);
}

.disclosure {
  margin-top: 22px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.loading-state {
  min-height: calc(100vh - 74px);
  display: grid;
  place-content: center;
  color: var(--muted);
}

.loading-rule {
  width: 180px;
  height: 2px;
  margin-bottom: 15px;
  background: linear-gradient(90deg, transparent, var(--blue), transparent);
  animation: pulse 1.4s infinite;
}

.error-state {
  max-width: 720px;
  margin: 80px auto;
  padding: 30px;
  background: #fff;
  border-left: 4px solid var(--red);
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.25;
  }
  50% {
    opacity: 1;
  }
}

@media (max-width: 1080px) {
  .metric-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .two-column,
  .three-column {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .topbar {
    height: 64px;
    padding: 0 14px;
  }

  .brand img {
    width: 185px;
  }

  .status-line {
    display: none;
  }

  .sidebar {
    inset: 64px 0 auto 0;
    width: auto;
    height: 49px;
    padding: 0 10px;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .sidebar-eyebrow,
  .sidebar-footer {
    display: none;
  }

  #primary-nav {
    display: flex;
    width: max-content;
  }

  #primary-nav a {
    padding: 15px 10px 11px;
    border-left: 0;
    border-bottom: 2px solid transparent;
  }

  #primary-nav a.active {
    border-left: 0;
    border-bottom-color: #73a8c9;
  }

  #app {
    margin-left: 0;
    padding-top: 113px;
  }

  .page-shell {
    padding: 30px 17px 55px;
  }

  .page-heading {
    grid-template-columns: 1fr;
  }

  .as-of-card {
    padding-left: 0;
    border-left: 0;
  }

  .metric-grid,
  .research-grid {
    grid-template-columns: 1fr;
  }

  .hero-thesis {
    padding: 24px 20px;
  }
}
