:root {
  color-scheme: light;
  --bg: #f7f5ef;
  --surface: #ffffff;
  --surface-muted: #f0eee7;
  --text: #1b1f23;
  --muted: #5f6972;
  --border: #d8d3c8;
  --accent: #0f766e;
  --accent-strong: #0b5f59;
  --blue: #2563eb;
  --red: #b42318;
  --green: #067647;
  --shadow: 0 18px 60px rgba(18, 24, 31, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

a {
  color: inherit;
}

.site-header,
.site-footer {
  align-items: center;
  display: flex;
  gap: 20px;
  justify-content: space-between;
  margin: 0 auto;
  max-width: 1180px;
  padding: 20px;
}

.brand {
  font-weight: 750;
}

.site-header nav,
.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.site-header a,
.site-footer a,
.secondary-link {
  color: var(--muted);
  font-size: 14px;
  text-decoration: none;
}

main {
  margin: 0 auto;
  max-width: 1180px;
  padding: 18px 20px 54px;
}

.hero {
  align-items: flex-start;
  display: flex;
  gap: 28px;
  justify-content: space-between;
  padding: 34px 0 24px;
}

.hero h1 {
  font-size: clamp(36px, 6vw, 68px);
  line-height: 1.02;
  margin: 0;
  max-width: 920px;
}

.lede {
  color: var(--muted);
  font-size: 18px;
  margin: 18px 0 0;
  max-width: 760px;
}

.helper-text {
  color: var(--muted);
  font-size: 14px;
  margin: -4px 0 16px;
}

.eyebrow {
  color: var(--accent);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0;
  margin: 0 0 10px;
  text-transform: uppercase;
}

.workspace,
.article-layout {
  align-items: start;
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(270px, 340px) 1fr;
}

.article-layout {
  grid-template-columns: minmax(260px, 360px) 1fr;
}

.panel,
.report-notes,
.content-page,
.band {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.panel,
.report-notes,
.content-page {
  padding: 22px;
}

.controls {
  position: sticky;
  top: 14px;
}

.controls h2,
.panel h2,
.band h2,
.content-page h1,
.report-notes h2 {
  margin: 0 0 14px;
}

label {
  display: grid;
  gap: 8px;
  margin: 0 0 16px;
}

label > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

select,
input,
textarea {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font: inherit;
  padding: 10px 12px;
  width: 100%;
}

textarea {
  min-height: 130px;
  resize: vertical;
}

.chips {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, 1fr);
}

.chip {
  margin: 0;
}

.chip input {
  inline-size: 1px;
  opacity: 0;
  position: absolute;
}

.chip span {
  align-items: center;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  display: flex;
  font-size: 13px;
  font-weight: 750;
  justify-content: center;
  min-height: 38px;
  padding: 8px 10px;
}

.chip input:checked + span {
  background: #d8f3ef;
  border-color: var(--accent);
  color: var(--accent-strong);
}

.button,
.ghost-button {
  align-items: center;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  font-weight: 750;
  justify-content: center;
  min-height: 42px;
  padding: 10px 14px;
  text-decoration: none;
}

.button {
  background: var(--accent);
  border: 1px solid var(--accent);
  color: #fff;
  width: 100%;
}

.button:hover {
  background: var(--accent-strong);
}

.ghost-button {
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text);
}

.section-header,
.band {
  align-items: center;
  display: flex;
  gap: 18px;
  justify-content: space-between;
}

.band {
  margin-top: 20px;
  padding: 22px;
}

.band p {
  color: var(--muted);
  margin: 0;
}

.band .button {
  flex: 0 0 auto;
  width: auto;
}

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

.inline-cta {
  align-items: center;
  background: #f4fbf9;
  border: 1px solid #b8ddd7;
  border-radius: 8px;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  margin: 16px 0;
  padding: 14px;
}

.inline-cta span {
  color: var(--muted);
  display: block;
  font-size: 13px;
  margin-top: 2px;
}

.metric {
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 14px;
}

.metric span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 700;
}

.metric strong {
  display: block;
  font-size: 24px;
  margin-top: 4px;
}

.chart-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr;
}

.chart-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
}

.chart-title {
  align-items: baseline;
  display: flex;
  justify-content: space-between;
}

.chart-title h3,
.table-wrap h3 {
  margin: 0 0 10px;
}

.chart-title span,
.fine-print {
  color: var(--muted);
  font-size: 12px;
}

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

.axis-label,
.axis-title {
  fill: var(--muted);
  font-size: 11px;
}

.axis-title {
  font-weight: 700;
}

.strategy-line,
.benchmark-line,
.drawdown-line,
.grid-line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.strategy-line {
  stroke: var(--accent);
  stroke-width: 3;
}

.benchmark-line {
  stroke: var(--blue);
  stroke-width: 2;
}

.drawdown-line {
  stroke: var(--red);
  stroke-width: 3;
}

.grid-line {
  stroke: var(--border);
  stroke-width: 1;
}

.legend {
  align-items: center;
  color: var(--muted);
  display: flex;
  gap: 8px;
  font-size: 12px;
}

.strategy-dot,
.benchmark-dot,
.drawdown-dot {
  border-radius: 999px;
  display: inline-block;
  height: 10px;
  width: 10px;
}

.strategy-dot {
  background: var(--accent);
}

.benchmark-dot {
  background: var(--blue);
  margin-left: 10px;
}

.drawdown-dot {
  background: var(--red);
}

.table-wrap {
  margin-top: 16px;
  overflow-x: auto;
}

table {
  border-collapse: collapse;
  width: 100%;
}

th,
td {
  border-bottom: 1px solid var(--border);
  padding: 9px 8px;
  text-align: right;
}

th:first-child,
td:first-child {
  text-align: left;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.positive {
  color: var(--green);
}

.negative {
  color: var(--red);
}

.strategy-summary {
  background: #fbfaf6;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-top: 16px;
  padding: 14px;
}

.strategy-summary p {
  margin: 0 0 8px;
}

.report-notes {
  position: sticky;
  top: 14px;
}

.report-notes ul {
  padding-left: 20px;
}

.content-page {
  margin: 28px auto;
  max-width: 820px;
}

.content-page p,
.content-page li {
  color: var(--muted);
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.form-actions .button {
  width: auto;
}

@media (max-width: 860px) {
  .hero,
  .section-header,
  .band,
  .site-header,
  .site-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .workspace,
  .article-layout {
    grid-template-columns: 1fr;
  }

  .controls,
  .report-notes {
    position: static;
  }

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

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

@media (max-width: 560px) {
  main {
    padding-inline: 12px;
  }

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

  .metric strong {
    font-size: 20px;
  }
}
