@charset "UTF-8";

/* 配色・基本設定：サイト全体の色はここで変更します。 */

/* 配色・基本設定：サイト全体の色はここで変更します。 */
/* 配色・基本設定：サイト全体の色はここで変更します。 */
:root {
  --paper: #fffcf5;
  --ink: #342c21;
  --muted: #796b58;
  --accent: #e7a00e;
  --brown: #86541d;
  --line: #ded4c0;
  --soft: #f4eddc;
  color-scheme: light;
  font-family: -apple-system,BlinkMacSystemFont,"Hiragino Kaku Gothic ProN","Yu Gothic",Meiryo,sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* {
  box-sizing: border-box;
}

html {
  scroll-padding-top: 24px;
}

body {
  margin: 0;
  font-size: 15px;
  line-height: 1.9;
  background: var(--paper);
}

a {
  color: var(--brown);
  text-decoration: none;
  text-underline-offset: 5px;
}

a: visited {
  color: var(--brown);
}

a: hover {
  text-decoration: underline;
  color: #58340e;
}

a: focus-visible,summary:focus-visible,button:focus-visible {
  outline: 3px solid #986010;
  outline-offset: 5px;
}

h1,h2,h3,p,figure {
  margin: 0;
}

h1,h2,h3 {
  line-height: 1.5;
}

img {
  max-width: 100%;
  height: auto;
}

summary {
  cursor: pointer;
}

p,li {
  overflow-wrap: anywhere;
}

.skip-link {
  position: fixed;
  top: -100px;
  left: 16px;
  padding: 10px 20px;
  background: var(--ink);
  color: white;
  z-index: 50;
}

.skip-link:focus {
  top: 12px;
}

/* 共通ヘッダーとナビゲーション */

/* 共通ヘッダーとナビゲーション */
/* 共通ヘッダーとナビゲーション */
.site-header {
  max-width: 1280px;
  margin: auto;
  padding: 23px 48px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
  gap: 24px;
}

.brand,.brand:visited {
  display: flex;
  align-items: center;
  gap: 13px;
  color: var(--ink);
  font-size: 26px;
  font-weight: 750;
  line-height: 1.2;
  letter-spacing: -1px;
}

.brand:hover {
  text-decoration: none;
}

.brand b {
  font-size: 17px;
  font-weight: 600;
}

.brand small {
  display: block;
  font-size: 9px;
  font-weight: 550;
  letter-spacing: 2px;
  margin-top: 7px;
}

.brand-icon {
  font-family: Georgia,serif;
  font-style: italic;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  width: 44px;
  height: 44px;
  font-size: 37px;
  position: relative;
}

.brand-icon span {
  font-size: 17px;
  font-style: normal;
  margin: 4px 0 0 2px;
}

.site-header nav {
  display: flex;
  gap: 30px;
  font-size: 12px;
  font-weight: 600;
}

.site-header nav a {
  color: var(--ink);
}

/* トップページ：本文の幅とパンくず */

/* トップページ：本文の幅とパンくず */
/* トップページ：本文の幅とパンくず */
.home main {
  max-width: 1280px;
  margin: auto;
  padding: 0 48px;
}

.breadcrumb {
  display: flex;
  gap: 14px;
  align-items: center;
  font-size: 11px;
  color: var(--muted);
  padding-top: 24px;
}

.breadcrumb a {
  color: var(--muted);
}

.breadcrumb span {
  color: #b5a88e;
}

/* トップページ：導入部分と図版 */

/* トップページ：導入部分と図版 */
/* トップページ：導入部分と図版 */
.hero {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 38px;
  align-items: center;
  padding: 52px 0 55px;
}

.eyebrow {
  font-size: 10px;
  letter-spacing: 1.8px;
  font-weight: 650;
  color: var(--brown);
}

.hero h1 {
  font-size: clamp(36px,4.1vw,56px);
  line-height: 1.38;
  letter-spacing: -2px;
  margin: 22px 0;
}

.hero h1 span {
  color: var(--brown);
}

.hero-subtitle {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 17px;
}

.hero-description {
  font-size: 13px;
  color: var(--muted);
  line-height: 2;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 25px;
  margin-top: 29px;
}

.button,.button:visited {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  background: var(--accent);
  color: #342810;
  padding: 13px 19px;
  font-size: 12px;
  font-weight: 700;
  min-height: 48px;
}

.button:hover {
  background: #f0b52f;
  text-decoration: none;
}

.text-link {
  font-size: 12px;
  font-weight: 600;
}

.hero-figure {
  min-width: 0;
}

.hero-figure svg {
  display: block;
  width: 100%;
  height: auto;
}

.hero-figure figcaption {
  display: flex;
  gap: 22px;
  border-top: 1px solid var(--line);
  padding-top: 13px;
  margin-top: 17px;
  font-size: 10px;
  color: var(--muted);
}

.hero-figure figcaption span {
  font-family: monospace;
}

.course-meta {
  display: flex;
  gap: 34px;
  align-items: center;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--line);
  padding: 18px 0;
  font-size: 11px;
  color: var(--muted);
}

.course-meta>span+span {
  border-left: 1px solid var(--line);
  padding-left: 34px;
}

.course-meta b {
  color: var(--ink);
  font-size: 15px;
  margin-right: 7px;
}

/* トップページ：学習ガイドと各パートの目次 */

/* トップページ：学習ガイドと各パートの目次 */
/* トップページ：学習ガイドと各パートの目次 */
.curriculum {
  padding-top: 68px;
  scroll-margin-top: 15px;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 25px;
  align-items: end;
  margin-bottom: 30px;
}

.section-heading h2,.about-section h2 {
  font-size: 27px;
  letter-spacing: -1px;
  margin-top: 9px;
}

.section-heading>p {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.9;
}

.chapter-list {
  border-top: 2px solid var(--ink);
}

.chapter {
  display: grid;
  grid-template-columns: 116px 1fr;
  border-bottom: 1px solid var(--line);
  padding: 26px 0 23px;
}

.chapter-number {
  font-family: Georgia,"Times New Roman",serif;
  font-size: 64px;
  line-height: 1.1;
  color: #b08234;
  font-style: italic;
  letter-spacing: -3px;
}

.chapter-label {
  font-family: monospace;
  font-size: 10px;
  letter-spacing: 1.2px;
  color: var(--brown);
  margin-bottom: 6px;
}

.chapter-label span {
  color: var(--muted);
  margin-left: 10px;
  font-size: 9px;
}

.chapter h3 {
  font-size: 21px;
  letter-spacing: -.6px;
}

.chapter h3 a {
  color: var(--ink);
  display: flex;
  justify-content: space-between;
  gap: 15px;
}

.chapter h3 a span {
  font-size: 22px;
  font-weight: 400;
  color: var(--brown);
  padding-right: 10px;
}

.chapter-body>p:not(.chapter-label) {
  font-size: 12px;
  color: var(--muted);
  margin-top: 9px;
}

.chapter details {
  margin-top: 16px;
  font-size: 12px;
}

.chapter summary {
  list-style: none;
  display: flex;
  gap: 12px;
  align-items: center;
  width: fit-content;
  min-height: 34px;
  font-size: 11px;
  color: var(--brown);
}

.chapter summary::-webkit-details-marker {
  display: none;
}

.chapter summary:before {
  content: '＋';
  font-size: 16px;
}

.chapter details[open] summary:before {
  content: '−';
}

.chapter summary span {
  font-size: 9px;
  border: 1px solid var(--line);
  padding: 0 6px;
  line-height: 1.6;
  color: var(--muted);
}

.chapter details ul {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 28px;
  padding: 12px 0 5px;
  margin: 0;
}

.chapter details li {
  border-bottom: 1px dotted var(--line);
}

.chapter details li a {
  display: block;
  padding: 9px 0;
  font-size: 12px;
}

/* トップページ：紹介文と著者の説明 */

/* トップページ：紹介文と著者の説明 */
/* トップページ：紹介文と著者の説明 */
.about-section {
  margin: 65px 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  padding: 36px 32px;
  background: var(--soft);
  border-left: 4px solid var(--accent);
}

.about-section>div>p:not(.eyebrow) {
  margin-top: 17px;
  font-size: 13px;
  color: var(--muted);
}

.author-note {
  font-size: 12px;
  align-self: center;
}

.author-note summary {
  font-weight: 600;
  padding: 12px 0;
}

.author-note p {
  margin: 15px 0;
  line-height: 2;
}

/* トップページ：サンプルコードと参考リンク */

/* トップページ：サンプルコードと参考リンク */
/* トップページ：サンプルコードと参考リンク */
.resources {
  padding-bottom: 60px;
}

.resource-columns {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 65px;
  border-top: 1px solid var(--ink);
  padding-top: 26px;
}

.resource-columns h3 {
  font-size: 16px;
  margin-bottom: 14px;
}

.resource-columns p,.resource-columns li {
  font-size: 12px;
}

.resource-columns ul {
  list-style: none;
  margin: 16px 0;
  padding: 0;
}

.resource-columns li {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.site-footer {
  max-width: 1280px;
  margin: auto;
  border-top: 1px solid var(--line);
  padding: 25px 48px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  font-size: 10px;
  color: var(--muted);
}

.site-footer a {
  color: var(--muted);
}

/* 解説ページ：本文と右側のページ内目次 */
body.article.lesson {
  background: var(--paper);
  color: var(--ink);
  position: static;
  font-size: 15px;
  line-height: 2;
}

.course-nav {
  max-width: 1184px;
  margin: 0 auto;
  display: flex;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: thin;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
}

.course-nav a {
  flex-shrink: 0;
  padding: 6px 15px;
  white-space: nowrap;
  border-right: 1px solid var(--line);
  color: var(--muted);
}

.course-nav a:first-child {
  padding-left: 0;
}

.course-nav a span {
  font-family: monospace;
  font-weight: bold;
  margin-right: 5px;
}

.course-nav a[aria-current] {
  color: var(--ink);
  background: #f7e6b5;
  box-shadow: inset 0 -2px var(--accent);
}

.lesson-layout {
  max-width: 1184px;
  margin: auto;
  display: grid;
  grid-template-columns: minmax(0,850px) 245px;
  gap: 64px;
  padding: 45px 0 65px;
  align-items: start;
}

.lesson-toc {
  grid-column: 2;
  grid-row: 1;
  position: sticky;
  top: 24px;
  font-size: 11px;
  border-top: 3px solid var(--accent);
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding-top: 14px;
}

.lesson-toc summary {
  font-weight: 700;
  font-size: 12px;
  margin-bottom: 16px;
}

.lesson-toc nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.lesson-toc a {
  color: var(--muted);
  padding: 6px 8px;
  border-left: 2px solid transparent;
  line-height: 1.7;
}

.lesson-toc a.level-3 {
  font-weight: 700;
  color: var(--ink);
  margin-top: 10px;
}

.lesson-toc a.level-4 {
  padding-left: 15px;
}

.lesson-toc a[aria-current] {
  border-color: var(--accent);
  color: var(--brown);
  background: var(--soft);
}

body.article.lesson #maintext {
  grid-row: 1;
  grid-column: 1;
  width: 100%;
  min-width: 0;
  font-size: 15px;
  padding: 0;
  margin: 0;
}

body.article.lesson #maintext :is(p,li,dl,table,h1,h2,h3,h4,h5,pre,img,.proglist,.code,.fig,.eqn,.cmdline,.note,.algorithm,.algorithm-no-border,.rescale,.table_scroll) {
  position: static;
  left: auto;
  min-width: 0;
  max-width: 100%;
  width: auto;
}

body.article.lesson #maintext :is(p,li) {
  line-height: 2;
}

body.article.lesson #maintext p {
  margin: 1.4em 0;
}

body.article.lesson #maintext li {
  margin: .55em 0;
}

body.article.lesson #maintext :is(h2,h3) {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 54px 0 23px;
  padding-top: 23px;
  font-size: 25px;
  letter-spacing: -.6px;
}

body.article.lesson #maintext h4 {
  font-size: 19px;
  margin: 37px 0 16px;
  border: 0;
}

body.article.lesson #maintext h5 {
  font-size: 15px;
  margin: 28px 0 14px;
}

body.article.lesson #maintext .lesson-heading {
  border-bottom: 2px solid var(--ink);
  padding-bottom: 22px;
  margin-bottom: 28px;
}

body.article.lesson #maintext .lesson-heading h1 {
  border: 0;
  font-size: clamp(28px,3.2vw,40px);
  margin: 13px 0;
  font-weight: 750;
  letter-spacing: -1px;
}

body.article.lesson #maintext .lesson-heading .eyebrow {
  margin: 0;
}

body.article.lesson #maintext .lesson-date {
  font-size: 10px;
  color: var(--muted);
  margin: 12px 0 0;
}

body.article.lesson #maintext :is(.code,.proglist,.cmdline,.eqn) {
  margin: 24px 0;
  line-height: 1.65;
}

body.article.lesson #maintext pre {
  overflow-x: auto;
  width: 100%;
  font-size: 13px;
  padding: 20px;
  margin: 0;
  white-space: pre;
  tab-size: 4;
  border: 1px solid var(--line);
  border-left: 3px solid #c3a477;
  background: #23251f;
  color: #f8f8f2;
  border-radius: 0;
  line-height: 1.7;
  box-shadow: none;
  text-shadow: none;
}

body.article.lesson #maintext .cmdline pre {
  background: #1d211d;
  color: #f8f8f2;
  border-left-color: var(--accent);
}

body.article.lesson #maintext code {
  font-family: Menlo,Consolas,monospace;
  font-size: .88em;
  overflow-wrap: anywhere;
}

body.article.lesson #maintext pre code {
  font-size: inherit;
  overflow-wrap: normal;
}

body.article.lesson #maintext .note {
  background: var(--soft);
  border: 0;
  border-left: 3px solid #b99758;
  border-radius: 0;
  padding: 12px 18px;
  margin: 24px 0;
  box-shadow: none;
  width: 100%;
}

body.article.lesson #maintext .note :is(p,h5,pre) {
  width: auto;
  font-size: 12px;
  margin: 8px 0;
  line-height: 1.9;
}

body.article.lesson #maintext .note a {
  display: inline;
}

body.article.lesson #maintext .fig {
  width: 100%;
  margin: 30px 0;
  padding: 0;
  line-height: 1.6;
  font-size: 12px;
  color: var(--muted);
}

body.article.lesson #maintext img {
  height: auto;
}

body.article.lesson #maintext .fig img {
  max-width: 100%;
}

body.article.lesson #maintext .fig:has(img[src="images/hbar.png"]) {
  height: 1px;
  background: var(--line);
  margin: 45px 0;
}

body.article.lesson #maintext img[src="images/hbar.png"] {
  display: none;
}

body.article.lesson #maintext iframe {
  max-width: 100%;
  aspect-ratio: 16/9;
  height: auto;
}

body.article.lesson #maintext .table_scroll {
  width: 100%;
  overflow-x: auto;
  white-space: normal;
}

body.article.lesson #maintext table {
  display: block;
  overflow-x: auto;
  border-collapse: collapse;
  max-width: 100%;
  font-size: 13px;
}

body.article.lesson #maintext :is(td,th) {
  padding: 10px;
  border: 1px solid var(--line);
}

body.article.lesson #maintext .att p {
  background: #fff0c6;
  padding: 16px;
  border: 1px solid #e7c46f;
}

body.article.lesson #maintext .lesson-pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 25px;
  border-top: 2px solid var(--ink);
  margin-top: 60px;
  padding-top: 22px;
  font-size: 11px;
}

body.article.lesson #maintext .lesson-pager a {
  padding: 14px;
  background: var(--soft);
}

.lesson-pager a:last-child {
  text-align: right;
}

.lesson-pager strong {
  display: block;
  color: var(--ink);
  font-size: 14px;
  margin-top: 6px;
}

body.article.lesson #maintext mjx-container {
  max-width: 100%;
  min-width: 0!important;
  overflow-x: auto;
  overflow-y: hidden;
}

body.article.lesson #maintext mjx-container[display="true"] {
  padding: 12px 0;
}

body.article.lesson #maintext small {
  font-size: 12px;
}

body.article.lesson #maintext blockquote {
  margin: 24px 0;
  padding-left: 20px;
  border-left: 3px solid var(--line);
}

body.article.lesson #maintext blockquote p {
  border: 0;
  padding: 0;
}

/* 画面幅に応じた表示の調整（レスポンシブ対応） */

/* 画面幅に応じた表示の調整（レスポンシブ対応） */
/* 画面幅に応じた表示の調整（レスポンシブ対応） */
@media(min-width:1440px) {
  .hero {
    padding-top: 65px;
    padding-bottom: 65px;
  }

}

@media(max-width:1240px) {
  .lesson-layout {
    margin: 0 40px;
    gap: 35px;
    grid-template-columns: minmax(0,1fr) 220px;
  }

  .course-nav {
    margin: 0 40px;
  }

  .hero h1 {
    font-size: 44px;
  }

}

@media(max-width:900px) {
  .site-header {
    padding: 20px 28px;
  }

  .home main {
    padding: 0 28px;
  }

  .hero {
    gap: 20px;
  }

  .hero h1 {
    font-size: 35px;
    letter-spacing: -1.5px;
  }

  .hero-actions {
    flex-wrap: wrap;
    gap: 14px;
  }

  .hero-description {
    font-size: 12px;
  }

  .desktop-break {
    display: none;
  }

  .course-meta {
    gap: 18px;
    flex-wrap: wrap;
  }

  .course-meta>span+span {
    padding-left: 18px;
  }

  .course-meta>span:last-child {
    border: 0;
    padding: 0;
  }

  .section-heading h2,.about-section h2 {
    font-size: 23px;
  }

  .chapter {
    grid-template-columns: 85px 1fr;
  }

  .chapter-number {
    font-size: 52px;
  }

  .resource-columns {
    gap: 32px;
  }

  .about-section {
    gap: 28px;
    padding: 28px;
  }

  .lesson-layout {
    display: flex;
    flex-direction: column;
    margin: 0 28px;
    padding-top: 25px;
    gap: 24px;
  }

  .lesson-toc {
    position: static;
    max-height: 310px;
    width: 100%;
    order: 0;
    padding: 12px 16px;
    border: 1px solid var(--line);
    border-top: 3px solid var(--accent);
  }

  .lesson-toc nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px 20px;
  }

  .lesson-toc summary {
    margin-bottom: 8px;
  }

  .lesson-toc a.level-3 {
    grid-column: 1/-1;
  }

  .course-nav {
    margin: 0 28px;
  }

  body.article.lesson #maintext {
    order: 1;
  }

  .site-footer {
    padding: 24px 28px;
    flex-wrap: wrap;
  }

}

@media(max-width:600px) {
  .site-header {
    padding: 16px 20px;
    align-items: start;
    gap: 15px;
    flex-direction: column;
  }

  .brand {
    font-size: 23px;
  }

  .brand-icon {
    width: 38px;
    height: 38px;
    font-size: 31px;
  }

  .brand small {
    font-size: 8px;
  }

  .site-header nav {
    width: 100%;
    justify-content: space-between;
    gap: 10px;
    font-size: 11px;
  }

  .home main {
    padding: 0 20px;
  }

  .breadcrumb {
    padding-top: 17px;
    font-size: 10px;
  }

  .hero {
    grid-template-columns: 1fr;
    padding: 32px 0;
  }

  .hero h1 {
    font-size: 39px;
    margin: 18px 0;
    line-height: 1.42;
  }

  .hero .eyebrow {
    font-size: 8px;
    letter-spacing: 1.2px;
  }

  .hero-subtitle {
    font-size: 14px;
  }

  .hero-description {
    font-size: 12px;
  }

  .hero-actions {
    margin-top: 24px;
    gap: 20px;
  }

  .hero-figure {
    max-width: 420px;
    width: 100%;
    margin: 10px auto 0;
  }

  .hero-figure svg {
    max-height: 290px;
  }

  .hero-figure figcaption {
    font-size: 9px;
  }

  .course-meta {
    gap: 9px 15px;
    font-size: 10px;
    padding: 13px 0;
  }

  .course-meta b {
    font-size: 13px;
  }

  .course-meta>span+span {
    padding-left: 15px;
  }

  .course-meta>span:last-child {
    flex-basis: 100%;
    padding: 0;
  }

  .curriculum {
    padding-top: 39px;
  }

  .section-heading {
    display: block;
    margin-bottom: 22px;
  }

  .section-heading h2,.about-section h2 {
    font-size: 23px;
  }

  .section-heading>p {
    margin-top: 13px;
    font-size: 11px;
  }

  .chapter {
    grid-template-columns: 54px 1fr;
    padding: 22px 0;
  }

  .chapter-number {
    font-size: 39px;
    letter-spacing: -2px;
  }

  .chapter h3 {
    font-size: 17px;
  }

  .chapter h3 a span {
    font-size: 18px;
    padding: 0;
  }

  .chapter-body>p:not(.chapter-label) {
    font-size: 11px;
  }

  .chapter details ul {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .chapter details li a {
    font-size: 11px;
    padding: 10px 0;
  }

  .chapter-label {
    font-size: 9px;
  }

  .chapter-label span {
    font-size: 8px;
  }

  .about-section {
    grid-template-columns: 1fr;
    gap: 17px;
    margin: 36px 0;
    padding: 23px 20px;
  }

  .about-section>div>p:not(.eyebrow) {
    font-size: 12px;
  }

  .author-note {
    font-size: 11px;
  }

  .resource-columns {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .resources .section-heading>a {
    display: inline-block;
    margin-top: 15px;
  }

  .resources {
    padding-bottom: 35px;
  }

  .site-footer {
    padding: 22px 20px;
    gap: 10px;
    font-size: 9px;
  }

  .site-footer>a:first-child {
    flex-basis: 100%;
  }

  .site-footer>a:last-child {
    margin-left: auto;
  }

  .course-nav {
    margin: 0 20px;
    font-size: 10px;
  }

  .lesson-layout {
    margin: 0 20px;
    padding-bottom: 35px;
  }

  .lesson-toc nav {
    grid-template-columns: 1fr;
  }

  .lesson-toc a.level-3 {
    grid-column: auto;
  }

  body.article.lesson #maintext {
    font-size: 14px;
  }

  body.article.lesson #maintext .lesson-heading h1 {
    font-size: 28px;
  }

  body.article.lesson #maintext :is(h2,h3) {
    font-size: 22px;
    margin-top: 38px;
  }

  body.article.lesson #maintext h4 {
    font-size: 17px;
  }

  body.article.lesson #maintext pre {
    padding: 14px 12px;
    font-size: 12px;
  }

  body.article.lesson #maintext .lesson-pager {
    gap: 12px;
  }

  body.article.lesson #maintext .lesson-pager a {
    padding: 12px 10px;
  }

  .lesson-pager strong {
    font-size: 12px;
  }

  body.article.lesson #maintext :is(ul,ol) {
    padding-left: 1.5em;
    width: auto;
  }

  body.article.lesson #maintext .fig img {
    max-width: 100%;
  }

  body.article.lesson #maintext .size_fix {
    max-width: 100%!important;
    width: auto!important;
  }

}

@media print {
  .site-header,.course-nav,.lesson-toc,.lesson-pager,.skip-link {
    display: none;
  }

  .lesson-layout {
    display: block;
    margin: 0;
    padding: 0;
  }

  body.article.lesson #maintext {
    width: 100%;
  }

  .home main {
    padding: 0;
  }

  .chapter details {
    display: block;
  }

  .hero {
    grid-template-columns: 1fr 1fr;
  }

  .site-footer {
    position: static;
  }

  body.article.lesson #maintext pre {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
  }

  .chapter,.hero-figure {
    break-inside: avoid;
  }

}

@media(max-width:600px) {
  .hero h1 {
    font-size: clamp(28px,8.8vw,39px);
  }

  .hero h1 span {
    white-space: nowrap;
  }

}

@media(min-width:601px) {
  .hero-description {
    font-size: 14px;
  }

  .chapter-body>p:not(.chapter-label) {
    font-size: 14px;
  }

  .chapter details li a {
    font-size: 13px;
  }

  .section-heading>p {
    font-size: 13px;
  }

  .resource-columns p,.resource-columns li {
    font-size: 13px;
  }

}

body.article.lesson #header {
  height: auto;
  width: auto;
  background: transparent;
  color: var(--ink);
  margin: 0 auto;
  padding: 23px 48px;
}

body.article.lesson #header a {
  color: var(--ink);
}

body.article.lesson #footer {
  position: static;
  bottom: auto;
  height: auto;
  width: auto;
  background: transparent;
  color: var(--muted);
  margin: 0 auto;
  padding: 25px 48px;
  font-size: 10px;
}

body.article.lesson #footer a {
  color: var(--muted);
}

@media(max-width:900px) {
  body.article.lesson #header {
    padding: 20px 28px;
  }

  body.article.lesson #footer {
    padding: 24px 28px;
  }

}

@media(max-width:600px) {
  body.article.lesson #header {
    padding: 16px 20px;
  }

  body.article.lesson #footer {
    padding: 22px 20px;
    font-size: 9px;
  }

}

/* プログラムリスト：暗い背景・文字色・コピーボタン */
body.article.lesson #maintext pre code {
  color: #f8f8f2;
  background: transparent;
  text-shadow: none;
}

body.article.lesson #maintext pre :is(.token.comment,.token.prolog,.token.doctype,.token.cdata) {
  color: #a8b4c1;
}

body.article.lesson #maintext pre::selection,body.article.lesson #maintext pre ::selection {
  background: #52667a;
  color: #fff;
}

.code-example {
  min-width: 0;
  max-width: 100%;
}

.code-toolbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 6px 10px;
  background: #30332c;
  border: 1px solid #44483d;
  border-bottom: 0;
  color: #d5ddcf;
}

.copy-code {
  flex-shrink: 0;
  min-height: 32px;
  padding: 4px 12px;
  border: 1px solid #737b67;
  border-radius: 3px;
  background: #3c4235;
  color: #fff;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  line-height: 1.5;
}

.copy-code:hover {
  background: #505a44;
  border-color: #a7b296;
}

.copy-code:focus-visible {
  outline: 3px solid #e7a00e;
  outline-offset: 3px;
}

.copy-status {
  font-size: 11px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

body.article.lesson #maintext .code-example pre {
  border-color: #44483d;
  border-left-color: #c3a477;
}

@media print {
  .code-toolbar {
    display: none;
  }

  body.article.lesson #maintext pre,body.article.lesson #maintext pre code {
    background: #fff;
    color: #111;
  }

  body.article.lesson #maintext pre .token {
    color: #111;
  }

}
