:root {
  color-scheme: light;
  --navy: #102a3e;
  --deep: #0a2233;
  --ink: #142d40;
  --body: #243949;
  --muted: #496172;
  --teal: #126963;
  --teal-deep: #0e5957;
  --aqua: #a4ded8;
  --gold: #f1c276;
  --paper: #fcfbf7;
  --line: #d8e0de;
  --sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --serif: Georgia, "Times New Roman", serif;
}
* { box-sizing: border-box; }
html { scroll-padding-top: 1.2rem; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: var(--sans); }
[hidden] { display: none !important; }
a { color: var(--teal-deep); text-underline-offset: .16em; text-decoration-thickness: .07em; }
a:hover { text-decoration-thickness: .13em; }
:focus-visible { outline: 3px solid #a75607; outline-offset: 4px; border-radius: 2px; }
.skip { position: fixed; left: .9rem; top: .9rem; transform: translateY(-200%); z-index: 3; padding: .7rem 1rem; background: white; }
.skip:focus { transform: none; }
.masthead { background: var(--deep); color: white; }
.mast-inner, .partbar > div, footer > div {
  max-width: 1270px; margin-inline: auto; padding-inline: clamp(20px, 4.2vw, 64px);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.mast-inner { min-height: 84px; }
.brand { color: white; display: grid; gap: .24rem; text-decoration: none; }
.brand span { font-family: var(--serif); font-size: 1.35rem; letter-spacing: .055em; }
.brand small { color: var(--aqua); font-size: .63rem; letter-spacing: .12em; }
.mast-inner nav { display: flex; gap: clamp(.4rem, 1.6vw, 1.4rem); }
.mast-inner nav a { padding: .7rem .45rem; color: #deecef; font-size: .86rem; text-decoration: none; white-space: nowrap; }
.mast-inner nav a[aria-current] { color: var(--gold); box-shadow: inset 0 -2px var(--gold); }
.mast-inner a:focus-visible { outline-color: var(--gold); }
.partbar { background: #e8efed; border-bottom: 1px solid #d4e1dd; color: #264956; font-size: .79rem; }
.partbar > div { min-height: 39px; padding-block: .4rem; }
.edition { color: var(--teal-deep); font-size: .66rem; letter-spacing: .1em; text-transform: uppercase; white-space: nowrap; }
.layout { display: grid; grid-template-columns: minmax(168px, 226px) minmax(0, 758px); column-gap: clamp(2rem, 5.5vw, 6rem); max-width: 1270px; margin: auto; padding: 53px clamp(20px, 4.2vw, 64px) 75px; }
main { min-width: 0; }
.auxiliary { grid-template-columns: minmax(0, 758px); justify-content: center; }
.sidebar { align-self: stretch; }
.sidebar nav { position: sticky; top: 1.4rem; border-top: 2px solid var(--teal); padding-top: 1.12rem; }
.sidebar h2 { margin: 0 0 .9rem; color: var(--teal-deep); font-family: var(--sans); font-size: .73rem; letter-spacing: .12em; text-transform: uppercase; }
.sidebar ol, .mobile-toc ol { list-style: none; margin: 0; padding: 0; }
.sidebar a, .mobile-toc a { display: grid; grid-template-columns: 2rem minmax(0, 1fr); gap: .45rem; padding: .53rem .3rem; color: var(--ink); font-size: .84rem; line-height: 1.37; text-decoration: none; }
.sidebar a span, .mobile-toc a span { color: var(--teal-deep); font-weight: 700; font-variant-numeric: tabular-nums; }
.sidebar a:hover, .mobile-toc a:hover, .sidebar a[aria-current="location"] { background: #e7f0ec; }
.mobile-toc { display: none; }
.chapter-head { border-bottom: 1px solid var(--line); margin-bottom: clamp(2rem, 4vw, 3.55rem); padding-bottom: clamp(1.55rem, 3.2vw, 2.5rem); }
.overline { color: var(--teal-deep); font-size: .74rem; line-height: 1.4; letter-spacing: .17em; font-weight: 750; }
h1, h2, h3 { color: var(--navy); font-family: var(--serif); font-weight: 400; }
h1 { margin: .55rem 0 0; font-size: clamp(2.6rem, 5.3vw, 4.55rem); line-height: 1.03; letter-spacing: -.04em; }
main h2 { margin: 0 0 1.3rem; font-size: clamp(1.66rem, 3vw, 2.45rem); line-height: 1.14; letter-spacing: -.025em; }
main h3 { margin: 2.1rem 0 .85rem; font-size: clamp(1.34rem, 2.35vw, 1.77rem); line-height: 1.22; }
main > section + section { margin-top: 3.25rem; padding-top: 2.3rem; border-top: 1px solid var(--line); }
main p, main li { color: var(--body); font-family: var(--serif); font-size: clamp(1.04rem, 1.45vw, 1.16rem); line-height: 1.62; }
main p { margin: 0 0 1.05rem; }
main ul { padding-left: 1.5rem; margin: 0 0 1.1rem; }
main li + li { margin-top: .34rem; }
main ul li::marker { color: var(--teal); }
main a.gloss-link { text-decoration-style: dotted; }
.permalink { display: inline-block; margin-left: .5em; font: .61em var(--sans); opacity: 0; text-decoration: none; }
:is(h2,h3):hover .permalink, .permalink:focus-visible, :target > .permalink { opacity: 1; }
:where(h2, h3, p, figure, .table-block, .term):target { outline: 2px solid #75a79b; outline-offset: 5px; }
main p.principle { border-inline-start: 3px solid var(--teal); background: #eaf2ee; padding: .85rem 1.1rem; color: var(--navy); font-size: 1.11rem; font-weight: 700; font-style: italic; }
.scene-pair { display: grid; grid-template-columns: minmax(0, .43fr) minmax(0, .57fr); align-items: start; gap: clamp(.8rem, 2.4vw, 1.45rem); margin: 1.25rem 0 1.2rem; }
.scene-pair:not(.scene-first) > .scene { grid-column: 1; grid-row: 1; }
.scene-pair:not(.scene-first) > p { grid-column: 2; grid-row: 1; }
.scene-pair > p { margin-bottom: 0; }
.scene img, .diagram img { display: block; max-width: 100%; height: auto; }
.scene img { border-radius: 4px; }
.diagram { margin: 1.6rem 0 1.9rem; padding: .85rem; border: 1px solid var(--line); background: #fff; border-radius: 4px; }
.diagram img { width: 100%; }
.diagram figcaption { margin-top: .8rem; text-align: center; color: var(--ink); font-size: .89rem; line-height: 1.42; font-weight: 650; }
.diagram-open { display: inline-block; margin-top: .4rem; font-size: .79rem; }
.table-block { margin: 1.7rem 0; }
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 4px; background: #fff; }
.table-block table { border-collapse: collapse; width: 100%; table-layout: fixed; color: var(--ink); }
.table-block caption { background: #fff; text-align: left; padding: .85rem .85rem .7rem; font-size: .91rem; line-height: 1.36; font-weight: 700; }
.table-block :is(th,td) { text-align: left; vertical-align: top; padding: .62rem .75rem; border-top: 1px solid var(--line); }
.table-block :is(th,td) + :is(th,td) { border-left: 1px solid var(--line); }
.table-block thead { background: #dfebe8; }
.table-block thead th[scope="col"] { text-align: center; vertical-align: middle; }
.table-block tbody tr:nth-child(even) { background: #f4f7f5; }
.table-block th[scope="row"] { background: #eaf1ee; width: 27%; }
.table-block .matrix table { min-width: 565px; }
.table-block .matrix thead td:first-child { width: 27%; }
.table-block p { font: .88rem/1.46 var(--sans); margin: 0; overflow-wrap: break-word; }
.table-block p + p { margin-top: .5rem; }
.end-nav { margin-top: 2.6rem; border-top: 1px solid var(--line); padding-top: 1rem; display: flex; gap: 1rem 1.3rem; flex-wrap: wrap; font-size: .85rem; }
.back { display: inline-block; margin: -1rem 0 1.65rem; font-size: .88rem; }
.search { margin-bottom: 1.8rem; }
.search label { display: block; font-size: .86rem; font-weight: 650; margin-bottom: .4rem; }
.search input { font: 1rem var(--sans); width: min(100%, 440px); padding: .75rem; border: 1px solid #748e95; border-radius: 4px; color: var(--ink); background: #fff; }
.search #term-count { font: .84rem var(--sans); margin-top: .55rem; color: var(--muted); }
.term { margin: 1.1rem 0; }
.term h3 { margin: 0 0 .27rem; font-size: 1.45rem; }
.term p { margin-bottom: .43rem; }
.term .classification { color: var(--teal-deep); font: .79rem var(--sans); }
p.note { color: var(--muted); border-left: 2px solid var(--line); padding-left: .85rem; font-size: 1rem; }
.sources ul { list-style: none; padding: 0; }
.sources li { margin-bottom: .95rem; }
footer { border-top: 1px solid var(--line); background: #e8efed; color: var(--muted); font-size: .75rem; }
footer > div { min-height: 62px; padding-block: .75rem; flex-wrap: wrap; }
@media (max-width: 850px) {
  .layout { display: block; max-width: 800px; padding-top: 2.15rem; }
  .sidebar { display: none; }
  .mobile-toc { display: block; margin: 0 0 1.75rem; border: 1px solid var(--line); border-radius: 4px; background: #edf4f0; }
  .mobile-toc summary { cursor: pointer; padding: .85rem; font-size: .87rem; font-weight: 700; }
  .mobile-toc summary span { float: right; color: var(--teal-deep); font-weight: 500; }
  .mobile-toc ol { padding: 0 .8rem .65rem; }
}
@media (max-width: 630px) {
  .mast-inner { align-items: flex-start; flex-direction: column; justify-content: center; gap: .28rem; padding-top: .86rem; }
  .mast-inner nav { gap: .86rem; }
  .mast-inner nav a { padding: .65rem 0 .56rem; }
  .partbar > div { gap: .45rem; font-size: .71rem; }
  .edition { font-size: .61rem; }
  .table-block .matrix th[scope="row"], .table-block .matrix thead td:first-child { position: sticky; left: 0; box-shadow: 1px 0 #bbccca; }
  .table-block .matrix thead td:first-child { background: #dfebe8; }
}
@media (max-width: 580px) {
  .chapter-head { margin-bottom: 1.1rem; }
  .auxiliary .chapter-head { margin-bottom: 2.2rem; }
  .scene-pair { display: flex; flex-direction: column; }
  .scene-pair .scene { align-self: center; max-width: 420px; width: 100%; }
  .diagram { padding: .45rem; }
  figcaption, .diagram-open { margin-inline: .3rem; }
  .table-block :is(th,td) { padding: .48rem .5rem; }
  .table-block p { font-size: .84rem; }
}
.table-block .table-hint { display: none; }
@media (max-width: 630px) {
  .table-block .matrix table { min-width: 520px; }
  .table-block .matrix thead td:first-child { width: 22%; }
  .table-block .matrix caption { padding-inline: 0; }
  .table-block .matrix :is(.caption-label, .table-hint) { position: sticky; left: .85rem; display: block; width: calc(100vw - 4.4rem); }
  .table-block .matrix .table-hint { color: var(--muted); margin-top: .33rem; font-size: .77rem; font-weight: 400; }
}
.term .term-return { margin: .1rem 0 .45rem; }

/* Part I contents and cross-chapter navigation */
.book-title { padding-bottom: 1.6rem; margin-bottom: 2rem; }
.book-title .book-subtitle { font-style: italic; margin-top: .85rem; }
.book-title .book-part { font-weight: 700; margin-top: 1.25rem; }
.book-title p { margin-bottom: .35rem; }
.book-title .book-imprint, .publication p { color: var(--muted); font: .85rem/1.55 var(--sans); }
.contents-entry { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .6rem 1rem; padding: .9rem .1rem; border-top: 1px solid var(--line); }
.contents-title { display: flex; align-items: baseline; gap: .8rem; font: 1.14rem/1.35 var(--serif); text-decoration: none; color: var(--ink); }
.contents-title:hover { text-decoration: underline; }
.chapter-number { color: var(--teal-deep); font: 700 .76rem var(--sans); }
.contents-entry details { display: contents; }
.contents-entry summary { color: var(--teal-deep); font: .81rem var(--sans); cursor: pointer; padding: .25rem 0; }
.contents-entry ol { grid-column: 1 / -1; list-style: none; margin: 0; padding: 0 0 .25rem 1.8rem; }
.contents-entry li { font-size: .98rem; }
.publication { border-top: 1px solid var(--line); margin-top: 1.5rem; padding-top: 1rem; }
.publication p { margin-bottom: .25rem; }
.chapter-neighbours { justify-content: space-between; }
.chapter-neighbours a { display: grid; gap: .3rem; max-width: 48%; }
.chapter-neighbours a span { color: var(--muted); font-size: .75rem; }
.chapter-neighbours a + a { text-align: right; margin-left: auto; }
.table-block th[scope="rowgroup"] { background: #eaf1ee; }
.table-block .wide-table table { min-width: 580px; }
@media (max-width: 630px) {
  .table-block .wide-table caption { padding-inline: 0; }
  .table-block .wide-table :is(.caption-label, .table-hint) { position: sticky; left: .85rem; display: block; width: calc(100vw - 4.4rem); }
  .table-block .wide-table .table-hint { color: var(--muted); margin-top: .33rem; font-size: .77rem; font-weight: 400; }
}

/* Covers and publisher artwork from the PDF edition */
.book-title { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 13rem); align-items: center; gap: 1.8rem; }
.front-cover, .back-cover img { display: block; max-width: 100%; height: auto; }
.book-title .publisher-logo { margin-top: .8rem; width: 6.25rem; }
.publisher-logo { display: block; width: 7.5rem; max-width: 100%; height: auto; }
.publisher-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .65rem 1.1rem; margin-bottom: 1rem; }
.publisher-heading h2 { margin: 0; }
.back-cover { display: grid; grid-template-columns: minmax(0, 16rem) minmax(0, 1fr); gap: 1.65rem; align-items: start; }
.back-cover h2 { font-size: 1.65rem; }
@media (max-width: 580px) {
  .book-title, .back-cover { grid-template-columns: minmax(0, 1fr); }
  .front-cover, .back-cover img { width: min(100%, 15rem); }
}

/* Keep navigation available without covering a linked passage. */
html { scroll-padding-top: calc(var(--mast-height, 8.5rem) + 1.2rem); }
.masthead { position: sticky; top: 0; z-index: 2; }
.sidebar nav { top: calc(var(--mast-height, 8.5rem) + 1.4rem); }
.mast-inner nav { flex-wrap: wrap; row-gap: 0; }
footer a { color: inherit; }
a.front-cover-link { display: block; }
.reader-form { display: grid; gap: 1rem; max-width: 38rem; }
.reader-form label { display: grid; gap: .35rem; font-weight: 650; }
.reader-form :is(input, textarea, select, button) { padding: .65rem .8rem; font: inherit; border: 1px solid var(--muted); border-radius: 4px; }
.reader-form textarea { resize: vertical; }
.reader-form button { justify-self: start; color: white; background: var(--teal-deep); cursor: pointer; }
.reader-form .trap { position: absolute; left: -9999px; }
.post-date { color: var(--muted); font-size: .86rem; }
.blog-body { overflow-wrap: anywhere; white-space: pre-wrap; }
@media (max-width: 390px) {
  .mast-inner nav { column-gap: .6rem; }
  .mast-inner nav a { font-size: .79rem; }
}
.sidebar li:has(.publisher-section-link), .mobile-toc li:has(.publisher-section-link) { display: flex; flex-wrap: wrap; }
.publisher-section-link { color: var(--teal-deep); }

.post-content img { display: block; max-width: 100%; height: auto; margin: 1rem auto; }
