/* Beyond the Gears: shared reading layout and an illustrated chapter directory. */
.gears-intro { display: grid; grid-template-columns: 1fr 1fr; gap: 66px; align-items: center; padding: 54px 0 51px; }
.gears-intro-copy h1 { margin: 15px 0 23px; font: 400 clamp(64px, 7vw, 100px)/.94 var(--site-serif); letter-spacing: -.035em; }
.gears-intro-copy h1 em { color: var(--site-blue); font-weight: 400; }
.gears-intro-copy .gears-invitation { margin: 0 0 15px; font: 400 29px/1.2 var(--site-serif); }
.gears-intro-copy > p:last-of-type { max-width: 37ch; margin: 0 0 25px; color: var(--site-muted); font-size: 16px; }
.gears-start { display: inline-flex; align-items: center; gap: 24px; padding: 11px 0; border-bottom: 1px solid #b88b9b; font-size: 14px; font-weight: 650; text-decoration: none; }
.gears-start span { font-size: 24px; font-weight: 400; }
.gears-start:hover { border-color: var(--site-blue); }
.gears-frontispiece { position: relative; min-width: 0; margin: 0; padding: 16px 0 35px; }
.frontispiece-main { display: block; width: 86%; margin-left: auto; margin-right: 6%; mix-blend-mode: multiply; transform: rotate(-8deg); }
.frontispiece-small { position: absolute; width: 38%; bottom: 9%; left: -5%; padding: 14px; border: 1px solid #c69caa; background: var(--site-pink); transform: rotate(-8deg); }
.gears-frontispiece figcaption { margin: 20px 0 0 44%; color: var(--site-muted); font-size: 12px; line-height: 1.65; }
.gears-frontispiece figcaption em { font: italic 18px/1.3 var(--site-serif); }
.directory-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 25px; padding-top: 23px; border-top: 1px solid #c69caa; }
.directory-heading h2 { margin: 0; font: 400 39px/1.15 var(--site-serif); }
.directory-heading p { max-width: 38ch; margin: 0; color: var(--site-muted); font-size: 14px; }
.chapter-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; padding: 0; margin: 27px 0 0; list-style: none; }
.chapter-card { min-width: 0; }
.chapter-card > a { position: relative; display: flex; flex-direction: column; height: 100%; padding: 25px 29px 27px; border: 1px solid #cfadb9; background: #fffaf75e; text-decoration: none; color: var(--site-ink); transition: background-color .15s, border-color .15s; }
.chapter-card > a:hover { border-color: #a67589; background: #fffaf7a8; }
.chapter-card-number { display: block; color: #a36b80; font: italic 35px/1 var(--site-serif); }
.chapter-card h3 { max-width: 23ch; margin: 16px 0 11px; font: 400 33px/1.12 var(--site-serif); letter-spacing: -.015em; }
.chapter-card p { margin: 0; color: var(--site-muted); font-size: 14px; line-height: 1.7; max-width: 51ch; }
.chapter-card-art { display: flex; align-items: center; justify-content: center; min-height: 175px; margin: 22px -10px 18px; border-top: 1px solid #cfbdc37a; border-bottom: 1px solid #cfbdc37a; }
.chapter-card-art img { width: 100%; height: 175px; object-fit: contain; mix-blend-mode: multiply; }
.chapter-card-read { display: flex; justify-content: space-between; gap: 10px; margin-top: auto; color: var(--site-blue); font-size: 13px; font-weight: 600; }
.chapter-card:last-child { grid-column: 1 / -1; }
.chapter-card:last-child > a { display: grid; grid-template-columns: 1fr 1fr; column-gap: 45px; }
.chapter-card:last-child .chapter-card-art { grid-column: 2; grid-row: 1 / 6; margin: 0; border: 0; }
.chapter-card:last-child .chapter-card-art img { height: 250px; }
.chapter-card:last-child .chapter-card-read { margin-top: 25px; }
.gears-afterword { max-width: 750px; margin: 32px 0 15px; font: italic 23px/1.45 var(--site-serif); color: var(--site-muted); }
.math-reading { width: min(100%, 820px); margin: 0 auto; }
.chapter-heading { padding: 29px 0 0; }
.chapter-breadcrumb { display: inline-block; padding: 7px 0; font-size: 12px; color: var(--site-muted); text-decoration: none; }
.chapter-breadcrumb:hover { text-decoration: underline; }
.chapter-breadcrumb span { padding: 0 7px; color: #b68e9e; }
.chapter-count { margin: 24px 0 10px; color: var(--site-blue); font-size: 13px; font-weight: 650; letter-spacing: .05em; text-transform: uppercase; }
.chapter-count span { color: var(--site-muted); font-weight: 400; }
.chapter-heading h1 { margin: 0; max-width: 23ch; font: 400 clamp(40px, 4.3vw, 61px)/1.06 var(--site-serif); letter-spacing: -.025em; }
.chapter-deck { margin: 20px 0 23px; color: var(--site-muted); font-size: 18px; line-height: 1.65; }
.chapter-menu { padding: 12px 0; border-top: 1px solid var(--site-line); border-bottom: 1px solid var(--site-line); font-size: 13px; }
.chapter-menu summary { width: fit-content; padding: 4px 0; cursor: pointer; color: var(--site-blue); }
.chapter-menu ol { display: grid; grid-template-columns: 1fr 1fr; column-gap: 27px; row-gap: 9px; margin: 18px 0 9px; padding-left: 23px; }
.chapter-menu a { display: inline-block; padding: 4px 0; }
.chapter-menu a[aria-current="page"] { font-weight: 700; color: var(--site-ink); }
.chapter-contents { margin: 24px 0 31px; }
.chapter-contents > p { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--site-muted); }
.chapter-contents ol { display: flex; flex-wrap: wrap; gap: 4px 22px; list-style: none; padding: 0; margin: 0; }
.chapter-contents a { display: block; padding: 5px 0; font-size: 13px; text-decoration-color: #bd9ca9; }
.math-prose { font-size: 17px; line-height: 1.8; }
.math-prose p { margin: 0 0 18px; }
.math-prose .chapter-opening { font-size: 20px; line-height: 1.65; }
.math-prose h2 { scroll-margin-top: 20px; margin: 41px 0 15px; font: 400 35px/1.14 var(--site-serif); letter-spacing: -.01em; }
.math-prose h3 { margin: 26px 0 12px; font-size: 20px; line-height: 1.4; }
.math-prose ul, .math-prose ol { padding-left: 25px; margin: 16px 0 23px; }
.math-prose li + li { margin-top: 8px; }
.math-prose var { font-family: Georgia, serif; }
.math-definitions { margin: 20px 0 27px; padding-left: 20px; border-left: 2px solid #b88b9b; }
.math-definitions dt { font-weight: 650; color: var(--site-blue); }
.math-definitions dd { margin: 3px 0 14px; }
.math-prose .equation { max-width: 100%; overflow-x: auto; margin: 23px 0; padding: 21px 15px; border-left: 2px solid #b88b9b; background: #fffaf790; }
.math-prose math { font-size: 1.15em; }
.math-figure { margin: 29px 0 31px; padding: 18px 20px 14px; background: #fffaf7; border: 1px solid #d6bec6; }
.math-figure img { display: block; width: 100%; height: auto; }
.math-figure figcaption { margin-top: 13px; padding-top: 13px; border-top: 1px solid #ddcdd1; font-size: 13px; line-height: 1.65; color: var(--site-muted); }
.diagram-open { display: inline-block; margin-top: 9px; font-size: 12px; }
.math-note { margin: 24px 0; padding: 18px 23px; border-left: 3px solid #b88b9b; background: #fffaf75c; font-size: 15px; line-height: 1.75; }
.math-table { width: 100%; border-collapse: collapse; margin: 25px 0; font-size: 15px; line-height: 1.6; text-align: left; }
.math-table caption { text-align: left; margin-bottom: 12px; font-weight: 600; }
.math-table th, .math-table td { padding: 12px; border-bottom: 1px solid var(--site-line); }
.math-table thead th { color: var(--site-blue); border-bottom-color: #b88b9b; }
.math-table tbody th { width: 15%; }
.math-prose .making-steps { display: grid; grid-template-columns: repeat(4, 1fr); list-style: none; padding: 0; gap: 15px; counter-reset: making; }
.making-steps li { padding-top: 14px; border-top: 2px solid #ba90a1; counter-increment: making; font-size: 13px; }
.making-steps li + li { margin-top: 0; }
.making-steps strong, .making-steps span { display: block; }
.making-steps strong::before { content: counter(making) ". "; color: #a36b80; }
.physical-figure img { max-height: 530px; object-fit: contain; }
.chapter-pagination { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin: 45px 0 20px; padding-top: 25px; border-top: 1px solid #b88b9b; }
.chapter-pagination a { display: block; text-decoration: none; padding: 12px 14px; border: 1px solid var(--site-line); }
.chapter-pagination a:hover { background: #fffaf7a8; }
.chapter-pagination a:last-child { text-align: right; }
.chapter-pagination span { display: block; color: var(--site-muted); font-size: 11px; letter-spacing: .04em; text-transform: uppercase; }
.chapter-pagination strong { display: block; margin-top: 5px; font: 400 24px/1.2 var(--site-serif); }
.math-references { margin-top: 30px; padding-top: 15px; border-top: 1px solid var(--site-line); font-size: 13px; color: var(--site-muted); }
.math-references summary { cursor: pointer; padding: 6px 0; }
@media (max-width: 900px) {
 .gears-intro { gap: 32px; padding-top: 35px; }
 .gears-intro-copy h1 { font-size: 72px; }
 .frontispiece-small { left: 0; }
 .chapter-card > a { padding: 23px; }
 .chapter-card h3 { font-size: 30px; }
}
@media (max-width: 700px) {
 .gears-intro { grid-template-columns: 1fr; gap: 15px; padding: 30px 0 32px; }
 .gears-intro-copy h1 { font-size: 73px; }
 .gears-intro-copy > p:last-of-type { max-width: 43ch; }
 .gears-frontispiece { width: min(100%, 420px); margin: 0 auto; padding: 15px 0 20px; }
 .frontispiece-main { width: 85%; }
 .frontispiece-small { width: 35%; bottom: 12%; }
 .directory-heading { display: block; }
 .directory-heading h2 { font-size: 35px; }
 .directory-heading p { margin-top: 14px; }
 .chapter-cards { grid-template-columns: 1fr; gap: 18px; }
 .chapter-card:last-child > a { display: flex; }
 .chapter-card:last-child .chapter-card-art { margin: 22px -10px 18px; border-top: 1px solid #cfbdc37a; border-bottom: 1px solid #cfbdc37a; }
 .chapter-card:last-child .chapter-card-art img { height: 175px; }
 .chapter-card:last-child .chapter-card-read { margin-top: auto; }
 .chapter-heading { padding-top: 20px; }
 .chapter-count { margin-top: 20px; }
 .chapter-deck { font-size: 16px; }
 .chapter-menu ol { grid-template-columns: 1fr; }
 .chapter-contents { margin-bottom: 26px; }
 .math-prose { font-size: 16px; line-height: 1.8; }
 .math-prose .chapter-opening { font-size: 18px; }
 .math-prose h2 { font-size: 31px; }
 .math-prose math { font-size: 1em; }
 .math-prose .equation { padding: 18px 9px; }
 .math-figure { padding: 12px 9px; margin-inline: 0; }
 .math-note { padding: 15px 18px; }
 .math-prose .making-steps { grid-template-columns: 1fr 1fr; }
 .chapter-pagination { gap: 12px; }
 .chapter-pagination strong { font-size: 21px; }
 .chapter-pagination a { padding: 12px 10px; }
}

@media (max-width: 400px) {
 .math-prose .roulette-equation math { font-size: 15px; }
}
