@font-face {
  font-family: "Caladea";
  src: url("/caladea-bold.woff") format("woff");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Noto Serif";
  src: url("/noto-serif-regular.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #f5f0e4;
  --ink: #232821;
  --red: #993521;
  --soft: #606355;
  --rule: #b7b5a6;
  --sheet: #fffaf0;
  font-family: "Noto Serif", Georgia, serif;
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--paper);
  -webkit-text-size-adjust: 100%;
}

* { box-sizing: border-box; }
html { scroll-padding-top: 2rem; }
body { margin: 0; }
body, main, article, section, aside, nav { min-width: 0; }
h1, h2, h3, strong, summary {
  font-family: "Caladea", Georgia, serif;
  font-weight: 700;
}
h1 {
  font-size: clamp(2.9rem, 5.4vw, 5.3rem);
  line-height: 1.02;
  letter-spacing: -0.028em;
  margin: 0.7rem 0 1.4rem;
  max-width: 17ch;
  text-wrap: balance;
}
h2 {
  font-size: clamp(1.55rem, 2.5vw, 1.9rem);
  line-height: 1.22;
  margin: 0 0 0.85rem;
  text-wrap: balance;
}
h3 { font-size: 1.3rem; line-height: 1.3; }
p { margin: 0 0 1rem; }
a {
  color: var(--red);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 44px;
  min-width: 44px;
  padding: 0.4rem 0;
  line-height: 1.4;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  overflow-wrap: anywhere;
}
a:hover { color: var(--ink); text-decoration-thickness: 2px; }
a:focus-visible, summary:focus-visible {
  outline: 3px solid var(--red);
  outline-offset: 5px;
}
ul, ol { padding-left: 1.5rem; margin: 0 0 1.2rem; }
li { margin: 0.3rem 0; }
img { display: block; max-width: 100%; height: auto; }
figure { margin: 0; }
figcaption { color: var(--soft); font-size: 16px; padding: 0.6rem 0; line-height: 1.5; }
summary { cursor: pointer; min-height: 48px; font-size: 1.5rem; line-height: 1.3; padding: 0.65rem 0; }
[hidden] { display: none !important; }
strong { font-size: inherit; }

body > header {
  max-width: 1360px;
  margin: 0 auto;
  padding: 1rem 2.5rem 0.85rem;
  border-bottom: 3px solid var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}
body > header > a {
  color: var(--ink);
  font-family: "Caladea", Georgia, serif;
  font-size: 1.7rem;
  font-weight: 700;
  text-decoration: none;
}
body > header p { margin: 0; color: var(--red); }
body > footer {
  max-width: 1360px;
  padding: 1.8rem 2.5rem 2rem;
  margin: 3rem auto 0;
  border-top: 3px solid var(--ink);
  font-size: 16px;
}
body > footer p { max-width: 70ch; }
body > footer nav { display: flex; flex-wrap: wrap; column-gap: 2rem; row-gap: 0.5rem; }

[class$="-spread"] {
  max-width: 1360px;
  padding: 2rem 2.5rem 0;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 245px minmax(0, 1fr);
  column-gap: clamp(2rem, 5vw, 4.5rem);
  align-items: start;
}
[class$="-spread"] > aside { position: sticky; top: 1.5rem; border-top: 1px solid var(--ink); }
[class$="-spread"] > aside nav { max-height: calc(100vh - 6.5rem); overflow-y: auto; overscroll-behavior: contain; padding-right: 0.5rem; }
[class$="-spread"] > aside nav section > p {
  color: var(--soft);
  font-family: "Noto Serif", Georgia, serif;
  font-size: 16px;
  font-weight: 400;
  margin: 1.3rem 0 0.3rem;
  line-height: 1.5;
}
[class$="-spread"] > aside nav ol { list-style: none; padding: 0; margin: 0; }
[class$="-spread"] > aside nav li { margin: 0; border-bottom: 1px solid var(--rule); }
[class$="-spread"] > aside nav a {
  font-size: 16px;
  color: var(--ink);
  width: 100%;
  min-height: 48px;
  text-decoration: none;
  padding: 0.65rem 0.35rem;
}
[class$="-spread"] > aside nav a:hover { text-decoration: underline; text-underline-offset: 0.2em; }
[class$="-spread"] > aside nav a[aria-current="page"] { color: var(--red); box-shadow: inset 4px 0 0 var(--red); padding-left: 0.85rem; }
main > header { padding-bottom: 1.5rem; border-bottom: 1px solid var(--ink); }
main > header > a { margin-right: 1rem; }
main > header nav { color: var(--soft); font-size: 16px; margin: -0.5rem 0 1rem; }
main > header nav ol { list-style: none; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.9rem; margin: 0; }
main > header nav li { margin: 0; }
main > header nav li + li::before { content: "/"; margin-right: 0.8rem; color: var(--soft); }
[class$="-rubric"] { color: var(--red); font-size: 17px; margin: 0 0 0.5rem; }
[class$="-lead"] { max-width: 58ch; font-size: 1.15rem; line-height: 1.65; }
main > article { max-width: 68ch; }
article > section { padding-top: 2.4rem; }
article p, article li { max-width: 68ch; }
article > section > ul { list-style-type: square; }

[class$="-notes"] {
  margin-top: 2.5rem;
  padding: 1.5rem 1.65rem 0.8rem;
  background: var(--sheet);
  border-left: 5px solid var(--red);
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}
[class$="-notes"] h2 { font-size: 1.6rem; }
[class$="-notes"] > p { color: var(--soft); font-size: 16px; }
dl { margin: 0; }
dt { font-size: 17px; margin-top: 1.1rem; }
dd { margin: 0; }
[class$="-notes"] dd { min-height: 3.2rem; padding-top: 1.5rem; }
[class$="-notes"] dd span { display: block; height: 1.5rem; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
[class$="-endnotes"] { border-top: 3px double var(--ink); margin-top: 2.5rem; padding-top: 1.4rem; }
[class$="-endnotes"] h2 { font-size: 1.5rem; }
[class$="-endnotes"] p { color: var(--soft); font-size: 16px; }
[class$="-endnotes"] ul { list-style: none; padding: 0; }
[class$="-endnotes"] li { border-bottom: 1px solid var(--rule); margin: 0; }
[class$="-endnotes"] a { font-size: 16px; width: 100%; padding: 0.65rem 0; min-height: 48px; justify-content: space-between; }
[class$="-endnotes"] a span { flex-shrink: 0; }
[class$="-page-turn"] {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  margin-top: 2rem;
  border-top: 1px solid var(--ink);
  gap: 1rem;
  max-width: 68ch;
}
[class$="-page-turn"] > a { display: flex; flex-direction: column; align-items: flex-start; padding: 1rem 0.25rem; max-width: 46%; font-size: 17px; text-decoration: none; }
[class$="-page-turn"] > a > span { color: var(--soft); font-size: 16px; }
[class$="-page-turn"] strong { font-size: 1.25rem; line-height: 1.35; text-decoration: underline; text-underline-offset: 0.2em; }
[class$="-skip"] { position: absolute; left: 1rem; top: 1rem; clip-path: inset(50%); white-space: nowrap; max-width: calc(100% - 2rem); }
[class$="-skip"]:focus { clip-path: none; z-index: 20; color: var(--paper); background: var(--ink); padding: 0.75rem 1rem; }
[class$="-progress"] { position: fixed; top: 0; left: 0; right: 0; height: 6px; z-index: 10; background: var(--paper); pointer-events: none; }
progress { appearance: none; -webkit-appearance: none; border: 0; width: 100%; height: 6px; display: block; color: var(--red); background: transparent; }
progress::-webkit-progress-bar { background: transparent; }
progress::-webkit-progress-value { background: var(--red); }
progress::-moz-progress-bar { background: var(--red); }

.open-notebook-page main > header { border-bottom: 0; padding-bottom: 0; }
.open-notebook-page h1 { font-size: clamp(3.2rem, 6.4vw, 5.8rem); max-width: 16ch; }
.open-notebook-start { background: var(--red); color: var(--sheet); text-decoration: none; padding: 0.85rem 1.1rem; min-height: 54px; margin: 0.5rem 0 0.8rem; }
.open-notebook-start:hover { background: var(--ink); color: var(--sheet); }
.open-notebook-opening { margin: 1.3rem 0 0; position: relative; }
.open-notebook-still-life { width: 100%; }
.open-notebook-still-life img { width: 100%; aspect-ratio: 20 / 13; background: #e5dcc8; object-fit: cover; color: var(--ink); font-size: 16px; }
.open-notebook-question { max-width: 26rem; margin: 0.8rem 0 0 auto; padding: 1.2rem 1.4rem; background: var(--ink); color: var(--sheet); border-top: 7px solid var(--red); }
.open-notebook-question-label { display: block; font-family: "Noto Serif", Georgia, serif; font-size: 16px; font-weight: 400; margin-bottom: 0.5rem; }
.open-notebook-question p { font-family: "Caladea", Georgia, serif; font-size: 1.65rem; font-weight: 700; line-height: 1.3; margin: 0; }
.budget-notes-still-life, .decision-notes-still-life { margin-top: 2.5rem; }
.budget-notes-still-life img, .decision-notes-still-life img { width: 100%; aspect-ratio: 3 / 2; background: #e5dcc8; object-fit: cover; font-size: 16px; }
.lost-notebook-page main { min-height: 45vh; }

@media (max-width: 1000px) {
  [class$="-spread"] { grid-template-columns: 210px minmax(0, 1fr); column-gap: 2rem; padding-left: 1.5rem; padding-right: 1.5rem; }
  body > header, body > footer { padding-left: 1.5rem; padding-right: 1.5rem; }
}
@media (max-width: 760px) {
  body > header { display: block; padding: 0.6rem 1.2rem 0.8rem; }
  body > header > a { font-size: 1.65rem; }
  body > header p { font-size: 16px; }
  [class$="-spread"] { display: block; padding: 1rem 1.2rem 0; }
  [class$="-spread"] > aside { position: static; margin: 0 0 1.65rem; border-top: 0; border-bottom: 1px solid var(--ink); }
  [class$="-spread"] > aside nav { max-height: 190px; margin-bottom: 0.6rem; }
  [class$="-spread"] > aside nav section > p { margin-top: 0.5rem; }
  summary { font-size: 1.3rem; }
  main > header nav { margin-top: 0; }
  h1 { font-size: clamp(2.55rem, 10.5vw, 3.5rem); max-width: 18ch; }
  .open-notebook-page h1 { font-size: clamp(2.6rem, 11vw, 3.6rem); }
  [class$="-lead"] { font-size: 1.05rem; }
  main > header > a { margin-right: 0; }
  .open-notebook-start { display: flex; justify-content: space-between; width: fit-content; margin-right: 0.8rem; }
  article > section { padding-top: 1.9rem; }
  [class$="-notes"] { padding: 1.2rem 1rem 0.7rem; margin-top: 1.9rem; }
  [class$="-page-turn"] > a { max-width: 100%; flex: 1 1 100%; }
  body > footer { padding: 1.4rem 1.2rem 1.8rem; }
  body > footer nav { flex-direction: column; align-items: flex-start; gap: 0.4rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media print {
  :root { font-size: 16px; color: #000; background: #fff; }
  body > header, body > footer, [class$="-spread"] > aside, [class$="-page-turn"], [class$="-progress"], [class$="-skip"], main > header > a, main > header nav, figure { display: none !important; }
  [class$="-spread"] { display: block; padding: 0; max-width: none; }
  h1, .open-notebook-page h1 { font-size: 2.5rem; max-width: none; }
  h2 { font-size: 1.5rem; break-after: avoid; }
  main > article { max-width: none; }
  article > section { padding-top: 1.1rem; }
  [class$="-notes"] { break-inside: avoid; background: #fff; }
  [class$="-notes"] dd { min-height: 4rem; }
  [class$="-endnotes"] { break-inside: avoid; }
  a { color: #000; }
  .open-notebook-question { background: #fff; color: #000; border: 1px solid #000; margin-left: 0; }
}
