@font-face {
  font-family: "DM Sans";
  src: url("./dm-sans-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 1000;
  font-display: swap;
}

@font-face {
  font-family: "Instrument Serif";
  src: url("./instrument-serif-latin-400-normal.woff2") format("woff2");
  font-display: swap;
}

@font-face {
  font-family: "Instrument Serif";
  src: url("./instrument-serif-latin-400-italic.woff2") format("woff2");
  font-style: italic;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #faf8f1;
  --panel: #f1f0e7;
  --surface: #fffdf7;
  --ink: #172e2a;
  --muted: #52625a;
  --green: #16453d;
  --green-deep: #0f332d;
  --accent: #a64221;
  --line: #d8dbce;
  --soft-green: #e3ebe1;
  --serif: "Instrument Serif", Georgia, serif;
  --sans: "DM Sans", system-ui, sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-padding-top: 1.5rem; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
button { font-family: inherit; }
a, button, summary { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.wrap { max-width: 1272px; width: calc(100% - 5rem); margin-inline: auto; }

.skip-link {
  position: absolute;
  z-index: 2;
  inset: 0 auto auto 1rem;
  padding: .8rem 1rem;
  background: var(--ink);
  color: var(--paper);
  transform: translateY(-150%);
}

.skip-link:focus { transform: translateY(0); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.site-header { border-bottom: 1px solid var(--line); }
.header-inner, .footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.header-inner { min-height: 70px; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  color: var(--ink);
  font-weight: 680;
  letter-spacing: -.025em;
  text-decoration: none;
  white-space: nowrap;
}

.brand-mark {
  display: grid;
  grid-auto-flow: column;
  place-content: center;
  gap: .07rem;
  width: 36px;
  height: 35px;
  border-radius: 4px;
  background: var(--green-deep);
  color: var(--paper);
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.15rem;
}

.brand-mark span { color: #ee9f66; }
.header-nav { display: flex; gap: clamp(1rem, 3vw, 2.5rem); }
.header-nav a, .site-footer a { font-size: .9rem; font-weight: 650; text-decoration: none; }
.header-nav a:hover, .site-footer a:hover { color: var(--accent); }
.header-nav a span, .site-footer a span { margin-left: .16rem; }

.hero {
  display: grid;
  grid-template-columns: 1fr 1.06fr;
  align-items: center;
  gap: clamp(2rem, 5vw, 5.5rem);
  padding-block: clamp(3rem, 5vw, 5.1rem) clamp(3.3rem, 5vw, 5rem);
}

.eyebrow, .module-number, .sidebar-caption {
  margin: 0;
  font-size: .73rem;
  font-weight: 750;
  letter-spacing: .135em;
  line-height: 1.45;
  text-transform: uppercase;
}

.eyebrow, .module-number { color: var(--accent); }

.hero h1 {
  margin: .85rem 0 1.15rem;
  font: 400 clamp(4rem, 7vw, 7rem)/.87 var(--serif);
  letter-spacing: -.044em;
}

.hero h1 em { color: var(--accent); }
.hero-description { max-width: 40ch; color: var(--muted); font-size: clamp(1rem, 1.4vw, 1.19rem); line-height: 1.65; }
.hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .9rem 1.45rem; margin-top: 1.8rem; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 1.05rem;
  border: 1px solid transparent;
  border-radius: 4px;
  padding: .78rem 1rem;
  font-size: .92rem;
  font-weight: 690;
  line-height: 1.45;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.button.primary { color: white; background: var(--green); }
.button.primary:hover { background: var(--green-deep); }
.button.secondary { border-color: var(--line); color: var(--green); background: var(--surface); }
.button.secondary:hover, .button[aria-pressed="true"] { border-color: #a4b7a8; background: var(--soft-green); }
.text-link { font-weight: 660; font-size: .92rem; text-underline-offset: 4px; }
.text-link:hover { color: var(--accent); }

.hero-art { margin: 0; min-width: 0; }

.hero-art img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3/2;
  border-radius: 5px;
  object-fit: cover;
  background: var(--green-deep);
}

.hero-art figcaption {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .45rem 1rem;
  padding-top: .8rem;
  color: var(--muted);
  font-size: .79rem;
}

.hero-art figcaption strong { margin-right: .3rem; color: var(--green-deep); font-weight: 750; }

.curriculum {
  border-block: 1px solid var(--line);
  background: var(--panel);
}

.curriculum-inner { padding-block: clamp(2.4rem, 4vw, 3.5rem) clamp(3.2rem, 5vw, 4.8rem); }

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: .5rem 1rem;
  margin-bottom: 1.5rem;
}

.section-heading h2 { margin: 0; font: 400 clamp(2.75rem, 5vw, 4rem)/.95 var(--serif); letter-spacing: -.025em; }
.section-heading p { margin: 0; color: var(--muted); font-size: .9rem; }

.module-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.module-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: clamp(1rem, 2.1vw, 1.65rem);
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
}

.module-card h3 {
  margin: .48rem 0 .55rem;
  font: 400 clamp(1.95rem, 2.65vw, 2.75rem)/1.02 var(--serif);
  letter-spacing: -.015em;
}

.module-description {
  flex: 1;
  margin: 0 0 1.15rem;
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.5;
}

.module-card ol, .sidebar ol { list-style: none; margin: 0; padding: 0; }

.lesson-row {
  display: grid;
  grid-template-columns: 1.7rem minmax(0, 1fr) .85rem;
  align-items: center;
  gap: .35rem;
  min-height: 46px;
  padding: .53rem 0;
  border-top: 1px solid var(--line);
  font-size: .9rem;
  font-weight: 650;
  line-height: 1.35;
  text-decoration: none;
}

.lesson-row:hover { color: var(--accent); }
.lesson-number { color: var(--muted); font: .71rem var(--mono); }
.row-arrow { text-align: right; }
.row-check { color: var(--green); text-align: right; }

.site-footer { color: var(--muted); }
.footer-inner { min-height: 79px; font-size: .83rem; }

.lesson-layout {
  display: grid;
  grid-template-columns: minmax(225px, 15rem) minmax(0, 49rem);
  gap: clamp(2rem, 6vw, 6rem);
  align-items: start;
  padding-block: clamp(2.4rem, 5vw, 4.6rem) 3rem;
}

.sidebar { position: sticky; top: 1.5rem; max-height: calc(100dvh - 3rem); overflow: auto; margin-inline: -.35rem; padding: .35rem; }
.lesson-menu > summary { display: none; }
.sidebar-caption { color: var(--green-deep); }

.progress {
  display: grid;
  gap: .36rem;
  margin-top: .72rem;
  color: var(--muted);
  font-size: .78rem;
}

.progress progress {
  display: block;
  width: 100%;
  height: 6px;
  overflow: hidden;
  appearance: none;
  border: 0;
  border-radius: 5px;
  background: var(--line);
}

.progress progress::-webkit-progress-bar { background: var(--line); }
.progress progress::-webkit-progress-value { background: var(--green); }
.progress progress::-moz-progress-bar { background: var(--green); }

.sidebar-module { margin-top: 1.22rem; }

.sidebar-module h2 {
  margin: 0 0 .35rem;
  padding: 0 .5rem;
  color: var(--muted);
  font-size: .77rem;
  font-weight: 700;
}

.sidebar .lesson-row {
  min-height: 39px;
  padding: .5rem .48rem;
  border: 0;
  border-radius: 3px;
  font-size: .83rem;
  font-weight: 580;
}

.sidebar .lesson-row[aria-current="page"] { color: var(--green-deep); background: var(--soft-green); font-weight: 750; }
.sidebar .lesson-row:hover { background: var(--panel); }

.lesson-heading { padding-bottom: 1.25rem; border-bottom: 1px solid var(--line); margin-bottom: 1.45rem; }
.lesson-heading .eyebrow span { margin-inline: .35rem; color: var(--muted); }

.lesson-heading h1 {
  margin: .55rem 0 0;
  font: 400 clamp(3rem, 6vw, 5.4rem)/.97 var(--serif);
  letter-spacing: -.035em;
}

.lab-download {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .85rem 1rem;
  margin-bottom: 1.4rem;
  border: 1px solid #cfddd0;
  border-radius: 5px;
  background: #ecf0e7;
  padding: .95rem 1.05rem;
}

.lab-download p { margin: 0; color: var(--muted); font-size: .87rem; line-height: 1.5; }
.lab-download strong { color: var(--ink); font-size: 1rem; }
.lab-download p + p { margin-top: .15rem; }

.prose { color: var(--ink); font-size: 1.02rem; line-height: 1.7; }
.prose p, .prose ol, .prose ul, .prose pre, .prose blockquote { margin-block: 0 1.1rem; }
.prose > :last-child { margin-bottom: 0; }

.prose h2, .prose h3 {
  margin: 2.05rem 0 .75rem;
  font: 400 clamp(1.9rem, 4vw, 2.55rem)/1.05 var(--serif);
  letter-spacing: -.02em;
}

.prose h3 { font-size: 1.75rem; }
.prose li + li { margin-top: .5rem; }
.prose ol, .prose ul { padding-left: 1.62rem; }
.prose li::marker { color: var(--accent); font-weight: 700; }
.prose a { color: var(--green); font-weight: 650; text-underline-offset: 3px; overflow-wrap: anywhere; }
.prose a:hover { color: var(--accent); }
code { font-family: var(--mono); }

.prose :not(pre) > code, .lab-download code {
  border-radius: 3px;
  padding: .08em .26em;
  background: #eeede4;
  color: #23473e;
  font-size: .84em;
  overflow-wrap: anywhere;
}

.prose pre {
  overflow-x: auto;
  padding: 1.05rem;
  border-radius: 5px;
  background: #152e29;
  color: #eff3e7;
  font: .83rem/1.63 var(--mono);
}

.prose blockquote {
  padding: .78rem 1rem;
  border-left: 3px solid #bb653c;
  border-radius: 0 4px 4px 0;
  background: var(--panel);
}

.prose blockquote p:last-child { margin-bottom: 0; }
.copy-box { position: relative; margin-bottom: 1.1rem; }
.copy-box pre, .copy-box blockquote { margin: 0; padding-top: 2.65rem; }

.copy-button {
  position: absolute;
  inset: .45rem .55rem auto auto;
  padding: .21rem .55rem;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--surface);
  color: var(--green);
  font-size: .77rem;
  font-weight: 680;
  line-height: 1.45;
  cursor: pointer;
}

.copy-button:hover { border-color: #a4b7a8; background: var(--soft-green); }
.code-box .copy-button { color: #eff3e7; background: #25453c; border-color: #59766b; }
.code-box .copy-button:hover { background: #315b50; }

.prose .table-hint { display: none; margin-bottom: .45rem; color: var(--muted); font-size: .8rem; }
.table-scroll { overflow-x: auto; margin-bottom: 1.1rem; border: 1px solid var(--line); border-radius: 4px; }
.prose table { width: 100%; min-width: 33rem; border-collapse: collapse; font-size: .9rem; text-align: left; }
.prose th, .prose td { padding: .65rem .72rem; vertical-align: top; }
.prose th { background: var(--soft-green); font-weight: 700; }
.prose td { border-top: 1px solid var(--line); }

.solution { margin-top: 1.6rem; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); }
.solution > .prose { padding: 0 1.1rem 1rem; }
.solution summary, .lesson-menu summary { padding: .85rem 1.1rem; font-weight: 720; cursor: pointer; }
.solution summary::marker, .lesson-menu summary::marker { color: var(--accent); }
.solution[open] summary { padding-bottom: .9rem; }

.completion { margin-top: 1.6rem; }

.lesson-pagination {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  border-top: 1px solid var(--line);
  margin-top: 1.7rem;
  padding-top: 1.25rem;
}

.lesson-pagination a { display: grid; gap: .2rem; width: fit-content; font-weight: 720; line-height: 1.35; text-decoration: none; }
.lesson-pagination a:last-child { justify-self: end; text-align: end; }
.lesson-pagination a:hover { color: var(--accent); }
.lesson-pagination a span { color: var(--muted); font-size: .79rem; font-weight: 650; }
.lesson-layout + .site-footer { border-top: 1px solid var(--line); }

@media (max-width: 1080px) {
  .wrap { width: calc(100% - 3.2rem); }
  .hero { gap: 2rem; }
  .hero h1 { font-size: clamp(3.8rem, 8vw, 5.75rem); }
}

@media (max-width: 860px) {
  .module-grid { gap: .65rem; }
  .lesson-layout { display: block; padding-top: 1.5rem; }
  .sidebar { position: static; overflow: visible; max-height: none; margin: 0 0 1.6rem; padding: 0; }
  .lesson-menu { border: 1px solid var(--line); border-radius: 5px; background: var(--surface); }
  .lesson-menu > summary { display: list-item; }
  .sidebar-inner { padding: 0 1.1rem .65rem; }
  .sidebar-caption { display: none; }
  .lesson-main { max-width: 49rem; margin-inline: auto; }
}

@media (max-width: 720px) {
  .wrap { width: calc(100% - 2rem); }
  .header-inner { min-height: 58px; }
  .hero { grid-template-columns: minmax(0, 1fr); padding-block: 2.5rem 2.75rem; }
  .hero h1 { font-size: clamp(3.7rem, 11vw, 6rem); }
  .hero-actions { margin-top: 1.3rem; }
  .hero-art { max-width: 35rem; }
  .module-grid { grid-template-columns: minmax(0, 1fr); gap: .85rem; }
  .module-card { padding: 1.1rem 1.25rem; }
  .module-card h3 { font-size: 2.45rem; }
  .curriculum-inner { padding-block: 2.2rem 2.65rem; }
  .footer-inner { min-height: 72px; padding-block: 1rem; flex-wrap: wrap; gap: .55rem; }
}

@media (max-width: 605px) {
  .prose .table-hint { display: block; }
}

@media (max-width: 400px) {
  .brand { gap: .4rem; font-size: .88rem; }
  .brand-mark { width: 30px; height: 30px; }
  .header-nav { gap: .65rem; }
  .header-nav a { font-size: .79rem; }
  .hero h1 { font-size: clamp(3.28rem, 12vw, 4.5rem); }
  .lab-download { align-items: start; flex-direction: column; }
  .prose ol, .prose ul { padding-left: 1.25rem; }
  .prose pre, .prose blockquote { padding-inline: .75rem; }
}
