:root {
  color-scheme: light;
  --ink: #17332a;
  --muted: #61736c;
  --paper: #fffef8;
  --wash: #eef3ec;
  --line: #d6dfd7;
  --green: #236c4b;
  --green-dark: #174936;
  --gold: #d59b35;
}

* { box-sizing: border-box; }

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 2rem;
  color: white;
  background: var(--green-dark);
  box-shadow: 0 2px 12px rgb(23 51 42 / 18%);
}

.topbar strong { display: block; font-size: 1.1rem; }
.eyebrow { color: var(--gold); font-size: .75rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.status, .badge { border-radius: 999px; padding: .25rem .65rem; font-size: .78rem; font-weight: 700; }
.status { border: 1px solid rgb(255 255 255 / 45%); text-transform: uppercase; }

.shell { display: grid; grid-template-columns: minmax(240px, 300px) minmax(0, 1fr); min-height: calc(100vh - 72px); }
.sidebar { padding: 2rem 1.25rem; border-right: 1px solid var(--line); background: var(--wash); }
.sidebar nav { display: grid; gap: .45rem; }
.nav-item { display: flex; align-items: center; gap: .7rem; padding: .7rem .8rem; border-radius: .55rem; color: var(--ink); text-decoration: none; line-height: 1.3; }
.nav-item:hover { background: white; }
.nav-item.active { color: white; background: var(--green); }
.nav-item.all-courses { margin-bottom: .75rem; border-bottom: 1px solid var(--line); border-radius: 0; font-weight: 750; }
.lesson-number { display: grid; place-items: center; flex: 0 0 1.7rem; height: 1.7rem; border: 1px solid currentColor; border-radius: 50%; font-size: .75rem; font-weight: 800; }
.version { margin: 2rem .8rem 0; color: var(--muted); font-size: .8rem; }

.content { width: 100%; max-width: 980px; padding: clamp(2rem, 5vw, 5rem); }
.catalog-content { width: min(1120px, 100%); margin: 0 auto; padding: clamp(2rem, 6vw, 5rem); }
.catalog-content > h1 { margin: .25rem 0 .5rem; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2.4rem, 6vw, 4.5rem); line-height: 1.05; }
.course-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.2rem; margin-top: 2.5rem; }
.classification-filters { display: flex; flex-wrap: wrap; gap: .55rem; margin-top: 1.5rem; }
.classification-filter { padding: .45rem .8rem; border: 1px solid var(--green); border-radius: 999px; color: var(--green); font-weight: 750; text-decoration: none; }
.classification-filter:hover, .classification-filter.active { color: white; background: var(--green); }
.classification-badges { display: flex; flex-wrap: wrap; gap: .35rem; margin: -.25rem 0 .6rem; }
.classification-badge { padding: .2rem .5rem; border-radius: 999px; color: var(--green-dark); background: #e0eee5; font-size: .72rem; font-weight: 750; }
.course-card { display: flex; min-height: 340px; flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: .85rem; background: white; box-shadow: 0 12px 34px rgb(23 51 42 / 7%); }
.course-card-image { display: block; width: 100%; height: 150px; object-fit: cover; background: #dfe9df; }
.course-card-image.placeholder { display: grid; place-items: center; color: rgb(255 255 255 / 75%); background: linear-gradient(135deg, var(--green-dark), var(--green)); font-family: Georgia, "Times New Roman", serif; font-size: 2.8rem; letter-spacing: .08em; }
.course-card-body { display: flex; flex: 1; flex-direction: column; padding: 1.35rem 1.5rem 1.5rem; }
.course-card h2 { margin: .3rem 0 1rem; font-family: Georgia, "Times New Roman", serif; font-size: 1.7rem; line-height: 1.2; }
.course-card p { color: var(--muted); }
.course-card .card-version { margin-top: 0; font-size: .85rem; }
.course-card.unavailable { opacity: .75; border-style: dashed; }
.open-course { align-self: flex-start; margin-top: auto; padding: .65rem 1rem; border-radius: .45rem; color: white; background: var(--green); font-weight: 750; text-decoration: none; }
.open-course:hover { background: var(--green-dark); }
.open-course.secondary { color: var(--green); background: transparent; border: 1px solid var(--green); }
.open-course.secondary:hover { color: white; background: var(--green); }
.empty-state { padding: 2rem; border: 1px dashed var(--line); border-radius: .75rem; }
.coming-soon-page { width: min(760px, 100%); margin: 0 auto; padding: clamp(2rem, 7vw, 6rem); text-align: center; }
.coming-soon-page .course-card-image { max-width: 520px; height: 260px; margin: 2rem auto; border-radius: 1rem; }
.coming-soon-page h1 { margin: .4rem 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2.4rem, 7vw, 4.8rem); line-height: 1.05; }
.coming-soon-message { color: var(--muted); font-size: 1.35rem; }
.back-link { color: var(--green); font-weight: 750; text-decoration: none; }
.course-overview > h1, .markdown-body > h1 { margin: .25rem 0 1rem; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2.2rem, 5vw, 4rem); line-height: 1.05; }
.lead { max-width: 45rem; color: var(--muted); font-size: 1.15rem; }
.summary-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin: 2rem 0; }
.summary-grid section, .panel { padding: 1.4rem; border: 1px solid var(--line); border-radius: .75rem; background: white; box-shadow: 0 10px 30px rgb(23 51 42 / 5%); }
.summary-grid section { display: grid; }
.metric { font-family: Georgia, serif; font-size: 2.2rem; color: var(--green); }
.panel { margin-top: 1rem; }

.lesson-meta { display: flex; flex-wrap: wrap; gap: .45rem; margin: .7rem 0 1.6rem; }
.badge { color: var(--green-dark); background: #e0eee5; }
.status-badge { color: #69460a; background: #f8e8c8; }
.markdown-body { max-width: 760px; }
.course-content-image { display: block; max-width: 100%; height: auto; margin: 1.5rem auto; border-radius: .5rem; }
.markdown-body h2 { margin-top: 2.8rem; padding-bottom: .45rem; border-bottom: 1px solid var(--line); font-family: Georgia, serif; font-size: 1.8rem; }
.markdown-body h3 { margin-top: 2rem; color: var(--green-dark); }
.markdown-body code { border-radius: .25rem; padding: .12rem .32rem; background: #edf1ed; font-family: "Cascadia Code", Consolas, monospace; font-size: .9em; }
.markdown-body pre { overflow-x: auto; padding: 1.1rem; border-left: 4px solid var(--gold); border-radius: .4rem; color: #eef8f1; background: #152920; }
.markdown-body pre code { padding: 0; color: inherit; background: transparent; }
.markdown-body li { margin: .35rem 0; }
blockquote { margin: 1rem 0; padding: .8rem 1rem; border-left: 4px solid var(--gold); background: #fff8e7; }
.table-scroll { overflow-x: auto; margin: 1.2rem 0; }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { padding: .7rem .8rem; border: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: white; background: var(--green); }
tr:nth-child(even) { background: #f7f9f5; }

.lesson-footer { display: flex; justify-content: space-between; gap: 1rem; max-width: 760px; margin-top: 4rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.lesson-link { display: inline-block; padding: .65rem .9rem; border: 1px solid var(--green); border-radius: .45rem; color: var(--green); font-weight: 750; text-decoration: none; }
.lesson-link.next { margin-left: auto; color: white; background: var(--green); }

@media (max-width: 760px) {
  .topbar { position: static; padding: .8rem 1rem; }
  .shell { display: block; }
  .sidebar { overflow-x: auto; padding: .8rem; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar nav { display: flex; width: max-content; }
  .nav-item { max-width: 220px; }
  .version { display: none; }
  .content { padding: 2rem 1.1rem 4rem; }
  .summary-grid { grid-template-columns: 1fr; }
}
