:root,
html[data-theme="night"] {
  color-scheme: dark;
  --ink: #f6f1e8;
  --paper: #100e18;
  --sheet: #1a1726;
  --muted: #cdc5b6;
  --line: rgba(246, 241, 232, 0.16);
  --lilac: #d7c9ff;
  --sakura: #f0b7cc;
  --serif: "Fraunces", "Iowan Old Style", Palatino, Georgia, serif;
  --sans: "Outfit", "Avenir Next", "Segoe UI", sans-serif;
  --size: 1.2rem;
}
html[data-theme="paper"] {
  color-scheme: light;
  --ink: #1a1330;
  --paper: #f6f1e8;
  --sheet: #fffdf8;
  --muted: #3d3454;
  --line: rgba(26, 19, 48, 0.14);
  --lilac: #4a2f86;
}
@font-face {
  font-family: "OpenDyslexic";
  src: url("../assets/fonts/OpenDyslexic-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "OpenDyslexic";
  src: url("../assets/fonts/OpenDyslexic-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
html[data-dyslexia="yes"] {
  --serif: "OpenDyslexic", "Outfit", "Avenir Next", sans-serif;
}
html[data-dyslexia="yes"] .reader {
  font-family: "OpenDyslexic", "Outfit", "Avenir Next", sans-serif;
  font-weight: 400;
  line-height: 1.85;
  letter-spacing: 0.01em;
  word-spacing: 0.08em;
}
html[data-dyslexia="yes"] .reader h1 {
  letter-spacing: 0;
  line-height: 1.3;
  font-weight: 700;
}
html[data-dyslexia="yes"] .reader p { margin-bottom: 1.35rem; }
html[data-dyslexia="yes"] .reader em {
  font-style: normal;
  font-weight: 700;
}
html[data-size="s"] { --size: 1.05rem; }
html[data-size="m"] { --size: 1.2rem; }
html[data-size="l"] { --size: 1.35rem; }
html[data-size="xl"] { --size: 1.5rem; }
* { box-sizing: border-box; }
html { background: var(--paper); }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  font-weight: 500;
  font-size: 1.05rem;
  line-height: 1.6;
}
a { color: inherit; }
img { max-width: 100%; display: block; }
.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  background: var(--sheet);
  color: var(--ink);
  padding: 0.7rem 1rem;
  border-radius: 999px;
  text-decoration: none;
}
.skip:focus { top: 0.75rem; }
.bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  width: min(74rem, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1rem 0;
}
.brand { letter-spacing: 0.18em; text-decoration: none; font-size: 0.86rem; }
.bar nav { display: flex; flex-wrap: wrap; gap: 0.9rem; }
.bar nav a { text-decoration: none; color: var(--muted); }
.bar nav a:hover { color: var(--ink); }
.reader-bar {
  position: sticky;
  top: 0;
  z-index: 25;
  width: 100%;
  margin: 0;
  padding: 0.75rem max(1rem, calc((100% - 46rem) / 2));
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  transition: transform 0.45s ease, opacity 0.45s ease;
}
body.is-immersed .reader-bar {
  transform: translateY(-110%);
  opacity: 0;
  pointer-events: none;
}
.reader-bar .brand {
  font-family: var(--serif);
  letter-spacing: 0;
  font-size: 1.15rem;
  font-weight: 620;
}
.library-link {
  text-decoration: none;
  color: var(--muted);
  font-size: 0.95rem;
}
.library-link:hover { color: var(--ink); }
.reader-bar p { margin: 0; color: var(--muted); font-size: 0.95rem; }
.tools { display: flex; gap: 0.4rem; }
.tools button[aria-pressed="true"] {
  background: var(--lilac);
  border-color: transparent;
  color: #1a1330;
}
html[data-theme="paper"] .tools button[aria-pressed="true"] { color: #f6f1e8; }
.tools button,
.btn,
.gate button {
  font: inherit;
  font-weight: 600;
  min-height: 44px;
  padding: 0.55rem 0.9rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--sheet);
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-primary, .gate button {
  background: var(--sakura);
  border-color: transparent;
  color: #1a1330;
}
.btn[hidden], [hidden] { display: none !important; }
.page { width: min(74rem, calc(100% - 2rem)); margin: 0 auto 4rem; }
.page h1, .reader h1, .gate h1 {
  font-family: var(--serif);
  font-weight: 620;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin: 0 0 0.7rem;
}
.page h1 { font-size: clamp(2.4rem, 5vw, 4rem); }
.page h2, .jump summary {
  font-family: var(--serif);
  font-size: 1.7rem;
  margin: 2rem 0 0.7rem;
}
.lede { font-size: 1.15rem; max-width: 40rem; }
.book-layout {
  display: grid;
  grid-template-columns: minmax(18rem, 28rem) minmax(16rem, 1fr);
  gap: clamp(1.4rem, 3vw, 2.6rem);
  align-items: center;
}
.cover {
  width: 100%;
  height: auto;
  max-width: none;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: center 42%;
  border-radius: 1.15rem;
  background: #241833;
}
.mark {
  display: inline-block;
  margin: 0 0 0.7rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: var(--sakura);
  color: #1a1330;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  font-weight: 600;
}
.meta, .status { color: var(--muted); margin: 0 0 0.8rem; }
.dek { font-size: 1.2rem; margin: 0 0 1.2rem; }
.actions { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.toc, .shelf, .jump ol { list-style: none; margin: 0; padding: 0; }
.toc a, .jump a, .shelf a {
  display: flex;
  gap: 0.8rem;
  align-items: baseline;
  text-decoration: none;
  padding: 0.7rem 0;
  border-top: 1px solid var(--line);
}
.toc a[aria-current="page"], .jump a[aria-current="page"] { font-weight: 650; }
.toc .n, .jump .n { color: var(--muted); min-width: 1.5rem; }
.about p, .person p { margin: 0 0 0.9rem; }
.person {
  margin-top: 0.4rem;
  padding: 1rem 1.1rem;
  background: var(--sheet);
  border: 1px solid var(--line);
  border-radius: 16px;
}
.person h3 { margin: 0 0 0.3rem; font-family: var(--serif); font-size: 1.6rem; }
.person blockquote { margin: 0.8rem 0 0; font-family: var(--serif); font-style: italic; }
.shelf { display: grid; gap: 0; }
.shelf a { align-items: center; gap: 1rem; }
.shelf img {
  width: 72px;
  height: 96px;
  object-fit: cover;
  border-radius: 8px;
  background: #241833;
  flex: none;
}
.shelf strong { display: block; font-family: var(--serif); font-size: 1.35rem; font-weight: 620; }
.shelf em, .shelf .premise { display: block; color: var(--muted); font-style: normal; }
.shelf .premise {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.reader {
  width: min(40rem, calc(100% - 2rem));
  margin: 0 auto;
  font-size: var(--size);
  line-height: 1.75;
}
.reader h1 { font-size: clamp(2rem, 4vw, 2.8rem); }
.reader .kicker { color: var(--muted); margin: 0 0 0.4rem; font-size: 0.95rem; }
.reader p { margin: 0 0 1rem; }
body:has(.reader) { padding-bottom: 3rem; }
.jump {
  width: min(40rem, calc(100% - 2rem));
  margin: 1.5rem auto 2rem;
}
.pager {
  position: static;
  z-index: 1;
  width: min(40rem, calc(100% - 2rem));
  margin: 3.2rem auto 0.5rem;
  display: flex;
  gap: 1.4rem;
  align-items: end;
  padding: 1.4rem 0 0;
  background: transparent;
  border-top: 1px solid var(--line);
}
.pager a {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 0.2rem;
  flex: 1 1 0;
  min-height: 0;
  min-width: 0;
  padding: 0.15rem 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  text-decoration: none;
  line-height: 1.2;
}
.pager a:hover { color: var(--ink); }
.pager a:last-child { align-items: flex-end; text-align: right; }
.pager a:nth-child(2) {
  align-items: center;
  text-align: center;
  background: transparent;
  color: var(--muted);
}
.pager .nav-kicker {
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
}
.pager .nav-name {
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 620;
  color: var(--ink);
}
.pager span:empty { display: none; }
.pager:not(:has(a + a)) a { align-items: center; text-align: center; }
.gate {
  width: min(36rem, calc(100% - 2rem));
  margin: 2rem auto 4rem;
  padding: 1.4rem 1.2rem;
  background: var(--sheet);
  border: 1px solid var(--line);
  border-radius: 18px;
}
.gate p { margin: 0 0 1rem; }
.gate .actions { margin-top: 0.4rem; }
#adult-boeken { display: none; }
html.adult-ok #adult-boeken { display: grid; }
html.adult-ok #adult-boeken-poort { display: none; }
body[data-adult="true"]:not(.is-open) .book,
body[data-adult="true"]:not(.is-open) .reader,
body[data-adult="true"]:not(.is-open) .pager,
body[data-adult="true"]:not(.is-open) .jump { display: none; }
body.is-open .gate-page { display: none; }
@media (max-width: 720px) {
  .book-layout { grid-template-columns: 1fr; }
  .cover { width: 100%; }
  .reader-bar { align-items: flex-start; flex-wrap: wrap; }
  .pager .nav-name { font-size: 0.98rem; }
}
