
.site-main {
  min-height: 100vh;
  background: #f7f8f5;
  color: #12120f;
}

.shell {
  max-width: 1280px;
  margin: 0 auto;
  padding-left: 20px;
  padding-right: 20px;
}

.hero-inner {
  padding-top: 24px;
  padding-bottom: 24px;
}

.body-grid {
  display: grid;
  gap: 20px;
  padding-top: 20px;
  padding-bottom: 20px;
}

@media (min-width: 1024px) {
  .shell {
    padding-left: 32px;
    padding-right: 32px;
  }

  .body-grid {
    grid-template-columns: 280px minmax(0, 1fr);
  }
}

:root {
  --background: #f7f8f5;
  --foreground: #12120f;
  --ink-soft: #575752;
  --line: #d9d7cf;
  --panel: #fffdfa;
  --teal: #006b61;
  --teal-soft: #e3f4ef;
  --red: #d94f3d;
  --amber: #c98518;
  --blue: #2d638b;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.hero-band {
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(90deg, rgba(0, 107, 97, 0.08), transparent 42%),
    linear-gradient(180deg, #fffdfa, #f3f4ef);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: end;
}

.course-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border: 1px solid rgba(0, 107, 97, 0.3);
  border-radius: 6px;
  background: var(--teal-soft);
  color: #004b44;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  padding: 8px 10px;
}

h1 {
  margin: 12px 0 8px;
  max-width: 780px;
  font-size: clamp(30px, 3.2vw, 40px);
  line-height: 1.08;
  letter-spacing: 0;
}

.hero-copy {
  margin: 0;
  max-width: 840px;
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1.7;
}

.stats-cluster {
  display: grid;
  grid-template-columns: repeat(3, minmax(92px, 1fr));
  gap: 10px;
  min-width: 330px;
}

.stats-cluster div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 250, 0.82);
  padding: 12px 14px;
}

.stats-cluster strong {
  display: block;
  font-size: 25px;
  line-height: 1;
}

.stats-cluster span {
  display: block;
  margin-top: 5px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.topic-tabs {
  display: flex;
  gap: 8px;
  margin-top: 22px;
  overflow-x: auto;
  padding-bottom: 10px;
  scrollbar-color: #85837b transparent;
}

.topic-tabs button,
.subtopic-list button,
.question-actions button {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  color: var(--foreground);
  cursor: pointer;
  font: inherit;
}

.topic-tabs button {
  flex: 0 0 auto;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
}

.topic-tabs button.active {
  border-color: #111;
  background: #111;
  color: #fff;
}

.subtopic-panel,
.concept-card,
.question-card,
.links-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 1px 2px rgba(18, 18, 15, 0.05);
}

.subtopic-panel {
  position: sticky;
  top: 14px;
  align-self: start;
  max-height: calc(100vh - 28px);
  overflow: hidden;
  padding: 12px;
}

.panel-title {
  display: grid;
  gap: 3px;
  border-bottom: 1px solid var(--line);
  padding: 4px 4px 12px;
}

.panel-title span {
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.panel-title strong {
  font-size: 15px;
  line-height: 1.3;
}

.subtopic-list {
  display: grid;
  gap: 7px;
  max-height: calc(100vh - 110px);
  overflow-y: auto;
  padding-top: 12px;
  scrollbar-width: thin;
}

.subtopic-list button {
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 8px;
  align-items: center;
  min-height: 43px;
  padding: 8px 10px;
  text-align: left;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.25;
}

.subtopic-list button span {
  color: var(--teal);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
}

.subtopic-list button.active {
  border-color: var(--teal);
  background: var(--teal);
  color: #fff;
}

.subtopic-list button.active span {
  color: #bde8df;
}

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

.concept-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 24px;
  min-height: 286px;
  padding: 22px;
}

.concept-copy {
  min-width: 0;
}

.crib-label {
  margin: 0 0 9px;
  color: #d51b0f;
  font-size: 13px;
  font-weight: 850;
}

h2 {
  margin: 0;
  font-size: clamp(24px, 2.6vw, 34px);
  line-height: 1.08;
  letter-spacing: 0;
}

.concept-copy > p:not(.crib-label) {
  margin: 14px 0 0;
  max-width: 760px;
  color: #252520;
  font-size: 16px;
  line-height: 1.75;
}

.fact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 20px;
  max-width: 560px;
}

.fact-grid span {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfaf5;
  padding: 9px 11px;
  color: #282822;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.34;
}

.visual-panel {
  display: grid;
  align-content: center;
  min-height: 238px;
  border: 1px solid #d8d1c3;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(0, 107, 97, 0.06), transparent 48%),
    #fffaf3;
  padding: 14px;
}

.visual-panel p {
  margin: 10px 6px 0;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
  text-align: center;
}

.visual-panel svg {
  display: block;
  width: 100%;
  min-height: 185px;
}

.axis,
.mark,
.branch {
  stroke: #8a887f;
  stroke-width: 2;
}

.bar,
.box,
.block,
.beam {
  fill: rgba(0, 107, 97, 0.22);
  stroke: rgba(0, 107, 97, 0.72);
  stroke-width: 1.5;
}

.bar.red,
.red-dot {
  fill: var(--red);
}

.bar.amber {
  fill: var(--amber);
}

.dot,
.pivot {
  fill: var(--teal);
}

.trend,
.curve,
.vector,
.force {
  fill: none;
  stroke: var(--teal);
  stroke-linecap: round;
  stroke-width: 4;
}

.curve {
  stroke-width: 3;
}

.component,
.stem {
  fill: none;
  stroke: var(--amber);
  stroke-dasharray: 5 5;
  stroke-width: 2.5;
}

.teal-stroke {
  stroke: var(--teal);
}

.red-stroke {
  stroke: var(--red);
}

.amber-stroke {
  stroke: var(--amber);
}

.sample-space {
  fill: rgba(45, 99, 139, 0.06);
  stroke: #bbb5aa;
}

.venn-a {
  fill: rgba(0, 107, 97, 0.22);
  stroke: var(--teal);
  stroke-width: 2;
}

.venn-b {
  fill: rgba(217, 79, 61, 0.2);
  stroke: var(--red);
  stroke-width: 2;
}

.area,
.tail {
  fill: rgba(217, 79, 61, 0.18);
}

.arrow-fill {
  fill: var(--teal);
}

.visual-panel text {
  fill: #383832;
  font-size: 12px;
  font-weight: 800;
}

.population-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 8px;
  margin: 12px auto 0;
  max-width: 290px;
}

.population-grid span {
  aspect-ratio: 1;
  border-radius: 50%;
  background: #c9cbc5;
}

.population-grid span.selected {
  background: var(--red);
  box-shadow: 0 0 0 4px rgba(217, 79, 61, 0.16);
}

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

.question-card {
  display: grid;
  align-content: start;
  min-height: 250px;
  padding: 18px;
}

.question-card.hard {
  border-top: 4px solid var(--red);
}

.question-card:not(.hard) {
  border-top: 4px solid var(--teal);
}

.question-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.question-head p {
  margin: 0;
  color: var(--teal);
  font-size: 14px;
  font-weight: 900;
}

.hard .question-head p {
  color: var(--red);
}

.question-head span {
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.question-prompt {
  margin: 12px 0 0;
  color: #1f1f1a;
  font-size: 15px;
  line-height: 1.65;
}

.working-lines {
  display: grid;
  gap: 8px;
  min-height: 102px;
  margin-top: 14px;
}

.working-lines p {
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 8px;
  margin: 0;
  border-left: 3px solid rgba(0, 107, 97, 0.22);
  padding: 6px 8px;
  background: #f8f8f2;
  color: #23231e;
  font-size: 14px;
  line-height: 1.5;
}

.working-lines span {
  color: var(--teal);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-weight: 900;
}

.question-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.question-actions button {
  min-height: 38px;
  padding: 8px 12px;
  background: #111;
  color: #fff;
  font-size: 13px;
  font-weight: 900;
}

.question-actions button:disabled {
  cursor: default;
  opacity: 0.55;
}

.question-actions button.secondary {
  background: var(--panel);
  color: #111;
}

.links-card {
  display: grid;
  gap: 13px;
  padding: 16px 18px;
}

.source-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  align-items: baseline;
}

.source-strip p,
.source-strip span {
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.45;
}

.source-strip p {
  color: var(--teal);
  font-weight: 900;
}

.link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.link-row a {
  border: 1px solid rgba(0, 107, 97, 0.25);
  border-radius: 6px;
  background: var(--teal-soft);
  color: #004b44;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 850;
  text-decoration: none;
}

@media (max-width: 1080px) {
  .hero-grid,
  .concept-card {
    grid-template-columns: 1fr;
  }

  .stats-cluster {
    min-width: 0;
  }

  .visual-panel {
    min-height: 210px;
  }
}

@media (max-width: 760px) {
  .stats-cluster,
  .question-grid {
    grid-template-columns: 1fr;
  }

  .subtopic-panel {
    position: static;
    max-height: none;
  }

  .subtopic-list {
    max-height: 330px;
  }

  h1 {
    font-size: 32px;
  }

  .concept-card,
  .question-card {
    padding: 16px;
  }
}
