@import url('/page-transition.css');

:root {
  --rail: 280px;
  --gutter: clamp(28px, 6vw, 104px);
  --measure: 39rem;
  --wide: 58rem;
  --soft: #6F6A5E;
  --stone: #F5F1E7;
  --stone-deep: #EDE7D9;
  --sheet-head: #FAF7EF;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

html { scroll-behavior: smooth; scroll-padding-top: 40px; }
.reading-room { background: var(--paper); }
.reading-room ::selection { background: var(--ink); color: var(--paper); }
.reading-room [tabindex="-1"]:focus { outline: none; }
.reading-room button { font: inherit; color: inherit; cursor: pointer; }
.reading-room :is(a, button):focus-visible { outline: 1px solid var(--ink); outline-offset: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-reader { position: fixed; left: 16px; top: -80px; z-index: 30; padding: 12px 16px; background: var(--ink); color: var(--paper); }
.skip-reader:focus { top: 16px; }

.progress { position: fixed; top: 0; left: var(--rail); right: 0; height: 2px; z-index: 20; pointer-events: none; }
.progress span { display: block; height: 100%; background: var(--ink); transform: scaleX(0); transform-origin: left; }

/* Contents rail */
.rail { position: fixed; inset: 0 auto 0 0; z-index: 10; width: var(--rail); display: flex; flex-direction: column; padding: 28px 28px 26px; border-right: 1px solid var(--rule); background: var(--paper); overflow-y: auto; scrollbar-width: none; }
.rail a { color: inherit; text-decoration: none; }
.rail-top { display: flex; align-items: baseline; justify-content: space-between; }
.rail-home { font-size: 15px; line-height: 1.4; color: var(--soft); transition: color .2s; }
.rail-home:hover { color: var(--ink); }
.rail-mark, .contents-toggle { display: none; }
.rail-panel { display: flex; flex: 1; flex-direction: column; }
.rail-volume { margin: 44px 0 0; font-size: 15px; line-height: 1.45; color: var(--soft); }
.rail-volume span { display: block; color: var(--ink); }
.toc { margin-top: 40px; font-size: 15px; line-height: 1.35; }
.toc a { color: var(--soft); transition: color .2s; }
.toc a:hover, .toc a[aria-current] { color: var(--ink); }
.toc-foreword { display: block; margin-bottom: 26px; }
.toc-title { display: block; font-size: 17px; line-height: 1.3; }
.toc-paper.is-within .toc-title { color: var(--ink); }
.toc-kicker { display: block; margin-bottom: 4px; font-size: 13px; color: var(--muted); }
.toc-list { position: relative; margin: 18px 0 0; padding: 0; list-style: none; }
.toc-list::before, .toc-list::after { content: ""; position: absolute; left: 0; top: 0; width: 1px; }
.toc-list::before { bottom: 0; background: var(--rule); }
.toc-list::after { height: var(--fill, 0px); background: var(--ink); transition: height .45s var(--ease); }
.toc-list a { position: relative; display: grid; grid-template-columns: 26px 1fr auto; padding: 7px 0 7px 16px; }
.toc-list a[aria-current]::before { content: ""; position: absolute; left: -2px; top: 50%; width: 5px; height: 5px; margin-top: -2.5px; border-radius: 50%; background: var(--ink); }
.toc-num { font-feature-settings: "tnum"; color: var(--muted); }
.toc-tag { padding-left: 10px; font-size: 12px; line-height: 1.7; color: var(--muted); }
.rail-brand { margin-top: auto; padding-top: 32px; font-size: 30px; line-height: 1; letter-spacing: .04em; color: var(--ink); }

/* Reading viewport */
.reading-page { display: block; min-width: 0; margin-left: var(--rail); padding: 0; }
.col { width: 100%; max-width: calc(var(--wide) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }
.kicker { display: flex; flex-wrap: wrap; gap: 0 10px; margin: 0 0 26px; font-size: 15px; line-height: 1.5; color: var(--soft); }
.kicker span + span::before { content: "·"; margin-right: 10px; color: var(--muted); }

.reader-cover { min-height: 100svh; display: flex; flex-direction: column; padding-top: 28px; padding-bottom: 44px; }
.running-head { display: flex; justify-content: space-between; gap: 24px; font-size: 15px; line-height: 1.5; color: var(--soft); }
.reader-cover h1 { margin: auto 0 0; padding-top: 72px; font-size: clamp(52px, 6.3vw, 104px); line-height: 1; letter-spacing: -.025em; font-weight: 400; }
.reader-cover h1 span { display: block; }
.cover-deck { max-width: 31ch; margin: 30px 0 0; font-size: clamp(22px, 2vw, 28px); line-height: 1.36; color: var(--muted); text-wrap: pretty; }
.volume-index { margin-top: auto; padding-top: 72px; }
.volume-label { margin: 0 0 12px; font-size: 13px; color: var(--soft); }
.volume-index ol { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--ink); }
.volume-index li + li { border-left: 1px solid var(--rule); }
.volume-index a { display: flex; flex-direction: column; height: 100%; padding: 18px 22px 2px; color: inherit; text-decoration: none; }
.volume-index li:first-child a { padding-left: 0; }
.vi-type { font-size: 13px; color: var(--soft); }
.vi-title { margin-top: 8px; font-size: 20px; line-height: 1.25; text-wrap: balance; text-decoration: underline; text-decoration-color: transparent; text-decoration-thickness: 1px; text-underline-offset: 4px; transition: text-decoration-color .2s; }
.volume-index a:hover .vi-title { text-decoration-color: currentColor; }
.vi-meta { margin-top: auto; padding-top: 16px; font-size: 13px; color: var(--muted); }

.paper-opening { padding-top: clamp(104px, 16vh, 168px); padding-bottom: 64px; }
.paper-opening h2 { max-width: 14ch; margin: 0; font-size: clamp(44px, 5vw, 78px); line-height: 1.04; letter-spacing: -.022em; font-weight: 400; text-wrap: balance; }
.deck { max-width: 32ch; margin: 28px 0 0; font-size: clamp(22px, 2vw, 27px); line-height: 1.38; color: var(--muted); text-wrap: pretty; }
.byline { margin: 30px 0 0; font-size: 15px; color: var(--soft); }

/* Settlement bridge */
.bridge { margin-block: 0; padding-bottom: 96px; }
.bridge-totals { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding-top: 26px; border-top: 1px solid var(--ink); }
.bridge-totals span { display: block; margin-bottom: 8px; font-size: 15px; color: var(--soft); }
.bridge-totals strong { display: block; font-size: clamp(38px, 4.4vw, 64px); line-height: 1; letter-spacing: -.02em; font-weight: 400; font-feature-settings: "tnum"; }
.bridge-gross strong { color: var(--muted); }
.bridge-net { text-align: right; }
.bridge-bar { display: flex; gap: 2px; height: 14px; margin-top: 30px; }
.bridge-bar span { flex: var(--w) 0 0; min-width: 3px; background: var(--c); }
.is-fee { --c: #CFC7B5; }
.is-interest { --c: #ABA28D; }
.is-costs { --c: #7F7764; }
.is-payout { --c: repeating-linear-gradient(135deg, #E4DDCD 0 3px, #F3EEE3 3px 6px); }
.is-usable { --c: var(--ink); }
.bridge-legend { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 18px 16px; margin: 24px 0 0; }
.bridge-legend div { display: grid; grid-template: auto 1fr / 10px 1fr; column-gap: 10px; }
.bridge-legend div::before { content: ""; grid-row: span 2; width: 10px; height: 10px; margin-top: 5px; background: var(--c); }
.bridge-legend dd { align-self: end; }
.bridge-legend .is-payout::before { box-shadow: inset 0 0 0 1px #1A181518; }
.bridge-legend dt { font-size: 14px; line-height: 1.4; color: var(--soft); }
.bridge-legend dd { margin: 2px 0 0; font-size: 18px; font-feature-settings: "tnum"; }
.bridge-legend .is-usable dd { color: var(--ink); }
.bridge figcaption { max-width: var(--measure); margin-top: 30px; font-size: 17px; line-height: 1.5; color: var(--soft); }
.bridge figcaption a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: 4px; }

/* The three underwriting questions behind the illustration */
.decision-card { margin-block: 0 100px; }
.decision-label { margin: 0 0 14px; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--soft); }
.decision-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--ink); border-bottom: 1px solid var(--rule); }
.decision-grid div { min-height: 132px; padding: 20px 24px 22px 0; }
.decision-grid div + div { padding-left: 24px; border-left: 1px solid var(--rule); }
.decision-grid span { display: block; margin-bottom: 15px; font-size: 13px; color: var(--soft); }
.decision-grid strong { display: block; max-width: 18ch; font-size: 22px; line-height: 1.18; font-weight: 400; }

/* Video */
.media { margin-block: 0; padding-bottom: 32px; }
.media-frame { position: relative; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 3px; background: radial-gradient(130% 120% at 18% 0%, #34302A 0%, #1A1815 58%); color: var(--paper); }
.media-slate { position: absolute; inset: 0; display: flex; flex-direction: column; padding: clamp(22px, 4%, 44px); }
.media-slate-kicker, .media-slate-status { font-size: 14px; color: #FEFBF48C; }
.media-slate-title { max-width: 16ch; margin-top: auto; font-size: clamp(28px, 3.6vw, 52px); line-height: 1.08; letter-spacing: -.015em; text-wrap: balance; }
.media-slate-status { display: flex; align-items: center; gap: 10px; margin-top: 18px; }
.media-slate-status::before { content: ""; width: 7px; height: 7px; border: 1px solid currentColor; border-radius: 50%; }
.media-poster { position: absolute; inset: 0; width: 100%; padding: 0; border: 0; background: #1A1815 center / cover no-repeat; color: var(--paper); }
.media-poster::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, #1A1815b0, #1A181500 55%); }
.media-play { position: absolute; left: 50%; top: 50%; z-index: 1; width: 76px; height: 76px; border: 1px solid #FEFBF4b0; border-radius: 50%; background: #1A181559; backdrop-filter: blur(8px); transform: translate(-50%, -50%); transition: transform .35s var(--ease), background .35s; }
.media-play::after { content: ""; position: absolute; left: 50%; top: 50%; border-left: 17px solid var(--paper); border-top: 10px solid transparent; border-bottom: 10px solid transparent; transform: translate(-38%, -50%); }
.media-poster:hover .media-play { transform: translate(-50%, -50%) scale(1.06); background: #1A181599; }
.media iframe, .media video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.media figcaption { display: flex; gap: 20px; max-width: var(--measure); margin-top: 16px; font-size: 17px; line-height: 1.5; color: var(--soft); }
.media-kicker { flex: none; color: var(--ink); }

/* Chapters */
.chapter { padding-top: 96px; }
.chapter-num { display: flex; align-items: center; gap: 14px; margin: 0 0 22px; font-size: 15px; color: var(--soft); font-feature-settings: "tnum"; }
.chapter-num::after { content: ""; width: 40px; height: 1px; background: var(--rule); }
.chapter h3 { max-width: 22ch; margin: 0 0 34px; font-size: clamp(32px, 3.1vw, 46px); line-height: 1.12; letter-spacing: -.015em; font-weight: 400; text-wrap: balance; }
.prose { max-width: var(--measure); }
.prose p { margin: 0 0 1.05em; font-size: 21px; line-height: 1.62; text-wrap: pretty; }
.prose strong { font-weight: 400; background: linear-gradient(transparent 64%, var(--stone-deep) 64%); }
.prose a { color: var(--soft); text-decoration: underline; text-decoration-color: var(--rule); text-decoration-thickness: 1px; text-underline-offset: 4px; transition: color .2s, text-decoration-color .2s; }
.prose a:hover { color: var(--ink); text-decoration-color: var(--ink); }
.end-mark { max-width: var(--measure); margin: 56px 0 0; padding-top: 20px; border-top: 1px solid var(--rule); font-size: 14px; line-height: 1.5; color: var(--soft); }
.triage-list { max-width: var(--measure); margin: 32px 0 0; padding: 0; list-style: none; border-top: 1px solid var(--ink); }
.triage-list li { display: grid; grid-template-columns: 42px 1fr; gap: 16px; padding: 15px 0; border-bottom: 1px solid var(--rule); }
.triage-list span { padding-top: 3px; font-size: 13px; color: var(--soft); font-feature-settings: "tnum"; }
.triage-list p { margin: 0; font-size: 19px; line-height: 1.45; }
.enquiry-card { max-width: var(--wide); margin-top: 56px; padding: clamp(28px, 5vw, 56px); background: var(--ink); color: var(--paper); }
.enquiry-eyebrow { margin: 0 0 26px; font-size: 13px; letter-spacing: .09em; text-transform: uppercase; color: #FEFBF49c; }
.enquiry-card h4 { max-width: 17ch; margin: 0; font-size: clamp(34px, 3.5vw, 51px); line-height: 1.08; font-weight: 400; }
.enquiry-card > p:not(.enquiry-eyebrow) { max-width: 35rem; margin: 22px 0 0; font-size: 20px; line-height: 1.5; color: #FEFBF4c4; }
.enquiry-card a { display: inline-flex; gap: 60px; justify-content: space-between; min-width: 220px; margin-top: 32px; padding: 13px 0; border-bottom: 1px solid #FEFBF4; color: var(--paper); font-size: 20px; text-decoration: none; }
.enquiry-card a:hover { border-bottom-width: 2px; }
.enquiry-card small { display: block; max-width: 35rem; margin-top: 28px; font-size: 13px; line-height: 1.5; color: #FEFBF499; }

/* Workbook */
.workbook { margin-top: 120px; padding-block: 104px 96px; background: var(--stone); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.workbook-head { max-width: var(--measure); margin-bottom: 44px; }
.workbook h2 { margin: 0; font-size: clamp(38px, 3.8vw, 56px); line-height: 1.06; letter-spacing: -.02em; font-weight: 400; }
.workbook-deck { margin: 20px 0 0; font-size: 21px; line-height: 1.5; color: var(--soft); text-wrap: pretty; }

.sheet { margin: 0; overflow: hidden; border: 1px solid var(--rule); border-radius: 4px; background: var(--paper); box-shadow: 0 1px 0 #1A18150a, 0 24px 60px -32px #1A181559; }
.sheet-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 18px; border-bottom: 1px solid var(--rule); font-size: 14px; color: var(--soft); }
.sheet-file { display: flex; align-items: center; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet-badge { flex: none; margin-right: 10px; padding: 3px 6px 2px; border: 1px solid var(--rule); border-radius: 3px; font: 10px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .06em; color: var(--ink); }
.sheet-download { flex: none; color: var(--ink); text-decoration: none; }
.sheet-download:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.sheet-scroll { overflow-x: auto; }
.sheet table { width: 100%; min-width: 420px; border-collapse: collapse; font-size: 17px; line-height: 1.35; font-feature-settings: "tnum"; }
.sheet thead th { padding: 9px 18px; border-bottom: 1px solid var(--rule); background: var(--sheet-head); font-size: 12px; font-weight: 400; text-align: left; color: var(--muted); }
.sheet thead th:last-child { text-align: right; }
.sheet tbody th[scope="row"] { width: 60px; padding: 15px 0 15px 18px; border-right: 1px solid var(--rule); border-bottom: 1px solid #1A181512; background: var(--sheet-head); font: 12px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 400; text-align: left; vertical-align: top; color: var(--muted); }
.sheet td { padding: 14px 18px; border-bottom: 1px solid #1A181512; vertical-align: top; }
.sheet td:last-child { text-align: right; white-space: nowrap; }
.sheet-group th { padding: 22px 18px 8px; border-bottom: 1px solid var(--rule); font-size: 13px; font-weight: 400; text-align: left; color: var(--soft); }
.sheet tbody:first-of-type .sheet-group th { padding-top: 16px; }
.formula { display: block; margin-top: 4px; font: 12px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--muted); }
.sheet-total td { border-top: 1px solid var(--ink); border-bottom: 0; font-size: 21px; }
.sheet-total th[scope="row"] { border-top: 1px solid var(--ink); border-bottom: 0; }
.sheet-foot { display: flex; align-items: stretch; border-top: 1px solid var(--rule); background: var(--sheet-head); font-size: 13px; }
.sheet-tab { padding: 8px 18px; border-right: 1px solid var(--rule); background: var(--paper); box-shadow: inset 0 2px 0 var(--ink); color: var(--ink); }
.sheet-range { margin-left: auto; padding: 8px 18px; color: var(--muted); }

.workbook-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 0 32px; margin-top: 44px; }
.action { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 18px 0; border-block: 1px solid var(--rule); font-size: 20px; color: var(--ink); text-decoration: none; }
.action span:last-child { font-size: 14px; color: var(--soft); transition: transform .25s var(--ease), color .2s; }
.action:hover span:last-child { color: var(--ink); transform: translateX(3px); }
.fine-print { margin: 24px 0 0; font-size: 14px; line-height: 1.5; color: var(--soft); }

.reader-footer { display: flex; flex-wrap: wrap; align-items: baseline; gap: 12px 28px; padding-top: 32px; padding-bottom: 44px; border: 0; font-size: 15px; }
.reader-footer a { border: 0; color: var(--soft); text-decoration: none; transition: color .2s; }
.reader-footer a:hover { color: var(--ink); }
.reader-footer a:last-child { margin-left: auto; }

/* Wide screens */
@media (min-width: 1600px) {
  :root { --rail: 304px; --wide: 62rem; }
  .rail { padding: 32px; }
}

/* Laptops and tablets */
@media (max-width: 1100px) and (min-width: 761px) {
  :root { --rail: 236px; --gutter: clamp(28px, 5vw, 56px); }
  .rail { padding: 24px 22px 22px; }
  .toc, .rail-volume { font-size: 14px; }
  .toc-title { font-size: 16px; }
  .toc-list a { grid-template-columns: 24px 1fr auto; padding-left: 14px; }
  .vi-title { font-size: 18px; }
  .volume-index a { padding-inline: 16px; }
}

/* Short desktop windows */
@media (max-height: 820px) and (min-width: 761px) {
  .rail-volume { margin-top: 30px; }
  .toc { margin-top: 28px; }
  .toc-foreword { margin-bottom: 18px; }
  .toc-list a { padding-block: 5px; }
  .reader-cover h1 { padding-top: 48px; }
  .volume-index { padding-top: 48px; }
}

/* Phones */
@media (max-width: 760px) {
  :root { --rail: 0px; --gutter: 22px; }
  html { scroll-padding-top: 76px; }
  .rail { inset: 0 0 auto; width: auto; height: 60px; padding: 0 22px; overflow: hidden; border-right: 0; border-bottom: 1px solid var(--rule); background: #FEFBF4eb; -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
  .rail-top { flex: none; align-items: center; height: 60px; }
  .rail-home { display: none; }
  .rail-mark { display: block; font-size: 22px; line-height: 1; letter-spacing: .04em; color: var(--ink); }
  .contents-toggle { display: block; padding: 8px 0 8px 16px; border: 0; background: none; font-size: 15px; color: var(--soft); }
  .rail-panel { display: none; }
  .rail.is-open { height: 100svh; overflow-y: auto; background: var(--paper); }
  .rail.is-open .rail-panel { display: flex; padding-bottom: 32px; }
  .contents-open { overflow: hidden; }
  .rail-volume { margin-top: 28px; }
  .toc { margin-top: 32px; font-size: 17px; }
  .toc-title { font-size: 21px; }
  .toc-list a { padding-block: 10px; }
  .rail-brand { display: none; }
  .reading-page { padding-top: 60px; }
  .progress { top: 60px; left: 0; }

  .reader-cover { min-height: calc(100svh - 60px); padding-top: 22px; padding-bottom: 32px; }
  .running-head span:last-child { display: none; }
  .reader-cover h1 { padding-top: 56px; font-size: clamp(44px, 13vw, 60px); line-height: 1.02; }
  .cover-deck { font-size: 21px; }
  .volume-index { padding-top: 48px; }
  .volume-index ol { grid-template-columns: 1fr; }
  .volume-index li + li { border-left: 0; border-top: 1px solid var(--rule); }
  .volume-index a, .volume-index li:first-child a { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 14px 0; }
  .vi-type { grid-column: 1; }
  .vi-meta { grid-column: 2; grid-row: 1; margin: 0; padding: 0; text-align: right; }
  .vi-title { grid-column: 1 / -1; margin: 0; font-size: 19px; }

  .paper-opening { padding-top: 88px; padding-bottom: 44px; }
  .paper-opening h2 { font-size: clamp(38px, 11vw, 52px); }
  .deck { font-size: 21px; }
  .bridge { padding-bottom: 72px; }
  .bridge-totals { flex-direction: column; align-items: flex-start; gap: 18px; }
  .bridge-net { text-align: left; }
  .bridge-totals strong { font-size: 40px; }
  .bridge-legend { grid-template-columns: 1fr 1fr; }
  .bridge-legend dd { align-self: start; }
  .decision-card { margin-bottom: 72px; }
  .decision-grid { grid-template-columns: 1fr; }
  .decision-grid div { min-height: 0; padding: 16px 0; }
  .decision-grid div + div { padding-left: 0; border-left: 0; border-top: 1px solid var(--rule); }
  .decision-grid span { margin-bottom: 5px; }
  .decision-grid strong { max-width: none; font-size: 21px; }
  .media { padding-inline: 0; }
  .media-frame { border-radius: 0; aspect-ratio: 4 / 3; }
  .media figcaption { flex-direction: column; gap: 2px; padding-inline: var(--gutter); }
  .chapter { padding-top: 72px; }
  .chapter h3 { font-size: 31px; margin-bottom: 26px; }
  .prose p { font-size: 19px; line-height: 1.6; }
  .triage-list p { font-size: 18px; }
  .enquiry-card { margin-inline: calc(var(--gutter) * -1); padding: 32px var(--gutter); }
  .enquiry-card > p:not(.enquiry-eyebrow) { font-size: 18px; }

  .workbook { margin-top: 88px; padding-block: 72px; }
  .workbook-deck { font-size: 19px; }
  .sheet { margin-inline: calc(var(--gutter) * -1); border-inline: 0; border-radius: 0; }
  .sheet table { min-width: 0; font-size: 16px; }
  .sheet tbody th[scope="row"] { width: 44px; padding-left: 12px; }
  .sheet td { padding: 12px 14px; }
  .sheet-total td { font-size: 19px; }
  .workbook-actions { grid-template-columns: 1fr; }
  .workbook-actions .action + .action { border-top: 0; }
  .action { font-size: 18px; }
  .reader-footer a:last-child { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reading-room *, .reading-room *::before, .reading-room *::after { transition: none !important; }
}
