:root {
  color-scheme: light;
  --bg: #f6f4ee;
  --surface: #fffdf7;
  --surface-2: #f0eadf;
  --ink: #1d2528;
  --muted: #657074;
  --line: #ddd6c9;
  --brand: #155e63;
  --brand-2: #c74f2f;
  --accent: #e6b94f;
  --shadow: 0 18px 50px rgba(29, 37, 40, 0.12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
}
a { color: inherit; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px clamp(18px, 4vw, 48px);
  background: rgba(255, 253, 247, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font-weight: 800;
}
.brand strong, .brand small { display: block; line-height: 1.1; }
.brand small { color: var(--muted); margin-top: 3px; }
.topnav { display: flex; gap: 6px; }
.topnav a, .nav-toggle {
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 700;
  background: transparent;
}
.topnav a:hover, .nav-toggle:hover { color: var(--ink); background: var(--surface-2); }
.nav-toggle { display: none; font: inherit; }
.hero {
  min-height: calc(100svh - 72px);
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  gap: clamp(28px, 6vw, 80px);
  align-items: center;
  padding: clamp(56px, 8vw, 100px) clamp(20px, 5vw, 80px);
  background:
    linear-gradient(120deg, rgba(21, 94, 99, 0.9), rgba(29, 37, 40, 0.68)),
    url("hero-curriculum.png") center / cover;
  color: #fff;
}
.hero-copy { max-width: 850px; }
.eyebrow {
  margin: 0 0 10px;
  color: var(--brand-2);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
  font-size: 0.78rem;
}
.hero .eyebrow { color: var(--accent); }
.hero h1 {
  margin: 0;
  max-width: 840px;
  font-size: clamp(3.2rem, 8vw, 7.5rem);
  line-height: 0.92;
  letter-spacing: 0;
}
.hero-lede {
  max-width: 720px;
  margin: 28px 0 0;
  color: rgba(255,255,255,0.86);
  font-size: 1.2rem;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 12px 18px;
  border-radius: 8px;
  font-weight: 800;
  text-decoration: none;
}
.button.primary { background: var(--accent); color: #251d0c; }
.button.secondary { border: 1px solid rgba(255,255,255,.36); color: #fff; }
.hero-panel {
  display: grid;
  gap: 12px;
  align-self: end;
}
.hero-panel div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  padding: 22px;
  background: rgba(255,255,255,.13);
  border: 1px solid rgba(255,255,255,.24);
  border-radius: 8px;
}
.hero-panel strong { font-size: 2rem; }
.hero-panel span { color: rgba(255,255,255,.78); font-weight: 700; }
.band, .catalog, .about {
  padding: clamp(54px, 7vw, 92px) clamp(20px, 5vw, 80px);
}
.band { background: var(--surface); }
.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 26px;
}
.section-heading h2, .about h2 {
  margin: 0;
  max-width: 760px;
  font-size: clamp(2rem, 4vw, 3.6rem);
  line-height: 1;
}
.course-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}
.course-card h3 { margin: 0; line-height: 1.15; }
.catalog-search {
  width: min(100%, 420px);
}
label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 800;
}
input[type="search"] {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 13px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}
.course-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.course-card a {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  min-height: 100%;
  padding: 22px;
  text-decoration: none;
}
.course-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); transition: .16s ease; }
.course-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 34px;
  margin-bottom: 18px;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--brand);
  font-weight: 800;
}
.course-card p { color: var(--muted); }
.course-card dl {
  display: grid;
  gap: 10px;
  margin: 18px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.course-card dl div { min-width: 0; }
.course-card dt {
  color: var(--muted);
  font-size: .76rem;
  font-weight: 800;
  text-transform: uppercase;
}
.course-card dd { margin: 2px 0 0; font-weight: 700; }
.about {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1fr);
  gap: 36px;
}
.about p:last-child { margin: 26px 0 0; color: var(--muted); font-size: 1.15rem; }
.footer { padding: 26px clamp(20px, 5vw, 80px); color: var(--muted); }

.course-layout {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
}
.course-sidebar {
  position: sticky;
  top: 72px;
  height: calc(100svh - 72px);
  overflow: auto;
  padding: 18px;
  border-right: 1px solid var(--line);
  background: var(--surface);
}
.sidebar-tools { margin-bottom: 18px; }
.nav-section { margin-bottom: 22px; }
.nav-section h3 {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: .75rem;
  text-transform: uppercase;
}
.nav-section a {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 10px;
  align-items: start;
  padding: 10px;
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
  font-size: .9rem;
  line-height: 1.3;
}
.nav-section a span { color: var(--brand); font-weight: 800; }
.nav-section a:hover, .nav-section a.active { background: var(--surface-2); color: var(--ink); }
.course-main { min-width: 0; }
.course-hero {
  padding: clamp(34px, 5vw, 70px) clamp(20px, 6vw, 90px) 34px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.back-link {
  display: inline-block;
  margin-bottom: 28px;
  color: var(--brand);
  font-weight: 800;
  text-decoration: none;
}
.course-hero h1 {
  max-width: 980px;
  margin: 0;
  font-size: clamp(2.2rem, 5vw, 5rem);
  line-height: 1;
}
.meta-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  max-width: 980px;
  margin-top: 28px;
}
.meta-grid div {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
}
.meta-grid span { display: block; color: var(--muted); font-size: .78rem; font-weight: 800; text-transform: uppercase; }
.meta-grid strong { display: block; margin-top: 4px; line-height: 1.25; }
.content-wrap {
  display: grid;
  grid-template-columns: minmax(0, 860px) 260px;
  gap: clamp(24px, 4vw, 56px);
  align-items: start;
  padding: clamp(34px, 5vw, 72px) clamp(20px, 6vw, 90px);
}
.course-content {
  min-width: 0;
  font-size: 1.03rem;
}
.course-content h1 { display: none; }
.course-content h2 {
  margin: 52px 0 18px;
  padding-top: 8px;
  font-size: 2rem;
  line-height: 1.1;
}
.course-content h2:first-child { margin-top: 0; }
.course-content h3 {
  margin: 38px 0 14px;
  padding: 18px;
  border-left: 5px solid var(--brand);
  border-radius: 8px;
  background: var(--surface);
  font-size: 1.35rem;
}
.course-content h4 { margin: 28px 0 8px; font-size: 1rem; color: var(--brand); }
.course-content p, .course-content li { color: #334044; }
.course-content ul, .course-content ol { padding-left: 1.35rem; }
.course-content li + li { margin-top: 6px; }
.course-content strong { color: var(--ink); }
.course-content code {
  padding: 2px 5px;
  border-radius: 5px;
  background: var(--surface-2);
}
.toc {
  position: sticky;
  top: 96px;
  max-height: calc(100svh - 120px);
  overflow: auto;
  padding-left: 18px;
  border-left: 1px solid var(--line);
}
.toc h2 {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: .78rem;
  text-transform: uppercase;
}
.toc a {
  display: block;
  padding: 6px 0;
  color: var(--muted);
  text-decoration: none;
  font-size: .86rem;
  line-height: 1.25;
}
.toc a.level-3 { padding-left: 12px; }
.toc a:hover, .toc a.active { color: var(--brand); }
.toc a.active {
  font-weight: 800;
  box-shadow: inset 3px 0 0 var(--brand);
  margin-left: -18px;
  padding-left: 15px;
}
.toc a.level-3.active { padding-left: 27px; }
.course-pagination {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 0 clamp(20px, 6vw, 90px) 70px;
}
.course-pagination a {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  text-decoration: none;
  font-weight: 800;
}
.course-pagination a:last-child { text-align: right; }
.course-pagination span { display: block; color: var(--muted); font-size: .78rem; text-transform: uppercase; }

@media (max-width: 1180px) {
  .course-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .content-wrap { grid-template-columns: minmax(0, 1fr); }
  .toc { position: static; max-height: none; border-left: 0; padding-left: 0; }
}
@media (max-width: 900px) {
  .hero, .about { grid-template-columns: 1fr; }
  .section-heading { align-items: start; flex-direction: column; }
  .course-layout { display: block; }
  .course-sidebar {
    position: fixed;
    z-index: 30;
    inset: 72px 0 0 auto;
    width: min(86vw, 360px);
    transform: translateX(100%);
    transition: transform .18s ease;
    box-shadow: var(--shadow);
  }
  body.nav-open .course-sidebar { transform: translateX(0); }
  .nav-toggle { display: inline-flex; }
  .topnav { display: none; }
  .meta-grid { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .hero { min-height: auto; padding-top: 46px; }
  .hero h1 { font-size: 3.15rem; }
  .course-grid { grid-template-columns: 1fr; }
  .course-pagination { grid-template-columns: 1fr; }
  .course-pagination a:last-child { text-align: left; }
}
