:root {
  color-scheme: light;
  --paper: #fdfcfa;
  --ink: #201b19;
  --muted: #5d524e;
  --accent: #ab211d;
  --rule: #e5dcd6;
  --rose: #f9eee9;
  --quiet: #f3efeb;
  --gutter: clamp(18px, 4vw, 48px);
  background: var(--paper);
  color: var(--ink);
  font: 100% / 1.6 system-ui, -apple-system, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
.page-width { width: min(100% - 2 * var(--gutter), 72rem); margin-inline: auto; }
a { color: var(--accent); text-underline-offset: .2em; overflow-wrap: anywhere; }
a:hover { color: #7f1815; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
h1, h2, h3 { text-wrap: balance; overflow-wrap: anywhere; }

.skip-link {
  position: absolute;
  inset: 12px auto auto var(--gutter);
  z-index: 1;
  transform: translateY(calc(-100% - 20px));
  background: var(--paper);
  padding: 8px 16px;
}
.skip-link:focus { transform: none; }
.site-header { border-bottom: 1px solid var(--rule); }
.site-header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  min-height: 68px;
}
.wordmark, .catalog-link {
  display: inline-flex;
  align-items: center;
  gap: .55em;
  min-height: 44px;
  font-weight: 750;
  text-decoration: none;
}
.wordmark { color: var(--ink); font-size: 1.18rem; letter-spacing: -.045em; }
.wordmark-dots { display: inline-flex; gap: 4px; }
.wordmark-dots i { width: 8px; height: 8px; border-radius: 50%; background: #d82925; }
.catalog-link { font-size: .91rem; }
.catalog-link:hover { text-decoration: underline; }

.article-header {
  background: var(--rose);
  border-bottom: 1px solid var(--rule);
}
.article-header-inner {
  display: grid;
  align-items: center;
  gap: clamp(24px, 4vw, 58px);
  padding-block: clamp(38px, 5.1vw, 80px);
}
.article-heading { min-width: 0; max-width: 48rem; }
.article-heading::before {
  content: "";
  display: block;
  width: 44px;
  height: 4px;
  border-radius: 2px;
  background: var(--accent);
  margin-bottom: clamp(18px, 2.3vw, 30px);
}
h1 {
  margin: 0;
  font-size: clamp(2.125rem, 5vw, 4rem);
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -.05em;
}
.article-lead {
  max-width: 62ch;
  margin: 1.1em 0 0;
  color: #463936;
  font-size: clamp(1.0625rem, 1.5vw, 1.25rem);
  line-height: 1.55;
  overflow-wrap: anywhere;
}
.article-cover {
  overflow: hidden;
  min-width: 0;
  border-radius: 20px;
  background: #e9d9ca;
}
.article-cover img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; }

.article-grid {
  display: grid;
  justify-content: center;
  grid-template-columns: minmax(0, 45rem);
  column-gap: clamp(38px, 7vw, 106px);
  padding-block: clamp(33px, 5vw, 70px) clamp(50px, 8vw, 112px);
}
.article-body {
  min-width: 0;
  font-size: clamp(1.0625rem, 1.4vw, 1.1875rem);
  line-height: 1.68;
  overflow-wrap: anywhere;
}
.article-body p, .article-body ul, .article-body ol { margin: 0 0 1em; }
.article-body ul, .article-body ol { padding-inline-start: 1.42em; }
.article-body li { margin-bottom: .55em; padding-inline-start: .24em; }
.article-body :where(ul, ol) > li::marker { color: var(--accent); font-weight: 700; }
.article-body li > :where(ul, ol) { margin-top: .55em; }
.article-body h2 {
  margin: 1.7em 0 .58em;
  font-size: clamp(1.625rem, 3vw, 2.375rem);
  line-height: 1.12;
  letter-spacing: -.039em;
  scroll-margin-block-start: 1.1rem;
}
.article-body h2:first-of-type { margin-top: 0; }
.article-body h2 ~ h2 { padding-top: .9em; border-top: 1px solid var(--rule); }
.article-body h3 {
  margin: 1.35em 0 .55em;
  font-size: clamp(1.3rem, 2vw, 1.6rem);
  line-height: 1.2;
  letter-spacing: -.028em;
}
.article-body blockquote {
  margin: 1.25em 0;
  padding: .25em 1em;
  border-inline-start: 3px solid var(--accent);
  color: var(--muted);
}
.article-body blockquote > :last-child { margin-bottom: 0; }
.article-body hr { margin: 2em 0; border: 0; border-top: 1px solid var(--rule); }
:not(pre) > code {
  font-size: .9em;
  font-family: ui-monospace, Consolas, monospace;
  background: var(--quiet);
  border-radius: 4px;
  padding: .12em .28em;
}
.article-body pre {
  margin: .9em 0 1.2em;
  padding: 16px clamp(13px, 3vw, 24px);
  overflow-x: auto;
  border-radius: 12px;
  background: #282321;
  color: #fff5eb;
  font: .91em / 1.55 ui-monospace, Consolas, monospace;
  tab-size: 4;
}
.article-body pre > code { font: inherit; }
.article-body pre:has(.language-text) {
  background: var(--quiet);
  color: var(--ink);
  border-inline-start: 3px solid #b7a79e;
}

.contents-desktop { display: none; }
.contents-mobile {
  margin: 0 0 1.75rem;
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: #fff;
}
.contents-mobile summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 8px 16px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 750;
  list-style: none;
}
.contents-mobile summary::-webkit-details-marker { display: none; }
.contents-mobile summary::after {
  content: "";
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: translateY(-2px) rotate(45deg);
}
.contents-mobile[open] summary::after { transform: translateY(2px) rotate(225deg); }
.contents-mobile nav { border-top: 1px solid var(--rule); padding: 6px 16px 12px; }
.contents-links, .article-body .contents-links { list-style: none; padding: 0; margin: 0; }
.contents-links li, .article-body .contents-links li { margin: 0; padding: 0; }
.contents-links a {
  display: block;
  padding-block: 9px;
  color: var(--muted);
  font-size: .94rem;
  line-height: 1.35;
  text-decoration: none;
}
.contents-links a:hover { color: var(--accent); text-decoration: underline; }

.article-body figure { margin: 1.55em 0 2em; }
.article-body figure a {
  display: grid;
  place-items: center;
  padding: clamp(8px, 2.4vw, 22px);
  background: var(--quiet);
  border: 1px solid var(--rule);
  border-radius: 16px;
  cursor: zoom-in;
}
.article-body img { display: block; max-width: 100%; height: auto; border-radius: 8px; }
.article-body figure img { box-shadow: 0 0 0 1px var(--rule); }
.article-body figcaption {
  margin-top: .72em;
  color: var(--muted);
  font-size: .875rem;
  line-height: 1.55;
}

.course-card {
  display: grid;
  align-items: center;
  gap: clamp(16px, 3vw, 26px);
  margin: 1.7em 0 2em;
  padding: clamp(13px, 2vw, 20px);
  border: 1px solid #ebd9d0;
  border-radius: 20px;
  background: var(--rose);
}
.course-card img { width: 100%; border-radius: 12px; }
.course-card .course-label {
  margin-bottom: .55em;
  color: var(--accent);
  font-size: .875rem;
  font-weight: 750;
}
.course-card h3 { margin: 0 0 .38em; }
.course-card p { margin-bottom: .92em; color: #463936; font-size: 1rem; line-height: 1.55; }
.course-action {
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  padding: 10px 15px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: .9375rem;
  font-weight: 700;
  line-height: 1.35;
  text-decoration: none;
}
.course-action:hover { background: #7f1815; color: #fff; }

@media (min-width: 42rem) {
  .course-card { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); }
}

@media (min-width: 52rem) {
  .article-header-inner:has(.article-cover) { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
}

@media (min-width: 59rem) {
  .article-grid:has(.contents-desktop) { grid-template-columns: minmax(0, 45rem) minmax(0, 15rem); }
  .contents-mobile { display: none; }
  .contents-desktop {
    display: block;
    position: sticky;
    top: 28px;
    align-self: start;
    max-height: calc(100vh - 56px);
    overflow: auto;
    border-inline-start: 1px solid var(--rule);
    padding-inline: 20px 5px;
  }
  .contents-desktop p { margin: 0 0 .55em; font-size: 1rem; font-weight: 760; }
}

@media (max-width: 51.99rem) {
  .site-header-inner { min-height: 56px; }
  .article-cover img { aspect-ratio: 16 / 9; max-height: 20rem; }
}

@media (max-width: 36rem) {
  .article-header-inner { gap: 20px; padding-block: 25px; }
  .article-heading::before { margin-bottom: 16px; }
  h1 { font-weight: 760; }
  .article-cover img { aspect-ratio: 2 / 1; }
  .article-grid { padding-top: 22px; }
  .contents-mobile { margin-bottom: 1.25rem; }
}
