@import url("fonts.css");
:root {
  color-scheme: light dark;
  --paper: #fff;
  --ink: #222;
  --red: #c81418;
  --hover: #df161b;
  --visited: #6b0b0d;
  --muted: #5c5c5c;
  --pale: #faf9f8;
  --inline: #f5f3f1;
  --rule: #d8d4d1;
  --reading: var(--type-reading);
  --heading: var(--type-heading);
  --code: var(--type-code);
}
* { box-sizing: border-box; }
html { scroll-padding-top: 1.5rem; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 17px/1.7 var(--reading); font-variant-ligatures: common-ligatures; font-variant-numeric: oldstyle-nums; }
a { color: var(--red); text-decoration: underline; text-underline-offset: .1em; }
a:visited { color: var(--visited); }
a:hover { color: var(--hover); }
a:focus-visible, button:focus-visible, input:focus-visible, summary:focus-visible {
  outline: 3px solid var(--red);
  outline-offset: 4px;
}
button, input, summary { font: inherit; }
.skip-link { position: absolute; left: 1rem; top: -100px; z-index: 10; background: var(--paper); padding: .5rem; }
.skip-link:focus { top: .5rem; }
.header-inner {
  max-width: 1200px;
  margin: auto;
  padding: 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  min-height: 104px;
}
.header-brand { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem; max-width: 100%; }
.brand, .brand:visited { display: flex; align-items: center; gap: 10px; color: var(--red); text-decoration: none; }
.brand img { flex: 0 0 48px; width: 48px; height: 48px; }
.brand span { font: 700 28px/1.15 var(--heading); }
.brand b { font-weight: inherit; }
.edition { color: var(--muted); font-size: 12px; white-space: nowrap; }
.project-links { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: flex-end; gap: 1.25rem; font-size: 13px; font-weight: 600; }
.project-links > a, .project-links > a:visited { color: var(--ink); text-decoration: none; white-space: nowrap; }
.project-links > a:hover { color: var(--red); text-decoration: underline; }
.path-disclosure { position: relative; }
.path-disclosure > summary { cursor: pointer; list-style: none; white-space: nowrap; }
.path-disclosure > summary::-webkit-details-marker { display: none; }
.path-disclosure > summary:hover { color: var(--red); text-decoration: underline; }
.path-disclosure[open] > summary { color: var(--red); }
.guide-menu {
  position: absolute;
  z-index: 5;
  top: 2rem;
  right: -4rem;
  width: 340px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  padding: 1.25rem;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 5px 16px #0002;
  font-size: 14px;
  font-weight: 400;
}
.search-label { display: block; font-weight: 700; margin-bottom: .5rem; }
.guide-menu input { width: 100%; border: 1px solid var(--rule); border-radius: 4px; padding: .6rem; background: var(--paper); color: var(--ink); }
.chapter-list { padding-left: 1.5rem; }
.chapter-list li { padding: .3rem 0; }
.chapter-list a[aria-current] { font-weight: 700; }
.search-status { color: var(--muted); font-size: 12px; }
.book-layout { display: grid; grid-template-columns: minmax(0, 44rem) minmax(14rem, 18rem); align-items: start; justify-content: space-between; gap: clamp(2rem, 5vw, 5rem); max-width: 1200px; margin: auto; padding: 2.75rem 24px 4rem; }
main { min-width: 0; outline: none; }
h1, h2 { font-family: var(--heading); font-weight: 700; }
h1, h2, h3, h4, h5, h6, ol { font-variant-numeric: lining-nums; }
h1 { color: var(--red); font-size: clamp(2.5rem, 4.5vw, 3.5rem); line-height: 1.1; margin: 0 0 1.5rem; overflow-wrap: anywhere; }
.introduction h1 span { display: block; margin-top: .75rem; color: var(--muted); font: 400 14px/1.5 var(--reading); }
h2 { font-size: 34px; line-height: 1.2; margin: 3rem 0 1rem; }
h3 { font-size: 22px; line-height: 1.35; font-weight: 600; margin: 2rem 0 .75rem; }
h4 { font-size: 18px; line-height: 1.4; font-weight: 600; margin: 1.75rem 0 .75rem; }
h2 a, h2 a:visited { color: var(--red); text-decoration: none; }
h3 a, h3 a:visited, h4 a, h4 a:visited { color: var(--ink); text-decoration: none; }
h2 a:hover, h3 a:hover, h4 a:hover { text-decoration: underline; }
p { margin: 0 0 1.125rem; }
ul, ol { padding-left: 1.75rem; }
li { margin-bottom: .5rem; }
.introduction > p, .guide-summary { font-size: 20px; line-height: 1.6; }
.guide-summary { margin: 0 0 2.5rem; }
.guide-body { counter-reset: chapter; }
.guide-body h2 { counter-increment: chapter; }
.guide-body h2 a::before { content: counter(chapter) ". "; font-weight: 400; }
.contents, .index-notes {
  position: sticky;
  top: 1.5rem;
  min-width: 0;
  max-height: calc(100dvh - 3rem);
  overflow: auto;
  padding: 4px 0;
  font-size: 14px;
  line-height: 1.65;
}
.contents h2 { font: 600 16px/1.4 var(--reading); margin: 0 0 1rem; }
.contents ol { margin: 0; padding: 0 0 0 1.5rem; }
.contents li { margin-bottom: .75rem; }
.contents li::marker { color: var(--muted); }
.contents .level-3 { margin-left: .75rem; list-style-type: circle; }
.contents a, .contents a:visited { color: var(--ink); text-decoration: none; }
.contents a:hover { color: var(--red); text-decoration: underline; }
.mobile-contents { display: none; }
.guide-note { border: 1px solid #b8e4e7; background: #f2fbfc; border-radius: 8px; padding: 16px 16px 16px 48px; margin-bottom: 16px; position: relative; }
.guide-note::before { content: "i"; position: absolute; left: 16px; top: 18px; border: 1px solid #00818a; color: #006d75; border-radius: 50%; width: 19px; height: 19px; font-weight: 600; text-align: center; line-height: 17px; }
.guide-note p { margin: 0; }
.example-note { border-color: #eadfa9; background: #fffcef; }
.example-note::before { content: "✓"; color: #6a5900; border-color: #9b8300; }
.guide-index section { margin-top: 3rem; }
.guide-index h2 { font-size: 30px; margin: 0 0 1.5rem; }
.guide-index dl { margin: 0; }
.guide-index dt { font-size: 20px; line-height: 1.4; font-weight: 700; margin: 0 0 .5rem; }
.guide-index dd { color: var(--muted); font-size: 16px; line-height: 1.65; margin: 0 0 1.25rem; padding: 0 0 1.25rem; border-bottom: 1px solid var(--rule); }
.guide-index dd:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }
.reading-note { margin-top: 2.5rem; }
.api-reference { margin-top: 2.5rem; }
.api-reference iframe { display: block; width: 100%; height: 75vh; min-height: 36rem; margin-top: 1.5rem; border: 1px solid var(--rule); border-radius: 8px; background: var(--paper); }
code { font: .88em/1.5 var(--code); background: var(--inline); border-radius: 4px; padding: 1px 3px; overflow-wrap: anywhere; }
pre { color: #fff; background: #261b23; border-radius: 8px; padding: 1.25rem; margin: 1.5rem 0; overflow: auto; font: 14px/1.7 var(--code); tab-size: 2; }
pre code { color: inherit; font: inherit; background: transparent; padding: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.code-block { position: relative; }
.code-block pre { padding-top: 2.5rem; }
.copy-code { position: absolute; top: .5rem; right: .6rem; color: #fff; background: #3a3939; border: 1px solid #888; border-radius: 4px; padding: .25rem .5rem; font-size: 12px; cursor: pointer; }
.ruby-keyword, .ruby-constant { color: #9decfc; }
.ruby-string, .ruby-regexp { color: #c1edb0; }
.ruby-comment { color: #b4b4b3; font-style: italic; }
.ruby-value { color: #cfb7fd; }
blockquote { margin: 1.5rem 0; background: #fff9da; border: 1px solid #e4c000; border-radius: 8px; padding: 1rem; }
blockquote p:last-child { margin-bottom: 0; }
.guide-body img { max-width: 100%; height: auto; }
figure { margin: 2rem 0; }
figcaption { font-size: 14px; color: var(--muted); margin-top: .75rem; }
.guide-body table { width: 100%; border-collapse: collapse; margin: 2rem 0; display: block; overflow: auto; }
th, td { padding: .5rem; text-align: left; }
th { background: #3a3939; color: #fff; font-size: 14px; }
tr:nth-child(even) { background: var(--pale); }
.pagination { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; border-top: 1px solid var(--rule); margin: 3rem 0 2rem; padding-top: 1.5rem; }
.pagination > div:last-child { text-align: right; }
.pagination > div { min-width: 0; overflow-wrap: anywhere; }
.pagination small { display: block; color: var(--muted); font-size: 12px; margin-bottom: .5rem; }
.contribute { color: var(--muted); font-size: 14px; }
.site-footer { max-width: 1200px; margin: auto; padding: 1.5rem 24px 2rem; color: var(--muted); font-size: 14px; }
.site-footer p { max-width: 75ch; }
.site-footer > a { display: inline-block; margin: .5rem 1.5rem .5rem 0; }
@media (max-width: 1100px) and (min-width: 1025px) {
  .header-inner { gap: 1rem; }
  .brand span { font-size: 26px; }
  .project-links { gap: 1rem; }
}
@media (max-width: 1024px) {
  .header-inner { flex-direction: column; align-items: flex-start; gap: 1rem; max-width: 752px; padding: 1.25rem 1.5rem; }
  .header-brand { flex-direction: column; align-items: flex-start; gap: .375rem; }
  .edition { padding-left: 58px; }
  .project-links { position: relative; width: 100%; justify-content: flex-start; gap: .5rem 1.5rem; }
  .project-links > a, .path-disclosure > summary { display: flex; align-items: center; justify-content: center; min-height: 44px; }
  .path-disclosure { position: static; }
  .guide-menu { top: 100%; right: 0; left: 0; width: min(340px, calc(100vw - 32px)); margin-inline: auto; max-height: min(32rem, 65dvh); }
  .book-layout { display: block; max-width: 752px; padding: 1.75rem 1.5rem 3rem; }
  .contents { display: none; }
  .mobile-contents { display: block; border: 1px solid var(--rule); border-radius: 8px; background: var(--pale); padding: .75rem 1rem; margin: 1.5rem 0 2rem; }
  .mobile-contents summary { cursor: pointer; font-weight: 700; }
  .mobile-contents ol { padding-left: 1.5rem; }
  .index-notes { position: static; padding: 0; width: auto; max-height: none; margin-top: 2rem; }
  .site-footer { max-width: 752px; padding: 1.5rem; }
}
@media (max-width: 479px) {
  h1 { font-size: clamp(2.25rem, 10vw, 2.75rem); }
  h2 { font-size: 30px; }
  h3 { font-size: 21px; }
  .introduction > p, .guide-summary { font-size: 18px; }
  .header-inner { padding: 1.25rem; }
  .brand span { font-size: clamp(1.5rem, 6.5vw, 1.75rem); }
  .project-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; gap: 0 .75rem; }
  .project-links > a, .path-disclosure > summary { justify-content: flex-start; }
  .project-links > a { white-space: normal; }
  .book-layout { padding-inline: 1.25rem; }
  .guide-index dt { font-size: 18px; }
  .pagination { gap: 1rem; font-size: 14px; }
  .copy-code { min-height: 44px; min-width: 44px; }
  .code-block pre { padding-top: 4rem; }
}
@media (prefers-color-scheme: dark) {
  :root { --paper: #181818; --ink: #e5e5e5; --red: #f06b6e; --hover: #eb3d40; --visited: #f06b6e; --muted: #b4b4b3; --pale: #292929; --inline: #2e2e2e; --rule: #666; }
  h1 { color: #ccc; }
  .guide-note { background: #153536; border-color: #00818a; }
  .guide-note::before { color: #a2edf0; border-color: #a2edf0; }
  .example-note, blockquote { background: #373219; border-color: #9b8300; }
  .example-note::before { color: #f3e6a0; border-color: #f3e6a0; }
}
@media print {
  .project-links, .contents, .index-notes, .mobile-contents, .copy-code, .pagination, .site-footer, .api-reference iframe { display: none; }
  .book-layout { display: block; max-width: none; padding: 0; }
  .header-inner { min-height: 0; padding: 0 0 2rem; }
  .header-brand { flex-direction: row; }
  .brand { flex-direction: row; }
  body { background: white; color: black; }
  a { color: inherit; }
  pre, pre code { white-space: pre-wrap; }
}
