/* Handbook: the palette and typefaces are inherited from design.html. */
.hb-page { --hb-top: 61px; --hb-tools: 49px; }
.hb-page::before { display: none; }
.hb-page ::selection { background: var(--color-accent); color: var(--color-text-inverse); }
.hb-page #main { overflow: clip; }
.hb-page a { text-underline-offset: .25em; }
.hb-page .hdr { position: relative; }
.hb-tools { position: sticky; top: 0; z-index: 110; min-height: var(--hb-tools); background: var(--color-bg); border-bottom: 1px solid var(--color-border); display: flex; align-items: center; gap: 24px; padding: 0 max(24px, calc((100vw - 1320px) / 2)); font: 11px var(--font-mono); }
.hb-index { flex-shrink: 0; }
.hb-index summary { list-style: none; display: flex; align-items: center; gap: 32px; cursor: pointer; min-height: 48px; }
.hb-index summary::-webkit-details-marker { display: none; }
.hb-index summary span { font-size: 20px; color: var(--color-accent); }
.hb-index[open] summary span { transform: rotate(45deg); }
.hb-index nav { position: absolute; left: max(16px, calc((100vw - 1320px) / 2)); top: 100%; width: min(600px, calc(100vw - 32px)); max-height: min(70svh, 620px); overflow: auto; overscroll-behavior: contain; background: var(--color-surface); border: 1px solid var(--color-border-strong); padding: 12px; box-shadow: var(--shadow-lg); }
.hb-index nav a { display: block; padding: 12px; color: var(--color-text-muted); font-size: 12px; border-bottom: 1px solid var(--color-border); line-height: 1.6; }
.hb-index nav a:hover, .hb-index nav a[aria-current] { background: var(--color-accent-bg); color: var(--color-accent); }
.hb-location { margin-left: auto; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--color-text-muted); max-width: 45%; }
.hb-motion { flex-shrink: 0; min-height: 44px; color: var(--color-text-muted); font: inherit; }
.hb-motion:hover { color: var(--color-accent); }
.hb-motion[hidden] { display: none; }
.hb-progress { position: absolute; bottom: -1px; left: 0; width: 100%; height: 2px; pointer-events: none; }
.hb-progress span { display: block; height: 100%; background: var(--color-accent); transform: scaleX(var(--reading-progress, 0)); transform-origin: left; }
.hb-article { position: relative; }
.hb-hero { position: relative; isolation: isolate; min-height: min(850px, calc(100svh - 110px)); padding: clamp(56px, 7vw, 104px) max(24px, calc((100vw - 1320px) / 2)) 72px; display: flex; align-items: center; }
.hb-hero-copy { position: relative; z-index: 2; width: 100%; }
.hb-hero h1 { font-size: clamp(44px, 7.6vw, 112px); font-weight: 800; line-height: .98; letter-spacing: -.065em; max-width: 12ch; margin: 0 0 34px; }
.hb-hero h1 span { color: var(--color-accent); display: block; }
.hb-subtitle { font-size: clamp(18px, 2vw, 26px); letter-spacing: -.035em; font-weight: 500; margin-bottom: 16px; }
.hb-description { font-size: 15px; line-height: 1.8; max-width: 66ch; color: var(--color-text-muted); }
.hb-start { display: inline-flex; align-items: center; gap: 56px; margin-top: 30px; padding: 13px 0; border-bottom: 1px solid var(--color-accent); font-size: 13px; font-weight: 600; }
.hb-start span { font-size: 22px; }
.hb-hero-art { position: absolute; z-index: -1; right: 5%; top: 10%; width: 36%; height: 74%; perspective: 1000px; }
.hb-paper { position: absolute; inset: 10% 8%; border: 1px solid var(--color-border-strong); background: var(--color-bg); transform-origin: 50% 80%; }
.hb-paper--back { transform: translate(24%, -7%) rotate(16deg); opacity: .45; }
.hb-paper--middle { transform: translate(8%, 0%) rotate(8deg); opacity: .6; }
.hb-paper--front { transform: translate(-8%, 8%) rotate(-7deg); border-color: var(--color-accent-soft); background: var(--color-surface); }
.hb-paper svg { width: 100%; height: 100%; stroke: var(--color-border-strong); stroke-width: 1; }
.hb-paper svg circle, .hb-paper svg path:last-child { stroke: var(--color-accent); opacity: .65; }
.hb-cross { position: absolute; font: 24px var(--font-mono); color: var(--color-accent); }
.hb-cross--one { top: 0; right: 0; }.hb-cross--two { bottom: 0; left: -10%; }
.hb-motion-on .hb-paper--back { transform: translate(24%, calc(-7% - var(--sc-p, 0) * 24%)) rotate(16deg); }
.hb-motion-on .hb-paper--middle { transform: translate(8%, calc(var(--sc-p, 0) * -8%)) rotate(8deg); }
.hb-motion-on .hb-paper--front { transform: translate(-8%, calc(8% + var(--sc-p, 0) * 18%)) rotate(-7deg); }
.hb-hero-baseline { position: absolute; bottom: 0; left: max(24px, calc((100vw - 1320px) / 2)); right: max(24px, calc((100vw - 1320px) / 2)); display: flex; align-items: center; gap: 12px; }
.hb-hero-baseline span { height: 1px; background: var(--color-border-strong); flex: 1; }.hb-hero-baseline span:first-child { max-width: 96px; background: var(--color-accent); }.hb-hero-baseline i { width: 5px; height: 5px; background: var(--color-accent); }
.hb-chapter { position: relative; padding: clamp(64px, 8vw, 128px) max(24px, calc((100vw - 1180px) / 2)); border-bottom: 1px solid var(--color-border); scroll-margin-top: 75px; }
.hb-chapter-grid { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: clamp(40px, 7vw, 100px); align-items: start; }
.hb-chapter-side { min-width: 0; }
.hb-chapter h2 { font-size: clamp(25px, 2.7vw, 40px); font-weight: 600; letter-spacing: -.045em; line-height: 1.16; text-wrap: balance; overflow-wrap: anywhere; }
.hb-roman { display: block; font: 12px var(--font-mono); color: var(--color-accent); letter-spacing: .04em; margin-bottom: 26px; }
.hb-side-rule { display: block; width: 40px; height: 1px; background: var(--color-accent); margin-top: 32px; }
.hb-prose { font-size: 16px; line-height: 1.8; max-width: 67ch; min-width: 0; color: var(--color-text-muted); }
.hb-prose p { margin: 0 0 16px; text-wrap: pretty; }
.hb-prose strong { font-weight: 600; color: var(--color-text); }
.hb-prose ul, .hb-prose ol { padding-left: 23px; margin: 22px 0 28px; list-style: disc; }
.hb-prose ol { list-style: decimal; }
.hb-prose li { padding-left: 7px; margin: 9px 0; }
.hb-prose li::marker { color: var(--color-accent); font-size: .85em; }
.hb-prose .hb-subheading { font-size: 22px; font-weight: 600; letter-spacing: -.025em; color: var(--color-text); margin: 36px 0 17px; line-height: 1.4; text-wrap: balance; }
.hb-prose h4.hb-subheading { font-size: 18px; }
.hb-scene .hb-subheading { position: relative; }
.hb-scene .hb-subheading.is-current::before { content: ''; position: absolute; left: -20px; top: .7em; width: 12px; height: 1px; background: var(--color-accent); }
.hb-prose > :first-child { margin-top: 0; }
.hb-prose > :last-child { margin-bottom: 0; }
.hb-comparison { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-block: 32px; border-block: 1px solid var(--color-border-strong); }
.hb-comparison > div { padding-block: 24px; }
.hb-comparison > div + div { border-left: 1px solid var(--color-border-strong); padding-left: 20px; }
.hb-comparison .hb-subheading { font: 12px/1.7 var(--font-mono); margin: 0 0 20px; color: var(--color-accent); }
.hb-prose .hb-statement { font-size: clamp(23px, 2.7vw, 36px); line-height: 1.25; letter-spacing: -.04em; color: var(--color-accent); padding-block: 24px; font-weight: 600; }
.hb-prose blockquote { font-size: clamp(22px, 2.6vw, 32px); letter-spacing: -.025em; line-height: 1.5; color: var(--color-text); margin: 32px 0; padding: 26px 0; border-block: 1px solid var(--color-border-strong); }
.hb-chapter--offset:not(.hb-scene):not(.hb-close) { background: var(--color-surface); }
.hb-chapter--emphasis { background: var(--color-accent-bg) !important; }
.hb-chapter--emphasis h2 { color: var(--color-accent); }
.hb-chapter--emphasis .hb-side-rule { width: 100%; opacity: .4; }
.hb-scene { background: var(--color-surface); }
.hb-scene h2 { font-size: clamp(28px, 3.5vw, 48px); }
.hb-motion-on .hb-scene .hb-chapter-side.is-pinnable { position: sticky; top: 80px; }
.hb-diagram { position: relative; margin-top: 38px; min-height: 260px; isolation: isolate; }
.hb-diagram-part { position: relative; color: var(--color-text-muted); font: 12px/1.6 var(--font-mono); }
.hb-diagram-part span { position: relative; z-index: 1; }
.hb-orbit { position: absolute; width: 100%; max-height: 300px; inset: 0; z-index: -1; stroke: var(--color-border-strong); opacity: .28; }
.hb-diagram-axis { position: absolute; inset: 0 auto 0 0; width: 1px; background: var(--color-border-strong); }
.hb-diagram-axis::after { content: ''; display: block; height: 100%; width: 1px; background: var(--color-accent); transform: scaleY(var(--diagram-progress, 1)); transform-origin: top; }
.hb-diagram--planes .hb-diagram-part { border: 1px solid var(--color-border-strong); background: var(--color-bg); padding: 23px 20px; margin-left: calc(var(--i) * 18px); margin-bottom: 12px; }
.hb-motion-on .hb-diagram--planes .hb-diagram-part { transform: translateX(calc((1 - var(--diagram-progress, 0)) * var(--i) * -12px)); }
.hb-diagram--chain .hb-diagram-part { margin-left: 20px; padding: 10px 14px; border-bottom: 1px solid var(--color-border); font-size: 10px; }
.hb-diagram--chain .hb-diagram-part::before { content: ''; width: 5px; height: 5px; background: var(--color-accent); position: absolute; left: -22px; top: 19px; }
.hb-diagram--documents { min-height: 290px; }
.hb-diagram--documents .hb-diagram-part { position: absolute; left: calc(var(--i) * 8px); right: calc((4 - var(--i)) * 8px); top: calc(var(--i) * 48px); padding: 17px 15px 36px; background: var(--color-bg); border: 1px solid var(--color-border-strong); box-shadow: var(--shadow-sm); }
.hb-motion-on .hb-diagram--documents .hb-diagram-part { transform: translateY(calc((1 - var(--diagram-progress, 0)) * var(--i) * -17px)); }
.hb-diagram--stop { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; min-height: 240px; background: var(--color-border); border: 1px solid var(--color-border); }
.hb-diagram--stop .hb-diagram-part { padding: 15px; display: grid; place-items: center; font: 600 72px/1 var(--font-sans); color: var(--color-text-muted); background: var(--color-bg); }
.hb-diagram--stop .hb-orbit, .hb-diagram--stop .hb-diagram-axis { display: none; }
.hb-diagram--resolve .hb-diagram-part { margin-left: 20px; padding: 16px 8px; border-bottom: 1px solid var(--color-border-strong); }
.hb-diagram--resolve .hb-diagram-part::before { content: ''; position: absolute; top: 50%; left: -20px; width: 15px; height: 1px; background: var(--color-accent); }
.hb-diagram-part.is-active { color: var(--color-accent); border-color: var(--color-accent); }
.hb-diagram--stop .hb-diagram-part.is-active { color: var(--color-text-inverse); background: var(--color-accent); }
.hb-scene[data-scene="resolve"] { background: var(--color-bg); padding-block: 140px; }
.hb-scene[data-scene="resolve"] h2 { font-size: clamp(42px, 5vw, 72px); }
.hb-scene[data-scene="resolve"] .hb-prose > h3 { color: var(--color-accent); font-size: clamp(32px, 4vw, 52px); line-height: 1.2; margin-block: 48px; }
.hb-scene[data-scene="resolve"] .hb-prose > h4 { margin-top: 48px; color: var(--color-accent); }
.hb-close { background: var(--color-accent); color: var(--color-text-inverse); padding-block: clamp(72px, 10vw, 160px); }
.hb-close .hb-chapter-grid { grid-template-columns: .7fr 1.3fr; }
.hb-close h2 { font: 12px var(--font-mono); letter-spacing: .06em; }
.hb-close .hb-side-rule { background: currentColor; }
.hb-close .hb-prose, .hb-close .hb-prose strong { color: var(--color-text-inverse); }
.hb-close .hb-prose { font-size: 18px; }
.hb-close .hb-prose > p:last-child { margin-top: 40px; font-size: clamp(28px, 4vw, 48px); letter-spacing: -.045em; line-height: 1.15; font-weight: 600; }
.hb-end { max-width: 1180px; margin: 0 auto; padding: 36px 24px; display: flex; justify-content: space-between; gap: 20px; font: 12px var(--font-mono); }
.hb-page .ftr { margin-top: 0; }
.hb-page [id] { scroll-margin-top: 78px; }
.hb-motion-on .hb-chapter.is-visible .hb-side-rule { animation: hb-rule 700ms var(--ease-out) both; transform-origin: left; }
@keyframes hb-rule { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@media (min-width: 1600px) { .hb-hero-art { right: calc((100vw - 1320px) / 2); width: 430px; } }
@media (max-width: 1000px) {
  .hb-chapter-grid { gap: 38px; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); }
  .hb-hero-art { opacity: .65; right: 3%; width: 40%; top: 7%; }
  .hb-location { max-width: 32%; }
}
@media (max-width: 700px) {
  .hb-tools { padding-inline: 20px; gap: 12px; justify-content: space-between; }
  .hb-location { display: none; }.hb-index summary { gap: 16px; }
  .hb-motion { font-size: 10px; }
  .hb-hero { min-height: 700px; padding: 54px 22px 200px; align-items: start; }
  .hb-hero h1 { font-size: clamp(35px, 8.9vw, 62px); letter-spacing: -.055em; max-width: none; line-height: 1.03; margin-bottom: 26px; }
  .hb-subtitle { font-size: 20px; max-width: 25ch; }
  .hb-description { font-size: 14px; line-height: 1.75; max-width: 45ch; }
  .hb-start { margin-top: 20px; }
  .hb-hero-art { width: 155px; height: 200px; top: auto; bottom: 20px; right: 32px; opacity: .9; }
  .hb-cross { font-size: 16px; }
  .hb-chapter { padding: 56px 22px; }
  .hb-chapter-grid, .hb-close .hb-chapter-grid { display: block; }
  .hb-chapter-side { margin-bottom: 32px; }
  .hb-chapter h2 { font-size: 28px; max-width: 23ch; }
  .hb-roman { margin-bottom: 18px; }
  .hb-side-rule { margin-top: 24px; }
  .hb-prose { max-width: none; font-size: 16px; }
  .hb-prose .hb-subheading { font-size: 21px; }
  .hb-comparison { gap: 12px; }
  .hb-comparison .hb-subheading { font-size: 11px; }
  .hb-comparison > div + div { padding-left: 12px; }
  .hb-diagram { margin: 24px 0 0; min-height: 0; }
  .hb-orbit { display: none; }
  .hb-diagram--planes, .hb-diagram--chain, .hb-diagram--resolve { display: flex; flex-wrap: wrap; gap: 6px; }
  .hb-diagram--planes .hb-diagram-part, .hb-diagram--chain .hb-diagram-part, .hb-diagram--resolve .hb-diagram-part { margin: 0; padding: 8px; font-size: 9px; border: 1px solid var(--color-border-strong); transform: none !important; flex: 1 1 28%; }
  .hb-diagram-axis, .hb-diagram-part::before { display: none; }
  .hb-diagram--documents { min-height: 195px; }
  .hb-diagram--documents .hb-diagram-part { top: calc(var(--i) * 32px); padding: 8px 10px 24px; font-size: 10px; }
  .hb-diagram--stop { grid-template-columns: repeat(4, 1fr); }
  .hb-diagram--stop .hb-diagram-part { font-size: 42px; padding: 12px; }
  .hb-motion-on .hb-scene .hb-chapter-side.is-pinnable { display: contents; position: static; }
  .hb-motion-on .hb-scene .hb-chapter-side.is-pinnable h2 { margin-bottom: 24px; }
  /* Only the small diagram pins on phones, for the first part of its chapter. */
  .hb-motion-on .hb-scene .hb-chapter-side.is-pinnable .hb-diagram { position: sticky; top: 49px; z-index: 3; background: var(--color-surface); margin-bottom: 32px; padding-block: 8px; }
  .hb-motion-on .hb-scene.mobile-pin-ended .hb-chapter-side.is-pinnable .hb-diagram { position: relative; top: auto; }
  .hb-scene[data-scene="resolve"] { padding-block: 72px; }
  .hb-scene[data-scene="resolve"] h2 { font-size: 44px; }
  .hb-close h2 { font-size: 12px; }
  .hb-close .hb-prose { font-size: 17px; }
  .hb-end { font-size: 10px; }
}
.hb-motion-off .hb-paper, .hb-motion-off .hb-diagram-part { transform: none; }
.hb-motion-off .hb-paper--back { transform: translate(24%, -7%) rotate(16deg); }
.hb-motion-off .hb-paper--middle { transform: translate(8%, 0%) rotate(8deg); }
.hb-motion-off .hb-paper--front { transform: translate(-8%, 8%) rotate(-7deg); }
.hb-motion-off .hb-diagram-axis::after { transform: none; }
.hb-motion-off { scroll-behavior: auto; }
html:has(.hb-motion-off) { scroll-behavior: auto; }
@media (prefers-reduced-motion: reduce) {
  .hb-page *, .hb-page *::before, .hb-page *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .hb-chapter-side { position: static !important; }
}
@media print {
  .hb-page { background: white; color: black; }
  .hb-page .hdr, .hb-tools, .hb-hero-art, .hb-diagram, .hb-start, .hb-end, .hb-page .ftr, .hb-hero-baseline, .hb-side-rule { display: none !important; }
  .hb-hero, .hb-chapter { padding: 20pt 0; background: white !important; min-height: 0; border-color: #aaa; }
  .hb-chapter-grid, .hb-close .hb-chapter-grid { display: block; }
  .hb-chapter-side { position: static !important; margin-bottom: 16pt; }
  .hb-prose { max-width: none; font-size: 11pt !important; }
  .hb-hero h1 { font-size: 32pt; max-width: none; }
  .hb-page h2 { font-size: 20pt !important; }
  .hb-page [data-source], .hb-page strong, .hb-page .hb-roman, .hb-page h1 span { color: black !important; opacity: 1 !important; }
  .hb-prose .hb-statement { font-size: 16pt; }
  .hb-prose li::marker { color: black; }
  .hb-page h2, .hb-page h3, .hb-page h4 { break-after: avoid; }
  .hb-prose p, .hb-prose li { orphans: 3; widows: 3; }
}
