:root {
  --paper: #f4f0e8;
  --ink: #1e1e1a;
  --muted: #77736a;
  --line: #d8d1c5;
  --soft: #ebe5da;
  --link: #2f50b5;
  --max: 820px;
  --font-editorial: "Newsreader", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html {
  background: var(--paper);
  color: var(--ink);
  font-size: 18px;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-editorial);
  transition: background-color 180ms ease, color 180ms ease;
}

button,
input,
textarea,
select {
  font: inherit;
}

button { cursor: pointer; }

::selection {
  background: var(--ink);
  color: var(--paper);
}

a {
  color: var(--link);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.16em;
}

a:hover { text-decoration-thickness: 2px; }

.page-shell {
  width: min(calc(100% - 40px), var(--max));
  margin: 0 auto;
}

.thoughts-header {
  display: flex;
  justify-content: flex-end;
  align-items: baseline;
  gap: 20px;
  padding: 38px 0 38px;
  border-bottom: 1px solid var(--line);
}

.wordmark {
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-decoration: none;
  text-transform: uppercase;
}

.header-tools {
  display: flex;
  align-items: baseline;
  gap: 18px;
}

.theme-switch {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  color: var(--muted);
  font-size: 0.78rem;
}

.theme-switch button,
.lock-button {
  appearance: none;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 0.14em;
}

.theme-switch button:hover,
.theme-switch button[aria-pressed="true"],
.lock-button:hover {
  color: var(--ink);
  text-decoration-color: currentColor;
}

main {
  padding: 70px 0 28px;
}

.eyebrow,
.story-path,
.story-date,
.series-meta,
.character-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.access-gate {
  max-width: 560px;
  padding: 18px 0 80px;
}

.access-gate .gate-form {
  margin-top: 0;
}

.access-gate h1,
.library-intro h1,
.story-header h1 {
  margin: 12px 0 0;
  color: var(--ink);
  font-size: clamp(2.6rem, 8vw, 5.3rem);
  font-weight: 400;
  letter-spacing: -0.04em;
  line-height: 0.94;
}

.gate-copy,
.library-intro > p:last-child {
  max-width: 42rem;
  margin: 28px 0 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.6;
}

.gate-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-top: 30px;
}

.gate-form input {
  min-width: 0;
  padding: 12px 13px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  outline: none;
}

.gate-form input:focus {
  border-color: var(--ink);
}

.gate-form button {
  padding: 12px 18px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
}

.gate-status {
  min-height: 1.3em;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.library-intro {
  max-width: 650px;
  padding-bottom: 62px;
}

.library-section {
  padding: 38px 0 0;
  border-top: 1px solid var(--line);
}

.library-section + .library-section {
  margin-top: 70px;
}

.section-heading {
  margin-bottom: 26px;
}

.section-heading h2 {
  margin: 0;
  font-size: 1.7rem;
  font-weight: 400;
  letter-spacing: -0.02em;
}

.series-block {
  padding: 30px 0 34px;
  border-top: 1px solid var(--line);
}

.series-block:first-child {
  border-top: 0;
  padding-top: 0;
}

.series-title-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: baseline;
}

.series-title {
  margin: 0;
  font-size: clamp(1.75rem, 5vw, 2.45rem);
  font-weight: 400;
  letter-spacing: -0.025em;
}

.series-description,
.subseries-description {
  max-width: 620px;
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.subseries-block {
  margin-top: 30px;
  padding-left: 22px;
  border-left: 1px solid var(--line);
}

.subseries-title {
  margin: 0;
  font-size: 1.18rem;
  font-weight: 600;
}

.story-list {
  display: grid;
  gap: 0;
  margin-top: 14px;
}

.story-row {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  gap: 14px;
  align-items: baseline;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.story-row:first-child {
  border-top: 0;
}

.story-index,
.story-row time {
  color: var(--muted);
  font-size: 0.72rem;
}

.story-row a {
  color: var(--ink);
  text-decoration-color: transparent;
}

.story-row a:hover {
  text-decoration-color: currentColor;
}

.character-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, 120px);
  gap: 22px 18px;
  align-items: start;
}

.character-card {
  width: 120px;
  min-width: 0;
}

.character-portrait,
.character-portrait-placeholder {
  width: 120px;
  aspect-ratio: 3 / 4;
  border: 1px solid var(--line);
  background: var(--soft);
}

.character-portrait {
  display: block;
  object-fit: cover;
}

.character-portrait-placeholder {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: clamp(2.8rem, 10vw, 5.2rem);
  font-weight: 400;
  letter-spacing: -0.05em;
}

.character-card h3 {
  margin: 9px 0 0;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.15;
}

.character-meta {
  margin-top: 3px;
  font-size: 0.58rem;
}

.character-bio {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.45;
  white-space: pre-line;
}

.empty-state {
  padding: 20px 0 60px;
  color: var(--muted);
}

.back-link {
  display: inline-block;
  margin-bottom: 48px;
  color: var(--muted);
  font-size: 0.8rem;
}

.story-header {
  margin-bottom: 42px;
}

.story-header h1 {
  max-width: 15ch;
}

.story-date {
  margin-top: 18px;
}

.story-characters {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: -8px 0 40px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
}

.story-character-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.82rem;
}

.story-character-chip img {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--line);
}

.story-character-chip .avatar-placeholder {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--soft);
  font-size: 0.7rem;
}

.post-body {
  font-size: 1.06rem;
  line-height: 1.72;
}

.post-body > *:first-child { margin-top: 0; }

.post-body p,
.post-body ul,
.post-body ol,
.post-body blockquote,
.post-body pre,
.post-body figure {
  margin: 0 0 1.55em;
}

.post-body h2 {
  margin: 2.3em 0 0.65em;
  font-size: 1.75rem;
  font-weight: 400;
  line-height: 1.15;
}

.post-body h3 {
  margin: 2em 0 0.6em;
  font-size: 1.3rem;
  font-weight: 500;
  line-height: 1.2;
}

.post-body ul,
.post-body ol {
  padding-left: 1.35em;
}

.post-body li {
  margin: 0.35em 0;
}

.post-body blockquote {
  padding-left: 1.1em;
  border-left: 2px solid var(--ink);
  color: #4d4a43;
  font-style: italic;
}

.post-body code {
  padding: 0.08em 0.32em;
  border: 1px solid var(--line);
  border-radius: 3px;
  font-family: var(--font-editorial);
  font-size: 0.92em;
}

.post-body pre {
  overflow-x: auto;
  padding: 18px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 90%, var(--ink) 10%);
}

.post-body pre code {
  padding: 0;
  border: 0;
}

.post-body figure {
  width: min(100vw - 40px, 940px);
  margin-left: 50%;
  transform: translateX(-50%);
}

.post-body figure img {
  display: block;
  width: 100%;
  height: auto;
}

.post-body figcaption {
  width: min(100%, var(--max));
  margin: 10px auto 0;
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.45;
}

.story-nav {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 80px;
  padding-top: 28px;
}

.story-nav::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: min(160px, 28%);
  border-top: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  transform: translateX(-50%);
}

.story-nav a {
  color: var(--ink);
  line-height: 1.35;
}

.story-nav #nextStory {
  text-align: right;
}

.thoughts-footer {
  margin-top: 70px;
  padding: 24px 0 48px;
  color: var(--muted);
  font-size: 0.72rem;
}

html[data-theme="dark"] {
  --paper: #191916;
  --ink: #eee9df;
  --muted: #aaa59b;
  --line: #37352f;
  --soft: #23231f;
  --link: #c4cfff;
}

html[data-theme="dark"] .post-body blockquote {
  color: #c3beb4;
}

@media (max-width: 680px) {
  html { font-size: 17px; }

  .page-shell {
    width: min(calc(100% - 30px), var(--max));
  }

  .thoughts-header {
    padding: 28px 0;
  }

  main {
    padding-top: 48px;
  }

  .gate-form {
    grid-template-columns: 1fr;
  }

  .gate-form button {
    width: 100%;
  }

  .character-grid {
    grid-template-columns: repeat(auto-fill, 120px);
  }

  .story-row {
    grid-template-columns: 34px 1fr;
  }

  .story-row time {
    display: none;
  }

  .subseries-block {
    padding-left: 14px;
  }

  .story-nav {
    grid-template-columns: 1fr;
  }

  .story-nav #nextStory {
    text-align: left;
  }
}


body.is-locked .thoughts-header,
body.is-locked .thoughts-footer {
  display: none;
}

body.is-locked .page-shell {
  width: min(calc(100% - 30px), 460px);
  min-height: 100vh;
}

body.is-locked main {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px 0;
}

body.is-locked .access-gate {
  width: 100%;
  max-width: none;
  padding: 0;
}

body.is-locked .gate-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0;
  width: 100%;
  margin: 0;
}

body.is-locked .gate-form input {
  border-right: 0;
  padding: 11px 13px;
}

body.is-locked .gate-form button {
  min-width: 82px;
  padding: 11px 16px;
}

body.is-locked .gate-status {
  margin: 8px 0 0;
  min-height: 0;
  font-size: 0.76rem;
}

@media (max-width: 520px) {
  body.is-locked .gate-form {
    grid-template-columns: 1fr auto;
  }

  body.is-locked .gate-form button {
    width: auto;
  }
}


/* iPhone / compact Safari usability */
@supports (height: 100dvh) {
  body,
  body.is-locked .page-shell,
  body.is-locked main {
    min-height: 100dvh;
  }
}

@media (max-width: 480px) {
  html {
    font-size: 17px;
    -webkit-text-size-adjust: 100%;
  }

  body {
    overflow-x: hidden;
    -webkit-tap-highlight-color: color-mix(in srgb, var(--ink) 14%, transparent);
  }

  .page-shell {
    width: auto;
    max-width: var(--max);
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
  }

  .thoughts-header {
    padding-top: max(18px, env(safe-area-inset-top));
    padding-bottom: 18px;
    align-items: center;
  }

  .header-tools {
    width: 100%;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
  }

  .theme-switch {
    align-items: center;
    gap: 0;
  }

  .theme-switch button,
  .lock-button {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
  }

  main {
    padding-top: 36px;
  }

  .library-intro {
    padding-bottom: 46px;
  }

  .library-section {
    padding-top: 30px;
  }

  .library-section + .library-section {
    margin-top: 52px;
  }

  .section-heading {
    margin-bottom: 22px;
  }

  .series-block {
    padding: 24px 0 28px;
  }

  .series-title-row {
    align-items: flex-start;
    gap: 12px;
  }

  .series-title {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .series-meta {
    flex: 0 0 auto;
    padding-top: 6px;
    white-space: nowrap;
  }

  .subseries-block {
    margin-top: 24px;
    padding-left: 12px;
  }

  .story-list {
    margin-top: 10px;
  }

  .story-row {
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 10px;
    min-height: 50px;
    padding: 0;
    align-items: center;
  }

  .story-row a {
    display: flex;
    align-items: center;
    min-height: 50px;
    padding: 10px 0;
    overflow-wrap: anywhere;
    touch-action: manipulation;
  }

  .story-index {
    align-self: center;
  }

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

  .character-card,
  .character-portrait,
  .character-portrait-placeholder {
    width: 100%;
  }

  .character-card h3 {
    overflow-wrap: anywhere;
  }

  .back-link {
    min-height: 44px;
    margin-bottom: 30px;
    display: inline-flex;
    align-items: center;
    touch-action: manipulation;
  }

  .story-header {
    margin-bottom: 30px;
  }

  .story-header h1 {
    max-width: none;
    font-size: clamp(2.6rem, 15vw, 4.35rem);
    overflow-wrap: anywhere;
  }

  .story-date {
    margin-top: 14px;
  }

  .story-characters {
    gap: 8px 10px;
    margin: -4px 0 30px;
    padding-bottom: 22px;
  }

  .story-character-chip {
    min-height: 44px;
  }

  .post-body {
    min-width: 0;
    font-size: 1rem;
    line-height: 1.68;
    overflow-wrap: anywhere;
  }

  .post-body blockquote {
    margin-left: 0 !important;
    padding-left: 1em;
  }

  .post-body img {
    max-width: 100%;
    height: auto;
  }

  .post-body pre {
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
  }

  .post-body figure {
    width: calc(100vw - 32px - env(safe-area-inset-left) - env(safe-area-inset-right));
    max-width: 940px;
  }

  .story-nav {
    gap: 4px;
    margin-top: 56px;
    padding-top: 20px;
  }

  .story-nav a {
    min-height: 48px;
    display: flex;
    align-items: center;
    padding: 8px 0;
    touch-action: manipulation;
  }

  .thoughts-footer {
    margin-top: 50px;
    padding-bottom: max(32px, env(safe-area-inset-bottom));
  }

  body.is-locked .page-shell {
    width: auto;
    max-width: 460px;
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
  }

  body.is-locked main {
    padding-top: max(16px, env(safe-area-inset-top));
    padding-bottom: max(16px, env(safe-area-inset-bottom));
  }

  body.is-locked .gate-form input,
  body.is-locked .gate-form button {
    min-height: 48px;
    font-size: 16px;
  }

  body.is-locked .gate-form button {
    min-width: 88px;
    touch-action: manipulation;
  }
}


/* Optional Series / Sub-series / Story banners */
.series-banner,
.subseries-banner,
.story-banner {
  display: block;
  width: 100%;
  aspect-ratio: 6 / 1;
  object-fit: cover;
  object-position: center;
  border: 1px solid var(--line);
  background: transparent;
}

.series-banner {
  margin: 0 0 12px;
}

.subseries-banner {
  margin: 0 0 10px;
}

.story-banner {
  aspect-ratio: 3 / 1;
  margin: 0 0 18px;
}

.series-banner[hidden],
.subseries-banner[hidden],
.story-banner[hidden] {
  display: none !important;
}

@media (max-width: 480px) {
  .series-banner {
    margin-bottom: 10px;
  }

  .subseries-banner {
    margin-bottom: 8px;
  }

  .story-banner {
    margin-bottom: 14px;
  }
}


/* Cinematic editorial archive */
.series-block {
  padding: 34px 0 42px;
  border-top-color: color-mix(in srgb, var(--line) 58%, transparent);
}

.series-block:first-child {
  padding-top: 0;
}

.subseries-block {
  margin-top: 34px;
  padding-left: 0;
  border-left: 0;
}

.archive-banner-shell {
  position: relative;
  width: 100%;
  aspect-ratio: 6 / 1;
  overflow: hidden;
  margin: 0 0 12px;
  border: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  background: var(--soft);
}

.archive-banner-shell::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    transparent 30%,
    rgba(0, 0, 0, 0.1) 55%,
    rgba(0, 0, 0, 0.7) 100%
  );
  pointer-events: none;
}

.archive-banner-shell .series-banner,
.archive-banner-shell .subseries-banner {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  margin: 0;
  border: 0;
  object-fit: cover;
  object-position: center;
}

.archive-banner-caption {
  position: absolute;
  z-index: 1;
  right: 14px;
  bottom: 11px;
  left: 14px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  color: #fff;
  pointer-events: none;
}

.archive-banner-title {
  margin: 0;
  color: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.035em;
  text-transform: uppercase;
  text-shadow: 0 1px 14px rgba(0, 0, 0, 0.65);
}

.archive-banner-meta {
  flex: 0 0 auto;
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.6rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.75);
}

.series-block.has-cinematic-banner > .series-description,
.subseries-block.has-cinematic-banner > .subseries-description {
  margin-top: 14px;
}

.story-list {
  margin-top: 10px;
}

.story-row {
  grid-template-columns: 32px minmax(0, 1fr) max-content;
  gap: 10px;
  margin: 0 -7px;
  padding: 8px 7px;
  border-top-color: color-mix(in srgb, var(--line) 48%, transparent);
  border-radius: 2px;
  transition: background-color 130ms ease;
}

.story-row:hover {
  background: color-mix(in srgb, var(--ink) 4%, transparent);
}

.story-index {
  opacity: 0.62;
  font-size: 0.66rem;
  font-variant-numeric: tabular-nums;
}

.story-row time {
  opacity: 0.68;
  font-size: 0.64rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.story-row a {
  text-decoration: none;
}

.story-row a:hover {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

@media (max-width: 480px) {
  .series-block {
    padding: 28px 0 34px;
  }

  .subseries-block {
    margin-top: 28px;
    padding-left: 0;
  }

  .archive-banner-shell {
    margin-bottom: 10px;
  }

  .archive-banner-caption {
    right: 9px;
    bottom: 8px;
    left: 9px;
  }

  .archive-banner-title {
    font-size: 0.74rem;
  }

  .archive-banner-meta {
    display: none;
  }

  .story-row {
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 8px;
    margin: 0 -6px;
    padding: 0 6px;
  }
}


/* Reader-selectable Series / Sub-series book cover focus */
.subseries-block.has-cinematic-banner > .archive-book-layout {
  margin-top: 10px;
}

.subseries-block.has-cinematic-banner > .archive-subseries-title-row {
  margin-top: 30px;
}

.archive-book-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px;
  grid-template-areas:
    "focus focus"
    "copy cover";
  column-gap: 26px;
  row-gap: 10px;
  align-items: start;
  margin-top: 2px;
}

.archive-book-copy {
  grid-area: copy;
  min-width: 0;
}

.archive-book-cover-frame {
  grid-area: cover;
  width: 112px;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  justify-self: end;
  border: 1px solid color-mix(in srgb, var(--line) 74%, transparent);
  background: var(--soft);
}

.archive-book-cover {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.archive-focus-toggle {
  grid-area: focus;
  justify-self: end;
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  color: var(--muted);
  font-size: 0.66rem;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

.archive-focus-toggle button {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  font: inherit;
  cursor: pointer;
  opacity: 0.55;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 0.16em;
}

.archive-focus-toggle button:hover,
.archive-focus-toggle button[aria-pressed="true"] {
  color: var(--ink);
  opacity: 1;
  text-decoration-color: currentColor;
}

.archive-focus-separator {
  opacity: 0.42;
}

.archive-book-layout[data-focus="cover"] {
  grid-template-columns: 184px minmax(0, 1fr);
  grid-template-areas:
    "focus focus"
    "cover copy";
  column-gap: 32px;
}

.archive-book-layout[data-focus="cover"] .archive-book-cover-frame {
  width: 184px;
  justify-self: start;
}

.archive-book-layout[data-focus="cover"] .series-title {
  font-size: clamp(1.55rem, 4vw, 2.1rem);
}

.archive-book-layout[data-focus="cover"] .subseries-title {
  font-size: 1.06rem;
}

.archive-book-layout[data-focus="cover"] .series-description,
.archive-book-layout[data-focus="cover"] .subseries-description {
  max-width: 34rem;
}

.archive-book-layout.cover-unavailable {
  display: block;
}

.series-block.has-book-cover.has-cinematic-banner
  > .archive-banner-shell
  .archive-banner-title,
.subseries-block.has-book-cover.has-cinematic-banner
  > .archive-banner-shell
  .archive-banner-title {
  display: none;
}

.series-block.has-book-cover.has-cinematic-banner
  > .archive-banner-shell
  .archive-banner-caption,
.subseries-block.has-book-cover.has-cinematic-banner
  > .archive-banner-shell
  .archive-banner-caption {
  justify-content: flex-end;
}

.series-block.has-book-cover > .archive-book-layout .series-title-row {
  display: flex;
}

.subseries-block.has-book-cover > .archive-book-layout .subseries-title {
  display: block;
}

@media (max-width: 480px) {
  .subseries-block.has-cinematic-banner > .archive-book-layout {
    margin-top: 8px;
  }

  .subseries-block.has-cinematic-banner > .archive-subseries-title-row {
    margin-top: 24px;
  }

  .archive-book-layout {
    grid-template-columns: minmax(0, 1fr) 88px;
    grid-template-areas:
      "focus focus"
      "copy cover";
    column-gap: 16px;
    row-gap: 9px;
  }

  .archive-book-cover-frame {
    width: 88px;
  }

  .archive-book-layout[data-focus="cover"] {
    grid-template-columns: 1fr;
    grid-template-areas:
      "focus"
      "cover"
      "copy";
    row-gap: 12px;
  }

  .archive-book-layout[data-focus="cover"] .archive-book-cover-frame {
    width: min(58vw, 220px);
    justify-self: start;
  }

  .archive-book-layout[data-focus="cover"] .series-title {
    font-size: clamp(1.65rem, 8vw, 2.3rem);
  }

  .archive-book-layout[data-focus="cover"] .subseries-title {
    font-size: 1.12rem;
  }
}


/* Reader Series / Sub-series collapse controls */
.library-home .series-title-row {
  justify-content: flex-start;
}

.library-home .series-title-row .series-meta {
  margin-left: auto;
}

.archive-subseries-title-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.archive-collapse-toggle {
  appearance: none;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  display: inline-grid;
  place-items: center;
  align-self: center;
  margin: 0 2px 0 -4px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.78rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.72;
}

.archive-collapse-toggle:hover,
.archive-collapse-toggle:focus-visible {
  color: var(--ink);
  opacity: 1;
}

.archive-collapse-toggle:focus-visible {
  outline: 1px solid currentColor;
  outline-offset: 2px;
}

.archive-collapse-icon {
  display: block;
  transform: translateY(-0.5px);
}

.archive-banner-caption .archive-collapse-toggle {
  margin-left: -7px;
  color: rgba(255, 255, 255, 0.78);
  opacity: 1;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.75);
}

.archive-banner-caption .archive-banner-title {
  margin-right: auto;
}

.series-block.has-book-cover
  > .archive-banner-shell
  .archive-collapse-toggle,
.subseries-block.has-book-cover
  > .archive-banner-shell
  .archive-collapse-toggle {
  display: none;
}

.series-block.reader-is-collapsed > .series-description,
.series-block.reader-is-collapsed > .story-list,
.series-block.reader-is-collapsed > .subseries-block,
.series-block.reader-is-collapsed
  > .archive-book-layout
  .series-description {
  display: none !important;
}

.subseries-block.reader-is-collapsed > .subseries-description,
.subseries-block.reader-is-collapsed > .story-list,
.subseries-block.reader-is-collapsed
  > .archive-book-layout
  .subseries-description {
  display: none !important;
}

.series-block.reader-is-collapsed,
.subseries-block.reader-is-collapsed {
  padding-bottom: 18px;
}

@media (max-width: 480px) {
  .series-block.has-cinematic-banner > .series-title-row {
    margin-top: 20px;
  }

  .archive-collapse-toggle {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
    margin-left: -7px;
    font-size: 0.86rem;
    touch-action: manipulation;
  }

  .archive-banner-caption .archive-collapse-toggle {
    width: 30px;
    height: 30px;
    flex-basis: 30px;
    margin-left: -8px;
  }
}


.series-block.has-cinematic-banner > .series-title-row {
  margin-top: 24px;
}


/* Stronger reader collapse affordance */
.archive-collapse-toggle {
  color: var(--ink);
  opacity: 1;
  font-size: 0.92rem;
}

.archive-collapse-toggle:hover,
.archive-collapse-toggle:focus-visible {
  opacity: 1;
}

.archive-subseries-title-row > .archive-collapse-toggle,
.series-title-row > .archive-collapse-toggle {
  margin-right: 4px;
}



/* Connected archive navigation */
.archive-section-nav {
  display: flex;
  gap: 22px;
  margin: -24px 0 42px;
  padding: 0 0 14px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  scrollbar-width: none;
}

.archive-section-nav::-webkit-scrollbar {
  display: none;
}

.archive-section-nav button {
  appearance: none;
  flex: 0 0 auto;
  padding: 4px 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.76rem;
  letter-spacing: 0.04em;
  cursor: pointer;
  text-transform: uppercase;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 0.32em;
}

.archive-section-nav button:hover,
.archive-section-nav button:focus-visible,
.archive-section-nav button[aria-pressed="true"] {
  color: var(--ink);
  text-decoration-color: currentColor;
}

.library-home > .archive-panel {
  margin-top: 0 !important;
}

.archive-section-description {
  max-width: 42rem;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.5;
}

.archive-tool-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 22px;
}

.archive-search-input {
  width: min(260px, 46vw);
  padding: 7px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  outline: 0;
  font: inherit;
  font-size: 0.78rem;
}

.archive-search-input:focus {
  border-color: var(--ink);
}

.archive-back-button {
  appearance: none;
  margin: 0 0 28px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.76rem;
  cursor: pointer;
}

.archive-back-button:hover {
  color: var(--ink);
}

/* World */
.world-category-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--line);
}

.world-category-card {
  appearance: none;
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 16px;
  align-items: baseline;
  min-width: 0;
  padding: 22px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.world-category-card:nth-child(odd) {
  padding-right: 24px;
}

.world-category-card:nth-child(even) {
  padding-left: 24px;
  border-left: 1px solid var(--line);
}

.world-category-card strong {
  font-size: 1.18rem;
  font-weight: 500;
}

.world-category-card > span:not(.world-category-arrow) {
  color: var(--muted);
  font-size: 0.7rem;
}

.world-category-arrow {
  color: var(--muted);
  transform: translateX(0);
  transition: transform 140ms ease;
}

.world-category-card:hover .world-category-arrow {
  transform: translateX(4px);
}

.world-category-card:disabled {
  color: var(--muted);
  cursor: default;
  opacity: 0.45;
}

.world-category-card:disabled .world-category-arrow {
  display: none;
}

.world-view-heading {
  margin-bottom: 28px;
}

.world-view-heading h3 {
  margin: 4px 0 0;
  font-size: clamp(2rem, 6vw, 3.6rem);
  font-weight: 400;
  letter-spacing: -0.035em;
}

.world-entry {
  display: grid;
  grid-template-columns: minmax(0, 180px) minmax(0, 1fr);
  gap: 28px;
  padding: 28px 0;
  border-top: 1px solid var(--line);
}

.world-entry:first-child {
  border-top: 0;
  padding-top: 0;
}

.world-entry:not(:has(.world-entry-media)) {
  grid-template-columns: 1fr;
}

.world-entry-media img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 1px solid var(--line);
  background: var(--soft);
}

.world-entry-copy h4 {
  margin: 0;
  font-size: 1.32rem;
  font-weight: 500;
}

.world-entry-description {
  max-width: 46rem;
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.58;
  white-space: pre-line;
}

.world-related {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.world-related-label {
  margin-right: 3px;
  color: var(--muted);
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.world-related-chip {
  padding: 4px 7px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.68rem;
  text-decoration: none;
}

a.world-related-chip:hover {
  color: var(--ink);
  border-color: var(--ink);
}

/* Timeline */
.archive-timeline {
  position: relative;
}

.timeline-group-heading {
  margin: 34px 0 8px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.68rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.timeline-group-heading:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.timeline-entry {
  display: grid;
  grid-template-columns: minmax(120px, 180px) minmax(0, 1fr);
  gap: 28px;
  padding: 18px 0 22px;
  border-top: 1px solid color-mix(in srgb, var(--line) 75%, transparent);
}

.timeline-group-heading + .timeline-entry,
.archive-timeline > .timeline-entry:first-child {
  border-top: 0;
}

.timeline-label {
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.4;
}

.timeline-copy h3 {
  margin: 0;
  font-size: 1.16rem;
  font-weight: 500;
}

.timeline-copy h3 a {
  color: inherit;
  text-decoration-color: transparent;
}

.timeline-copy h3 a:hover {
  text-decoration-color: currentColor;
}

.timeline-meta,
.timeline-synopsis {
  margin: 6px 0 0;
  color: var(--muted);
}

.timeline-meta {
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.timeline-synopsis {
  max-width: 42rem;
  font-size: 0.84rem;
  line-height: 1.5;
}

/* Gallery albums */
.gallery-album-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 30px 16px;
}

.gallery-album-card {
  appearance: none;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.gallery-album-cover {
  display: block;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--soft);
}

.gallery-album-cover img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition: transform 160ms ease;
}

.gallery-album-card:hover .gallery-album-cover img {
  transform: scale(1.015);
}

.gallery-album-copy {
  display: grid;
  gap: 3px;
  margin-top: 9px;
}

.gallery-album-copy strong {
  font-size: 0.88rem;
  font-weight: 500;
}

.gallery-album-copy span {
  color: var(--muted);
  font-size: 0.62rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.archive-gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 34px 16px;
}

.gallery-item {
  min-width: 0;
  margin: 0;
}

.gallery-item a {
  display: block;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--soft);
}

.gallery-item img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  transition: transform 180ms ease;
}

.gallery-item[data-shape="portrait"] img {
  aspect-ratio: 3 / 4;
}

.gallery-item[data-shape="poster"] img {
  aspect-ratio: 2 / 3;
}

.gallery-album-card[data-shape="poster"] .gallery-album-cover img {
  aspect-ratio: 2 / 3;
}

.gallery-item a:hover img {
  transform: scale(1.015);
}

.gallery-item figcaption {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
}

.gallery-item figcaption span:first-child {
  min-width: 0;
  font-size: 0.78rem;
  overflow-wrap: anywhere;
}

.gallery-item figcaption span:last-child {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.58rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.gallery-item-caption {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.4;
}

@media (max-width: 680px) {
  .archive-section-nav {
    gap: 19px;
    margin-top: -18px;
    margin-right: -15px;
    padding-right: 15px;
  }

  .archive-tool-heading {
    display: grid;
    align-items: start;
  }

  .archive-search-input {
    width: 100%;
  }

  .world-category-grid {
    grid-template-columns: 1fr;
  }

  .world-category-card:nth-child(odd),
  .world-category-card:nth-child(even) {
    padding-left: 0;
    padding-right: 0;
    border-left: 0;
  }

  .world-entry {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .world-entry-media {
    max-width: 180px;
  }

  .timeline-entry {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .gallery-album-grid,
  .archive-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 28px 12px;
  }

  .gallery-item figcaption {
    display: grid;
    gap: 2px;
  }
}


/* Larger disclosure chevrons and navigation arrows, with no border. */
.archive-collapse-toggle{font-size:1.16rem;border:0;}
.world-category-arrow{font-size:1.22rem;line-height:1;border:0;}
