/* Open Scroll, printed around 1908. The period feel comes from the typography. */

@font-face { font-family: 'Libre Caslon Text'; src: url(fonts/libre-caslon-text-400.woff2) format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Libre Caslon Text'; src: url(fonts/libre-caslon-text-400-italic.woff2) format('woff2'); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: 'Libre Caslon Text'; src: url(fonts/libre-caslon-text-700.woff2) format('woff2'); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'Libre Caslon Display'; src: url(fonts/libre-caslon-display-400.woff2) format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }

:root {
  color-scheme: light;
  --desk: #2a221c;
  --paper: #f4ecd8;
  --ink: #1f1a14;
  --ink-2: #3d3220;
  --ink-3: #5b4a33;
  --red: #8f2419;
  --red-dark: #5e160f;
  --rule: #b9a682;
  --leader: #8a7650;
  --cloth: #5a1f1b;
  --gilt: #d4af5a;
  --gilt-light: #e6c97e;
  --desk-text: #cdbd9c;
  --desk-text-light: #e9dcc0;
  --desk-border: #a08c66;
  --text: 'Libre Caslon Text', Georgia, 'Times New Roman', serif;
  --display: 'Libre Caslon Display', Georgia, 'Times New Roman', serif;
  /* The libre fonts carry no fleurons, so name the faces that draw them well. */
  --fleuron: 'Zapf Dingbats', 'Apple Symbols', 'Segoe UI Symbol', 'DejaVu Sans', serif;
  --page-height: clamp(560px, calc(100vh - 190px), 820px);
}
@supports (height: 100svh) {
  :root { --page-height: clamp(560px, calc(100svh - 190px), 820px); }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: auto; }
body {
  margin: 0;
  background: var(--desk);
  color: var(--ink);
  font-family: var(--text);
  font-variant-numeric: oldstyle-nums;
  font-synthesis-small-caps: auto;
}
a { color: var(--red); }
a:hover { color: var(--red-dark); }
h1, h2, h3, p, ol, ul { margin: 0; }
button { font: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.desk :focus-visible, .cover :focus-visible { outline-color: var(--gilt-light); }
[tabindex='-1']:focus { outline: 0; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}

/* ─── The desk ─── */
.desk {
  min-height: 100vh;
  display: flex; flex-direction: column; align-items: center; gap: 22px;
  padding: 40px 16px 28px;
}
.book { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 22px; }
.page { scroll-margin-top: 40px; } /* A deep link lands with the desk's margin above the page. */

/* Without script every page stands stacked as one scroll; with it, one at a time. */
.js .page { display: none; }
.js .page.current { display: flex; }
@media (prefers-reduced-motion: no-preference) {
  .js .page.current { animation: page-in 180ms ease-out; }
  @keyframes page-in { from { opacity: 0; } to { opacity: 1; } }
}

/* ─── The cover ─── */
.cover {
  position: relative;
  display: flex;
  width: 100%; max-width: 640px;
  min-height: var(--page-height);
  padding: clamp(16px, 5vw, 36px);
  background-color: var(--cloth);
  background-image:
    repeating-linear-gradient(0deg, rgba(0,0,0,.07) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgba(255,255,255,.04) 0 1px, transparent 1px 3px);
  border-radius: 3px 8px 8px 3px;
  box-shadow: inset 10px 0 14px rgba(0,0,0,.35), 0 18px 40px rgba(0,0,0,.5);
}
.cover-outer { flex: 1; display: flex; padding: 10px; border: 3px double var(--gilt); }
.cover-inner {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: 32px;
  padding: clamp(32px, 8vw, 56px) clamp(10px, 4vw, 24px) clamp(28px, 6vw, 44px);
  border: 1px solid var(--gilt);
  color: var(--gilt);
  text-align: center;
}
.cover-fleuron { font-family: var(--fleuron); font-size: 30px; line-height: 1; }
.cover-title { display: flex; flex-direction: column; align-items: center; gap: 22px; }
.cover h1 {
  font-family: var(--display); font-weight: 400;
  font-size: clamp(44px, 10vw, 68px); line-height: 1; letter-spacing: .09em;
  margin-right: -.09em; /* Letterspacing trails the last letter; pull it back to centre. */
  text-transform: uppercase;
}
.cover-rule { width: 120px; height: 3px; border-top: 1px solid var(--gilt); border-bottom: 1px solid var(--gilt); }
.cover-tagline { max-width: 320px; font-size: 19px; font-style: italic; line-height: 1.5; color: var(--gilt-light); }
.cover-open {
  display: inline-flex; align-items: center;
  min-height: 44px; padding: 0 22px;
  border: 1px solid var(--gilt); color: var(--gilt-light);
  font-size: 15px; letter-spacing: 3px; text-decoration: none; text-transform: uppercase;
}
.cover-open:hover { color: var(--paper); border-color: var(--gilt-light); }

/* ─── The paper ─── */
.sheet {
  position: relative;
  display: flex; flex-direction: column;
  width: 100%; max-width: 680px;
  min-height: var(--page-height);
  padding: clamp(28px, 7vw, 60px) clamp(24px, 7vw, 64px) clamp(32px, 7vw, 60px) clamp(24px, 7vw, 56px);
  overflow: hidden;
  background: var(--paper);
  box-shadow: inset 14px 0 18px -10px rgba(80,55,20,.28), 0 18px 40px rgba(0,0,0,.45);
}
.sheet > * { position: relative; }
/* Grain: a tiled SVG noise, one small tile rather than a filter the size of the page. */
.sheet::before {
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .09;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='256' height='256'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .35 0 0 0 0 .25 0 0 0 0 .1 0 0 0 1 0'/%3E%3C/filter%3E%3Crect width='256' height='256' filter='url(%23g)'/%3E%3C/svg%3E");
}
/* The ribbon bookmark. */
.sheet::after {
  content: ''; position: absolute; top: 0; right: clamp(14px, 8vw, 52px);
  width: clamp(13px, 3vw, 18px); height: clamp(68px, 20vw, 132px);
  background: var(--red);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 86%, 0 100%);
}
.running-head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  margin-bottom: 44px; padding: 0 clamp(24px, 6vw, 40px) 8px 0;
  border-bottom: 1px solid var(--rule);
  color: var(--ink-3); font-size: 12px; letter-spacing: clamp(1.5px, .6vw, 3px); text-transform: uppercase;
}
.page-body { flex: 1; display: flex; flex-direction: column; }
.folio { margin-top: 40px; text-align: center; font-size: 15px; color: var(--ink-2); }
.fleuron { font-family: var(--fleuron); color: var(--red); line-height: 1; }

/* ─── Title page ─── */
.title-page { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: 40px; text-align: center; }
.title-main { display: flex; flex-direction: column; align-items: center; gap: 22px; padding-top: 40px; }
.title-page h2 {
  font-family: var(--display); font-weight: 400;
  font-size: clamp(40px, 9vw, 60px); line-height: 1.05; letter-spacing: .08em; text-transform: uppercase;
}
.title-rule { width: 64px; border-top: 1px solid var(--ink); }
.title-byline { font-size: 15px; letter-spacing: 3px; line-height: 1.8; text-transform: uppercase; }
.title-author { color: var(--red); font-size: 22px; letter-spacing: 4px; }
.title-calm { max-width: 340px; font-size: 18px; font-style: italic; line-height: 1.5; }
.title-store {
  display: inline-flex; align-items: center;
  margin-top: 12px; min-height: 44px; padding: 0 clamp(6px, 3vw, 22px);
  border-top: 1px solid var(--red); border-bottom: 1px solid var(--red);
  font-size: clamp(12px, 3.4vw, 14px); letter-spacing: clamp(1px, .4vw, 3px); text-decoration: none; text-transform: uppercase; text-align: center;
}
.imprint { color: var(--ink-2); font-size: 13px; letter-spacing: 3px; line-height: 1.9; text-transform: uppercase; }
.imprint::before { content: ''; display: block; width: 40px; margin: 0 auto 14px; border-top: 1px solid var(--ink-2); }

/* ─── Notices ─── */
.notices {
  flex: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: 16px;
  max-width: 400px; margin: 0 auto;
  color: var(--ink-2); font-size: 14px; line-height: 1.65; text-align: center;
}
.notices a { display: inline-flex; align-items: center; min-height: 44px; }
.notices .fleuron { font-size: 18px; }
.notices-set { font-size: 13px; font-style: italic; }

/* ─── Contents ─── */
.contents { display: flex; flex-direction: column; gap: 30px; }
.contents h2 { font-family: var(--display); font-weight: 400; font-size: 32px; letter-spacing: 6px; text-align: center; text-transform: uppercase; }
.contents .fleuron { font-size: 20px; text-align: center; }
.toc { display: flex; flex-direction: column; gap: 6px; padding: 0; list-style: none; }
.toc a {
  display: flex; align-items: baseline; gap: 10px;
  min-height: 48px; padding: 8px 0;
  color: var(--ink); font-size: 18px; text-decoration: none;
}
.toc a:hover { color: var(--red-dark); }
.toc-num { min-width: 42px; color: var(--red); font-size: 13px; letter-spacing: 2px; }
.toc-leader { flex: 1; min-width: 16px; border-bottom: 2px dotted var(--leader); transform: translateY(-5px); }

/* ─── Chapters ─── */
.chapter-head { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-bottom: 34px; text-align: center; }
.chapter-num { color: var(--red); font-size: 13px; letter-spacing: 4px; text-transform: uppercase; }
.chapter-head h2 { font-family: var(--display); font-weight: 400; font-size: 40px; line-height: 1.15; }
.chapter-orn { font-size: 16px; letter-spacing: 8px; }
.chapter-end { margin-top: 36px; font-size: 18px; text-align: center; }

.prose { font-size: clamp(18px, 2.4vw, 19px); line-height: 1.7; }
.prose p, .prose li { text-wrap: pretty; }
.prose p {
  text-align: justify;
  -webkit-hyphens: auto; hyphens: auto;
  margin-bottom: 18px;
}
.prose p:last-child { margin-bottom: 0; }
.prose p + p { text-indent: 1.5em; }

.dropcap::first-letter { font-family: var(--display); font-weight: 400; font-style: normal; font-variant: normal; color: var(--red); letter-spacing: 0; }
@supports (initial-letter: 2) or (-webkit-initial-letter: 2) {
  .dropcap::first-letter { -webkit-initial-letter: 2; initial-letter: 2; margin-right: .1em; }
}
@supports not ((initial-letter: 2) or (-webkit-initial-letter: 2)) {
  .dropcap::first-letter { float: left; font-size: 3.9em; line-height: .8; padding: .08em .13em 0 0; }
}
.opening { font-variant: small-caps; letter-spacing: 1px; }
.path { font-style: normal; font-variant: small-caps; letter-spacing: 1px; color: var(--red); -webkit-hyphens: manual; hyphens: manual; }

/* ─── Below the book ─── */
.pager { display: none; width: 100%; max-width: 680px; align-items: center; justify-content: space-between; gap: 6px; }
.js .pager { display: flex; }
.pager button {
  flex: none; min-height: 44px; min-width: clamp(96px, 26vw, 110px); padding: 0 10px;
  background: transparent; border: 1px solid var(--desk-border);
  color: var(--desk-text-light); font-size: 15px; letter-spacing: 1px;
}
.pager button:hover:not(:disabled) { border-color: var(--desk-text-light); }
.pager button:disabled { opacity: .4; cursor: default; }
.pager-label {
  display: inline-flex; align-items: center;
  min-height: 44px; padding: 0 4px; text-align: center;
  color: var(--desk-text-light); font-size: clamp(12px, 3.4vw, 14px); letter-spacing: clamp(1px, .5vw, 3px); text-decoration: none;
}
.pager-label:hover { color: #fff; }
.colophon { max-width: 640px; color: var(--desk-text); font-size: 13px; line-height: 1.6; text-align: center; }
.colophon a, .desk-link { display: inline-flex; align-items: center; min-height: 44px; color: var(--desk-text-light); }
.colophon a:hover, .desk-link:hover { color: #fff; }

/* ─── Appendix: Privacy Policy ─── */
.desk-appendix { padding-top: 28px; padding-bottom: 32px; }
.appendix-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; width: 100%; max-width: 680px; }
.appendix-bar .desk-link { padding: 0 16px; border: 1px solid var(--desk-border); font-size: 15px; letter-spacing: 1px; text-decoration: none; }
.appendix-bar .desk-label { color: var(--desk-text); font-size: 13px; letter-spacing: 3px; }
.desk-link-foot { padding: 0 16px; font-size: 14px; letter-spacing: 2px; }

.sheet-long {
  max-width: 680px; min-height: 0;
  padding: clamp(28px, 7vw, 60px) clamp(22px, 8vw, 72px) clamp(44px, 9vw, 88px);
}
.sheet-long .running-head { margin-bottom: 48px; }
.appendix-head { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-bottom: 36px; text-align: center; }
.appendix-head .chapter-num { font-size: 13px; }
.appendix-head h1 { font-family: var(--display); font-weight: 400; font-size: clamp(36px, 8vw, 46px); line-height: 1.1; }
.effective { color: var(--ink-2); font-size: 16px; font-style: italic; }

.in-brief { margin-bottom: 40px; padding: 20px 8px; border-top: 3px double var(--red); border-bottom: 3px double var(--red); text-align: center; }
.in-brief h2, .seclist-title { font-weight: 400; font-size: 12px; letter-spacing: 4px; text-transform: uppercase; }
.in-brief h2 { margin-bottom: 10px; color: var(--red); }
.in-brief p { font-size: 19px; font-style: italic; line-height: 1.6; text-wrap: pretty; }

.seclist-nav { margin-bottom: 44px; }
.seclist-title { margin-bottom: 12px; color: var(--ink-3); text-align: center; }
.seclist { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); column-gap: 28px; padding: 0; list-style: none; font-size: 15px; line-height: 1.4; }
.seclist a { display: flex; align-items: baseline; gap: 8px; min-height: 44px; padding: 11px 0; color: var(--ink); text-decoration: none; }
.seclist a:hover { color: var(--red-dark); }
.seclist span { flex: none; min-width: 34px; color: var(--red); }

.policy { display: flex; flex-direction: column; gap: 34px; font-size: 18px; line-height: 1.7; }
.policy section { scroll-margin-top: 16px; }
.policy h2 { margin-bottom: 10px; font-weight: 400; font-size: 18px; line-height: 1.4; letter-spacing: 2px; font-variant: small-caps; }
.policy h2 span { color: var(--red); }
.policy h3 { margin: 20px 0 6px; font-weight: 400; font-style: italic; font-size: 18px; line-height: 1.4; }
.policy h2 + h3 { margin-top: 0; }
.policy h3 + p { text-indent: 0; }
.policy p { margin-bottom: 12px; }
.policy ul { margin: 0 0 12px; padding-left: 1.6em; list-style-type: '— '; }
.policy li { margin-bottom: 6px; }
.policy .pull {
  margin: 22px 0; padding: 16px 0;
  border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
  font-size: 20px; font-style: italic; line-height: 1.5; text-align: center; text-indent: 0;
  -webkit-hyphens: manual; hyphens: manual;
}
.policy .pull + p { text-indent: 0; }
.appendix-end { display: flex; flex-direction: column; align-items: center; gap: 16px; margin-top: 48px; text-align: center; }
.appendix-end .fleuron { font-size: 20px; }
.appendix-end .disclaimer { max-width: 420px; color: var(--ink-2); font-size: 14px; line-height: 1.65; }
.appendix-end .folio { margin-top: 12px; }

@media print {
  body, .sheet, .cover { background: #fff; box-shadow: none; }
  .pager, .appendix-bar, .desk-link-foot { display: none !important; }
  .sheet::before { display: none; }
}
