:root {
  --paper: #fcfcf8;
  --ink: #22201d;
  --quiet: #514e48;
  --sun: #ffdf45;
  --sun-soft: #fff1a3;
  --lilac: #dcd6fa;
  --lilac-soft: #eeebfc;
  --violet: #4931a2;
  --link: #3d278a;
  --line: #c9c4b8;
  --white: #ffffff;
  --display: "Rubik", "Arial Rounded MT Bold", Arial, sans-serif;
  --reading: "Noto Sans", Arial, sans-serif;
  --body-size: 1.0625rem;
  --leading: 1.68;
  --measure: 66ch;
  --wide: 76rem;
  --gutter: clamp(1.25rem, 4.6vw, 4.5rem);
  --curve: 2rem;
  --pill: 100vmax;
  --space: clamp(3.25rem, 6vw, 6rem);
}

@font-face {
  font-family: "Rubik";
  src: url("/assets/rubik-reading-head.3729158d7ab5.woff") format("woff");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "Noto Sans";
  src: url("/assets/noto-reading-text.833542dc8152.woff") format("woff");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

* { box-sizing: border-box; }
html { scroll-padding-top: 2rem; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--reading); font-size: var(--body-size); line-height: var(--leading); }
button { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: var(--link); text-decoration-thickness: .09em; text-underline-offset: .2em; }
a:hover { text-decoration-thickness: .16em; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--violet); outline-offset: 5px; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.13; text-wrap: balance; }
h1 { margin: .3em 0 .4em; font-size: clamp(2.5rem, 4.7vw, 4.3rem); letter-spacing: -.045em; }
h2 { margin: 0 0 .7em; font-size: clamp(1.75rem, 2.7vw, 2.5rem); letter-spacing: -.025em; }
h3 { margin: 0 0 .65em; font-size: 1.25rem; }
p { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }
figure { margin: 0; }
::selection { background: var(--sun); color: var(--ink); }
[id] { scroll-margin-top: 2rem; }

[class$="-skip"] { position: absolute; top: .6rem; left: var(--gutter); transform: translateY(-200%); z-index: 10; padding: .7rem 1rem; min-height: 44px; background: var(--white); }
[class$="-skip"]:focus { transform: none; }
[class$="-mast"] { max-width: var(--wide); margin: auto; padding: 1.4rem var(--gutter); display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
[class$="-name"] { display: flex; align-items: center; gap: .75rem; max-width: 18rem; min-height: 48px; font-family: var(--display); font-size: 1.125rem; line-height: 1.2; text-decoration: none; color: var(--ink); }
[class$="-name"]::before { content: ""; width: 1.4rem; height: 2.4rem; flex: 0 0 1.4rem; border-radius: .8rem; background: var(--sun); box-shadow: .3rem .15rem 0 var(--violet); }
[class$="-directory-link"] { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: .55rem 1.15rem; border-radius: var(--pill); background: var(--lilac-soft); color: var(--link); text-decoration: none; font-size: 1rem; white-space: nowrap; }
[class$="-directory-link"]::after { content: "↓"; margin-left: .65rem; }
[class$="-hero"] { max-width: var(--wide); margin: .3rem auto 0; padding: 3.5rem var(--gutter) 4rem; }
[class$="-kicker"] { font-size: 1rem; margin-bottom: 1.4rem; color: var(--ink); }
[class$="-lead"] { max-width: 52ch; font-size: clamp(1.125rem, 1.5vw, 1.3rem); line-height: 1.6; }
[class$="-crumb"] { max-width: var(--wide); margin: auto; padding: .35rem var(--gutter) 0; font-size: 1rem; display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; }
[class$="-crumb"] a { display: inline-flex; align-items: center; min-height: 44px; }
[class$="-crumb"] span + span::before { content: "/"; margin-right: .8rem; color: var(--quiet); }
[class$="-jump"] { max-width: 68rem; margin: 0 auto; padding: 1.5rem var(--gutter); border-bottom: 2px solid var(--ink); }
[class$="-jump-label"] { display: block; border: 0; margin: 0 0 .4rem; padding: 0; background: none; color: var(--ink); font-family: var(--display); font-weight: 700; font-size: 1rem; line-height: 1.4; }
button[class$="-jump-label"] { min-height: 44px; cursor: pointer; text-align: left; }
button[class$="-jump-label"]::after { content: "−"; display: inline-block; margin-left: .8rem; }
button[class$="-jump-label"][aria-expanded="false"]::after { content: "+"; }
[class$="-jump"] nav { display: flex; gap: .3rem 1.3rem; flex-wrap: wrap; }
[class$="-jump"] nav[hidden] { display: none; }
[class$="-jump"] nav a { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; font-size: 1rem; }
[class$="-jump"] nav a[aria-current="location"] { text-decoration-thickness: .18em; }
[class$="-chapter"] { max-width: 68rem; margin: auto; padding: 0 var(--gutter); }
[class$="-part"] { padding: 2.8rem 0; max-width: var(--measure); }
[class$="-part"] + [class$="-part"] { border-top: 1px solid var(--line); }
[class$="-part"] > p { max-width: var(--measure); }
[class$="-note"] { margin-top: 1.6rem; padding: .8rem 0 .4rem 1.1rem; border-left: .35rem solid var(--lilac); font-size: 1rem; color: var(--quiet); }
[class$="-note"] > p { margin-bottom: .25rem; }
[class$="-note"] a { display: table; min-height: 44px; padding: .6rem 0; font-size: 1rem; line-height: 1.4; }
[class$="-next"] { margin-top: 1rem; max-width: var(--measure); padding: 2rem; border-radius: var(--curve); background: var(--lilac-soft); }
[class$="-next"] a { display: inline-flex; align-items: center; min-height: 48px; font-family: var(--display); font-size: 1.125rem; }
[class$="-next"] p { margin-bottom: .6rem; }
[class$="-directory"] { margin-top: var(--space); padding: 3.5rem var(--gutter) 2rem; background: var(--lilac); border-radius: 3rem 3rem 0 0; }
[class$="-directory-inner"] { max-width: 67rem; margin: auto; }
[class$="-directory"] h2 { max-width: 18ch; }
[class$="-chapter-links"] { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 3rem; margin-top: 2rem; }
[class$="-chapter-links"] a { display: flex; flex-direction: column; justify-content: center; gap: .35rem; min-height: 112px; padding: 1.1rem 2rem 1.1rem 0; border-top: 2px solid var(--ink); color: var(--ink); text-decoration: none; position: relative; }
[class$="-chapter-links"] a::after { content: "↗"; position: absolute; right: .2rem; top: 1rem; font-size: 1.5rem; }
[class$="-chapter-links"] a > span:first-child { font-family: var(--display); font-size: 1.25rem; line-height: 1.3; }
[class$="-chapter-links"] a > span:last-child { font-size: 1rem; line-height: 1.5; }
[class$="-chapter-links"] a:hover > span:first-child, [class$="-chapter-links"] a[aria-current="page"] > span:first-child { text-decoration: underline; text-underline-offset: .2em; }
[class$="-footer-line"] { margin-top: 2.8rem; padding-top: 1.8rem; max-width: 68ch; font-size: 1rem; }
[class$="-back"] { display: inline-flex; align-items: center; min-height: 48px; margin-top: 1rem; font-size: 1rem; }

.opening-hero { display: grid; grid-template-columns: 1.25fr 1fr; align-items: center; gap: clamp(2rem, 4vw, 4rem); background: var(--sun); border-radius: 2.5rem 2.5rem 7rem 2.5rem; }
.opening-hero h1 { max-width: 13ch; }
.opening-hero .opening-lead { max-width: 42ch; }
.opening-bill-map { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; padding: 1.25rem; background: var(--paper); border-radius: 2.2rem; }
.opening-bill-map > p { grid-column: 1 / -1; margin: .25rem 0 .65rem; font-family: var(--display); font-size: 1.4rem; line-height: 1.25; }
.opening-bill-map a { display: flex; min-height: 88px; padding: 1rem .8rem; justify-content: center; align-items: center; text-align: center; color: var(--ink); background: var(--sun-soft); border-radius: var(--pill); font-family: var(--display); font-size: 1.0625rem; text-decoration: none; }
.opening-bill-map a:nth-of-type(2), .opening-bill-map a:nth-of-type(3) { background: var(--lilac); }
.opening-bill-map a:hover { text-decoration: underline; }
.opening-bill-map figcaption { grid-column: 1 / -1; padding: .6rem .2rem 0; color: var(--quiet); font-size: 1rem; line-height: 1.5; }
.opening-chapter { display: grid; grid-template-columns: 3fr 1fr; column-gap: 4rem; }
.opening-part { grid-column: 1; max-width: none; }
.opening-question { grid-column: 2; grid-row: 2 / span 2; align-self: start; margin-top: 3rem; padding: 1.5rem; border-radius: 1.5rem 1.5rem 4rem 1.5rem; background: var(--sun-soft); }
.opening-question h2 { font-size: 1.5rem; }

.bill-hero { text-align: center; padding-top: 2rem; padding-bottom: 2rem; }
.bill-hero .bill-lead { margin-inline: auto; }
.bill-question-band { max-width: 68rem; margin: .5rem auto 1.5rem; padding: 2.25rem var(--gutter); background: var(--sun); border-radius: var(--pill); display: flex; justify-content: space-between; align-items: center; gap: 2rem; }
.bill-question-band p { font-family: var(--display); font-size: 1.35rem; line-height: 1.4; margin: 0; }
.bill-question-band a { min-height: 48px; display: inline-flex; align-items: center; flex: 0 0 auto; font-size: 1rem; }
.bill-chapter { max-width: 65rem; }
.bill-part { max-width: none; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); column-gap: 3rem; }
.bill-part h2 { grid-column: 1; grid-row: 1 / 10; font-size: 1.75rem; }
.bill-part > p, .bill-part .bill-note { grid-column: 2; }
.bill-next { margin-left: auto; }

.cover-hero { display: grid; grid-template-columns: 1.45fr 1fr; gap: 3rem; padding-top: 2rem; padding-bottom: 2rem; }
.cover-hero h1 { max-width: 15ch; }
.cover-route { align-self: center; padding: 1.6rem 1.8rem; border-radius: 2rem; background: var(--lilac-soft); }
.cover-route p { margin: 0; text-align: center; font-family: var(--display); font-size: 1.125rem; }
.cover-route p + p::before { content: "↓"; display: block; margin: .4rem; font-size: 1.8rem; line-height: 1; }
.cover-route p:last-child { background: var(--sun); padding: 1rem; margin-top: .8rem; border-radius: 1rem; }
.cover-chapter { padding-bottom: .5rem; }
.cover-part { max-width: 66ch; margin-left: 4rem; }
.cover-part h2 { max-width: 25ch; }
.cover-part.cover-bridge { max-width: none; margin-left: 0; background: var(--sun-soft); padding: 2.5rem; border: none; border-radius: 2rem; }
.cover-bridge p { max-width: 61ch; }
.cover-next { margin-left: 4rem; }

.ask-hero { padding-top: 2rem; padding-bottom: 2rem; }
.ask-hero h1 { max-width: 17ch; }
.ask-kicker { display: inline-block; border-radius: var(--pill); background: var(--sun); padding: .65rem 1.25rem; }
.ask-chapter { display: grid; grid-template-columns: 1fr 1fr; gap: 0 3rem; }
.ask-part { max-width: none; border-top: 2px solid var(--ink); padding: 2.4rem 0; }
.ask-part + .ask-part { border-top: 2px solid var(--ink); }
.ask-part h2 { font-size: 1.75rem; max-width: 22ch; }
.ask-part.ask-long { grid-column: 1 / -1; background: var(--lilac-soft); padding: 2.4rem; border: 0; border-radius: 2rem; margin: .8rem 0 2rem; }
.ask-long > p { max-width: var(--measure); }
.ask-next { grid-column: 1 / -1; }

.lost-hero { max-width: 58rem; padding-bottom: 2rem; }
.lost-hero h1 { max-width: 15ch; }
.lost-hero p { max-width: 46ch; }

@media (max-width: 1050px) {
  .opening-hero { margin-inline: 1rem; padding-inline: 2rem; gap: 2rem; }
  .opening-chapter { grid-template-columns: minmax(0, 1fr); }
  .opening-question { grid-column: 1; grid-row: auto; margin: 0 0 2.5rem; max-width: var(--measure); }
  .bill-part { grid-template-columns: minmax(0, 1fr) minmax(0, 1.8fr); gap: 0 2rem; }
  .cover-part { margin-left: 0; }
  .cover-next { margin-left: 0; }
}

@media (max-width: 720px) {
  :root { --body-size: 1rem; --gutter: 1.25rem; --leading: 1.7; --space: 3rem; }
  h1 { font-size: clamp(2.5rem, 10.2vw, 3.3rem); }
  [class$="-mast"] { padding-block: 1rem; align-items: center; gap: .7rem; }
  [class$="-name"] { max-width: 11rem; font-size: 1rem; gap: .6rem; }
  [class$="-name"]::before { width: 1rem; flex-basis: 1rem; height: 2rem; box-shadow: .22rem .12rem 0 var(--violet); }
  [class$="-directory-link"] { padding-inline: .85rem; }
  [class$="-hero"] { padding-block: 2rem; }
  [class$="-jump"] { margin-top: .5rem; padding-block: 1rem; }
  [class$="-jump"] nav { flex-direction: column; gap: 0; padding-top: .3rem; }
  [class$="-jump"] nav a { padding: .55rem 0; }
  [class$="-part"] { padding-block: 2rem; }
  [class$="-directory"] { padding-top: 2.5rem; border-radius: 2rem 2rem 0 0; }
  [class$="-chapter-links"] { grid-template-columns: minmax(0, 1fr); margin-top: 1.5rem; }
  [class$="-chapter-links"] a { min-height: 108px; }
  [class$="-footer-line"] { margin-top: 1.5rem; }
  .opening-hero { margin-inline: .7rem; padding: 2.1rem 1.25rem 1.6rem; grid-template-columns: minmax(0, 1fr); gap: 1.75rem; border-radius: 1.7rem 1.7rem 3.8rem 1.7rem; }
  .opening-hero h1 { max-width: 14ch; }
  .opening-bill-map { padding: 1rem; gap: .6rem; border-radius: 1.5rem; }
  .opening-bill-map > p { font-size: 1.25rem; }
  .opening-bill-map a { min-height: 64px; font-size: 1rem; }
  .opening-question { padding: 1.5rem; }
  .bill-question-band { margin-inline: 1.25rem; border-radius: 1.5rem; padding: 1.5rem; flex-direction: column; align-items: flex-start; gap: .6rem; }
  .bill-question-band p { font-size: 1.25rem; }
  .bill-part { display: block; }
  .bill-part h2 { margin-bottom: .8rem; }
  .bill-next { margin-left: 0; }
  .cover-hero { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; }
  .cover-hero h1 { max-width: 15ch; }
  .cover-route { padding: 1.3rem; }
  .cover-route p { font-size: 1rem; }
  .cover-part.cover-bridge { padding: 1.5rem; margin-inline: -.3rem; }
  .ask-chapter { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .ask-part.ask-long { padding: 1.4rem; margin-inline: -.3rem; }
  .ask-part h2 { font-size: 1.65rem; }
  [class$="-next"] { padding: 1.5rem; }
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

@media print {
  :root { --paper: #fff; --ink: #000; --quiet: #333; --link: #000; }
  body { font-size: 12pt; }
  [class$="-mast"], [class$="-skip"], [class$="-jump"], [class$="-directory"] { display: none; }
  [class$="-hero"], [class$="-chapter"] { display: block; padding: 0; }
  [class$="-part"] { display: block; break-inside: avoid; }
  .opening-bill-map, .cover-route, .bill-question-band { display: none; }
  h1 { font-size: 28pt; }
  h2 { font-size: 18pt; }
  a { text-decoration: underline; }
}
