:root {
  --paper: #f7f8f2;
  --paper-deep: #e5ecd9;
  --ink: #16130f;
  --muted: #5d655d;
  --grep: #1f7a3d;
  --grok: #1f63b7;
  --highlight: #ffe45f;
  --accent: #d64538;
  --panel: #ffffff;
  --panel-blue: #edf5ff;
  --line: #211b13;
  --shadow: 8px 8px 0 rgba(33, 27, 19, 0.18);
  font-family:
    ui-rounded, "Avenir Next", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(rgba(33, 27, 19, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(33, 27, 19, 0.035) 1px, transparent 1px),
    var(--paper);
  background-size: 32px 32px;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px clamp(18px, 4vw, 56px);
  border-bottom: 3px solid var(--line);
  background: rgba(247, 248, 242, 0.94);
  backdrop-filter: blur(10px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 250px;
  text-decoration: none;
}

.brand-mark {
  display: flex;
  gap: 6px;
  align-items: end;
}

.grep-head,
.grok-head,
.avatar {
  display: grid;
  place-items: center;
  border: 3px solid var(--line);
  background: var(--panel);
  box-shadow: 3px 3px 0 var(--line);
}

.grep-head {
  width: 34px;
  height: 28px;
  border-radius: 6px;
  color: #9bf06c;
  background: #111;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 14px;
}

.grok-head {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 30% 30%, var(--grok) 0 3px, transparent 4px),
    radial-gradient(circle at 70% 35%, var(--grok) 0 3px, transparent 4px),
    radial-gradient(circle at 50% 68%, var(--grok) 0 3px, transparent 4px),
    linear-gradient(135deg, #fff, #dcecff);
}

.brand-kicker,
.eyebrow {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand-name {
  display: block;
  font-weight: 950;
  line-height: 1;
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

nav a {
  padding: 8px 10px;
  border-bottom: 3px solid transparent;
  font-weight: 800;
  text-decoration: none;
}

nav a:hover,
nav a:focus-visible {
  border-color: var(--grep);
}

main {
  overflow: hidden;
}

.hero {
  display: grid;
  grid-template-columns: minmax(360px, 0.82fr) minmax(520px, 1.18fr);
  gap: clamp(28px, 4vw, 64px);
  align-items: center;
  min-height: calc(100vh - 96px);
  padding: clamp(28px, 4.4vw, 62px) clamp(18px, 5vw, 72px) 24px;
}

.hero-copy h1 {
  margin: 0 0 18px;
  max-width: 720px;
  font-size: clamp(3rem, 6.4vw, 6.1rem);
  line-height: 0.94;
  letter-spacing: 0;
}

.hero-copy h1 span {
  display: block;
}

.hero-copy h1 span:first-child {
  color: var(--grep);
}

.hero-copy h1 span:last-child {
  color: var(--grok);
}

.lede {
  max-width: 660px;
  margin: 0;
  font-size: clamp(1.18rem, 1.7vw, 1.75rem);
  font-weight: 850;
  line-height: 1.25;
  text-wrap: balance;
}

.lede::first-line {
  background: linear-gradient(transparent 45%, var(--highlight) 45% 82%, transparent 82%);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 28px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 12px 18px;
  border: 3px solid var(--line);
  border-radius: 6px;
  box-shadow: 4px 4px 0 var(--line);
  font-weight: 900;
  text-decoration: none;
}

.button.primary {
  color: #fff;
  background: linear-gradient(135deg, var(--grep), #155c8e);
}

.button.secondary {
  background: var(--panel);
}

.strip-wall {
  display: grid;
  grid-template-columns: minmax(0, 1.24fr) minmax(150px, 0.76fr);
  gap: 16px;
  align-items: stretch;
}

.featured-strip,
.episode,
.character,
.semantic-note {
  border: 3px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.featured-strip {
  position: relative;
  padding: clamp(14px, 2vw, 22px);
  background: var(--panel);
}

.strip-label {
  display: inline-block;
  margin: 0 0 12px;
  padding: 5px 10px;
  background: var(--highlight);
  font-weight: 950;
  text-transform: uppercase;
}

.featured-strip img,
.episode img {
  width: 100%;
  border: 3px solid var(--line);
  border-radius: 4px;
  background: #fff;
}

.strip-caption {
  margin: 14px 0 0;
  font-size: 1.05rem;
  font-weight: 850;
}

.strip-thumbs {
  display: grid;
  grid-template-rows: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.strip-thumb {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 3px solid var(--line);
  border-radius: 8px;
  background: var(--panel-blue);
  box-shadow: 4px 4px 0 rgba(33, 27, 19, 0.16);
  color: inherit;
  font-weight: 950;
  line-height: 1.1;
  text-decoration: none;
}

.strip-thumb.is-featured {
  background: #f3ffd9;
}

.strip-thumb img {
  width: 76px;
  aspect-ratio: 1;
  object-fit: cover;
  border: 2px solid var(--line);
  border-radius: 4px;
  background: #fff;
}

.characters,
.episodes,
.semantic-note {
  margin: 0 auto;
  padding: clamp(34px, 5vw, 70px) clamp(18px, 5vw, 72px);
}

.characters {
  display: grid;
  grid-template-columns: minmax(240px, 0.7fr) minmax(0, 1.3fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: start;
  border-top: 3px dashed rgba(33, 27, 19, 0.45);
  border-bottom: 3px dashed rgba(33, 27, 19, 0.45);
  background: rgba(237, 245, 255, 0.68);
}

h2 {
  margin: 8px 0 0;
  font-size: clamp(2rem, 4vw, 4.4rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.character-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.character {
  padding: 22px;
}

.characters.page-section {
  display: block;
  width: 100%;
  max-width: none;
}

.characters.page-section .character-pair {
  width: min(100%, 1180px);
  margin: 0 auto;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
}

.characters.page-section .character {
  min-height: 100%;
}

.avatar {
  width: 76px;
  height: 76px;
  margin-bottom: 16px;
}

.grep-avatar {
  border-radius: 10px;
  color: #a6ff76;
  background: #111;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 1.4rem;
  font-weight: 900;
}

.grok-avatar {
  border-radius: 999px;
  background:
    radial-gradient(circle at 28% 34%, var(--grok) 0 5px, transparent 6px),
    radial-gradient(circle at 70% 30%, var(--grok) 0 5px, transparent 6px),
    radial-gradient(circle at 46% 72%, var(--grok) 0 5px, transparent 6px),
    linear-gradient(135deg, #fff, #dcecff);
}

.character h3,
.episode h3 {
  margin: 0 0 10px;
  font-size: 1.45rem;
  line-height: 1.08;
}

.character p,
.episode p,
.semantic-note p {
  margin: 0;
  color: #332b21;
  font-size: 1rem;
  line-height: 1.55;
}

.character .origin-note {
  margin-top: 18px;
  color: var(--muted);
  font-weight: 850;
}

.section-heading {
  max-width: 900px;
  margin-bottom: 28px;
}

.episode-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(230px, 1fr));
  gap: 18px;
}

.episode {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.episode img {
  border-width: 0 0 3px;
  border-radius: 0;
  aspect-ratio: 1;
  object-fit: cover;
}

.episode-body {
  display: grid;
  gap: 14px;
  padding: 16px;
}

dl {
  display: grid;
  gap: 8px;
  margin: 0;
}

dl div {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 10px;
}

dt {
  font-weight: 950;
}

dd {
  margin: 0;
  color: #40372c;
}

.semantic-note,
.process-teaser,
.page-hero,
.detail-page,
.prose-page {
  max-width: 1080px;
  margin-top: 24px;
  margin-bottom: 24px;
}

.semantic-note,
.process-teaser {
  background: #fffce6;
}

.process-teaser,
.detail-page {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(0, 1.2fr);
  gap: 24px;
}

.page-hero,
.prose-page {
  margin-right: auto;
  margin-left: auto;
  padding: clamp(34px, 6vw, 78px) clamp(18px, 5vw, 72px);
}

.page-hero h1,
.prose-page h1,
.detail-copy h1 {
  margin: 8px 0 18px;
  font-size: clamp(3rem, 7vw, 6rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.page-hero p,
.prose-page p,
.detail-copy p {
  max-width: 780px;
  font-size: 1.08rem;
  line-height: 1.6;
}

.detail-page {
  align-items: start;
  margin-right: auto;
  margin-left: auto;
  padding: clamp(24px, 4vw, 42px);
}

.episode-detail {
  grid-template-columns: 1fr;
  max-width: 1120px;
  gap: 26px;
}

.episode-detail .detail-image img {
  width: 100%;
}

.detail-copy h2,
.prose-page h2 {
  margin-top: 32px;
  font-size: clamp(1.7rem, 3vw, 2.8rem);
}

.detail-image {
  margin: 0;
}

.detail-image img {
  border: 3px solid var(--line);
  border-radius: 6px;
  background: #fff;
  box-shadow: var(--shadow);
}

.detail-image figcaption,
.origin-note {
  margin-top: 12px;
  color: var(--muted);
  font-weight: 800;
}

.detail-list {
  gap: 12px;
  margin-top: 24px;
  padding: 18px;
  border: 3px solid var(--line);
  border-radius: 8px;
  background: #fffce6;
}

.detail-list div {
  grid-template-columns: 86px 1fr;
}

.character-detail {
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr);
}

.character-portrait {
  display: grid;
  gap: 16px;
  justify-items: start;
  padding: 22px;
  border: 3px solid var(--line);
  border-radius: 8px;
  background: #edf5ff;
}

.character-portrait .avatar {
  width: 112px;
  height: 112px;
}

.episode-image-link,
.episode h3 a,
.character h3 a {
  text-decoration: none;
}

code {
  padding: 2px 5px;
  border: 1px solid rgba(33, 27, 19, 0.2);
  border-radius: 4px;
  background: #fff;
  font-size: 0.95em;
}

pre {
  max-width: 900px;
  overflow-x: auto;
  padding: 18px;
  border: 3px solid var(--line);
  border-radius: 8px;
  background: #111;
  box-shadow: 4px 4px 0 rgba(33, 27, 19, 0.18);
}

pre code {
  display: block;
  padding: 0;
  border: 0;
  background: transparent;
  color: #e8ffe0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.92rem;
  line-height: 1.55;
  white-space: pre;
}

footer {
  padding: 28px clamp(18px, 5vw, 72px) 40px;
  color: var(--muted);
  text-align: center;
}

footer p {
  margin: 0;
}

.site-credit {
  margin-top: 8px;
  color: var(--ink);
  font-weight: 850;
}

@media (max-width: 1050px) {
  .hero,
  .characters,
  .process-teaser,
  .detail-page,
  .character-detail {
    grid-template-columns: 1fr;
  }

  .episode-grid {
    grid-template-columns: repeat(2, minmax(240px, 1fr));
  }

  .hero {
    min-height: 0;
  }

  .strip-wall {
    grid-template-columns: 1fr;
  }

  .strip-thumbs {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-template-rows: none;
  }

  .strip-thumb {
    grid-template-columns: 1fr;
    align-content: start;
  }

  .strip-thumb img {
    width: 100%;
  }
}

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

  nav {
    justify-content: flex-start;
  }

  .hero {
    padding-top: 26px;
  }

  .hero-copy h1 {
    font-size: clamp(2.35rem, 13.5vw, 4.3rem);
  }

  .character-pair,
  .episode-grid {
    grid-template-columns: 1fr;
  }

  .characters.page-section .character-pair {
    grid-template-columns: 1fr;
  }

  .episode-meta {
    flex-direction: column;
  }

  .strip-thumbs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
