:root {
  color-scheme: light;
  --paper: #f5f2eb;
  --surface: #fffdf8;
  --ink: #141414;
  --muted: #6c6a65;
  --line: #d8d3ca;
  --accent: #ff5c35;
  --shadow: 0 22px 60px rgba(30, 25, 16, 0.09);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #171715;
  --surface: #22221f;
  --ink: #f3f0e9;
  --muted: #aaa79f;
  --line: #3b3a35;
  --accent: #ff7757;
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.25);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Manrope", sans-serif;
  transition: background 180ms ease, color 180ms ease;
}

button, a { font: inherit; }

a { color: inherit; text-decoration: none; }

button { color: inherit; }

.site-header {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin: 0 auto;
  max-width: 1440px;
  padding: 28px 42px;
}

.brand {
  align-items: center;
  display: flex;
  font-size: 17px;
  font-weight: 800;
  gap: 11px;
  letter-spacing: -0.03em;
}

.brand-mark {
  background: var(--accent);
  border-radius: 50% 50% 12% 50%;
  display: inline-block;
  height: 17px;
  transform: rotate(-8deg);
  width: 17px;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-tagline {
  color: var(--muted);
  font-family: "DM Mono", monospace;
  font-size: 8px;
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: 1.2;
}

nav { align-items: center; display: flex; gap: 28px; }

nav a, .nav-button {
  background: none;
  border: 0;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}

nav a:hover, .nav-button:hover { color: var(--accent); }

.theme-button, .close-button {
  align-items: center;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  font-size: 19px;
  height: 40px;
  justify-content: center;
  width: 40px;
}

.theme-button:hover, .close-button:hover { border-color: var(--ink); }

.comic-reader {
  margin: 70px auto 0;
  max-width: 1080px;
  padding: 0 32px;
}

.comic-meta {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 16px;
}

.issue, .date, .eyebrow, .keyboard-hint, .reader-position {
  font-family: "DM Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  margin: 0;
  text-transform: uppercase;
}

.date, .keyboard-hint, .reader-position { color: var(--muted); }

h1 {
  font-size: clamp(38px, 6.5vw, 84px);
  letter-spacing: -0.065em;
  line-height: 0.98;
  margin: 0 0 42px;
  max-width: 900px;
}

.comic-frame {
  align-items: center;
  aspect-ratio: 1.4 / 1;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  display: flex;
  justify-content: center;
  margin: 0;
  overflow: hidden;
  position: relative;
  width: 100%;
}

.comic-frame img {
  display: block;
  height: 100%;
  object-fit: contain;
  width: 100%;
}

.comic-caption {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
  margin: 20px auto 0;
  max-width: 900px;
  text-align: center;
}

.comic-arrow {
  align-items: center;
  background: transparent;
  border: 0;
  bottom: 0;
  color: var(--paper);
  cursor: pointer;
  display: flex;
  justify-content: center;
  padding: 0;
  position: absolute;
  top: 0;
  width: 50%;
  z-index: 2;
}

.comic-arrow span {
  color: color-mix(in srgb, var(--paper) 58%, transparent);
  display: block;
  font-family: "DM Mono", monospace;
  font-size: clamp(130px, 16vw, 240px);
  line-height: 1;
  opacity: 0;
  text-shadow: 0 2px 18px color-mix(in srgb, var(--ink) 55%, transparent);
  transition: opacity 150ms ease, transform 150ms ease;
}

.comic-arrow-previous { left: 0; }
.comic-arrow-next { right: 0; }

.comic-arrow:hover:not(:disabled) span,
.comic-arrow:focus-visible span {
  opacity: 1;
}

.comic-arrow:hover:not(:disabled) span {
  opacity: 0.78;
  transform: scale(1.06);
}

.comic-arrow:disabled {
  pointer-events: none;
}

.comic-arrow:disabled span { opacity: 0; }

.reader-controls {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: auto auto 1fr auto auto;
  margin-top: 24px;
}

.reader-controls button {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  padding: 11px 16px;
}

.reader-controls button:hover:not(:disabled) { background: var(--ink); color: var(--paper); }
.reader-controls button:disabled { cursor: not-allowed; opacity: 0.35; }
.reader-position { text-align: center; }
.keyboard-hint { margin-top: 16px; text-align: center; text-transform: none; }

.author-note {
  background: color-mix(in srgb, var(--accent) 8%, var(--paper));
  border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line));
  border-radius: 18px;
  margin: 0 auto 52px;
  max-width: 900px;
  padding: clamp(24px, 4vw, 42px);
}

.author-note-label {
  color: var(--accent);
  font-family: "DM Mono", monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  margin: 0 0 10px;
  text-transform: uppercase;
}

.author-note h2 {
  font-size: clamp(26px, 4vw, 42px);
  letter-spacing: -0.04em;
  line-height: 1.05;
  margin: 0 0 18px;
}

.author-note-intro {
  font-size: clamp(16px, 2vw, 19px);
  line-height: 1.65;
  margin: 0 0 22px;
  max-width: 760px;
}

.author-note summary {
  cursor: pointer;
  font-family: "DM Mono", monospace;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.author-note-copy {
  font-size: 15px;
  line-height: 1.75;
  margin-top: 24px;
  max-width: 790px;
}

.author-note-copy p { margin: 0 0 18px; }
.author-note-copy a { color: var(--accent); }
.author-note-copy blockquote {
  border-left: 3px solid var(--accent);
  color: var(--muted);
  margin: 24px 0;
  padding: 2px 0 2px 22px;
}
.author-note-copy blockquote p { margin: 0; }

.author-note-graphic {
  margin: 14px auto 0;
  max-width: 360px;
}

.author-note-graphic img {
  border-radius: 10px;
  display: block;
  height: auto;
  width: 100%;
}

.mini-comic-intro {
  font-size: 15px;
  font-weight: 400;
  margin: 8px 0 0;
}

.author-note-before-graphic {
  margin: 30px auto 0;
  max-width: 760px;
}

.author-note-transition {
  font-size: 15px;
  margin: 28px 0 0;
}

.einstein-quote {
  border-left: 3px solid var(--accent);
  margin: 0 0 26px;
  padding: 4px 0 4px 22px;
}

.einstein-quote p {
  font-size: clamp(16px, 2vw, 19px);
  line-height: 1.65;
  margin: 0 0 12px;
}

.einstein-quote cite {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
}

.einstein-quote a { color: var(--accent); }

.einstein-quote strong {
  color: var(--ink);
  font-weight: 800;
}

.comic-transcript {
  border-top: 1px solid var(--line);
  margin: 28px auto 0;
  max-width: 900px;
  padding-top: 18px;
}

.comic-transcript summary {
  color: var(--muted);
  cursor: pointer;
  font-family: "DM Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
}

.comic-transcript-copy {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
  margin: 18px auto 0;
  max-width: 760px;
}

.comic-transcript-copy p { margin: 0 0 10px; }

.about {
  border-top: 1px solid var(--line);
  margin: 150px auto 0;
  max-width: 1200px;
  padding: 28px 32px 140px;
}

.eyebrow { color: var(--accent); font-weight: 500; }

.about-grid {
  display: grid;
  gap: 80px;
  grid-template-columns: 1.5fr 1fr;
  margin-top: 60px;
}

.about h2 { font-size: clamp(34px, 5vw, 64px); letter-spacing: -0.055em; line-height: 1.02; margin: 0; }
.about-grid > div { font-size: 18px; line-height: 1.7; }
.about-grid > div p { margin-top: 0; }
.fine-print { color: var(--muted); font-size: 14px; }

footer {
  border-top: 1px solid var(--line);
  display: flex;
  font-family: "DM Mono", monospace;
  font-size: 11px;
  justify-content: space-between;
  margin: 0 32px;
  padding: 28px 10px 42px;
  text-transform: uppercase;
}

.archive-panel {
  background: color-mix(in srgb, var(--paper) 96%, transparent);
  inset: 0;
  opacity: 0;
  overflow-y: auto;
  pointer-events: none;
  position: fixed;
  transform: translateY(-12px);
  transition: 180ms ease;
  z-index: 10;
}

.archive-panel.open { opacity: 1; pointer-events: auto; transform: none; }
.archive-inner { margin: 0 auto; max-width: 900px; padding: 48px 32px; }
.archive-heading { align-items: start; display: flex; justify-content: space-between; }
.archive-heading h2 { font-size: 64px; letter-spacing: -0.06em; margin: 6px 0 44px; }
.archive-list { list-style: none; margin: 0; padding: 0; }
.archive-list li { border-top: 1px solid var(--line); }
.archive-list a { align-items: center; background: none; border: 0; cursor: pointer; display: grid; gap: 18px; grid-template-columns: 50px 1fr auto; padding: 22px 0; text-align: left; width: 100%; }
.archive-list a:hover { color: var(--accent); }
.archive-empty { color: var(--muted); padding: 60px 0; }

@media (max-width: 700px) {
  .site-header { padding: 22px 20px; }
  nav { gap: 16px; }
  nav a { display: none; }
  .comic-reader { margin-top: 50px; padding: 0 18px; }
  h1 { margin-bottom: 28px; }
  .reader-controls { grid-template-columns: 1fr 1fr; }
  .reader-controls button { width: 100%; }
  .reader-position { grid-column: 1 / -1; grid-row: 1; margin-bottom: 5px; }
  .comic-arrow:not(:disabled) span { opacity: 0.58; }
  .comic-caption { font-size: 14px; margin-top: 16px; }
  .comic-transcript { margin-top: 22px; }
  .about { margin-top: 100px; padding: 24px 20px 90px; }
  .about-grid { gap: 34px; grid-template-columns: 1fr; margin-top: 38px; }
  footer { margin: 0 20px; padding-left: 0; padding-right: 0; }
  .keyboard-hint { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
