/* Estates · chaptered editorial on a pale ground. Hard cuts between chapters, a folio in the margin. */

.page-estate { background: var(--color-paper); }
.estate { padding-top: 60px; }

/* the folio: chapter number and title, in the margin on wide screens */
.folio {
  position: fixed; z-index: var(--z-chrome); left: 0; right: 0; top: 60px;
  display: flex; gap: var(--space-3); align-items: baseline;
  padding: var(--space-2) var(--gutter);
  background: oklch(95% 0.01 240 / 0.92); border-bottom: 1px solid oklch(86% 0.012 240);
  color: oklch(38% 0.02 262); font-size: var(--text-xs);
}
:root[data-light="uv"] .folio { background: oklch(80% 0.085 262 / 0.94); border-bottom-color: oklch(70% 0.09 270); color: oklch(26% 0.06 285); }
.folio__n { font-family: var(--font-display); font-weight: 700; font-size: var(--text-sm); }
.folio__t { font-stretch: 78%; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
@media (min-width: 72rem) {
  .folio {
    left: var(--gutter); right: auto; top: auto; bottom: var(--space-6); flex-direction: column; gap: var(--space-2); width: 8.5rem;
    background: none; border: 0; padding: 0;
  }
  .folio__n { font-size: var(--text-2xl); line-height: 1; font-weight: 600; font-variation-settings: "SOFT" 100; }
}

/* ------------------------------------------------------------ title page */
.titlepage { position: relative; min-height: calc(100svh - 60px); display: grid; align-items: end; overflow: clip; }
.titlepage__light { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.titlepage__text { position: relative; padding: var(--space-9) var(--gutter) clamp(4rem, 12vh, 8rem); max-width: 62rem; }
@media (min-width: 72rem) { .titlepage__text { padding-left: calc(var(--gutter) + 11rem); } }
.titlepage__h {
  margin: var(--space-4) 0 0; font-family: var(--font-display); font-weight: 500; font-variation-settings: "SOFT" 100, "WONK" 0;
  font-size: clamp(2.6rem, 2rem + 4vw, 5.6rem); line-height: 1.02; letter-spacing: -0.03em; text-wrap: balance;
}
.titlepage__h .amp { font-weight: 300; color: var(--color-accent); }
.titlepage__lede { margin: var(--space-6) 0 0; max-width: 36ch; font-size: var(--text-md); line-height: 1.5; color: var(--color-ink-2); text-wrap: pretty; }

/* ------------------------------------------------------------- chapters */
.chapter { padding: clamp(5rem, 12vw, 9rem) var(--gutter); border-top: 1px solid var(--color-rule); }
@media (min-width: 72rem) { .chapter { padding-left: calc(var(--gutter) + 11rem); padding-right: calc(var(--gutter) + 4rem); } }
.intertitle { display: grid; gap: var(--space-3); margin-bottom: var(--space-8); }
.intertitle__n { font-family: var(--font-display); font-weight: 300; font-variation-settings: "SOFT" 100; font-size: clamp(3rem, 2rem + 4vw, 6rem); line-height: 0.9; color: var(--color-accent); }
.intertitle__h { margin: 0; font-family: var(--font-display); font-weight: 600; font-variation-settings: "SOFT" 100; font-size: var(--text-3xl); line-height: 1.05; letter-spacing: -0.02em; }
.spread { display: grid; gap: var(--space-5); max-width: 64rem; font-size: 1.125rem; line-height: 1.68; color: var(--color-ink-2); }
.spread p { margin: 0; max-width: 58ch; text-wrap: pretty; }
@media (min-width: 60rem) { .spread { grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: var(--space-8); align-items: start; } .spread > :nth-child(2) { margin-top: var(--space-9); } }
.dropcap { color: var(--color-ink); }
.dropcap::first-letter { float: left; font-family: var(--font-display); font-weight: 600; font-variation-settings: "SOFT" 100; font-size: 4.4em; line-height: 0.82; margin: 0.06em 0.1em 0 0; color: var(--color-accent); }
.pull { margin: 0; }
.pull p { font-family: var(--font-display); font-weight: 400; font-variation-settings: "SOFT" 100; font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.4rem); line-height: 1.2; letter-spacing: -0.015em; color: var(--color-ink); max-width: 22ch; }
.pull p::before { content: "“"; display: block; font-size: 2.2em; line-height: 0.6; color: var(--color-accent); }
.colophon { font-size: var(--text-base); color: var(--color-ink); }
.colophon .link { white-space: normal; }

/* ------------------------------------------------------------- routes */
.routes { margin: 0; max-width: 64rem; }
.routes__svg { width: 100%; height: auto; overflow: visible; font-family: var(--font-body); }
.routes__node rect, .routes__node circle { fill: var(--color-paper-2); stroke: var(--color-rule); stroke-width: 1.5; }
.routes__node--start rect { fill: var(--color-ink); stroke: none; }
.routes__node--start .routes__t, .routes__node--start .routes__s { fill: var(--color-paper); }
.routes__t { fill: var(--color-ink); font-family: var(--font-display); font-weight: 650; font-size: 21px; font-variation-settings: "SOFT" 100; }
.routes__s { fill: var(--color-ink-2); font-size: 15px; }
.routes__path { fill: none; stroke: var(--color-accent); stroke-width: 2.4; stroke-linecap: round; }
.routes__head { fill: var(--color-accent); }
.routes__cap { margin-top: var(--space-5); font-size: var(--text-sm); color: var(--color-muted); max-width: 60ch; }
.routes .routes__node { transition: opacity 500ms var(--ease-out); }
.js .routes__node:not(.routes__node--start):not(.is-on) { opacity: 0.25; }
@media (max-width: 40rem) {
  .routes__t { font-size: 26px; } .routes__s { font-size: 19px; }
}

.chapter--close { padding-bottom: clamp(6rem, 14vw, 10rem); }
.page-estate .foot { border-top-color: var(--color-rule); }
@media (max-width: 71.99rem) { html { scroll-padding-top: 116px; } .estate { padding-top: 92px; } .titlepage { min-height: calc(100svh - 92px); } }
:root[data-light="uv"] .titlepage__light { opacity: 0.25; }

/* phones: the diagram becomes a list with the same three routes */
.routes__list { display: none; list-style: none; margin: 0; padding: 0; }
@media (max-width: 40rem) {
  .routes__svg { display: none; }
  .routes__list { display: grid; gap: var(--space-3); }
  .routes__li { display: grid; gap: 2px; padding: var(--space-4) var(--space-4) var(--space-4) var(--space-6); border-radius: var(--radius-2); background: var(--color-paper-2); box-shadow: inset 0 0 0 1px var(--color-rule); position: relative; }
  .routes__li:not(.routes__li--start)::before { content: ""; position: absolute; left: var(--space-3); top: 50%; width: 8px; height: 8px; border-radius: 50%; background: var(--color-accent); translate: 0 -50%; }
  .routes__li--start { background: var(--color-ink); color: var(--color-paper); box-shadow: none; padding-left: var(--space-4); margin-bottom: var(--space-2); }
  .routes__lt { font-family: var(--font-display); font-weight: 650; font-variation-settings: "SOFT" 100; font-size: var(--text-md); }
  .routes__ls { font-size: var(--text-sm); color: var(--color-ink-2); }
  .routes__li--start .routes__ls { color: inherit; opacity: 0.8; }
}
