:root {
  color-scheme: light;
  --background: #f2f2ee;
  --paper: #ffffff;
  --foreground: #111111;
  --muted: #555555;
  --line: #050505;
  --panel: #ffffff;
  --accent: #111111;
  --accent-soft: #efefef;
  --paper-shadow: rgba(23, 23, 23, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 12px 12px, rgba(0, 0, 0, 0.04) 1.2px, transparent 1.3px) 0 0 / 24px 24px,
    var(--background);
  color: var(--foreground);
  font-family:
    "Trebuchet MS", "Comic Sans MS", ui-sans-serif, system-ui, -apple-system,
    BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
}

button {
  font: inherit;
}

.site-header {
  width: min(100%, 1040px);
  margin: 0 auto;
  padding: 24px 24px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--foreground);
  font-size: 1.1rem;
  font-weight: 700;
  text-decoration: none;
}

.brand-mark {
  width: 24px;
  height: 24px;
  display: inline-block;
  background:
    linear-gradient(90deg, transparent 46%, var(--line) 46% 55%, transparent 55%),
    linear-gradient(transparent 46%, var(--line) 46% 55%, transparent 55%);
  border: 2px solid var(--line);
  box-shadow: 2px 2px 0 var(--line);
}

.brand-mark::before,
.brand-mark::after {
  content: none;
}

.top-nav {
  display: flex;
  gap: 8px;
  color: var(--muted);
  font-size: 0.95rem;
}

.top-nav a {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  padding: 6px 11px;
  border: 2px solid transparent;
  border-radius: 4px;
  text-decoration: none;
}

.top-nav a:hover,
.top-nav a[aria-current="page"] {
  background: var(--paper);
  border-color: var(--line);
  color: var(--foreground);
  box-shadow: 2px 2px 0 var(--line);
}

.page {
  width: min(100%, 1040px);
  margin: 0 auto;
  padding: 18px 24px 64px;
}

.comic {
  text-align: center;
}

.view[hidden] {
  display: none;
}

.comic-header {
  margin: 18px auto 22px;
}

.comic-number {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

h1 {
  margin: 0;
  font-size: clamp(2.2rem, 6vw, 4.7rem);
  line-height: 0.98;
  letter-spacing: 0;
}

#comic-date {
  display: block;
  margin-top: 10px;
  color: var(--muted);
}

.comic-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  width: min(100%, 900px);
  margin: 28px auto 22px;
  padding: 16px;
  background: var(--paper);
  border: 3px solid var(--line);
  box-shadow:
    10px 10px 0 var(--line),
    0 16px 36px var(--paper-shadow);
}

.comic-strip-image {
  display: block;
  width: min(100%, 760px);
}

.comic-strip-empty {
  display: grid;
  min-height: 360px;
  place-items: center;
}

.comic-image-frame {
  margin: 0;
  position: relative;
}

.comic-page-image {
  width: 100%;
  display: block;
  background: #ffffff;
}

.empty-state {
  display: grid;
  gap: 8px;
  color: var(--muted);
  line-height: 1.5;
  text-align: center;
}

.empty-state strong {
  color: var(--foreground);
  font-size: 1.1rem;
}

.archive-empty {
  margin: 0;
  max-width: 520px;
  text-align: left;
}

.panel {
  min-height: 315px;
  position: relative;
  overflow: hidden;
  background: var(--panel);
  border: 3px solid var(--line);
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 4px 4px, rgba(0, 0, 0, 0.055) 1px, transparent 1.2px) 0 0 / 10px 10px,
    linear-gradient(115deg, rgba(255, 255, 255, 0.75), transparent 42%);
  mix-blend-mode: multiply;
}

.panel svg {
  width: 100%;
  height: 100%;
  min-height: 315px;
  display: block;
  position: relative;
}

.panel text {
  font-family:
    "Trebuchet MS", "Comic Sans MS", ui-sans-serif, system-ui, sans-serif;
  font-size: 11.5px;
  font-weight: 700;
  fill: var(--foreground);
}

.panel .caption {
  font-size: 12px;
}

.sketch-line {
  fill: none;
  stroke: var(--line);
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.thin-line {
  stroke-width: 1.8;
}

.fill-paper {
  fill: #ffffff;
  stroke: var(--line);
  stroke-width: 2.6;
}

.skin-fill {
  fill: #ffffff;
  stroke: var(--line);
  stroke-width: 2.3;
}

.hair-fill {
  fill: #151515;
  stroke: var(--line);
  stroke-width: 1.8;
}

.shirt-fill {
  fill: url("#tone-light");
  stroke: var(--line);
  stroke-width: 2.2;
}

.pants-fill {
  fill: #161616;
  stroke: var(--line);
  stroke-width: 2.1;
}

.shadow-fill {
  fill: url("#tone-shadow");
  stroke: var(--line);
  stroke-width: 1.6;
}

.tone-fill {
  fill: url("#tone-light");
}

.dark-fill {
  fill: #111111;
}

.white-fill {
  fill: #ffffff;
}

.comic-caption {
  max-width: 680px;
  min-height: 52px;
  margin: 22px auto 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.55;
}

.comic-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 24px;
}

.nav-button,
.archive-button {
  min-height: 40px;
  padding: 8px 14px;
  background: var(--paper);
  color: var(--foreground);
  border: 2px solid var(--line);
  border-radius: 3px;
  box-shadow: 3px 3px 0 var(--line);
  cursor: pointer;
}

.nav-button:hover,
.archive-button:hover,
.nav-button:focus-visible,
.archive-button:focus-visible {
  background: var(--accent-soft);
}

.nav-button:active,
.archive-button:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--line);
}

.nav-button:disabled {
  color: #949494;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.archive,
.about {
  margin-top: 24px;
}

h2 {
  margin: 0 0 16px;
  font-size: 1.35rem;
}

.archive-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.archive-button {
  width: 100%;
  text-align: left;
}

.archive-button strong,
.archive-button span {
  display: block;
}

.archive-button span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.85rem;
}

.about p {
  max-width: 620px;
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

@media (max-width: 820px) {
}

@media (max-width: 560px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .page {
    padding-inline: 14px;
  }

  .comic-strip {
    grid-template-columns: 1fr;
    box-shadow: 5px 5px 0 var(--line);
  }

  .panel,
  .panel svg {
    min-height: 285px;
  }

  .comic-controls {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .nav-button {
    width: 100%;
  }
}
