:root {
  color-scheme: light;
  --ink: #111414;
  --muted: #59615d;
  --paper: #f7f6f1;
  --paper-strong: #fffdf7;
  --line: rgba(17, 20, 20, 0.14);
  --fern: #2d6a4f;
  --cobalt: #3155a6;
  --clay: #b85c38;
  --gold: #c69c40;
  --shadow: 0 20px 70px rgba(17, 20, 20, 0.14);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
}

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

#signal-field {
  position: fixed;
  inset: 0;
  z-index: -2;
  width: 100vw;
  height: 100vh;
  background:
    radial-gradient(circle at 82% 14%, rgba(49, 85, 166, 0.2), transparent 29%),
    radial-gradient(circle at 12% 78%, rgba(45, 106, 79, 0.22), transparent 31%),
    var(--paper);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(17, 20, 20, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(17, 20, 20, 0.055) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: linear-gradient(to bottom, black 0%, black 48%, transparent 92%);
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px clamp(18px, 4vw, 52px);
  background: rgba(247, 246, 241, 0.78);
  border-bottom: 1px solid rgba(17, 20, 20, 0.08);
  backdrop-filter: blur(18px);
}

.brand,
.nav-links {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  font-weight: 760;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-strong);
  color: var(--fern);
  box-shadow: 0 10px 30px rgba(45, 106, 79, 0.12);
  font-size: 0.82rem;
}

.nav-links {
  gap: clamp(12px, 3vw, 30px);
  color: var(--muted);
  font-size: 0.94rem;
}

.nav-links a {
  padding: 8px 0;
  border-bottom: 1px solid transparent;
}

.nav-links a:hover {
  color: var(--ink);
  border-color: var(--ink);
}

.nav-links a.active {
  color: var(--ink);
  border-color: var(--fern);
}

.hero {
  min-height: 80vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(28px, 5vh, 48px);
  padding: 112px clamp(18px, 6vw, 88px) 28px;
}

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

.eyebrow,
.section-kicker,
.work-type {
  margin: 0 0 16px;
  color: var(--clay);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  max-width: 10ch;
  margin-bottom: 24px;
  font-size: clamp(4.2rem, 11vw, 9.5rem);
  line-height: 0.88;
  letter-spacing: 0;
}

.hero-text {
  max-width: 760px;
  color: #27302c;
  font-size: clamp(1.18rem, 2.4vw, 1.68rem);
  line-height: 1.45;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 760;
  transition:
    transform 170ms ease,
    border-color 170ms ease,
    background 170ms ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button.primary {
  background: var(--ink);
  color: var(--paper-strong);
  border-color: var(--ink);
}

.button.secondary {
  background: rgba(255, 253, 247, 0.72);
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  max-width: 920px;
}

.hero-meta span,
.status {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 247, 0.74);
  padding: 0 12px;
  color: #27302c;
  font-size: 0.9rem;
}

.section {
  padding: clamp(62px, 9vw, 112px) clamp(18px, 6vw, 88px);
  border-top: 1px solid rgba(17, 20, 20, 0.1);
}

.intro {
  padding-top: clamp(42px, 7vw, 78px);
}

.split,
.section-heading,
.notes-layout,
.contact-panel {
  max-width: 1180px;
  margin: 0 auto;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(260px, 0.72fr);
  gap: clamp(24px, 7vw, 96px);
  align-items: start;
}

h2 {
  font-size: clamp(2.1rem, 5vw, 4.6rem);
  line-height: 1;
  letter-spacing: 0;
}

.intro p,
.section-heading p,
.contact p,
.work-item p,
.focus-card p {
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.65;
}

.focus-band {
  background: rgba(255, 253, 247, 0.62);
}

.focus-band > h2,
.focus-band > .section-kicker {
  max-width: 1180px;
  margin-left: auto;
  margin-right: auto;
}

.focus-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  max-width: 1180px;
  margin: 34px auto 0;
}

.focus-card,
.work-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 247, 0.78);
  box-shadow: 0 18px 60px rgba(17, 20, 20, 0.07);
}

.focus-card {
  min-height: 286px;
  padding: 24px;
}

.card-index {
  color: var(--cobalt);
  font-weight: 820;
  margin-bottom: 74px;
}

h3 {
  margin-bottom: 12px;
  font-size: clamp(1.28rem, 2vw, 1.7rem);
  letter-spacing: 0;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 24px;
  margin-bottom: 28px;
}

.section-heading p {
  max-width: 360px;
  margin-bottom: 10px;
}

.work-list {
  display: grid;
  gap: 12px;
  max-width: 1180px;
  margin: 0 auto;
}

.work-item {
  display: grid;
  grid-template-columns: minmax(220px, 0.85fr) minmax(280px, 1.25fr) auto;
  gap: 24px;
  align-items: center;
  padding: 22px;
}

.work-type {
  margin-bottom: 8px;
  color: var(--cobalt);
}

.work-item h3,
.work-item p {
  margin-bottom: 0;
}

.notes {
  background: #edf3ef;
}

.notes-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.85fr) minmax(300px, 1fr);
  gap: clamp(32px, 7vw, 94px);
}

.note-links {
  display: grid;
  gap: 10px;
}

.note-links a {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 18px;
  align-items: center;
  min-height: 78px;
  padding: 18px;
  border: 1px solid rgba(17, 20, 20, 0.12);
  border-radius: 8px;
  background: rgba(255, 253, 247, 0.7);
  font-weight: 740;
}

.note-links span {
  color: var(--clay);
}

.contact-panel {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(260px, 0.8fr) auto;
  gap: clamp(22px, 5vw, 64px);
  align-items: center;
  padding: clamp(24px, 5vw, 46px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-strong);
  box-shadow: var(--shadow);
}

.contact-panel h2 {
  font-size: clamp(2rem, 4.3vw, 4rem);
  margin-bottom: 0;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 26px clamp(18px, 6vw, 88px);
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 0.9rem;
}

.cma-page h1 {
  max-width: 12ch;
  font-size: clamp(3.4rem, 8vw, 7.6rem);
}

.stocks-page h1 {
  max-width: 10ch;
  font-size: clamp(3.6rem, 8.5vw, 7.8rem);
}

.stock-hero,
.cma-hero {
  min-height: 72vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 28px;
  padding: 116px clamp(18px, 6vw, 88px) 34px;
}

.stock-title-row,
.cma-title-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  gap: clamp(28px, 6vw, 72px);
  align-items: end;
}

.refresh-panel,
.metric-card,
.impact-card,
.comp-detail-panel,
.source-note {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 247, 0.8);
  box-shadow: 0 18px 60px rgba(17, 20, 20, 0.07);
}

.refresh-panel {
  display: grid;
  gap: 7px;
  padding: 20px;
}

.refresh-panel span,
.metric-card span,
.comp-table span,
.impact-card span {
  color: var(--muted);
  font-size: 0.84rem;
}

.refresh-panel strong {
  color: var(--fern);
  font-size: 1.35rem;
}

.cma-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.cma-tabs a {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 247, 0.74);
  color: #27302c;
  font-weight: 760;
}

.cma-section .section-heading h2 {
  max-width: 760px;
}

.stock-section .section-heading h2 {
  max-width: 820px;
}

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

.metric-card {
  min-height: 230px;
  padding: 22px;
}

.metric-card strong {
  display: block;
  margin: 12px 0 14px;
  color: var(--ink);
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  line-height: 1;
}

.metric-card p,
.impact-card p,
.sources-layout p,
.source-note p,
.cma-disclaimer {
  color: var(--muted);
  line-height: 1.65;
}

.metric-card.emphasis {
  background: #edf3ef;
}

.ticker-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  max-width: 1180px;
  margin: 0 auto 14px;
}

.ticker-card,
.news-card,
.opportunity-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 247, 0.8);
  box-shadow: 0 18px 60px rgba(17, 20, 20, 0.07);
}

.ticker-card {
  cursor: pointer;
  min-height: 162px;
  padding: 20px;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.ticker-card:hover,
.ticker-card.is-focus {
  transform: translateY(-2px);
  border-color: rgba(45, 106, 79, 0.42);
  background: #edf3ef;
}

.ticker-card span,
.news-card span {
  color: var(--clay);
  font-size: 0.78rem;
  font-weight: 820;
  text-transform: uppercase;
}

.ticker-card strong {
  display: block;
  margin: 26px 0 10px;
  color: var(--ink);
  font-size: clamp(1.9rem, 3vw, 2.6rem);
  line-height: 1;
}

.ticker-card p,
.news-card p,
.opportunity-card p {
  color: var(--muted);
  line-height: 1.58;
}

.stock-dashboard {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 14px;
  max-width: 1180px;
  margin: 0 auto;
  align-items: stretch;
}

.stock-chart-frame {
  min-height: 430px;
}

.stock-detail-panel .alert-stack {
  display: grid;
  gap: 8px;
  margin-top: auto;
  padding-top: 24px;
}

.alert-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  font-size: 0.84rem;
  font-weight: 760;
}

.alert-pill.risk {
  background: rgba(184, 92, 56, 0.12);
  color: #7a341d;
}

.alert-pill.watch {
  background: rgba(49, 85, 166, 0.12);
  color: #243f7b;
}

.alert-pill.opportunity {
  background: rgba(45, 106, 79, 0.12);
  color: var(--fern);
}

.news-grid,
.opportunity-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  max-width: 1180px;
  margin: 0 auto;
}

.news-card,
.opportunity-card {
  min-height: 292px;
  padding: 22px;
}

.news-card h3,
.opportunity-card h3 {
  margin-top: 42px;
}

.news-card a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  margin-top: 8px;
  border-bottom: 1px solid var(--fern);
  color: var(--fern);
  font-weight: 760;
}

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

.opportunity-score {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  color: var(--cobalt);
  font-size: 0.84rem;
  font-weight: 820;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 14px;
  max-width: 1180px;
  margin: 0 auto;
  align-items: stretch;
}

.chart-panel {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 247, 0.78);
  box-shadow: 0 18px 60px rgba(17, 20, 20, 0.07);
}

.chart-toolbar,
.band-labels,
.scenario-output {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.chart-toolbar {
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.segmented-control {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(247, 246, 241, 0.78);
}

.segmented-control button {
  min-height: 36px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 760;
  padding: 0 12px;
}

.segmented-control.compact button {
  padding: 0 10px;
}

.segmented-control button.is-active {
  background: var(--ink);
  color: var(--paper-strong);
}

.valuation-band {
  margin-bottom: 18px;
}

.band-labels {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.86rem;
}

.band-labels strong {
  color: var(--fern);
}

.range-track {
  position: relative;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(184, 92, 56, 0.12), rgba(45, 106, 79, 0.2)),
    rgba(255, 253, 247, 0.78);
}

.range-fill {
  position: absolute;
  inset: 13px 12% 13px 12%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--clay), var(--fern), var(--cobalt));
}

.range-marker {
  position: absolute;
  top: 17px;
  transform: translateX(-50%);
  width: 12px;
  height: 12px;
}

.range-marker::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 10px;
  height: 10px;
  transform: translateX(-50%);
  border: 2px solid var(--paper-strong);
  border-radius: 50%;
  background: var(--ink);
  box-shadow: 0 0 0 1px var(--line);
}

.subject-marker {
  left: 32%;
}

.zestimate-marker {
  left: 34%;
}

.zestimate-marker::before {
  background: var(--cobalt);
}

.range-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.range-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.range-legend i {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 999px;
}

.subject-dot {
  background: var(--ink);
}

.zestimate-dot {
  background: var(--cobalt);
}

.chart-frame {
  overflow-x: auto;
  border-top: 1px solid rgba(17, 20, 20, 0.1);
  padding-top: 12px;
}

.cma-chart {
  display: block;
  width: 100%;
  min-width: 720px;
  height: auto;
}

.chart-label {
  fill: var(--ink);
  font-size: 14px;
  font-weight: 760;
}

.chart-sub-label,
.chart-axis-label {
  fill: var(--muted);
  font-size: 12px;
}

.chart-value {
  fill: var(--ink);
  font-size: 13px;
  font-weight: 760;
}

.chart-track {
  fill: rgba(17, 20, 20, 0.07);
}

.chart-grid-line,
.chart-zero-line {
  stroke: rgba(17, 20, 20, 0.12);
  stroke-width: 1;
}

.chart-zero-line {
  stroke: rgba(17, 20, 20, 0.32);
}

.chart-row {
  cursor: pointer;
}

.chart-row .chart-bar {
  opacity: 0.78;
  transition:
    opacity 160ms ease,
    filter 160ms ease;
}

.chart-row:hover .chart-bar,
.chart-row.is-selected .chart-bar {
  opacity: 1;
  filter: drop-shadow(0 6px 10px rgba(17, 20, 20, 0.16));
}

.comp-detail-panel {
  display: flex;
  flex-direction: column;
  padding: 22px;
}

.comp-detail-panel > span {
  color: var(--clay);
  font-size: 0.78rem;
  font-weight: 820;
  text-transform: uppercase;
}

.comp-detail-panel h3 {
  margin-top: 16px;
}

.comp-detail-panel dl {
  display: grid;
  gap: 14px;
  margin: 0;
}

.comp-detail-panel dt,
.scenario-control label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 780;
  text-transform: uppercase;
}

.comp-detail-panel dd {
  margin: 4px 0 0;
  color: #27302c;
  line-height: 1.5;
}

.scenario-control {
  display: grid;
  gap: 12px;
  margin-top: auto;
  padding-top: 24px;
}

.scenario-control input {
  accent-color: var(--fern);
  width: 100%;
}

.scenario-output span {
  color: var(--muted);
  font-weight: 760;
}

.scenario-output strong {
  color: var(--fern);
  font-size: 1.2rem;
}

.table-wrap {
  max-width: 1180px;
  margin: 0 auto;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-strong);
  box-shadow: 0 18px 60px rgba(17, 20, 20, 0.07);
}

.comp-table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
}

.comp-table th,
.comp-table td {
  padding: 18px;
  border-bottom: 1px solid rgba(17, 20, 20, 0.1);
  text-align: left;
  vertical-align: top;
}

.comp-table th {
  color: var(--clay);
  font-size: 0.78rem;
  letter-spacing: 0;
  text-transform: uppercase;
}

.comp-table td {
  color: #27302c;
  line-height: 1.45;
}

.comp-table tbody tr:last-child td {
  border-bottom: 0;
}

.comp-table tbody tr {
  cursor: pointer;
}

.comp-table tbody tr.is-selected td {
  background: rgba(45, 106, 79, 0.09);
}

.impact-band {
  background: #edf3ef;
}

.impact-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  max-width: 1180px;
  margin: 0 auto;
}

.impact-card {
  min-height: 310px;
  padding: 24px;
}

.impact-card > span {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin-bottom: 54px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--cobalt);
  font-weight: 820;
}

.sources-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(280px, 0.8fr);
  gap: clamp(28px, 6vw, 72px);
  max-width: 1180px;
  margin: 0 auto;
}

.source-list {
  display: grid;
  gap: 10px;
}

.source-list a {
  display: flex;
  align-items: center;
  min-height: 52px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 247, 0.78);
  color: #27302c;
  font-weight: 740;
}

.source-list a:hover,
.cma-tabs a:hover {
  border-color: var(--ink);
}

.source-note,
.cma-disclaimer {
  max-width: 1180px;
  margin: 28px auto 0;
}

.source-note {
  padding: 18px 20px;
}

.source-note summary {
  cursor: pointer;
  color: var(--fern);
  font-weight: 780;
}

.source-note p,
.cma-disclaimer {
  font-size: 0.94rem;
}

@media (max-width: 900px) {
  .site-header {
    position: sticky;
  }

  .hero {
    min-height: 76vh;
    padding-top: 68px;
  }

  .split,
  .focus-grid,
  .metric-grid,
  .impact-grid,
  .ticker-grid,
  .stock-dashboard,
  .news-grid,
  .opportunity-grid,
  .dashboard-grid,
  .stock-title-row,
  .cma-title-row,
  .sources-layout,
  .section-heading,
  .notes-layout,
  .contact-panel,
  .work-item {
    grid-template-columns: 1fr;
  }

  .section-heading {
    align-items: start;
  }

  .work-item {
    gap: 14px;
  }

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

@media (max-width: 620px) {
  .site-header {
    align-items: flex-start;
  }

  .brand span:last-child {
    display: none;
  }

  .nav-links {
    gap: 12px;
    font-size: 0.86rem;
  }

  h1 {
    font-size: clamp(3.3rem, 18vw, 5rem);
  }

  .contact-panel .button {
    width: 100%;
  }

  .site-footer {
    flex-direction: column;
  }

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

  .ticker-card,
  .news-card,
  .opportunity-card {
    min-height: auto;
  }

  .table-wrap {
    overflow: visible;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .comp-table,
  .comp-table tbody,
  .comp-table tr,
  .comp-table td {
    display: block;
    width: 100%;
    min-width: 0;
  }

  .comp-table thead {
    display: none;
  }

  .comp-table tr {
    margin-bottom: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--paper-strong);
    box-shadow: 0 18px 50px rgba(17, 20, 20, 0.07);
    overflow: hidden;
  }

  .comp-table td {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 14px;
    padding: 14px 16px;
  }

  .comp-table td::before {
    content: attr(data-label);
    color: var(--clay);
    font-size: 0.72rem;
    font-weight: 820;
    text-transform: uppercase;
  }
}

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

  .button {
    transition: none;
  }
}
