:root {
  --bg: #f7f1e3;
  --fg: #2b2118;
  --muted: #7a6a58;
  --accent: #6b2d5c;
  --line: #d9ccb4;
  --note-bg: #fffbe6;
  --note-line: #c9dcef;
  --size: 1;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="licht"]):not([data-theme="papier"]) {
    --bg: #15121a; --fg: #e9e2d6; --muted: #a39a8c; --accent: #c99ae0; --line: #3a3340;
    --note-bg: #232029; --note-line: #353547; color-scheme: dark;
  }
}
:root[data-theme="donker"] {
  --bg: #15121a; --fg: #e9e2d6; --muted: #a39a8c; --accent: #c99ae0; --line: #3a3340;
  --note-bg: #232029; --note-line: #353547; color-scheme: dark;
}
:root[data-theme="licht"] { --bg: #ffffff; --fg: #1d1d1d; --muted: #6b6b6b; --accent: #6b2d5c; --line: #e3e3e3; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: 'Literata', Georgia, serif;
  font-size: calc(1.15rem * var(--size));
  line-height: 1.7;
}
a { color: var(--accent); }

.bar {
  position: sticky; top: 0; z-index: 2;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .6rem 16px;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
  font-size: 1rem;
}
.home { font-family: 'IM Fell English SC', serif; text-decoration: none; color: var(--fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tools { display: flex; gap: .35rem; flex-shrink: 0; }
.tools button {
  font: inherit; font-size: .95rem; min-width: 2.4rem; padding: .3rem .5rem;
  background: transparent; color: var(--fg); border: 1px solid var(--line); border-radius: 8px; cursor: pointer;
}
.tools button:hover { border-color: var(--accent); }

main { max-width: 38rem; margin: 0 auto; padding: 2rem 16px 3rem; }

.kicker { font-family: 'IM Fell English SC', serif; color: var(--muted); letter-spacing: .05em; margin: 0; }
h1 { font-family: 'IM Fell English SC', serif; font-weight: 400; font-size: 2.2em; line-height: 1.15; margin: .2em 0 1.2em; }
article p { margin: 0 0 1em; }
hr.scene { border: 0; text-align: center; margin: 2em 0; }
hr.scene::after { content: '✦  ✦  ✦'; color: var(--muted); letter-spacing: .4em; }

.notebook {
  margin: 3em 0 1em; padding: 1.2em 1.4em 1em 2.2em;
  background-color: var(--note-bg);
  background-image: repeating-linear-gradient(to bottom, transparent 0, transparent 1.95em, var(--note-line) 1.95em, var(--note-line) 2em);
  border-left: 3px solid #e7a4a4;
  border-radius: 4px;
  box-shadow: 0 2px 10px rgb(0 0 0 / .08);
  transform: rotate(-.4deg);
  font-family: 'Patrick Hand', 'Comic Sans MS', cursive;
  font-size: 1.15em; line-height: 2em;
}
.notebook h2 { font-family: inherit; font-weight: 400; font-size: 1.2em; margin: 0 0 .2em; }
.notebook ul { margin: 0; padding-left: 1.1em; }
.notebook del { opacity: .7; }

.pager {
  max-width: 38rem; margin: 0 auto 3rem; padding: 1.2rem 16px 0;
  display: flex; justify-content: space-between; gap: 1rem;
  border-top: 1px solid var(--line); font-size: 1rem;
}
.pager a { text-decoration: none; }

.cover { text-align: center; }
.cover h1.book { font-size: 2.6em; margin-bottom: .3em; }
.cover .for { color: var(--muted); font-style: italic; margin: 0 0 2rem; }
.continue {
  display: inline-block; margin-bottom: 2rem; padding: .6rem 1.4rem;
  border-radius: 999px; background: var(--accent); color: var(--bg); text-decoration: none;
}
.toc { list-style: none; padding: 0; margin: 0 auto; max-width: 26rem; text-align: left; }
.toc a {
  display: flex; gap: 1rem; align-items: baseline; padding: .75rem .25rem;
  border-bottom: 1px solid var(--line); text-decoration: none; color: var(--fg);
}
.toc a:hover { color: var(--accent); }
.toc .nr { font-family: 'IM Fell English SC', serif; color: var(--muted); min-width: 1.5em; }

@media (max-width: 420px) {
  h1 { font-size: 1.8em; }
  .cover h1.book { font-size: 2em; }
}

/* --- boekenkast --- */
body { --book: #3b1f3f; --book-accent: #d9b44a; }
.shelf-link { text-decoration: none; color: var(--muted); font-size: 1.2rem; margin-right: .5rem; }
.bar > a.home { flex: 1; min-width: 0; }
.book .continue, .chapter .continue { background: var(--book); color: #fff; }

.shelf { text-align: center; }
.volumes {
  list-style: none; padding: 0 0 1.4rem; margin: 2.5rem auto 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1.4rem;
  border-bottom: 14px solid #7a5530;
  box-shadow: 0 10px 12px -8px rgb(0 0 0 / .35);
}
.volume {
  display: flex; flex-direction: column; justify-content: space-between; gap: .6rem;
  aspect-ratio: 2 / 3; padding: 1.1rem .9rem;
  background: linear-gradient(90deg, rgb(0 0 0 / .28) 0 7px, transparent 7px), var(--book);
  color: #fff; text-decoration: none; text-align: left;
  border-radius: 3px 8px 8px 3px;
  box-shadow: 0 6px 14px rgb(0 0 0 / .25);
  transition: transform .15s ease;
}
.volume:hover { transform: translateY(-4px) rotate(-1deg); }
.volume-title {
  font-family: 'IM Fell English SC', serif; font-size: 1.25rem; line-height: 1.2; color: #fff;
  border-top: 2px solid var(--book-accent); border-bottom: 2px solid var(--book-accent); padding: .5rem 0;
}
.volume-sub { font-size: .85rem; opacity: .85; font-style: italic; line-height: 1.35; }
.volume-count { font-size: .8rem; color: var(--book-accent); }
