:root {
  color-scheme: light;
  --paper: #fafafa;
  --ink: #0d0c0c;
  --muted: #626262;
  --rule: #dedede;
  --red: #f51b1b;
  --accent: #a51717;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.55 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
body, h1, h2, p, dd { margin: 0; }
a { color: inherit; text-underline-offset: 4px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.wrap { width: min(100% - 48px, 840px); margin-inline: auto; }
.reading { max-width: 680px; }
main.wrap { padding-bottom: 48px; }

.topbar {
  background: #fff;
  border-bottom: 1px solid var(--rule);
  font-size: 0.92rem;
}
.topbar .wrap { display: flex; align-items: center; min-height: 56px; }
.topbar a { display: inline-flex; align-items: center; min-height: 44px; }
.wordmark { font-size: 1rem; font-weight: 720; letter-spacing: -0.035em; }

h1 {
  font-size: clamp(1.9rem, 4.6vw, 3.25rem);
  font-weight: 720;
  line-height: 1.09;
  letter-spacing: -0.045em;
  text-wrap: balance;
}
h2 { font-size: clamp(1.35rem, 3.5vw, 1.65rem); line-height: 1.25; letter-spacing: -0.025em; }
.course-card {
  padding: clamp(22px, 4.6vw, 38px);
  margin-top: clamp(20px, 4vw, 44px);
  border: 1px solid var(--rule);
  border-radius: 16px;
  background: #fff;
}
.course-meta, .eyebrow { color: var(--muted); font-size: 0.875rem; }
.course-card h1 { max-width: 23ch; margin-top: 9px; }
.course-continue { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 15px; margin-top: 23px; }
.course-continue p { color: var(--muted); font-size: 0.9rem; line-height: 1.45; }
.action {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 13px;
  min-height: 46px;
  padding: 9px 15px;
  border-radius: 7px;
  background: var(--ink);
  color: #fff;
  font-size: 0.94rem;
  font-weight: 650;
  text-decoration: none;
}
.action [aria-hidden="true"] { color: #ff8d8d; }
.action:hover { background: #292525; }

.directory { margin-top: clamp(31px, 5vw, 52px); }
.directory > h2 { margin-bottom: 15px; }
.program-stages { counter-reset: course-module; }
.program-stage + .program-stage { margin-top: 22px; }
.program-stage h3 { margin: 0 0 7px; font-size: 1rem; font-weight: 650; }
.modules {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--rule);
}
.modules > li {
  display: grid;
  grid-template-columns: 2.05rem minmax(0, 1fr);
  align-items: start;
  border-bottom: 1px solid var(--rule);
  counter-increment: course-module;
}
.modules > li::before {
  content: counter(course-module, decimal-leading-zero);
  padding-block: 19px;
  color: var(--muted);
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
}
.module summary, .module-planned {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 58px;
  padding-block: 14px;
  line-height: 1.35;
}
.module summary { list-style: none; cursor: pointer; font-size: clamp(1.06rem, 3vw, 1.2rem); }
.module summary::-webkit-details-marker { display: none; }
.module summary::after {
  content: "";
  flex: 0 0 8px;
  height: 8px;
  margin-inline: 2px 5px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
}
.module[open] summary::after { transform: translateY(2px) rotate(225deg); }
.module-body { padding-bottom: 12px; }
.module-planned { color: var(--muted); }

.lesson-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.lesson-cards a {
  display: flex;
  flex-direction: column;
  gap: 5px;
  height: 100%;
  padding: 13px;
  border: 1px solid var(--rule);
  border-radius: 9px;
  background: #fff;
  text-decoration: none;
}
.lesson-cards a:hover { border-color: var(--accent); }
.lesson-cards a span { color: var(--accent); font-size: 0.82rem; }
.lesson-cards a strong { font-size: 0.95rem; line-height: 1.38; overflow-wrap: anywhere; }
.text-link { display: inline-flex; align-items: center; min-height: 44px; font-size: 0.92rem; }

.page-heading { margin-top: clamp(25px, 5vw, 48px); }
.page-heading h1 { margin-top: 8px; }
.page-heading > p + h1 + p { margin-top: 13px; color: var(--muted); }
.panel { margin-top: 29px; font-size: 1.035rem; line-height: 1.65; }
.panel > section { padding-block: 19px; border-top: 1px solid var(--rule); }
.panel > section > p { margin-top: 10px; }
.route { padding-left: 1.35em; margin: 10px 0 0; }
.route li + li { margin-top: 8px; }
.models { display: grid; gap: 9px; margin: 12px 0 0; }
.models > div { padding: 12px 15px; border: 1px solid var(--rule); border-radius: 9px; background: #fff; }
.models dt { font-weight: 700; }
.models dd { margin-top: 3px; }
.lesson-actions { margin-top: 4px; padding-top: 14px; border-top: 1px solid var(--rule); }
.lesson-navigation { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 17px; }

@media (max-width: 530px) {
  .wrap { width: calc(100% - 36px); }
  .course-continue { display: grid; justify-items: start; }
  .module-body { margin-left: -2.05rem; }
}

@media (max-width: 350px) {
  .lesson-cards { grid-template-columns: minmax(0, 1fr); }
}

.wb-offer .course-card { display: grid; grid-template-columns: 1.5fr 1fr; gap: 22px; align-items: center; }
.wb-offer .course-card p { margin-top: 12px; }
.wb-offer .course-card img { width: 100%; height: auto; border-radius: 9px; }
.wb-offer .offer-price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px 12px; margin: 16px 0; }
.wb-offer .offer-price strong { font-size: 1.75rem; }
.wb-offer .offer-price del { color: var(--muted); }
.wb-offer .offer-price span { color: var(--accent); font-weight: 650; }
.wb-offer .lesson-labels { margin: 0 0 10px; padding-left: 1.35rem; }
.wb-offer .lesson-labels li + li { margin-top: 4px; }
@media (max-width: 620px) {
  .wb-offer .course-card { grid-template-columns: minmax(0, 1fr); }
  .wb-offer .course-card img { max-width: 320px; }
}
