@import url('/style.css');

:root {
  --course-max: 860px;
  --paper: #fffefb;
  --ink-soft: #45433f;
  --accent: #176b58;
  --accent-soft: #e4f2ed;
  --amber: #9a5d00;
  --amber-soft: #fff1d6;
  --wrong: #8d2f2f;
  --wrong-soft: #fae8e6;
}

body { padding: 0 1.25rem; }
.skip-link { position: fixed; left: 1rem; top: -4rem; z-index: 20; background: var(--text); color: white; padding: 0.65rem 0.9rem; border-radius: 4px; font: 0.85rem system-ui, sans-serif; }
.skip-link:focus { top: 1rem; color: white; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid #b45309 !important; outline-offset: 3px; }
.course-main p a, .course-main li a, .source-list a { text-decoration: underline; text-underline-offset: 0.12em; }
.course-header, .course-nav, .course-main { max-width: var(--course-max); }
.course-header { margin-top: 1.75rem; }
.course-header h1 { font-size: 1.28rem; }
.course-home { font: 0.78rem system-ui, sans-serif; }
.course-nav { gap: 1rem; overflow-x: auto; flex-wrap: nowrap; }
.course-nav a { white-space: nowrap; min-height: 44px; display: inline-flex; align-items: center; }
.course-nav a[aria-current="page"] { color: var(--text); font-weight: 650; }
.course-main { margin-top: 2rem; }

.eyebrow, .kicker {
  color: var(--accent);
  font: 700 0.72rem/1.3 system-ui, sans-serif;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}
.hero h2 { font-size: clamp(1.8rem, 5vw, 3rem); line-height: 1.08; letter-spacing: -0.035em; margin: 0.4rem 0 1rem; overflow-wrap: anywhere; }
.hero .lede { color: var(--ink-soft); font-size: 1.08rem; line-height: 1.7; max-width: 700px; }
.meta-line { color: var(--muted); font: 0.78rem system-ui, sans-serif; margin-top: 1rem; }

.course-main h3 { font-size: 1.35rem; margin: 2.5rem 0 0.7rem; line-height: 1.25; }
.course-main h4 { font-size: 1rem; margin: 1.4rem 0 0.45rem; }
.course-main p { margin-bottom: 0.9rem; }
.course-main ul, .course-main ol { margin: 0.6rem 0 1rem 1.35rem; }
.course-main li { margin-bottom: 0.42rem; }

.callout, .activity, .checkpoint, .source-note {
  border: 1px solid var(--border);
  border-radius: 7px;
  margin: 1.5rem 0;
  padding: 1.2rem;
  background: var(--paper);
}
.callout { border-left: 4px solid var(--accent); }
.callout.warning { border-left-color: var(--amber); background: var(--amber-soft); }
.callout p:last-child, .source-note p:last-child { margin-bottom: 0; }
.activity { box-shadow: 0 10px 26px rgba(35, 31, 25, 0.06); }
.activity h3 { margin-top: 0; }
.activity-intro { color: var(--muted); font: 0.86rem/1.55 system-ui, sans-serif; }

.causal-map { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr; gap: 0.6rem; align-items: stretch; margin: 1rem 0; }
.causal-map div { border-top: 3px solid var(--accent); background: var(--paper); padding: 0.8rem; }
.causal-map strong, .causal-map span { display: block; }
.causal-map strong { font: 700 0.78rem system-ui, sans-serif; color: var(--accent); margin-bottom: 0.35rem; }
.causal-map span { font-size: 0.82rem; line-height: 1.45; color: var(--ink-soft); }
.causal-map b { align-self: center; color: var(--muted); }

.course-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.85rem; margin: 1.5rem 0; }
.toolkit-step { margin: 2rem 0; padding: 0 0 1.7rem; border-bottom: 1px solid var(--border); }
.toolkit-step h3 { margin-top: 0.25rem; }
.position-table { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin: 1rem 0 1.5rem; background: var(--border); border: 1px solid var(--border); }
.position-table > div { padding: 1rem; background: var(--paper); }
.position-table strong { font: 700 0.8rem/1.35 system-ui, sans-serif; color: var(--accent); }
.position-table p { font-size: 0.87rem; line-height: 1.55; margin: 0.55rem 0 0; color: var(--ink-soft); }
.thinker-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin: 1rem 0 2rem; }
.thinker-grid article { padding: 1rem; border-top: 3px solid var(--accent); background: var(--paper); }
.thinker-grid h4 { margin: 0.25rem 0 0.5rem; font-size: 1.08rem; }
.thinker-grid p { font-size: 0.88rem; line-height: 1.58; }
.thinker-grid p:last-child { margin-bottom: 0; font-family: system-ui, sans-serif; font-size: 0.76rem; }
.lesson-card { display: block; border: 1px solid var(--border); border-radius: 6px; padding: 1rem; background: var(--paper); color: var(--text); }
.lesson-card:hover { border-color: var(--accent); text-decoration: none; }
.lesson-card .number { font: 700 0.68rem system-ui, sans-serif; color: var(--accent); letter-spacing: 0.08em; }
.lesson-card strong { display: block; margin: 0.35rem 0; }
.lesson-card span { color: var(--muted); font: 0.8rem/1.45 system-ui, sans-serif; }

.term { border-bottom: 1px dotted var(--muted); cursor: help; }
.equation { overflow-x: auto; font: 0.92rem ui-monospace, SFMono-Regular, Menlo, monospace; background: #f1efe9; padding: 0.75rem; border-radius: 4px; margin: 1rem 0; }
details { margin: 0.8rem 0; border-left: 2px solid var(--border); padding-left: 0.8rem; }
summary { cursor: pointer; color: var(--link); font: 650 0.82rem system-ui, sans-serif; }
details p { margin-top: 0.7rem; font-size: 0.9rem; color: var(--ink-soft); }

button, input, select { font: inherit; }
.activity button, .choice {
  border: 1px solid var(--border); border-radius: 4px; background: white; color: var(--text);
  cursor: pointer; padding: 0.55rem 0.75rem;
}
.activity button:hover, .activity button:focus-visible, .choice:hover, .choice:focus-visible { border-color: var(--accent); outline: 2px solid transparent; }
.activity button.primary { background: var(--accent); color: white; border-color: var(--accent); }
.controls { display: flex; flex-wrap: wrap; align-items: end; gap: 0.8rem; margin: 1rem 0; }
.control { min-width: 125px; flex: 1; }
.control label { display: flex; justify-content: space-between; gap: 1rem; }
.control input[type="range"] { width: 100%; accent-color: var(--accent); }
.choice-list { display: grid; gap: 0.55rem; margin-top: 0.8rem; }
.choice { text-align: left; width: 100%; }
.choice.correct { border-color: var(--accent); background: var(--accent-soft); }
.choice.incorrect { border-color: var(--wrong); background: var(--wrong-soft); }
.feedback { min-height: 1.5em; margin-top: 0.75rem; font: 0.84rem/1.5 system-ui, sans-serif; }
.feedback.good { color: #0c5a48; }
.feedback.try { color: var(--wrong); }

.beetle-field { min-height: 145px; border-radius: 6px; padding: 0.8rem; display: grid; grid-template-columns: repeat(10, 1fr); gap: 0.35rem; align-content: center; background: #d6c3a1; margin: 1rem 0; }
.beetle { width: 100%; aspect-ratio: 1; border-radius: 50% 50% 45% 45%; border: 2px solid rgba(0,0,0,.28); }
.beetle.dark { background: #3f3a35; }
.beetle.light { background: #e8d8b9; }
.counts, .sim-summary { display: flex; gap: 1rem; flex-wrap: wrap; font: 0.8rem system-ui, sans-serif; color: var(--muted); }

.chart { width: 100%; height: 230px; display: block; margin: 1rem 0; background: #fff; border: 1px solid var(--border); border-radius: 4px; }
.chart-line { fill: none; stroke: var(--accent); stroke-width: 2; }
.chart-axis { stroke: #6f6f6f; stroke-width: 1; }
.chart-grid { stroke: #b8b5ae; stroke-width: 1; stroke-dasharray: 4 4; }
.chart-label { fill: #555; font: 11px system-ui, sans-serif; }
.table-wrap { overflow-x: auto; margin-top: 0.75rem; }
.data-table { width: 100%; border-collapse: collapse; font: 0.76rem system-ui, sans-serif; }
.data-table caption { text-align: left; font-weight: 650; margin-bottom: 0.4rem; }
.data-table th, .data-table td { border-bottom: 1px solid var(--border); padding: 0.35rem 0.5rem; text-align: right; }
.data-table th:first-child { text-align: left; }

.channel-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.6rem; }
.channel { border: 1px solid var(--border); border-radius: 4px; padding: 0.7rem; min-height: 72px; font: 0.82rem/1.4 system-ui, sans-serif; background: white; }
.channel.selected { border-color: var(--accent); background: var(--accent-soft); }

.source-list { list-style: none; margin-left: 0 !important; }
.source-list li { border-top: 1px solid var(--border); padding: 0.75rem 0; font-size: 0.9rem; }
.source-list small { color: var(--muted); display: block; font-family: system-ui, sans-serif; }

.next-links { display: flex; justify-content: space-between; gap: 1rem; border-top: 1px solid var(--border); margin-top: 3rem; padding-top: 1rem; font: 0.82rem system-ui, sans-serif; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (max-width: 620px) {
  .course-grid, .channel-grid, .causal-map, .position-table, .thinker-grid { grid-template-columns: 1fr; }
  .causal-map b { transform: rotate(90deg); justify-self: center; }
  .beetle-field { grid-template-columns: repeat(8, 1fr); }
  .hero h2 { font-size: 2rem; }
  .controls { align-items: stretch; flex-direction: column; }
  .controls > *, .control { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; } }
@media print {
  .course-nav, .activity button, .next-links { display: none; }
  body { background: white; }
  .course-main { margin: 1rem auto; }
  .activity, .callout { break-inside: avoid; box-shadow: none; }
}
