:root {
  color-scheme: light;
  --ink: #142126;
  --muted: #526269;
  --line: #d8e0dc;
  --paper: #f7f8f5;
  --surface: #ffffff;
  --green: #1d6b53;
  --gold: #b67a1f;
  --blue: #315f8f;
  --red: #9b3d32;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(20, 33, 38, 0.05) 1px, transparent 1px),
    linear-gradient(180deg, rgba(20, 33, 38, 0.05) 1px, transparent 1px),
    var(--paper);
  background-size: 44px 44px;
}

.shell {
  min-height: 100vh;
  display: block;
}

.hero {
  width: 100%;
  min-height: 100vh;
  padding: 32px clamp(20px, 5vw, 76px) 56px;
  display: flex;
  flex-direction: column;
  /* Topbar pinned to top, hero-grid pinned to bottom of the viewport.
     Each column inside the grid is bottom-aligned so the headline copy
     hugs the bottom-left and the chart card hugs the bottom-right. */
  justify-content: space-between;
  gap: clamp(54px, 11vh, 118px);
}

.topbar {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-weight: 700;
}

.brand-logo {
  width: 104px;
  height: 104px;
  object-fit: contain;
}

.brand-name {
  font-size: 18px;
}

.portal-link {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.76);
  color: var(--ink);
  padding: 0 18px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 800;
}

.portal-link:hover {
  border-color: var(--green);
  color: var(--green);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 560px);
  /* Both columns bottom-align so the headline (left) and the chart card
     (right) share the bottom edge of the hero. Combined with .hero's
     justify-content: space-between, the whole grid hugs the viewport
     bottom while the topbar stays pinned to the top. */
  align-items: end;
  gap: clamp(28px, 5vw, 76px);
  width: 100%;
}

.hero-copy {
  max-width: 790px;
}

.eyebrow {
  margin: 0 0 18px;
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  max-width: 13ch;
  font-size: clamp(50px, 7.2vw, 96px);
  line-height: 0.95;
  letter-spacing: 0;
}

.lede {
  max-width: 670px;
  margin: 26px 0 0;
  color: var(--muted);
  font-size: clamp(18px, 2vw, 22px);
  line-height: 1.55;
}

.market-status {
  width: min(100%, 720px);
  margin-top: 34px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.76);
}

.market-status div {
  min-height: 78px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 7px;
  padding: 14px 16px;
  border-left: 1px solid var(--line);
}

.market-status div:first-child {
  border-left: 4px solid var(--green);
}

.market-status div:nth-child(2) {
  border-left: 4px solid var(--blue);
}

.market-status div:nth-child(3) {
  border-left: 4px solid var(--gold);
}

.market-status div:nth-child(4) {
  border-left: 4px solid var(--red);
}

.market-status strong {
  font-size: 18px;
  line-height: 1;
}

.market-status span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.primary-link {
  display: inline-flex;
  margin-top: 34px;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 20px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: #ffffff;
  text-decoration: none;
  font-weight: 800;
}

.primary-link:hover {
  background: var(--green);
  border-color: var(--green);
}

.signal-panel {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 24px 60px rgba(20, 33, 38, 0.10);
  padding: 24px;
}

.panel-topline,
.metric-grid {
  display: grid;
  gap: 14px;
}

.panel-topline {
  grid-template-columns: 1fr auto;
  align-items: center;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}

.panel-topline strong {
  color: var(--green);
  text-align: right;
}

.gauge-row {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 22px;
  align-items: end;
  min-height: 210px;
  padding: 26px 0;
}

.gauge {
  aspect-ratio: 1;
  border: 14px solid #d9e7df;
  border-top-color: var(--green);
  border-right-color: var(--gold);
  border-radius: 50%;
  display: grid;
  place-content: center;
  text-align: center;
}

.gauge-value {
  font-size: 42px;
  font-weight: 900;
}

.gauge-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.sparkline {
  height: 180px;
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 8px;
  align-items: end;
}

.sparkline span {
  display: block;
  min-height: 18px;
  background: var(--blue);
}

.sparkline span:nth-child(3n) {
  background: var(--gold);
}

.sparkline span:nth-child(7) {
  background: var(--green);
}

.metric-grid {
  grid-template-columns: repeat(3, 1fr);
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.metric-grid div {
  min-height: 92px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-left: 4px solid var(--line);
  padding: 10px 12px;
  background: #f7faf8;
}

.metric-grid div:nth-child(1) {
  border-color: var(--gold);
}

.metric-grid div:nth-child(2) {
  border-color: var(--green);
}

.metric-grid div:nth-child(3) {
  border-color: var(--red);
}

.metric-grid span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.metric-grid strong {
  font-size: 17px;
}

.evidence-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 14px;
}

.evidence-strip span {
  min-height: 64px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  border: 1px solid var(--line);
  background: #eef5f1;
  color: var(--ink);
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 800;
}

.evidence-strip small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

@media (max-width: 860px) {
  .hero {
    min-height: auto;
    padding-top: 22px;
    justify-content: flex-start;
    gap: 48px;
  }

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

  .topbar {
    align-items: flex-start;
  }

  h1 {
    max-width: 11ch;
    font-size: clamp(44px, 13vw, 68px);
  }

  .signal-panel {
    padding: 18px;
  }

  .gauge-row {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .gauge {
    width: min(160px, 58vw);
  }

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

  .evidence-strip {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 560px) {
  .market-status {
    grid-template-columns: 1fr;
  }
}
