@font-face {
  font-family: Inter;
  src: url('/assets/fonts/inter-latin.woff2') format('woff2');
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: 'Geist Mono';
  src: url('/assets/fonts/geist-mono-latin.woff2') format('woff2');
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}
:root {
  color-scheme: light dark;
  --paper: #fff;
  --ink: #242622;
  --body: #555852;
  --muted: #6e716c;
  --line: #eeefec;
  --accent: #5748e7;
  --tint: #f5f3ff;
  --code: #f8f9f7;
  --sans: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'Geist Mono', 'SFMono-Regular', Consolas, monospace;
  font-family: var(--sans);
  font-optical-sizing: auto;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
body { margin: 0; }
::selection { background: #e4dfff; color: #27223b; }
a { color: var(--accent); text-underline-offset: .22em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.skip-link { position: fixed; top: -5rem; left: 1rem; z-index: 5; background: var(--paper); padding: 1rem; }
.skip-link:focus { top: 1rem; }
.masthead { display: flex; align-items: center; justify-content: space-between; min-height: 6rem; max-width: 80rem; margin: auto; padding: 0 2rem; gap: 1.5rem; }
.brand { display: inline-flex; align-items: center; gap: 1rem; color: var(--ink); text-decoration: none; }
.brand img { display: block; width: 8.4375rem; height: auto; }
.brand .logo-dark { display: none; }
.brand span { padding-left: 1rem; border-left: 1px solid var(--line); font-size: .8125rem; font-weight: 450; color: var(--accent); }
.edition { color: var(--muted); font-size: .8125rem; }
.book { display: grid; grid-template-columns: 12rem minmax(0, 40rem) 10rem; gap: 3.5rem; max-width: 80rem; padding: 3.25rem 2rem; margin: auto; }
.sidebar, .outline { align-self: start; position: sticky; top: 2rem; max-height: calc(100dvh - 4rem); overflow-y: auto; padding: .25rem .5rem .5rem; margin: -.25rem -.5rem -.5rem; }
.part { color: var(--ink); font-size: .75rem; font-weight: 550; margin: 2.5rem 0 .75rem; }
.part:first-child { margin-top: .2rem; }
.sidebar a, .mobile-contents nav a { position: relative; display: flex; gap: .75rem; padding: .6rem .5rem; margin-left: -.5rem; border-radius: .375rem; text-decoration: none; color: var(--muted); font-size: .8125rem; line-height: 1.5; }
.chapter-number { flex-shrink: 0; font-family: var(--mono); font-size: .6875rem; padding-top: .16rem; }
a[aria-current='page'] { background: var(--tint); color: var(--accent); font-weight: 500; }
.sidebar a:hover, .mobile-contents nav a:hover { color: var(--ink); background: var(--code); }
.outline a { display: block; color: var(--muted); font-size: .75rem; line-height: 1.6; text-decoration: none; padding: .45rem 0; }
.outline a:hover { color: var(--accent); }
main { min-width: 0; }
.chapter-meta { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem; color: var(--muted); font-size: .75rem; }
.chapter-meta a { color: var(--muted); }
article { font-size: 1rem; line-height: 1.85; color: var(--body); overflow-wrap: break-word; }
h1, h2, h3, h4 { color: var(--ink); font-weight: 550; line-height: 1.25; scroll-margin-top: 2rem; text-wrap: balance; }
h1 { font-size: 2.5rem; letter-spacing: -.045em; margin: 1.5rem 0 2rem; }
h2 { font-size: 1.375rem; letter-spacing: -.025em; margin: 3rem 0 1rem; }
h3 { font-size: 1.125rem; letter-spacing: -.015em; margin: 2rem 0 1rem; }
p { margin: 1.25rem 0; }
.introduction h1 { font-size: clamp(2.5rem, 4vw, 3rem); max-width: 15ch; line-height: 1.12; }
.introduction h1 + p { font-size: 1.125rem; line-height: 1.75; color: var(--ink); }
li { padding-left: .2rem; margin: .8rem 0; }
ul, ol { padding-left: 1.4rem; }
strong { font-weight: 600; color: var(--ink); }
blockquote { margin: 2rem 0; padding: .2rem 0 .2rem 1.25rem; border-left: 2px solid var(--accent); }
code { font-family: var(--mono); font-size: .82em; background: var(--code); padding: .15em .3em; border-radius: .25rem; color: var(--ink); }
.code-example { margin: 2rem 0; border: 1px solid var(--line); border-radius: .75rem; background: var(--code); overflow: hidden; }
.code-example figcaption { font-family: var(--mono); font-size: .6875rem; color: var(--muted); padding: .65rem 1.25rem; border-bottom: 1px solid var(--line); }
pre { margin: 0; padding: 1.25rem; overflow-x: auto; font-size: .8125rem; line-height: 1.85; }
pre code { padding: 0; background: none; font-size: inherit; }
table { display: block; overflow-x: auto; border-collapse: collapse; margin: 2rem 0; font-size: .875rem; line-height: 1.6; }
th, td { text-align: left; padding: .875rem .75rem; border-bottom: 1px solid var(--line); min-width: 8rem; vertical-align: top; }
th { font-weight: 550; color: var(--ink); }
hr { border: 0; border-top: 1px solid var(--line); margin: 3rem 0; }
.pagination { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem; border-top: 1px solid var(--line); margin-top: 3.5rem; padding-top: 1.5rem; overflow-wrap: anywhere; }
.pagination a { text-decoration: none; color: var(--ink); font-size: .875rem; line-height: 1.6; }
.pagination a:hover { color: var(--accent); }
.pagination a:last-child { text-align: right; }
.pagination span { display: block; color: var(--muted); font-size: .6875rem; margin-bottom: .375rem; }
footer { display: flex; align-items: center; gap: .5rem; margin: 3rem 0 1rem; font-size: .6875rem; color: var(--muted); }
.mobile-contents { display: none; }
.motion-example { display: block; width: 100%; height: 26rem; border: 1px solid var(--line); border-radius: .75rem; margin: 2rem 0; }
@media (prefers-color-scheme: dark) {
  :root { --paper: #191a18; --ink: #eeeFEB; --body: #b9bcb5; --muted: #a1a59d; --line: #30332e; --accent: #b7adff; --tint: #2b2740; --code: #21231f; }
  .brand .logo-light { display: none; }
  .brand .logo-dark { display: block; }
  footer img { filter: brightness(1.8) saturate(.7); }
}
@media (max-width: 1200px) {
  .book { grid-template-columns: 12rem minmax(0, 40rem); gap: 3rem; max-width: 62rem; }
  .masthead { max-width: 62rem; }
  .outline { display: none; }
}
@media (max-width: 960px) {
  .masthead { min-height: 5rem; padding: 0 1.5rem; }
  .edition { display: none; }
  .book { display: block; max-width: 44rem; padding: 2.5rem 1.5rem; }
  .sidebar { display: none; }
  .mobile-contents { display: block; border-block: 1px solid var(--line); }
  .mobile-contents summary { padding: 1rem 1.5rem; font-size: .8125rem; cursor: pointer; }
  .mobile-contents summary span { color: var(--muted); margin-left: .75rem; }
  .mobile-contents nav { padding: .5rem 2rem 1.5rem; }
  .mobile-contents nav a { min-height: 2.75rem; align-items: center; }
  h1 { font-size: 2.125rem; }
}
@media print {
  :root { --paper: #fff; --ink: #000; --body: #222; --muted: #444; --accent: #000; --line: #ddd; --code: #f5f5f5; }
  .sidebar, .outline, .mobile-contents, .pagination, .chapter-meta, .skip-link { display: none; }
  .brand .logo-light { display: block; }
  .brand .logo-dark { display: none; }
  .book { display: block; padding: 0; }
  .masthead { padding: 0; min-height: 3rem; }
  article { font-size: 11pt; }
  h1 { font-size: 28pt; }
  pre { white-space: pre-wrap; }
  h2, h3 { break-after: avoid; }
}
