/* The notebook starts small; wider screens gain a left-hand paper index. */
:root {
  color-scheme: light;
  --paper: #f5eedf;
  --sheet: #fffaf0;
  --ink: #3b3029;
  --soft-ink: #66574c;
  --clay: #8c422d;
  --clay-deep: #533026;
  --olive: #3f4a3a;
  --olive-paper: #e1e3d4;
  --edge: #b2a18b;
  --ochre-paper: #ead3a9;
  font-family: "Aptos", "Candara", "Segoe UI", "Optima", "Trebuchet MS", sans-serif;
  font-size: 18px;
  line-height: 1.6;
}

* { box-sizing: border-box; }
html { scroll-behavior: auto; }
body { margin: 0; background: var(--paper); color: var(--ink); }
img { display: block; max-width: 100%; height: auto; }
a { color: var(--clay); text-underline-offset: .2em; text-decoration-thickness: .065em; }
button, input, summary { font: inherit; }
p, figure, h1, h2 { margin: 0; }
main, aside, section, div, nav { min-width: 0; }
a, summary { -webkit-tap-highlight-color: #ead3a9; }
a:focus-visible, summary:focus-visible { outline: 3px solid var(--olive); outline-offset: 5px; }

.notebook__skip {
  position: fixed;
  top: 10px;
  left: 12px;
  z-index: 20;
  min-height: 48px;
  max-width: calc(100vw - 24px);
  padding: 10px 16px;
  transform: translateY(-160%);
  background: var(--sheet);
  color: var(--ink);
}
.notebook__skip:focus { transform: translateY(0); }
.notebook__shell { max-width: 1520px; margin-inline: auto; }
.notebook__page { padding: 30px 24px 0; outline: none; }

.side-index { padding: 18px 24px 0; border-bottom: 1px solid var(--edge); }
.side-index__home {
  display: flex;
  gap: 12px;
  align-items: baseline;
  min-height: 48px;
  width: fit-content;
  max-width: 100%;
  color: var(--clay-deep);
  text-decoration: none;
}
.side-index__place { font-size: 25px; font-weight: 600; letter-spacing: -.04em; }
.side-index__name { font-size: 16px; }
.side-index__drawer { margin-top: 4px; }
.side-index__toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 52px;
  cursor: pointer;
  color: var(--clay-deep);
  font-size: 17px;
  list-style: none;
}
.side-index__toggle::-webkit-details-marker { display: none; }
.side-index__toggle-mark { width: 14px; height: 14px; border-right: 2px solid; border-bottom: 2px solid; transform: rotate(45deg); margin: 0 3px 7px; }
.side-index__drawer[open] .side-index__toggle-mark { transform: rotate(225deg); margin-bottom: 0; }
.side-index__nav { padding-block: 16px 24px; }
.side-index__group + .side-index__group { margin-top: 20px; }
.side-index__group-name { color: var(--soft-ink); font-size: 16px; padding: 0 10px 7px; }
.side-index__link {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 48px;
  padding: 9px 10px;
  border-bottom: 1px solid #d8cbb9;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.35;
  text-decoration: none;
}
.side-index__letter { color: var(--clay); flex: 0 0 18px; font-size: 16px; }
.side-index__link[aria-current="page"] { background: var(--ochre-paper); color: var(--clay-deep); border-left: 3px solid var(--clay); padding-left: 7px; }
.side-index__link:hover { background: var(--sheet); }

.page-head { border-bottom: 2px solid var(--clay); padding-bottom: 30px; margin-bottom: 34px; }
.page-head__eyebrow { font-size: 16px; color: var(--clay); line-height: 1.45; margin-bottom: 16px; }
.page-head__title { font-weight: 500; font-size: clamp(2rem, 6vw, 3.55rem); line-height: 1.1; letter-spacing: -.045em; max-width: 19ch; overflow-wrap: break-word; }
.page-head__intro { max-width: 62ch; margin-top: 23px; font-size: 19px; line-height: 1.55; }

.collage { position: relative; margin-top: 28px; isolation: isolate; }
.collage__paper { position: absolute; inset: 0 0 44px; overflow: clip; background: #e7d8bf; clip-path: polygon(1% 3%, 23% 0, 45% 2%, 69% 1%, 99% 4%, 98% 39%, 100% 68%, 97% 99%, 72% 98%, 49% 100%, 22% 98%, 1% 99%, 0 63%, 2% 30%); }
.collage__paper::before { content: ""; position: absolute; width: 54%; height: 85%; left: 18%; bottom: -20%; border-radius: 50% 50% 0 0; background: #ad6550; transform: rotate(-8deg); }
.collage__paper::after { content: ""; position: absolute; width: 55%; height: 43%; left: 42%; top: 18%; background: #e6e1ca; transform: rotate(13deg); border: 8px solid #f4ecd7; }
.collage__image { position: relative; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; clip-path: polygon(1% 3%, 23% 0, 45% 2%, 69% 1%, 99% 4%, 98% 39%, 100% 68%, 97% 99%, 72% 98%, 49% 100%, 22% 98%, 1% 99%, 0 63%, 2% 30%); color: transparent; font-size: 0; }
.collage__image--pending { visibility: hidden; }
.collage__caption { font-size: 16px; color: var(--soft-ink); padding-top: 14px; line-height: 1.45; }

.reading { max-width: 67ch; }
.reading__section { margin-bottom: 35px; }
.reading__heading { margin-bottom: 14px; font-size: clamp(1.35rem, 3.5vw, 1.65rem); font-weight: 600; line-height: 1.25; letter-spacing: -.018em; }
.reading__paragraph + .reading__paragraph { margin-top: 13px; }
.reading__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 48px;
  width: fit-content;
  max-width: 100%;
  padding: 10px 0;
  margin-top: 10px;
  font-size: 17px;
  line-height: 1.45;
}
.reading__arrow { flex: 0 0 auto; font-size: 24px; text-decoration: none; }
.reading__section--step { padding-left: 20px; border-left: 3px solid var(--edge); }

.myth-reveal { margin: 8px 0 38px; border-top: 1px solid var(--clay); }
.myth-reveal__item { border-bottom: 1px solid var(--clay); }
.myth-reveal__question { display: flex; justify-content: space-between; align-items: center; gap: 20px; min-height: 64px; padding: 16px 0; font-size: 20px; font-weight: 600; line-height: 1.35; cursor: pointer; list-style: none; }
.myth-reveal__question::-webkit-details-marker { display: none; }
.myth-reveal__mark { flex: 0 0 22px; width: 22px; height: 22px; position: relative; color: var(--clay); }
.myth-reveal__mark::before, .myth-reveal__mark::after { content: ""; position: absolute; background: currentColor; }
.myth-reveal__mark::before { width: 18px; height: 2px; left: 2px; top: 10px; }
.myth-reveal__mark::after { width: 2px; height: 18px; left: 10px; top: 2px; }
.myth-reveal__item[open] .myth-reveal__mark::after { display: none; }
.myth-reveal__answer { padding: 4px 20px 24px; border-left: 3px solid var(--clay); margin-bottom: 20px; }
.myth-reveal__item[open] .myth-reveal__question { color: var(--clay); }

.pencil-note { background: var(--olive-paper); border-left: 5px solid var(--olive); max-width: 67ch; padding: 24px; margin-block: 45px; }
.pencil-note__heading { font-size: 17px; font-weight: 600; color: var(--olive); margin-bottom: 9px; }
.pencil-note__text { color: var(--ink); font-size: 19px; line-height: 1.55; }

.source-box { max-width: 67ch; padding: 26px 0; border-block: 1px solid var(--edge); }
.source-box__heading { font-size: 23px; font-weight: 600; line-height: 1.3; }
.source-box__intro { color: var(--soft-ink); margin-top: 9px; font-size: 17px; }
.source-box__links { display: grid; margin-top: 14px; }
.source-box__link { display: flex; align-items: center; min-height: 48px; font-size: 16px; line-height: 1.45; padding: 10px 0; width: fit-content; max-width: 100%; }

.page-turn { display: grid; gap: 12px; max-width: 67ch; margin-block: 40px; }
.page-turn__link { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; min-height: 76px; padding: 14px 20px; background: var(--clay-deep); color: var(--sheet); text-decoration: none; font-size: 19px; line-height: 1.4; border: 1px solid var(--clay-deep); }
.page-turn__link--back { background: transparent; color: var(--clay-deep); }
.page-turn__direction { grid-column: 1 / -1; font-size: 16px; padding-bottom: 4px; }
.page-turn__arrow { font-size: 27px; padding-left: 15px; }
.page-turn__link:hover { text-decoration: underline; }
.page-turn__link:focus-visible { outline-offset: 4px; }

.page-footer { border-top: 1px solid var(--edge); padding: 28px 0 32px; max-width: 67ch; }
.page-footer__line { font-size: 16px; line-height: 1.55; max-width: 65ch; color: var(--soft-ink); }
.page-footer__links { display: flex; flex-wrap: wrap; gap: 4px 24px; margin-top: 15px; }
.page-footer__link { display: inline-flex; align-items: center; min-height: 48px; max-width: 100%; padding-block: 10px; font-size: 16px; line-height: 1.4; }

@media (min-width: 650px) {
  .notebook__page { padding-inline: 42px; }
  .side-index { padding-inline: 42px; }
  .side-index__nav { display: grid; grid-template-columns: 1fr 1fr; gap: 22px 32px; }
  .side-index__group + .side-index__group { margin-top: 0; }
  .page-head--collage { display: grid; grid-template-columns: minmax(0, 1fr) minmax(160px, .46fr); gap: 30px; align-items: center; }
  .page-head--collage .page-head__title { font-size: clamp(2rem, 4.4vw, 3.3rem); }
  .collage { margin-top: 0; }
  .page-turn { grid-template-columns: 1fr 1fr; }
  .page-turn__link:only-child { grid-column: 1 / -1; }
}

@media (min-width: 1060px) {
  .notebook__shell { display: grid; grid-template-columns: 272px minmax(0, 1fr); column-gap: 58px; padding: 28px 42px 0 28px; }
  .side-index { position: sticky; align-self: start; top: 28px; max-height: calc(100dvh - 56px); overflow-y: auto; padding: 22px 20px; background: var(--clay-deep); border: none; color: var(--sheet); scrollbar-width: thin; }
  .side-index__home { display: block; color: var(--sheet); padding: 0 8px 22px; width: 100%; }
  .side-index__place { display: block; font-size: 33px; line-height: 1.05; margin-bottom: 8px; }
  .side-index__name { display: block; font-size: 18px; }
  .side-index__toggle { color: var(--sheet); }
  .side-index--expanded .side-index__toggle { display: none; }
  .side-index__toggle:focus-visible, .side-index__link:focus-visible, .side-index__home:focus-visible { outline-color: var(--ochre-paper); outline-offset: 2px; }
  .side-index__nav { display: block; padding-block: 0; }
  .side-index__group + .side-index__group { margin-top: 20px; }
  .side-index__group-name { color: var(--ochre-paper); font-size: 16px; }
  .side-index__link { color: var(--sheet); border-bottom-color: #966b56; }
  .side-index__letter { color: var(--ochre-paper); }
  .side-index__link[aria-current="page"] { background: var(--paper); color: var(--clay-deep); border-left-color: var(--ochre-paper); }
  .side-index__link[aria-current="page"] .side-index__letter { color: var(--clay); }
  .side-index__link:hover { background: #724433; color: var(--sheet); }
  .side-index__link[aria-current="page"]:hover { background: var(--paper); color: var(--clay-deep); }
  .notebook__page { padding: 27px 0 0; }
  .page-head { padding-bottom: 42px; margin-bottom: 45px; }
  .page-head__title { font-size: 3.45rem; }
  .page-head--collage { grid-template-columns: minmax(0, 1fr) 235px; gap: 32px; }
  .page-head--collage .page-head__title { font-size: 3.15rem; }
  .page-head__intro { font-size: 21px; }
  .reading__section { margin-bottom: 40px; }
  .source-box__links { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 28px; }
}

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

@media print {
  :root { font-size: 16px; }
  body { background: white; color: #222; }
  .notebook__shell { display: block; padding: 0; max-width: none; }
  .notebook__page { padding: 0; }
  .side-index, .notebook__skip, .collage, .page-turn, .page-footer__links { display: none; }
  .page-head { display: block; margin-bottom: 20px; padding-bottom: 20px; }
  .page-head__title, .page-head--collage .page-head__title { font-size: 32px; }
  .reading, .source-box, .pencil-note, .page-footer { max-width: none; }
  .reading__section { break-inside: avoid; margin-bottom: 22px; }
  .myth-reveal__item::details-content { content-visibility: visible; }
  .myth-reveal__answer { display: block; }
  .myth-reveal__mark { display: none; }
  .source-box__links { display: block; }
  .pencil-note { background: white; border-color: #666; margin-block: 22px; }
  a { color: #222; }
}
