:root {
  --bg: #faf0e6; /* linen */
  --text: #000;
  --muted: #888;
}

/* Night mode: grey background, text stays black */
:root[data-theme="dark"] {
  --bg: #777777;
  --text: #000;
  --muted: #2e2e2e;
}

* { box-sizing: border-box; }

html { background: var(--bg); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Times New Roman", Times, serif;
  font-size: 12pt;
  line-height: 1.35;
}

.page {
  max-width: 576px;
  margin: 0 auto;
  padding: 84px 16px 64px;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

a { color: var(--text); text-decoration-skip-ink: none; }
nav a { text-decoration: none; }
nav a:hover, nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 3px; }
main a { text-underline-offset: 3px; }

p { margin: 0 0 12px; }

h1 { font-size: 12pt; font-weight: bold; margin: 0 0 12px; }

ul.list { list-style: none; padding: 0; margin: 0; }
ul.list li { margin-bottom: 12px; }
.muted { opacity: 0.6; }

button.theme {
  -webkit-touch-callout: none;
  user-select: none;
  touch-action: manipulation;
  background: none;
  border: 0;
  padding: 4px;
  margin: -4px;
  cursor: pointer;
  color: var(--text);
  display: flex;
}

.social {
  display: flex;
  gap: 14px;
  margin-top: 36px;
}

.social a { display: flex; }

svg { width: 16px; height: 16px; }

/* Posters sit to the right of the text but take no vertical space,
   so the next paragraph keeps its normal spacing */
.with-media {
  position: relative;
  padding-right: 172px;
  margin-bottom: 12px;
}

.with-media p { margin: 0 0 6px; }

ul.sub { margin: 0; padding-left: 1.5em; list-style: none; color: var(--muted); }


/* Each pair of covers overlaps like a small fanned pile */
.media {
  position: absolute;
  top: -4px;
  right: 0;
  width: 152px;
  height: 130px;
}

.media img {
  position: absolute;
  width: 84px;
  height: 122px;
  object-fit: cover;
  display: block;
  transition: transform 0.2s ease;
}

.media img:first-child { left: 0; top: 0; transform: rotate(-5deg); z-index: 1; }
.media img:last-child { right: 0; top: 8px; transform: rotate(4deg); z-index: 2; }
.media img:hover { transform: rotate(0) scale(1.06); z-index: 3; }

/* Too narrow for text and posters side by side: show posters below */
@media (max-width: 480px) {
  .with-media { padding-right: 0; }
  .media { position: relative; margin-top: 16px; }
}


/* Inline link with no underline and a light bold (Times has no semibold, so thicken the stroke slightly) */
a.soft {
  text-decoration: none;
  -webkit-text-stroke: 0.35px currentColor;
}
a.soft:hover { text-decoration: underline; }

ul.sets { list-style: none; padding: 0; margin: 0; }
ul.sets li { margin-bottom: 4px; }

/* Theme icon: sun behind clouds in light mode, sun in night mode */
.icon-sun { display: none; }
:root[data-theme="dark"] .icon-cloud { display: none; }
:root[data-theme="dark"] .icon-sun { display: block; }

ul.books { list-style: none; padding: 0; margin: 0 0 24px; }
ul.books li { margin-bottom: 4px; }
ul.books li.sub-book { padding-left: 1.5em; }
.author { color: var(--muted); margin-left: 6px; }

.tools { margin-bottom: 20px; }
button.link {
  background: none;
  border: 0;
  padding: 0;
  margin-right: 12px;
  font: inherit;
  color: var(--text);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-skip-ink: none;
}
