/* ── Fonts ──────────────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Bangers&family=Newsreader:ital,opsz,wght@0,6..72,300..800;1,6..72,300..800&family=Syne:wght@400;600;700;800&family=IBM+Plex+Mono:wght@400;600&display=swap');

/* ── Design tokens ──────────────────────────────────────────────────────── */
:root {
  --ink:     #0D0D0D;
  --paper:   #F4EFE4;
  --white:   #FFFDF8;
  --red:     #C0392B;
  --red-dk:  #96281B;
  --border:  3px solid #0D0D0D;
  --shadow:  5px 5px 0 #0D0D0D;
  --shadow-red: 5px 5px 0 var(--red);
}

/* ── Reset ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background-color: var(--paper);
  color: var(--ink);
  font-family: 'Newsreader', serif;
  font-size: 1.1rem;
  line-height: 1.7;
  /* subtle dot-grid paper texture */
  background-image: radial-gradient(circle, rgba(0,0,0,0.06) 1px, transparent 1px);
  background-size: 20px 20px;
}

/* ── Navigation ─────────────────────────────────────────────────────────── */
.site-nav {
  background: var(--ink);
  border-bottom: 4px solid var(--red);
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  padding: 0 2rem;
  position: sticky;
  top: 0;
  z-index: 200;
  gap: 1rem;
}

.nav-logo {
  font-family: 'Bangers', cursive;
  font-size: 1.8rem;
  letter-spacing: 3px;
  color: #fff;
  text-decoration: none;
  display: flex;
  align-items: center;
  padding: 0.6rem 0;
  white-space: nowrap;
}
.nav-logo .accent { color: var(--red); }

.nav-links {
  display: flex;
  list-style: none;
  align-items: stretch;
  gap: 0;
  flex: 1;
  justify-content: flex-end;
}

.nav-links li { display: flex; align-items: stretch; }

.nav-links a {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  display: flex;
  align-items: center;
  padding: 0 1.1rem;
  border-left: 1px solid rgba(255,255,255,0.08);
  transition: color 0.15s, background 0.15s;
}
.nav-links a:hover { color: #fff; background: rgba(255,255,255,0.06); }
.nav-links a.active { color: var(--red); }

.nav-subscribe-btn {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  background: var(--red);
  color: #fff !important;
  border: none;
  border-left: 1px solid rgba(255,255,255,0.08) !important;
  cursor: pointer;
  padding: 0 1.4rem !important;
  transition: background 0.15s !important;
}
.nav-subscribe-btn:hover { background: var(--red-dk) !important; }

/* ── Subscribe modal ────────────────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(13,13,13,0.75);
  z-index: 500;
  align-items: center;
  justify-content: center;
}
.modal-overlay.open { display: flex; }

.modal-box {
  background: var(--paper);
  border: 4px solid var(--ink);
  box-shadow: var(--shadow);
  padding: 2.5rem;
  max-width: 440px;
  width: 90%;
  position: relative;
}
.modal-box h2 {
  font-family: 'Bangers', cursive;
  font-size: 2.2rem;
  letter-spacing: 3px;
  margin-bottom: 0.4rem;
}
.modal-box h2 .accent { color: var(--red); }
.modal-box p {
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
  opacity: 0.75;
}
.modal-close {
  position: absolute;
  top: 0.75rem; right: 1rem;
  font-family: 'Bangers', cursive;
  font-size: 1.5rem;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ink);
  line-height: 1;
}
.modal-form { display: flex; gap: 0; }
.modal-form input[type="email"] {
  flex: 1;
  padding: 0.7rem 1rem;
  font-family: 'Syne', sans-serif;
  font-size: 0.9rem;
  border: 3px solid var(--ink);
  border-right: none;
  background: var(--white);
  outline: none;
}
.modal-form button[type="submit"] {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  padding: 0.7rem 1.2rem;
  background: var(--ink);
  color: #fff;
  border: 3px solid var(--ink);
  cursor: pointer;
  transition: background 0.15s;
}
.modal-form button[type="submit"]:hover { background: var(--red); border-color: var(--red); }

/* ── Flash messages ─────────────────────────────────────────────────────── */
.flash-wrap { max-width: 1100px; margin: 1rem auto; padding: 0 2rem; }
.flash {
  font-family: 'Syne', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.9rem 1.25rem;
  border: 3px solid var(--ink);
  margin-bottom: 0.5rem;
}
.flash.success { background: #d4edda; border-color: #27ae60; color: #155724; }
.flash.error   { background: #fde8e6; border-color: var(--red); color: #7b1e1e; }

/* ── Main container ─────────────────────────────────────────────────────── */
main { max-width: 1100px; margin: 0 auto; padding: 2.5rem 2rem; }

/* ── Hero ───────────────────────────────────────────────────────────────── */
.hero {
  background: var(--ink);
  color: #fff;
  border: 4px solid var(--ink);
  box-shadow: var(--shadow-red);
  padding: 4rem 3rem;
  margin-bottom: 3rem;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,0.07) 1px, transparent 1px);
  background-size: 14px 14px;
  pointer-events: none;
}
.hero-eyebrow {
  font-family: 'Syne', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--red);
  margin-bottom: 1rem;
}
.hero h1 {
  font-family: 'Bangers', cursive;
  font-size: clamp(3rem, 9vw, 6.5rem);
  letter-spacing: 4px;
  line-height: 0.95;
  margin-bottom: 1.25rem;
}
.hero h1 .accent { color: var(--red); }
.hero p {
  font-size: 1.15rem;
  max-width: 560px;
  opacity: 0.85;
  margin-bottom: 2rem;
}
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }

/* ── Buttons ────────────────────────────────────────────────────────────── */
.btn {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  padding: 0.75rem 1.75rem;
  border: 3px solid;
  text-decoration: none;
  display: inline-block;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.1s;
}
.btn:hover { transform: translate(-2px,-2px); }
.btn-primary { background: var(--red); color: #fff; border-color: var(--red); box-shadow: 3px 3px 0 #fff; }
.btn-primary:hover { box-shadow: 5px 5px 0 #fff; }
.btn-outline { background: transparent; color: #fff; border-color: #fff; box-shadow: 3px 3px 0 var(--red); }
.btn-outline:hover { box-shadow: 5px 5px 0 var(--red); }
.btn-dark { background: var(--ink); color: #fff; border-color: var(--ink); box-shadow: 3px 3px 0 var(--red); }
.btn-dark:hover { box-shadow: 5px 5px 0 var(--red); }

/* ── Section headings ───────────────────────────────────────────────────── */
.section-heading {
  font-family: 'Bangers', cursive;
  font-size: 2.2rem;
  letter-spacing: 3px;
  border-bottom: 4px solid var(--ink);
  padding-bottom: 0.4rem;
  margin-bottom: 1.75rem;
}
.section-heading .accent { color: var(--red); }

/* ── Chapter grid / cards ───────────────────────────────────────────────── */
.chapter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.chapter-card {
  border: 3px solid var(--ink);
  box-shadow: var(--shadow);
  background: var(--white);
  text-decoration: none;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  transition: transform 0.12s, box-shadow 0.12s;
}
.chapter-card:hover { transform: translate(-3px,-3px); box-shadow: 8px 8px 0 var(--ink); }

.chapter-card-header {
  background: var(--ink);
  color: #fff;
  padding: 0.6rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.chapter-label {
  font-family: 'Bangers', cursive;
  font-size: 1rem;
  letter-spacing: 2px;
  color: var(--red);
}
.chapter-year {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  opacity: 0.6;
}
.chapter-card-body { padding: 1.25rem; flex: 1; }
.chapter-card-title {
  font-family: 'Bangers', cursive;
  font-size: 1.5rem;
  letter-spacing: 1px;
  margin-bottom: 0.5rem;
  line-height: 1.1;
}
.chapter-card-desc { font-size: 0.9rem; opacity: 0.7; line-height: 1.5; }
.chapter-card-footer { padding: 0.75rem 1.25rem; border-top: 2px solid var(--ink); }

.status-badge {
  display: inline-block;
  font-family: 'Syne', sans-serif;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  padding: 0.2rem 0.6rem;
  border: 2px solid;
}
.status-published  { border-color: #27ae60; color: #27ae60; }
.status-illustrated{ border-color: #2980b9; color: #2980b9; }
.status-scripted   { border-color: var(--red); color: var(--red); }
.status-draft      { border-color: #888; color: #888; }
.status-planned    { border-color: #888; color: #888; background: #f0ece4; }

/* ── Blog cards ─────────────────────────────────────────────────────────── */
.blog-list { display: flex; flex-direction: column; gap: 1.5rem; margin-bottom: 2.5rem; }

.blog-card {
  border: 3px solid var(--ink);
  box-shadow: var(--shadow);
  background: var(--white);
  padding: 1.5rem;
  text-decoration: none;
  color: var(--ink);
  display: block;
  transition: transform 0.12s, box-shadow 0.12s;
}
.blog-card:hover { transform: translate(-3px,-3px); box-shadow: 8px 8px 0 var(--ink); }
.blog-card-meta {
  font-family: 'Syne', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--red);
  margin-bottom: 0.4rem;
}
.blog-card-title {
  font-family: 'Bangers', cursive;
  font-size: 1.8rem;
  letter-spacing: 1px;
  line-height: 1.1;
  margin-bottom: 0.5rem;
}
.blog-card-excerpt { font-size: 0.92rem; opacity: 0.72; }

/* ── Workshop cards ─────────────────────────────────────────────────────── */
.workshop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}
.workshop-card {
  border: 3px solid var(--ink);
  box-shadow: var(--shadow);
  background: var(--white);
  text-decoration: none;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  transition: transform 0.12s, box-shadow 0.12s;
}
.workshop-card:hover { transform: translate(-3px,-3px); box-shadow: 8px 8px 0 var(--ink); }
.workshop-card-banner {
  background: var(--red);
  color: #fff;
  padding: 0.6rem 1rem;
  font-family: 'Syne', sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
}
.workshop-card-body { padding: 1.25rem; flex: 1; }
.workshop-card-title {
  font-family: 'Bangers', cursive;
  font-size: 1.5rem;
  letter-spacing: 1px;
  margin-bottom: 0.5rem;
}
.workshop-card-desc { font-size: 0.9rem; opacity: 0.7; }
.difficulty-badge {
  display: inline-block;
  font-family: 'Syne', sans-serif;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  padding: 0.2rem 0.6rem;
  border: 2px solid var(--ink);
  margin-top: 0.75rem;
}

/* ── Content page (chapter / blog / workshop) ───────────────────────────── */
.content-header {
  background: var(--ink);
  color: #fff;
  border: 3px solid var(--ink);
  box-shadow: var(--shadow);
  padding: 2.5rem 2rem;
  margin-bottom: 1.75rem;
  position: relative;
  overflow: hidden;
}
.content-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,0.06) 1px, transparent 1px);
  background-size: 14px 14px;
  pointer-events: none;
}
.content-header .eyebrow {
  font-family: 'Syne', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--red);
  margin-bottom: 0.5rem;
}
.content-header h1 {
  font-family: 'Bangers', cursive;
  font-size: clamp(2rem, 6vw, 3.5rem);
  letter-spacing: 3px;
  line-height: 1.05;
  margin-bottom: 0.75rem;
}
.content-header .meta {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.8rem;
  opacity: 0.55;
}

/* ── Rendered markdown body ─────────────────────────────────────────────── */
.content-body {
  border: 3px solid var(--ink);
  box-shadow: var(--shadow);
  background: var(--white);
  padding: 2rem 2.25rem;
  margin-bottom: 2rem;
}
.content-body h2 {
  font-family: 'Bangers', cursive;
  font-size: 2rem;
  letter-spacing: 2px;
  border-bottom: 3px solid var(--ink);
  padding-bottom: 0.2rem;
  margin: 2.5rem 0 1rem;
}
.content-body h3 {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--red);
  margin: 2rem 0 0.5rem;
}
.content-body p  { margin-bottom: 1rem; }
.content-body ul,
.content-body ol { margin: 0.5rem 0 1rem 1.75rem; }
.content-body li { margin-bottom: 0.3rem; }
.content-body strong { font-weight: 700; }
.content-body em    { font-style: italic; }

.content-body code {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.83rem;
  background: #ede8db;
  padding: 0.1rem 0.4rem;
  border: 1px solid #c8c0b0;
}
.content-body pre {
  background: var(--ink);
  color: #a8ff78;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.85rem;
  padding: 1.5rem;
  border: 3px solid var(--ink);
  overflow-x: auto;
  margin: 1.5rem 0;
}
.content-body pre code { background: none; border: none; padding: 0; color: inherit; }

.content-body img.comic-panel {
  max-width: 100%;
  border: 3px solid var(--ink);
  display: block;
  margin: 2rem auto;
  box-shadow: var(--shadow);
}
.content-body blockquote {
  border-left: 5px solid var(--red);
  padding: 0.75rem 1.5rem;
  background: #ede8db;
  margin: 1.5rem 0;
  font-style: italic;
}
.content-body hr {
  border: none;
  border-top: 3px solid var(--ink);
  margin: 2.5rem 0;
}
.content-body table { border-collapse: collapse; width: 100%; margin: 1.5rem 0; }
.content-body th {
  background: var(--ink); color: #fff;
  font-family: 'Syne', sans-serif;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 0.6rem 0.9rem;
  border: 2px solid var(--ink);
  text-align: left;
}
.content-body td { padding: 0.6rem 0.9rem; border: 2px solid var(--ink); }
.content-body tr:nth-child(even) td { background: #f0ece4; }

/* ── Workshop steps ─────────────────────────────────────────────────────── */
.content-body ol.steps { list-style: none; margin-left: 0; }
.content-body ol.steps li {
  border: 3px solid var(--ink);
  box-shadow: var(--shadow);
  background: var(--white);
  margin-bottom: 1.5rem;
  counter-increment: step;
  padding: 0;
  overflow: hidden;
}
.content-body ol.steps li::before {
  content: 'STEP ' counter(step);
  display: block;
  background: var(--ink);
  color: var(--red);
  font-family: 'Bangers', cursive;
  font-size: 1rem;
  letter-spacing: 2px;
  padding: 0.5rem 1rem;
}

/* ── Chapter nav (prev/next) ────────────────────────────────────────────── */
.chapter-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2rem;
}
.chapter-nav a {
  font-family: 'Syne', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  text-decoration: none;
  color: var(--ink);
  border: 3px solid var(--ink);
  padding: 0.6rem 1.25rem;
  box-shadow: var(--shadow);
  transition: transform 0.1s, box-shadow 0.1s;
}
.chapter-nav a:hover { transform: translate(-2px,-2px); box-shadow: 7px 7px 0 var(--ink); }

/* ── Subscribe strip ────────────────────────────────────────────────────── */
.subscribe-strip {
  background: var(--red);
  color: #fff;
  border: 4px solid var(--ink);
  box-shadow: var(--shadow);
  padding: 2.5rem 2rem;
  text-align: center;
  margin: 3rem 0;
}
.subscribe-strip h2 {
  font-family: 'Bangers', cursive;
  font-size: 2.4rem;
  letter-spacing: 3px;
  margin-bottom: 0.4rem;
}
.subscribe-strip p { opacity: 0.88; margin-bottom: 1.5rem; }
.subscribe-strip .strip-form { display: flex; max-width: 460px; margin: 0 auto; gap: 0; }
.subscribe-strip .strip-form input[type="email"] {
  flex: 1;
  padding: 0.75rem 1rem;
  font-family: 'Syne', sans-serif;
  font-size: 0.9rem;
  border: 3px solid #fff;
  border-right: none;
  background: #fff;
  color: var(--ink);
  outline: none;
}
.subscribe-strip .strip-form button {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  padding: 0.75rem 1.5rem;
  background: var(--ink);
  color: #fff;
  border: 3px solid #fff;
  cursor: pointer;
  transition: background 0.15s;
}
.subscribe-strip .strip-form button:hover { background: #333; }

/* ── Empty state ────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 4rem 1rem;
  font-family: 'Syne', sans-serif;
  color: #888;
}
.empty-state .big {
  font-family: 'Bangers', cursive;
  font-size: 3rem;
  letter-spacing: 3px;
  display: block;
  margin-bottom: 1rem;
  color: #ccc;
}

/* ── Footer ─────────────────────────────────────────────────────────────── */
.site-footer {
  background: var(--ink);
  color: rgba(255,255,255,0.6);
  border-top: 4px solid var(--red);
  text-align: center;
  padding: 2rem;
  margin-top: 4rem;
  font-family: 'Syne', sans-serif;
  font-size: 0.78rem;
  letter-spacing: 1px;
}
.site-footer a { color: var(--red); text-decoration: none; }
.site-footer .footer-logo {
  font-family: 'Bangers', cursive;
  font-size: 1.6rem;
  letter-spacing: 3px;
  color: #fff;
  display: block;
  margin-bottom: 0.5rem;
}
.site-footer .footer-logo .accent { color: var(--red); }

/* ── Part label (archive) ───────────────────────────────────────────────── */
.part-label {
  font-family: 'Syne', sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--red);
  border-bottom: 2px solid var(--red);
  padding-bottom: 0.3rem;
  margin: 2.5rem 0 1rem;
}

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 720px) {
  .site-nav { padding: 0 1rem; flex-wrap: wrap; }
  .nav-links a { padding: 0 0.7rem; font-size: 0.72rem; }
  main { padding: 1.5rem 1rem; }
  .hero { padding: 2.5rem 1.5rem; }
  .hero h1 { font-size: 3rem; }
  .chapter-grid { grid-template-columns: 1fr; }
  .workshop-grid { grid-template-columns: 1fr; }
  .subscribe-strip .strip-form { flex-direction: column; }
  .subscribe-strip .strip-form input[type="email"] { border-right: 3px solid #fff; border-bottom: none; }
  .chapter-nav { flex-direction: column; }
}
