:root {
  color-scheme: light;
  --paper: #fbf6ea;
  --card: #fffdf7;
  --ink: #2b2723;
  --muted: #7a7166;
  --line: #e4dccb;
  --frame: #2b2723;
  --link: #3d5aa8;
  --badge: #ffe7a3;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --paper: #1c1b20;
    --card: #25242b;
    --ink: #ece6dc;
    --muted: #a59d90;
    --line: #38363f;
    --frame: #8f8678;
    --link: #a9bdff;
    --badge: #5a4a1f;
  }
}

* { box-sizing: border-box; }
html { background: var(--paper); }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font: 17px/1.55 ui-rounded, "SF Pro Rounded", "Nunito", system-ui, sans-serif;
}
a { color: var(--link); }

/* Cover */
.cover { display: flex; justify-content: center; padding: 2rem 1rem 1rem; }
.cover-art {
  width: min(420px, 86vw);
  height: auto;
  border: 3px solid var(--frame);
  border-radius: 18px;
  box-shadow: 0 6px 0 var(--frame);
  transform: rotate(-1.2deg);
}
.intro { max-width: 620px; margin: 0.6rem auto 0; padding: 0 1rem; text-align: center; font-size: 1.1rem; }
.intro p { margin: 0.5rem 0; }
.issues-wrap { max-width: 1120px; margin: 0 auto; padding: 1.5rem 1rem 2rem; }
.issues {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.4rem;
}
.issue a {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 0.7rem 0.7rem 1rem;
  background: var(--card);
  border: 2px solid var(--frame);
  border-radius: 14px;
  box-shadow: 0 4px 0 var(--frame);
  color: inherit;
  text-decoration: none;
  transition: transform 120ms ease, box-shadow 120ms ease;
}
.issue a:hover { transform: translateY(-3px) rotate(-0.4deg); box-shadow: 0 7px 0 var(--frame); }
.issue img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.issue-number {
  align-self: flex-start;
  margin-top: 0.7rem;
  padding: 0 0.55rem;
  border-radius: 6px;
  background: var(--badge);
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
}
.issue-title { margin-top: 0.35rem; font-weight: 800; font-size: 1.1rem; line-height: 1.3; }
.issue-caption { margin-top: 0.3rem; color: var(--muted); font-size: 0.92rem; }

/* Comic page */
.bar { max-width: 1120px; margin: 0 auto; padding: 0.9rem 1rem 0; }
.brand { display: inline-flex; align-items: center; gap: 0.5rem; color: inherit; text-decoration: none; font-weight: 800; font-size: 1.2rem; }
.brand img { border-radius: 9px; }

.comic { max-width: 1120px; margin: 0 auto; padding: 0.5rem 1rem 2rem; }
.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin: 1rem 0 0;
  color: var(--muted);
  font-weight: 800;
  letter-spacing: 0.05em;
}
.comic h1 { margin: 0.1rem 0 1rem; font-size: 1.9rem; line-height: 1.2; }
figure { margin: 0; }
figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 2px solid var(--frame);
  border-radius: 14px;
  cursor: zoom-in;
}
figcaption { margin: 0.8rem 0 0; font-size: 1.05rem; font-style: italic; }
.prompt { margin: 0.4rem 0 0; color: var(--muted); font-size: 0.9rem; }

.copy {
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  padding: 0.05rem 0.6rem;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.copy:hover { border-color: var(--frame); color: var(--ink); }

.pager {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1rem;
  align-items: center;
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 2px solid var(--line);
}
.pager a { text-decoration: none; font-weight: 700; }
.pager a:hover { text-decoration: underline; }
.pager-next { text-align: right; }
.pager-home { color: var(--muted); }

.site-footer { padding: 1.5rem 1rem 2.5rem; text-align: center; color: var(--muted); font-size: 0.85rem; }
.site-footer a { color: inherit; }

@media (max-width: 640px) {
  .comic h1 { font-size: 1.4rem; }
  .pager { grid-template-columns: 1fr 1fr; }
  .pager-home { display: none; }
}
