/* ============================================================
   LANTERNOLOGY — comic-book halftone theme
   Pure CSS. No frameworks. Deep-space dark + halftone dots.
   ============================================================ */

:root {
  --bg: #0a0a16;
  --bg-2: #121222;
  --ink: #f5f1e6;
  --ink-dim: #b9b4a6;
  --line: #000;

  --red: #ff3131;
  --orange: #ff8c1a;
  --yellow: #ffd93b;
  --green: #2eff6e;
  --blue: #38a1ff;
  --indigo: #7b5cff;
  --violet: #e04fd8;
  --black-corps: #23232e;
  --white: #f8f8ff;

  --corps: var(--green); /* default accent, overridden per corps */

  --halftone: radial-gradient(circle, rgba(255, 255, 255, 0.055) 1.2px, transparent 1.6px);
}

.corps-red    { --corps: var(--red); }
.corps-orange { --corps: var(--orange); }
.corps-yellow { --corps: var(--yellow); }
.corps-green  { --corps: var(--green); }
.corps-blue   { --corps: var(--blue); }
.corps-indigo { --corps: var(--indigo); }
.corps-violet { --corps: var(--violet); }
.corps-black  { --corps: #8a8a99; }
.corps-white  { --corps: var(--white); }

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background-color: var(--bg);
  background-image: var(--halftone);
  background-size: 22px 22px;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
}

/* Keep prose and source links readable against the dark page background. */
a { color: var(--green); }
.eyebrow a { color: inherit; }

/* ---------- accessibility: skip link + focus ---------- */

.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  z-index: 100;
  padding: 0.6rem 1rem;
  background: var(--green);
  color: #06130a;
  font-weight: 800;
  text-decoration: none;
  border-radius: 0 0 6px 6px;
  transition: top 0.15s ease;
}

.skip-link:focus {
  top: 0;
}

:focus-visible {
  outline: 3px solid var(--green);
  outline-offset: 2px;
}

/* Keep focus visible on dark interactive elements */
button:focus-visible,
input:focus-visible,
summary:focus-visible,
select:focus-visible {
  outline: 3px solid var(--green);
  outline-offset: 2px;
}

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 1.25rem;
  background: rgba(10, 10, 22, 0.92);
  border-bottom: 3px solid var(--line);
  backdrop-filter: blur(6px);
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--ink);
  text-decoration: none;
}

.logo-ring {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 6px solid var(--green);
  box-shadow: 0 0 12px var(--green), inset 0 0 8px rgba(46, 255, 110, 0.6);
  background: radial-gradient(circle at 35% 35%, #1c1c30, #06060f 70%);
}

.logo-text {
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 1.15rem;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--ink-dim);
  text-decoration: none;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  padding: 0.45rem 0.6rem;
  border: 2px solid transparent;
  white-space: nowrap;
}

.site-nav a:hover,
.site-nav a.active {
  color: var(--ink);
  border-color: var(--green);
  background: rgba(46, 255, 110, 0.08);
}

.nav-reading-shortcut {
  display: none;
  align-items: center;
  min-height: 44px;
  margin-left: auto;
  font-size: 0.9rem;
  font-weight: 800;
  white-space: nowrap;
}

.nav-toggle {
  display: none;
  min-height: 44px;
  font: inherit;
  font-weight: 700;
  background: none;
  border: 2px solid var(--ink-dim);
  color: var(--ink);
  padding: 0.35rem 0.75rem;
  cursor: pointer;
}

@media (width > 1100px) {
  .site-nav { margin-inline: auto; }
  .site-header .site-search { margin-inline: 0; }
}

/* ---------- hero ---------- */

.hero {
  text-align: center;
  padding: 3.5rem 1.25rem 2.5rem;
  max-width: 1100px;
  margin: 0 auto;
}

.eyebrow {
  display: inline-block;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.78rem;
  color: var(--bg);
  background: var(--green);
  padding: 0.35rem 0.9rem;
  transform: rotate(-1.5deg);
  box-shadow: 4px 4px 0 var(--line);
  margin: 0 0 1.25rem;
}

.hero h1 {
  margin: 0 0 1rem;
  font-size: clamp(2.6rem, 7vw, 5rem);
  line-height: 1.02;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  text-shadow: 4px 4px 0 var(--line);
}

.lede {
  font-size: 1.15rem;
  color: var(--ink-dim);
  margin: 0 0 2.25rem;
}

.tl-collected { display: block; margin-top: 0.35rem; font-size: 0.82rem; color: var(--ink-dim); font-style: italic; }

/* ---------- glossary ---------- */

.glossary { display: grid; gap: 1rem; }

.glossary-term { margin: 0; }

.glossary-term dt {
  font-size: 1.15rem;
  font-weight: 800;
  margin-bottom: 0.4rem;
}

.glossary-term dd { margin: 0; font-size: 0.92rem; line-height: 1.6; }

/* ---------- entities ---------- */

.entity-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.entity-card {
  border: 2px solid var(--line);
  background: var(--bg-2);
  box-shadow: 5px 5px 0 var(--line);
  border-top: 8px solid var(--corps);
}

.entity-card img {
  width: 100%;
  aspect-ratio: 16/10;
  object-fit: cover;
  object-position: top center;
  display: block;
  border-bottom: 2px solid var(--line);
}

.entity-card > div { padding: 1rem 1.1rem 1.2rem; }

.entity-card h3 { margin: 0 0 0.15rem; font-size: 1.25rem; }

.entity-card h3 a { color: var(--ink); text-decoration: none; }
.entity-card h3 a:hover { color: var(--corps); text-decoration: underline; }
.entity-card p a { color: var(--corps); font-weight: 700; }
.entity-card p a:hover { color: var(--ink); }

.entity-light {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--corps);
  font-weight: 800;
  margin: 0 0 0.6rem;
}

.entity-card p { font-size: 0.9rem; line-height: 1.55; }

.entity-first { font-size: 0.8rem; color: var(--ink-dim); font-style: italic; margin-top: 0.6rem; }

/* ---------- spectrum ---------- */

.spectrum {
  display: flex;
  border: 3px solid var(--line);
  box-shadow: 8px 8px 0 var(--line);
  overflow: hidden;
  background: var(--bg-2);
}

.band {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 1.1rem 0.25rem 1.25rem;
  text-decoration: none;
  color: var(--ink);
  border-right: 2px solid var(--line);
  transition: flex 0.25s ease, filter 0.2s ease;
  position: relative;
}

.band:last-child { border-right: none; }

.band-swatch {
  width: 100%;
  height: 64px;
  background: var(--corps);
  box-shadow: 0 0 18px var(--corps);
  border-top: 2px solid rgba(255, 255, 255, 0.35);
  border-bottom: 2px solid rgba(0, 0, 0, 0.45);
}

.band-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: top center;
  display: block;
  border: 2px solid var(--line);
  background: var(--bg);
}

.band-name {
  font-weight: 900;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
}

.band-emotion {
  font-size: 0.72rem;
  color: var(--ink-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.band:hover,
.band:focus-visible {
  flex: 1.6 1 0;
  filter: brightness(1.15);
  outline: none;
}

.band:hover .band-swatch,
.band:focus-visible .band-swatch {
  box-shadow: 0 0 30px var(--corps);
}

/* ---------- sections ---------- */

.corps-section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2.5rem 1.25rem;
}

.corps-section h2,
.panel h2 {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin: 0 0 0.5rem;
  text-shadow: 3px 3px 0 var(--line);
}

.section-lede {
  color: var(--ink-dim);
  max-width: 60ch;
  margin: 0 0 1.75rem;
}

.corps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.1rem;
}

.corps-card {
  display: block;
  text-decoration: none;
  color: var(--ink);
  background: var(--bg-2);
  background-image: var(--halftone);
  background-size: 18px 18px;
  border: 3px solid var(--line);
  box-shadow: 6px 6px 0 var(--line);
  padding: 1.25rem 1.1rem 1.1rem;
  border-top: 8px solid var(--corps);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.corps-card:hover,
.corps-card:focus-visible {
  transform: translate(-2px, -2px);
  box-shadow: 8px 8px 0 var(--line), 0 0 24px var(--corps);
  outline: none;
}

.corps-card h3 {
  margin: 0 0 0.3rem;
  font-size: 1.05rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.card-img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: top center;
  display: block;
  border: 3px solid var(--corps);
  margin-bottom: 0.9rem;
  background: var(--bg);
}

.card-emotion {
  margin: 0;
  font-weight: 800;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  color: var(--corps);
}

.card-figure {
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
  color: var(--ink-dim);
}

/* ---------- comic panels ---------- */

.panel {
  max-width: 1100px;
  margin: 2rem auto;
  padding: 2rem 1.75rem;
  background: var(--bg-2);
  background-image: var(--halftone);
  background-size: 18px 18px;
  border: 3px solid var(--line);
  box-shadow: 8px 8px 0 var(--line);
  border-left: 10px solid var(--green);
}

.panel p { max-width: 68ch; }

.roadmap-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
  display: grid;
  gap: 0.5rem;
}

.roadmap-list li {
  padding: 0.55rem 0.9rem;
  background: rgba(255, 255, 255, 0.04);
  border: 2px solid var(--line);
  font-weight: 600;
}

.roadmap-list li.done {
  border-left: 8px solid var(--green);
  color: var(--ink-dim);
  text-decoration: line-through;
}

/* ---------- site search ---------- */

.site-search {
  position: relative;
  margin-left: auto;
  margin-right: 0.75rem;
}

.site-search input[type="search"] {
  font: inherit;
  font-size: 0.85rem;
  background: var(--bg-2);
  color: var(--ink);
  border: 2px solid var(--line);
  padding: 0.4rem 0.6rem;
  width: 180px;
  box-shadow: 2px 2px 0 var(--line);
}

.site-search input[type="search"]:focus {
  outline: none;
  border-color: var(--green);
  width: 220px;
}

.search-results {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 300px;
  background: var(--bg-2);
  border: 2px solid var(--line);
  box-shadow: 4px 4px 0 var(--line);
  z-index: 50;
  max-height: 70vh;
  overflow-y: auto;
}

.search-hit {
  display: block;
  padding: 0.55rem 0.75rem;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid var(--line);
}

.search-hit:hover { background: rgba(255, 255, 255, 0.06); }

.search-hit strong { display: block; font-size: 0.9rem; }

.search-hit span { font-size: 0.78rem; color: var(--ink-dim); }

.search-hit.active {
  background: rgba(46, 255, 110, 0.12);
  outline: 2px solid var(--green);
  outline-offset: -2px;
}

.search-type {
  display: inline-block;
  font-size: 0.65rem;
  font-style: normal;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--green);
  border: 1px solid var(--green);
  border-radius: 3px;
  padding: 0.1rem 0.35rem;
  margin-left: 0.5rem;
  vertical-align: middle;
}

.search-empty {
  padding: 0.75rem;
  font-size: 0.85rem;
  color: var(--ink-dim);
  margin: 0;
}

@media (max-width: 700px) {
  .site-search { margin-right: 0.5rem; }
  .site-search input[type="search"] { width: 120px; }
  .site-search input[type="search"]:focus { width: 150px; }
  .search-results { width: 260px; }
}

/* ---------- corps pages ---------- */

.corps-page .corps-hero {
  text-align: center;
  padding: 4rem 1.25rem 3rem;
  background:
    radial-gradient(ellipse at 50% 120%, var(--corps), transparent 65%),
    var(--bg);
  background-image:
    radial-gradient(ellipse at 50% 120%, var(--corps), transparent 65%),
    var(--halftone);
  background-size: auto, 22px 22px;
  border-bottom: 3px solid var(--line);
}

.corps-page .corps-hero h1 {
  font-size: clamp(2.2rem, 6vw, 4rem);
  font-weight: 900;
  text-transform: uppercase;
  margin: 0.75rem 0 1.5rem;
  text-shadow: 0 0 28px var(--corps), 4px 4px 0 var(--line);
}

.corps-page .eyebrow {
  background: var(--corps);
}

.coming-soon {
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
  border-left-color: var(--corps);
}

.coming-soon a {
  color: var(--corps);
  font-weight: 800;
}

/* ---------- footer ---------- */

.site-footer {
  text-align: center;
  padding: 2.5rem 1.25rem;
  color: var(--ink-dim);
  font-size: 0.85rem;
  border-top: 3px solid var(--line);
  margin-top: 3rem;
}

.site-footer p { margin: 0.25rem 0; }

.analytics-preferences {
  min-height: 44px;
  padding: 0 0.5rem;
  border: 0;
  background: transparent;
  color: var(--green);
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 0.2em;
  cursor: pointer;
}

.analytics-consent {
  position: fixed;
  z-index: 60;
  inset: auto 1rem 1rem auto;
  width: min(25rem, calc(100% - 2rem));
  max-height: calc(100dvh - 2rem);
  overflow: auto;
  padding: 0.85rem 1rem;
  border: 1px solid var(--ink-dim);
  border-radius: 0.35rem;
  background: var(--bg-2);
  box-shadow: 0 0.5rem 1.75rem rgb(0 0 0 / 55%);
  color: var(--ink);
}

.analytics-consent h2 {
  margin: 0;
  font-size: 1rem;
}

.analytics-consent p {
  margin: 0.35rem 0 0.65rem;
  font-size: 0.9rem;
}

.analytics-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.analytics-actions button {
  flex: 1 1 0;
  min-height: 44px;
  padding: 0.45rem 0.8rem;
  border: 1px solid var(--green);
  border-radius: 0.25rem;
  background: var(--bg);
  color: var(--green);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

/* ---------- corps profile pages ---------- */

.oath-panel {
  max-width: 760px;
  margin: 2.5rem auto;
  padding: 2rem 2rem 1.6rem;
  background: var(--bg-2);
  background-image: var(--halftone);
  background-size: 18px 18px;
  border: 3px solid var(--line);
  box-shadow: 8px 8px 0 var(--line);
  border-top: 10px solid var(--corps);
  text-align: center;
}

.oath-panel h2 {
  font-size: 0.85rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin: 0 0 1rem;
  text-shadow: none;
}

.oath-panel blockquote {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 2;
}

.oath-panel blockquote span { display: block; }

.profile {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem 1.25rem 2rem;
}

.fact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.1rem;
  margin-bottom: 1.1rem;
}

.fact-card {
  background: var(--bg-2);
  background-image: var(--halftone);
  background-size: 18px 18px;
  border: 3px solid var(--line);
  box-shadow: 6px 6px 0 var(--line);
  padding: 1.4rem 1.3rem;
}

.fact-card h3 {
  margin: 0 0 0.6rem;
  font-size: 1rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--corps);
}

.fact-card p { margin: 0.4rem 0; }

.facts { display: grid; gap: 0.5rem; margin: 1.25rem 0; }
.fact-row { display: grid; grid-template-columns: 9rem 1fr; gap: 0.75rem; padding: 0.45rem 0; border-bottom: 1px solid var(--line); font-size: 0.92rem; }
.fact-row:last-child { border-bottom: none; }
.fact-label { font-weight: 700; text-transform: uppercase; font-size: 0.72rem; letter-spacing: 0.06em; color: var(--ink-dim); padding-top: 0.15rem; }

.member-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}

.member-list li {
  padding: 0.5rem 0.75rem;
  background: rgba(255, 255, 255, 0.04);
  border-left: 4px solid var(--corps);
}

.member-list span {
  color: var(--ink-dim);
  font-size: 0.92rem;
}

.lore-panel { margin-top: 0; }

.lore-panel h3 {
  margin: 0 0 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 1rem;
  color: var(--corps);
}

.homeworld-panel {
  margin: 2rem 0 0;
  border-left: 4px solid var(--corps);
}

.homeworld-panel p { margin: 0; }
.homeworld-panel a { color: var(--corps); }

.corps-pager {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.25rem 1rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.corps-pager a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 800;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  padding: 0.7rem 1.1rem;
  border: 3px solid var(--line);
  background: var(--bg-2);
  box-shadow: 4px 4px 0 var(--line);
}

.corps-pager a:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--line);
}

@media (max-width: 760px) {
  .fact-grid { grid-template-columns: 1fr; }
}

/* ---------- spectrum + timeline pages ---------- */

.explainer {
  max-width: 880px;
  margin: 0 auto 3rem;
  padding: 0 1.25rem;
}

/* Reading guidance and optional story outcomes. */
.source-note, .spoiler-note {
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--ink-dim);
}

.source-note a, .spoiler-note a { color: var(--green); }

details.lore-spoilers, details.spoiler-details {
  margin: 1.25rem 0;
  padding: 1rem 1.2rem;
  border: 2px solid var(--line);
  border-left: 5px solid var(--yellow);
  background: var(--bg-2);
}

details.lore-spoilers > summary, details.spoiler-details > summary {
  cursor: pointer;
  font-weight: 800;
  line-height: 1.5;
}

details.lore-spoilers[open] > summary, details.spoiler-details[open] > summary {
  margin-bottom: 1rem;
}

.reader-routes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 1rem;
}

.reader-routes .panel { margin: 0; }
.source-list { padding-left: 1.3rem; line-height: 1.7; }
.source-list li + li { margin-top: 0.65rem; }
.source-list a { overflow-wrap: anywhere; }
.timeline-item.is-read .tl-panel { border-left-color: var(--green); }
.timeline-item.is-read h3::after { content: " ✓"; color: var(--green); }
.timeline input[type="checkbox"] { accent-color: var(--green); width: 1.1rem; height: 1.1rem; vertical-align: middle; margin-right: 0.4rem; }

.explainer h2 {
  font-size: clamp(1.4rem, 3.5vw, 2rem);
  font-weight: 900;
  text-transform: uppercase;
  text-shadow: 3px 3px 0 var(--line);
  margin: 0 0 1rem;
}

.timeline {
  position: relative;
  max-width: 820px;
  margin: 1rem auto 2rem;
  padding: 0 1.25rem 0 2.5rem;
  border-left: 4px solid var(--green);
}

/* ---------- corps member chips ---------- */

.member-chips {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 0.7rem;
}

.member-chip {
  display: flex;
  gap: 0.7rem;
  align-items: center;
  text-decoration: none;
  color: inherit;
  border: 2px solid var(--line);
  background: var(--bg);
  padding: 0.45rem 0.6rem;
  box-shadow: 3px 3px 0 var(--line);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

a.member-chip:hover {
  transform: translate(-2px, -2px);
  box-shadow: 5px 5px 0 var(--line);
}

.member-chip img {
  width: 52px;
  height: 52px;
  object-fit: cover;
  object-position: top center;
  border: 2px solid var(--corps);
  flex: none;
  background: var(--bg-2);
}

.member-chip-initial {
  width: 52px;
  height: 52px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--corps);
  color: #0a0a0a;
  font-weight: 900;
  font-size: 1.4rem;
  border: 2px solid var(--line);
}

.member-chip-text { font-size: 0.82rem; line-height: 1.35; }

.member-chip-text strong { display: block; font-size: 0.9rem; }

.member-chip-text > span { color: var(--ink-dim); }

/* ---------- timeline reading-order covers ---------- */

.tl-panel { display: flex; gap: 1.1rem; align-items: flex-start; }

.tl-cover {
  width: 92px;
  height: auto;
  flex: none;
  border: 3px solid var(--line);
  box-shadow: 4px 4px 0 var(--line);
  transform: rotate(1.5deg);
  background: var(--bg);
}

.timeline-item:nth-child(even) .tl-cover { transform: rotate(-1.5deg); }

/* ---------- homepage spectrum chart + interact figure ---------- */

.panel.about { display: flow-root; }

.about-figure {
  float: right;
  width: min(400px, 100%);
  margin: 0.25rem 0 1rem 1.5rem;
  border: 3px solid var(--line);
  box-shadow: 6px 6px 0 var(--line);
  background: var(--bg);
}

.about-figure img,
.interact-figure img {
  width: 100%;
  height: auto;
  display: block;
}

.about-figure figcaption,
.interact-figure figcaption {
  font-size: 0.78rem;
  color: var(--ink-dim);
  padding: 0.5rem 0.75rem;
  border-top: 3px solid var(--line);
}

.interact-figure {
  margin: 0 0 1.25rem;
  border: 3px solid var(--line);
  box-shadow: 6px 6px 0 var(--line);
  background: var(--bg);
}

@media (max-width: 700px) {
  .about-figure { float: none; width: 100%; margin: 0 0 1rem; }
}

/* ---------- in-universe era visuals ---------- */

.era-panel { display: flex; gap: 1.1rem; align-items: flex-start; }

.era-img {
  width: 110px;
  height: auto;
  flex: none;
  border: 3px solid var(--line);
  box-shadow: 4px 4px 0 var(--line);
  transform: rotate(-1.5deg);
  background: var(--bg);
}

/* ---------- spectrum interaction citations ---------- */

.member-list .cite {
  display: block;
  font-size: 0.8rem;
  color: var(--ink-dim);
  margin-top: 0.3rem;
  font-style: normal;
}

@media (max-width: 560px) {
  .era-img { width: 84px; }
}

.timeline-item { position: relative; margin-bottom: 1.75rem; }

/* kill the rail + panel double border inside the timeline */
.timeline-item .panel { border-left: 3px solid var(--line); }

.timeline-item::before {
  content: "";
  position: absolute;
  left: calc(-2.5rem - 11px);
  top: 1.5rem;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--corps, var(--green));
  border: 3px solid #000;
  box-shadow: 0 0 14px var(--corps, var(--green));
}

.timeline-item .era {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--bg);
  background: var(--corps, var(--green));
  padding: 0.25rem 0.7rem;
  margin: 0 0 0.6rem;
  transform: rotate(-1deg);
  box-shadow: 3px 3px 0 var(--line);
}

.timeline-item .panel h3 {
  margin: 0 0 0.5rem;
  font-size: 1.15rem;
  font-weight: 900;
  text-transform: uppercase;
}

/* ---------- corps artwork ---------- */

.corps-visual {
  display: block;
  width: 100%;
  max-width: 880px;
  margin: 2rem auto 0;
  border: 3px solid var(--line);
  box-shadow: 8px 8px 0 var(--line);
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--bg-2);
}

.art-credit {
  text-align: center;
  color: var(--ink-dim);
  font-size: 0.8rem;
  margin: 0.7rem 0 0;
}

/* ---------- character roster ---------- */

.roster-section { margin-bottom: 3rem; }

.roster-corps-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.35rem;
  font-weight: 900;
  text-transform: uppercase;
  margin: 0 0 1.25rem;
}

.roster-corps-title .dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  flex: none;
  background: var(--corps, var(--green));
  border: 3px solid #000;
  box-shadow: 0 0 12px var(--corps, var(--green));
}

.roster-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 230px));
  gap: 1.25rem;
  justify-content: center;
}

.character-card {
  background: var(--bg-2);
  border: 3px solid var(--line);
  box-shadow: 5px 5px 0 var(--line);
  overflow: hidden;
}

.character-card img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: top center;
  display: block;
  border-bottom: 3px solid var(--line);
  background: var(--bg);
}

.character-card .char-info { padding: 0.75rem 0.8rem 0.9rem; }
.character-card h3 { font-size: 1rem; margin: 0 0 0.3rem; }
.character-card p { font-size: 0.85rem; color: var(--ink-dim); margin: 0; }

a.character-card {
  text-decoration: none;
  color: inherit;
  display: block;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

a.character-card:hover {
  transform: translate(-2px, -2px);
  box-shadow: 7px 7px 0 var(--line);
}

/* ---------- character detail page ---------- */

.char-detail {
  display: grid;
  grid-template-columns: minmax(220px, 320px) 1fr;
  gap: 2rem;
  align-items: start;
  margin-top: 1rem;
}

.char-portrait {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: top center;
  display: block;
  border: 3px solid var(--line);
  box-shadow: 8px 8px 0 var(--line);
  background: var(--bg-2);
}

.char-artwork { margin: 0; min-width: 0; }
.char-artwork .art-credit { margin-top: 1.25rem; text-align: left; }
.portrait-placeholder { display: grid; place-items: center; min-height: 5rem; background: var(--bg-2); color: var(--ink-dim); font-size: 2rem; font-weight: 900; }
.character-card > .portrait-placeholder { aspect-ratio: 3 / 4; border-bottom: 3px solid var(--line); }
.member-chip > .portrait-placeholder { width: 64px; height: 80px; flex: none; min-height: 0; font-size: 1.2rem; }
.art-page-credits { max-width: 880px; margin: 2.5rem auto; padding: 1.25rem; border: 1px solid var(--ink-dim); }
.art-page-credits summary, .art-record summary { cursor: pointer; font-weight: 800; }
.art-page-credits li { margin-block: .75rem; }
.art-page-credits p, .art-page-credits li, .art-record { font-size: .9rem; overflow-wrap: anywhere; }
.art-category-links { line-height: 2; }
.art-category { margin-top: 2rem; }
.art-record { padding: .9rem 0; border-top: 1px solid var(--ink-dim); scroll-margin-top: 6rem; }
.art-record:target { border-color: var(--green); }
.art-status { display: block; margin-top: .2rem; color: var(--ink-dim); font-size: .8rem; font-weight: 400; }

.char-detail h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 900;
  text-transform: uppercase;
  margin: 0 0 0.75rem;
  text-shadow: 3px 3px 0 var(--line);
}

.char-detail .lede {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--corps, var(--green));
  margin: 0 0 1rem;
}

.char-detail .first-app {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.5rem 0.9rem;
  border: 3px solid var(--line);
  background: var(--bg-2);
  box-shadow: 4px 4px 0 var(--line);
  font-size: 0.9rem;
}

.char-facts {
  display: grid;
  gap: 0.6rem;
  margin: 1.25rem 0 0;
  padding: 1rem 1.1rem;
  border: 3px solid var(--line);
  background: var(--bg-2);
  box-shadow: 4px 4px 0 var(--line);
}

.char-facts > div {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 0.75rem;
  align-items: baseline;
}

.char-facts dt {
  font-weight: 800;
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--ink-dim);
}

.char-facts dd { margin: 0; font-weight: 600; }

.char-facts dd a { color: var(--corps, var(--green)); }

.char-detail.has-profile-guide {
  grid-template-areas: "portrait intro" "portrait body";
  grid-template-columns: minmax(220px, 320px) minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  row-gap: 0;
}

.has-profile-guide .char-intro { grid-area: intro; }
.has-profile-guide .char-artwork { grid-area: portrait; }
.has-profile-guide .char-body { grid-area: body; }

.char-start {
  padding: 0.8rem 1rem;
  border: 2px solid var(--line);
  border-left: 4px solid var(--green);
  background: var(--bg-2);
  scroll-margin-top: 6rem;
}

.char-start h2, .char-guide-section h2 {
  font-size: 1.1rem;
  text-transform: none;
  text-shadow: none;
  margin: 0 0 0.5rem;
}

.char-start p { margin: 0.5rem 0 0; }
.char-start .char-first-book { font-size: 1.1rem; }

.char-guide-section {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 2px solid var(--line);
}

@media (max-width: 700px) {
  .char-detail { grid-template-columns: 1fr; }
  .char-portrait { max-width: 320px; }
  .char-detail.has-profile-guide {
    grid-template-areas: "intro" "portrait" "body";
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto;
    row-gap: 1.5rem;
  }
}

/* ---------- quiz ---------- */

.quiz-wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 1.25rem 2rem;
}

.quiz-panel { text-align: center; }

.quiz-panel .eyebrow { margin-bottom: 0.75rem; }

.quiz-q {
  font-size: 1.4rem;
  font-weight: 900;
  margin: 0 0 1.25rem;
  text-shadow: none;
  text-transform: none;
  letter-spacing: 0;
}

.quiz-progress {
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ink-dim);
  margin: 0 0 0.75rem;
}

.quiz-answers {
  display: grid;
  gap: 0.6rem;
  text-align: left;
}

.quiz-answers button,
.quiz-begin,
.quiz-again {
  font-family: inherit;
  padding: 0.9rem 1.1rem;
  background: rgba(255, 255, 255, 0.04);
  border: 2px solid var(--line);
  color: var(--ink);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}

.quiz-answers button:hover,
.quiz-begin:hover,
.quiz-again:hover {
  border-color: var(--corps, var(--green));
  background: rgba(255, 255, 255, 0.08);
  transform: translate(-2px, -2px);
  box-shadow: 4px 4px 0 var(--line);
}

.quiz-begin {
  font-size: 1.1rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 1rem 2rem;
  background: var(--green);
  color: var(--bg);
  border-color: var(--line);
  box-shadow: 5px 5px 0 var(--line);
}

.quiz-result { border-top: 10px solid var(--corps); }

.quiz-kindred { font-size: 0.95rem; color: var(--ink-dim); margin-top: 0.4rem; }

.quiz-kindred a { color: var(--green); font-weight: 700; }

.quiz-result h2 {
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  text-shadow: 0 0 24px var(--corps);
}

.quiz-emotion {
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--corps);
  margin: 0.25rem 0 1rem;
}

.quiz-actions {
  display: flex;
  gap: 0.8rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}

.quiz-go {
  display: inline-block;
  padding: 0.9rem 1.4rem;
  background: var(--corps);
  color: var(--bg);
  font-weight: 800;
  text-transform: uppercase;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  text-decoration: none;
  border: 3px solid var(--line);
  box-shadow: 4px 4px 0 var(--line);
}

.quiz-go:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--line);
}

.quiz-note {
  text-align: center;
  color: var(--ink-dim);
  font-size: 0.85rem;
  margin-top: 1rem;
}

/* ---------- responsive ---------- */

@media (max-width: 860px) {
  .corps-grid { grid-template-columns: repeat(2, 1fr); }
  .band-emotion { display: block; font-size: 0.75rem; }
}

/* The complete link list remains visible if JavaScript is unavailable. */
@media (max-width: 1100px) {
  .site-header:not(.nav-ready) {
    position: relative;
    flex-wrap: wrap;
  }
  .site-header:not(.nav-ready) .site-nav { flex-basis: 100%; }
  .nav-ready .nav-toggle:not([hidden]) { display: block; }
  .nav-ready .nav-reading-shortcut { display: inline-flex; }
  .nav-ready .site-search { margin-left: 0; margin-right: 0; }
  .nav-ready .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    flex-direction: column;
    flex-wrap: nowrap;
    background: var(--bg);
    border-bottom: 3px solid var(--line);
    padding: 0.5rem;
    max-height: calc(100dvh - 7rem);
    overflow-y: auto;
  }
  .nav-ready .site-nav.open { display: flex; }
}

@media (max-width: 640px) {
  .corps-grid { grid-template-columns: 1fr; }
  .spectrum { flex-wrap: wrap; }
  .band {
    flex: 1 1 30%;
    border-bottom: 2px solid var(--line);
  }
  .band:hover { flex: 1 1 30%; }
}

/* ---------- events ---------- */

.event-hero {
  display: flex;
  gap: 2rem;
  align-items: center;
  max-width: 1100px;
  margin: 0 auto;
  padding: 3rem 1.5rem 1rem;
}

.event-cover {
  width: 220px;
  flex: 0 0 auto;
  border: 3px solid var(--line);
  box-shadow: 8px 8px 0 var(--line);
  transform: rotate(-1.5deg);
}

.event-hero-text .event-year {
  font-size: 0.85rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin: 0 0 0.25rem;
}

.event-hero-text h1 {
  margin: 0 0 0.5rem;
  font-size: 2.5rem;
}

.event-tagline {
  font-size: 1.15rem;
  color: var(--ink-dim);
  font-style: italic;
  margin: 0;
}

.event-corps {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.event-corps a {
  display: inline-block;
  padding: 0.4rem 0.9rem;
  border: 2px solid var(--line);
  background: var(--bg-2);
  font-size: 0.9rem;
}

@media (max-width: 640px) {
  .event-hero { flex-direction: column; text-align: center; padding-top: 2rem; }
  .event-cover { width: 170px; }
  .event-hero-text h1 { font-size: 2rem; }
  .panel .fact-row { grid-template-columns: 1fr; gap: 0.2rem; }
}

/* ---------- reading checklist ---------- */





.timeline-item .tl-text h3 {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}







.timeline-item.is-read .tl-cover {
  filter: saturate(0.4);
  opacity: 0.75;
}

.timeline-item.is-read .tl-text h3 {
  color: var(--ink-dim);
}

/* ---------- oath quotes ---------- */

.oath-card blockquote {
  margin: 0.75rem 0 0;
  padding: 0;
  border: none;
  font-size: 1.05rem;
  line-height: 1.7;
  font-style: italic;
}

.oath-card blockquote span {
  display: block;
}

.oath-card .entity-light a {
  text-decoration: none;
  font-weight: 800;
}

/* ---------- random lantern button ---------- */

.random-btn {
  font: inherit;
  font-weight: 800;
  font-size: 1rem;
  padding: 0.7rem 1.4rem;
  background: var(--green);
  color: #06130a;
  border: 3px solid var(--line);
  box-shadow: 5px 5px 0 var(--line);
  cursor: pointer;
  transition: transform 0.1s ease;
}

.random-btn:hover { transform: translate(-2px, -2px); box-shadow: 7px 7px 0 var(--line); }
.random-btn:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--line); }

/* ---------- character key stories ---------- */

.char-stories {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 2px solid var(--line);
}

.char-stories h2 {
  font-size: 1.1rem;
  margin: 0 0 0.6rem;
}

.char-stories ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.char-stories li a {
  display: inline-block;
  padding: 0.35rem 0.8rem;
  border: 2px solid var(--line);
  background: var(--bg-2);
  font-size: 0.85rem;
  font-weight: 700;
}

.char-stories .story-issues {
  display: block;
  font-size: 0.78rem;
  opacity: 0.75;
  margin-top: 0.15rem;
}

/* ---------- essays ---------- */

.essay .essay-dek {
  font-size: 1.2rem;
  font-style: italic;
  color: var(--ink-dim);
  margin-bottom: 1.5rem;
}

.essay h2 {
  margin-top: 2rem;
  font-size: 1.4rem;
}

.essay p {
  max-width: 68ch;
  line-height: 1.7;
}

.char-signature {
  background: var(--bg-2);
  border-left: 4px solid var(--green);
  padding: 0.7rem 1rem;
  font-size: 0.95rem;
}

/* Footer sitemap */
.footer-sitemap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.2rem;
  justify-content: center;
  margin-bottom: 1.2rem;
  padding-bottom: 1.2rem;
  border-bottom: 1px solid var(--line);
}
.footer-sitemap a {
  color: var(--ink-dim);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
}
.footer-sitemap a:hover { color: var(--green); text-decoration: underline; }

/* Glossary icons */
.gloss-icon { display:inline-flex; width:1.4em; height:1.4em; vertical-align:-0.25em; margin-right:0.5em; color:var(--green); }
.gloss-icon svg { width:100%; height:100%; }
.glossary-term dt { font-size:1.15rem; }

/* Spectrum interaction cards */
.interact-cards { display:grid; gap:0.8rem; margin-top:1rem; }
.interact-card { border:2px solid var(--line); background:var(--bg-2); }
.interact-card summary { padding:0.9rem 1.1rem; cursor:pointer; font-size:1rem; list-style:none; display:flex; gap:0.6rem; align-items:baseline; flex-wrap:wrap; }
.interact-card summary::-webkit-details-marker { display:none; }
.interact-card summary::before { content:"▸"; color:var(--green); font-weight:900; }
.interact-card[open] summary::before { content:"▾"; }
.interact-card summary:hover strong { color:var(--green); }
.interact-card summary span { color:var(--ink-dim); font-size:0.9rem; }
.interact-card img { width:100%; max-height:320px; object-fit:cover; object-position:top center; display:block; border-top:2px solid var(--line); border-bottom:2px solid var(--line); }
.interact-card p { padding:1rem 1.1rem; margin:0; font-size:0.92rem; line-height:1.6; }


/* ---------- Mobile fixes (Dash feedback Nov 2026) ---------- */

/* 1. Header: prevent overflow on narrow screens */
@media (max-width: 480px) {
  .site-header {
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.6rem 0.75rem;
  }
  .logo { gap: 0.4rem; }
  .logo-ring { width: 28px; height: 28px; border-width: 5px; }
  .logo-text { font-size: 0.95rem; letter-spacing: 0.055em; }
  .nav-reading-shortcut { font-size: 0.8rem; }
  .nav-toggle { font-size: 0.9rem; padding-inline: 0.5rem; }
  .site-search {
    order: 3;
    flex: 1 1 100%;
    margin: 0;
  }
  .site-search input[type="search"] {
    width: 100% !important;
  }
  .site-search input[type="search"]:focus {
    width: 100% !important;
  }
  .search-results {
    width: 100% !important;
    max-width: 100vw;
    left: 0;
    right: 0;
    max-height: 60vh;
    overflow-y: auto;
  }
}

@media (max-width: 355px) {
  .nav-ready .nav-reading-shortcut { display: none; }
}

/* 2. Timeline cards: stack on narrow screens */
@media (max-width: 560px) {
  .tl-panel, .era-panel {
    flex-direction: column !important;
  }
  .tl-panel .tl-cover, .era-panel .era-img {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    margin-bottom: 1rem;
  }
  .tl-panel > div, .era-panel > div {
    width: 100% !important;
    min-width: 0 !important;
  }
}

/* 3. Anchor destinations below sticky header */
html {
  scroll-padding-top: 80px;
}
@media (max-width: 480px) {
  html {
    scroll-padding-top: 120px;
  }
}
[id] {
  scroll-margin-top: 80px;
}
@media (max-width: 480px) {
  [id] {
    scroll-margin-top: 120px;
  }
}

/* 4. Reading checklist: better contrast and tap targets */

/* 6. Roster: compact two-column on mobile */
@media (max-width: 640px) {
  .roster-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.75rem;
  }
  .character-card {
    font-size: 0.85rem;
  }
  .character-card img {
    aspect-ratio: 1;
    object-fit: cover;
  }
  .character-card .char-info h3 {
    font-size: 0.95rem;
    margin: 0.4rem 0 0.2rem;
  }
  .character-card .char-info p {
    font-size: 0.75rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
}

/* Roster quick-jump nav */
.roster-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  padding: 1rem;
  max-width: 880px;
  margin: 0 auto 1rem;
}
.roster-jump a {
  padding: 0.5rem 1rem;
  background: var(--bg-2);
  border: 2px solid var(--line);
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.85rem;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.roster-jump a:hover {
  border-color: var(--green);
  color: var(--green);
}

/* Quiz back button */
.quiz-back {
  margin-top: 1rem;
  padding: 0.6rem 1.2rem;
  background: transparent;
  border: 2px solid var(--line);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  min-height: 44px;
}
.quiz-back:hover {
  border-color: var(--green);
  color: var(--green);
}



/* Detail hero images: constrain on mobile */
.entity-detail {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
}
.entity-detail .detail-hero {
  flex: 0 0 400px;
  max-width: 400px;
  height: auto;
  max-height: 500px;
  object-fit: cover;
  display: block;
}
.entity-detail > div {
  flex: 1;
  min-width: 0;
}
@media (max-width: 860px) {
  .entity-detail {
    flex-direction: column;
  }
  .entity-detail .detail-hero {
    flex: none;
    max-width: 100%;
    width: 100%;
    max-height: 50vh;
    object-fit: cover;
  }
}

/* Worlds share one centered reading area, including the index introduction. */
.world-page {
  max-width: 1100px;
  margin: 2rem auto 3rem;
  padding: 0 1.25rem;
}

.world-page .crumbs {
  margin-bottom: 1.5rem;
  color: var(--ink-dim);
  font-size: 0.9rem;
}

.world-page h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  line-height: 1.15;
  text-transform: uppercase;
  text-shadow: 4px 4px 0 var(--line);
}

.world-page > .lede { max-width: 68ch; }

.world-page .entity-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
}

.world-detail {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  gap: 2rem;
}

.world-heading { grid-column: 1 / -1; }
.world-heading .entity-light { margin: 0; }

.world-artwork {
  min-width: 0;
  margin: 0;
  background: var(--bg-2);
  border: 3px solid var(--line);
  border-top: 6px solid var(--corps);
  box-shadow: 5px 5px 0 var(--line);
}

.world-artwork .detail-hero {
  width: 100%;
  max-width: 100%;
  max-height: none;
  height: auto;
}

.world-artwork .art-credit {
  margin: 0;
  padding: 1rem;
  text-align: left;
  overflow-wrap: anywhere;
}

.world-body > p:first-child { margin-top: 0; }
.world-body p { max-width: 68ch; }

@media (max-width: 860px) {
  .world-detail { grid-template-columns: minmax(0, 1fr); }
  .world-artwork { width: min(100%, 400px); }
}

@media (max-width: 640px) {
  .world-detail .fact-row { grid-template-columns: 1fr; gap: 0.2rem; }
}

/* Timeline link cards: entire card clickable */
.tl-link-card {
  text-decoration: none;
  color: inherit;
  display: flex;
  cursor: pointer;
}
.tl-link-card:hover {
  text-decoration: none;
}
.tl-link-card h3 {
  color: var(--ink);
}

/* Chip links (entity detail pages) */
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0;
}
.chip {
  display: inline-block;
  padding: 0.4rem 0.9rem;
  background: var(--bg-2);
  border: 2px solid var(--line);
  color: var(--ink);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 700;
}
.chip:hover {
  border-color: var(--corps, var(--green));
  color: var(--corps, var(--green));
}

/* Clickable entity cards (worlds index) */
.entity-link-card {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  display: block;
}
.entity-link-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}
.entity-link-card h3 {
  color: var(--ink);
}

/* Contextual Amazon recommendations; all content is present without JavaScript. */
.amazon-picks {
  max-width: 880px;
  margin: 3rem auto;
  padding: 1.5rem 1.25rem 0;
  border-top: 1px solid var(--ink-dim);
}
.amazon-picks h2 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.5rem, 4vw, 2rem);
  text-transform: uppercase;
}
.amazon-disclosure {
  margin: 0;
  color: var(--ink-dim);
  font-size: 0.9rem;
  line-height: 1.5;
}
.amazon-disclosure a { color: var(--green); }
.amazon-picks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  gap: 1rem;
  margin-top: 1.25rem;
}
.amazon-pick {
  display: flex;
  min-width: 0;
  background: var(--bg-2);
  border: 1px solid rgba(245, 241, 230, 0.22);
  border-top: 3px solid var(--corps);
  border-radius: 4px;
}
.amazon-pick > a {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  padding: 1.25rem;
  color: inherit;
  text-decoration: none;
}
.amazon-pick-image {
  align-self: center;
  width: 7rem;
  height: 8rem;
  margin-bottom: 1rem;
  padding: 0.375rem;
  border-radius: 3px;
  background: #fff;
  object-fit: contain;
}
.amazon-pick h3 { margin: 0; font-size: 1.1rem; line-height: 1.4; }
.amazon-pick p { color: var(--ink-dim); line-height: 1.6; }
.amazon-pick .amazon-pick-format {
  margin: 0 0 0.65rem;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.amazon-pick-cta {
  align-self: flex-start;
  margin-top: auto;
  color: var(--green);
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}
.amazon-pick > a:hover .amazon-pick-cta {
  color: var(--ink);
}

/* Homepage reader paths and the reading guide. */
.hero-action {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  gap: 0.5rem;
  margin: 0 0 1.75rem;
  padding: 0.45rem 1rem;
  border: 2px solid var(--green);
  background: var(--bg-2);
  font-weight: 800;
  text-decoration: none;
}

.hero-action:hover {
  background: var(--green);
  color: var(--bg);
}

.section-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0;
}

.section-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--ink-dim);
  background: var(--bg-2);
  font-weight: 700;
  text-decoration: none;
}

.section-links a:hover {
  border-color: var(--green);
  text-decoration: underline;
}

.reading-hero { padding-bottom: 1rem; }
.reading-hero .lede { max-width: 52ch; margin-inline: auto; }
.reading-hero .section-links { justify-content: center; }

/* These links only need the sticky header offset set on html. */
#start-here, #corps, #routes-title, .reading-routes article,
#reading-order, #on-screen, #amazon-picks-heading { scroll-margin-top: 0; }

.reading-routes .reader-routes {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 0.85rem;
}

.reading-routes .panel {
  padding: clamp(1rem, 3vw, 1.4rem);
  border-left-color: var(--corps);
  max-width: none;
}

.reading-routes .panel h3 { margin: 0; }
.reading-routes .panel .reading-next { margin-bottom: 0; }

.reading-edition {
  padding: 0.8rem 1rem;
  border-left: 3px solid var(--corps);
  background: var(--bg);
}

.reading-edition > p:first-child { margin-top: 0; }
.reading-edition > p:last-child { margin-bottom: 0; }

.reading-edition-johns {
  margin: 1.5rem 0;
  background: var(--bg-2);
}

.reading-edition-johns h3 { margin: 0; }
.reading-amazon-link, .amazon-source-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: fit-content;
  max-width: 100%;
}
.reading-amazon-link {
  margin-top: 0.7rem;
  font-weight: 700;
  text-decoration: none;
}
.amazon-inline-image {
  flex: none;
  width: 4.5rem;
  height: 5.5rem;
  padding: 0.25rem;
  border-radius: 3px;
  background: #fff;
  object-fit: contain;
}
.reading-amazon-label { text-decoration: underline; text-underline-offset: 0.15em; }
.reading-amazon-label > span { font-weight: 400; }

/* Shared article layout */
.editorial-page {
  width: min(100% - 2.5rem, 66rem);
  margin: 0 auto 4rem;
}

.editorial-crumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 0.5rem;
  margin: 1.5rem 0;
  padding: 0;
  list-style: none;
  font-size: 0.85rem;
  color: var(--ink-dim);
}

.editorial-crumbs li + li::before { content: "›" / ""; margin-right: 0.5rem; }

.editorial-header {
  display: grid;
  align-items: center;
  gap: clamp(1rem, 4vw, 3rem);
  padding: clamp(1.25rem, 4vw, 2.75rem);
  background: var(--bg-2);
  border: 2px solid var(--line);
  border-top: 4px solid var(--green);
  box-shadow: 6px 6px var(--line);
}

.editorial-header.has-cover { grid-template-columns: minmax(0, 1fr) minmax(8rem, 11rem); }

.editorial-header h1 {
  margin: 0 0 1rem;
  font-size: clamp(2rem, 4.5vw, 3.8rem);
  line-height: 1.08;
  text-wrap: balance;
}

.editorial-dek { max-width: 58ch; font-size: clamp(1rem, 2vw, 1.2rem); }
.editorial-byline, .editorial-scope { color: var(--ink-dim); font-size: 0.9rem; }
.editorial-byline { margin-bottom: 0.15rem; }
.editorial-scope { margin: 0; }

.editorial-cover { margin: 0; }
.editorial-cover img { display: block; width: 100%; height: auto; border: 1px solid var(--ink-dim); }
.editorial-cover figcaption { margin-top: 0.45rem; color: var(--ink-dim); font-size: 0.75rem; line-height: 1.45; }

.editorial-section, .editorial-related {
  margin-top: 2.5rem;
  padding-top: 1.35rem;
  border-top: 1px solid var(--ink-dim);
}

.editorial-body > :first-child { border: 0; padding-top: 0; }
.editorial-section h2, .editorial-related h2 { margin: 0 0 0.65rem; font-size: clamp(1.45rem, 3vw, 1.9rem); line-height: 1.25; }
.editorial-section > p { max-width: 78ch; }
.editorial-page [tabindex="-1"] { scroll-margin-top: 0; }

.editorial-related ul { margin: 0; padding-left: 1.25rem; }
.editorial-related li + li { margin-top: 0.55rem; }
.editorial-related li span { display: block; color: var(--ink-dim); }

.updates-list { list-style: none; margin: 1.25rem 0 0; padding: 0; }
.updates-list > li { padding: 0.9rem 0; border-top: 1px solid var(--line); }
.updates-list time { color: var(--ink-dim); font-size: 0.9rem; }
.updates-list h3 { margin: 0.2rem 0 0.35rem; line-height: 1.3; }
.updates-list p { margin: 0; max-width: 68ch; }

/* Collected-edition comparison */
.guide-choices, .edition-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
  gap: 1rem;
  margin: 1rem 0 1.5rem;
}

.guide-choices > div, .edition-card {
  min-width: 0;
  padding: 1rem;
  background: var(--bg-2);
  border: 1px solid rgba(245, 241, 230, 0.28);
  border-top: 3px solid var(--green);
}

.guide-choices h3, .edition-card h3 { margin: 0 0 0.35rem; line-height: 1.3; }
.guide-choices p { margin: 0; color: var(--ink-dim); }
.edition-grid { align-items: start; }
.edition-card { padding: 1.2rem; }
.edition-format, .edition-isbn, .edition-evidence, .edition-note { font-size: 0.88rem; color: var(--ink-dim); }
.edition-format { margin: 0; }
.edition-isbn span { white-space: nowrap; font-variant-numeric: tabular-nums; }
.edition-card details { border-block: 1px solid rgba(245, 241, 230, 0.28); }
.edition-card summary { min-height: 44px; padding: 0.55rem 0.2rem; cursor: pointer; font-weight: 700; }
.edition-card details ul { padding-left: 1.2rem; margin: 0.25rem 0 0.8rem; font-size: 0.93rem; }
.edition-card details li + li { margin-top: 0.4rem; }
.edition-note { padding-left: 0.7rem; border-left: 2px solid var(--yellow); }
.edition-card > :last-child { margin-bottom: 0; }
.edition-shop.reading-edition { padding: 0.6rem 0.7rem; }
.edition-overlap dt { margin: 1rem 0 0.25rem; font-weight: 800; }
.edition-overlap dd { margin: 0; max-width: 78ch; }

@media (max-width: 650px) {
  .editorial-page { width: calc(100% - 1.75rem); }
  .editorial-header.has-cover { grid-template-columns: minmax(0, 1fr); }
  .editorial-cover { display: flex; gap: 0.65rem; align-items: center; }
  .editorial-cover img { width: 3.25rem; flex: none; }
  .editorial-cover figcaption { margin-top: 0; max-width: 35ch; }
}

@media (min-width: 1050px) {
  .start-routes { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .reading-routes .reader-routes { grid-template-columns: minmax(0, 1fr); }
}

/* Compare Corps page */
.compare-selectors {
  display: flex;
  gap: 1.5rem;
  align-items: end;
  justify-content: center;
  margin: 2rem 0;
  flex-wrap: wrap;
}
.compare-select label {
  display: block;
  font-weight: 700;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
}
.compare-select select {
  padding: 0.75rem 1rem;
  font-size: 1rem;
  border-radius: 8px;
  border: 2px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  min-height: 44px;
  cursor: pointer;
}
.compare-vs {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--muted);
  padding-bottom: 0.75rem;
}
.compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin: 2rem 0;
}
.compare-card {
  border: 2px solid var(--corps, var(--line));
  border-radius: 12px;
  padding: 1.5rem;
  background: var(--card-bg, rgba(255,255,255,0.02));
}
.compare-card h2 {
  margin-top: 0;
  font-size: 1.5rem;
}
.compare-facts {
  margin: 1rem 0;
}
.compare-facts > div {
  display: flex;
  gap: 1rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--line);
}
.compare-facts dt {
  font-weight: 700;
  min-width: 100px;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.compare-facts dd {
  margin: 0;
}
.compare-oath {
  font-style: italic;
  border-left: 3px solid var(--corps, var(--line));
  padding-left: 1rem;
  margin: 1rem 0;
}

/* Owned-edition finder */
.finder-controls fieldset {
  display: grid;
  gap: 0.55rem;
  min-width: 0;
  margin: 0 0 1rem;
  padding: 0;
  border: 0;
}
.finder-controls legend { margin-bottom: 0.55rem; font-weight: 800; }
.finder-choice {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--line);
  background: var(--bg-2);
  cursor: pointer;
}
.finder-choice input { flex: none; width: 1.2rem; height: 1.2rem; accent-color: var(--green); }
.finder-choice span span { display: block; color: var(--ink-dim); font-size: 0.9rem; }
.finder-actions { display: flex; flex-wrap: wrap; gap: 0.55rem; }
.finder-actions button, .finder-share input {
  min-height: 44px;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--line);
  color: var(--ink);
  background: var(--bg-2);
  font: inherit;
}
.finder-actions button { cursor: pointer; font-weight: 700; }
.finder-actions button:first-child { color: var(--bg); background: var(--green); }
.finder-actions button:disabled { cursor: default; opacity: 0.55; }
.finder-share input { display: block; width: 100%; }
.finder-results.panel { margin-top: 1rem; border-left-color: var(--green); }
.finder-count { font-size: 1.1rem; font-weight: 800; }
.finder-owned { color: var(--ink-dim); overflow-wrap: anywhere; }
.finder-breakdown {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  gap: 0.8rem 1.3rem;
}
.finder-breakdown section, .finder-next { border-top: 1px solid var(--line); }
.finder-breakdown h4, .finder-next h4 { margin: 0.6rem 0 0.35rem; }
.finder-breakdown p, .finder-breakdown ul { margin: 0 0 0.55rem; }
.finder-breakdown ul { padding-left: 1.3rem; }
.finder-breakdown li + li { margin-top: 0.35rem; }
.finder-next { margin-top: 0.6rem; }
.finder-references { margin-top: 1.5rem; }
.finder-reference { padding: 0.55rem 0; border-top: 1px solid var(--line); }
.finder-reference summary { cursor: pointer; }
.finder-reference p { margin: 0.45rem 0 0.45rem 1rem; }

@media print {
  .edition-finder-page {
    --ink: #171717;
    --ink-dim: #333;
    --bg: #fff;
    --bg-2: #fff;
    --line: #888;
    --green: #195538;
    color: var(--ink);
    background: #fff;
  }
  .edition-finder-page .site-header, .edition-finder-page .site-footer,
  .edition-finder-page .skip-link, .edition-finder-page .editorial-crumbs,
  .edition-finder-page .editorial-related, .edition-finder-page .analytics-consent,
  .edition-finder-page .finder-controls, .finder-results .amazon-disclosure,
  .finder-results .reading-edition { display: none; }
  .edition-finder-page .editorial-page { margin: 0; padding: 0; max-width: none; }
  .edition-finder-page .editorial-header, .edition-finder-page .finder-results {
    box-shadow: none;
    text-shadow: none;
  }
  .finder-breakdown section, .finder-reference { break-inside: avoid; }
}

@media (max-width: 640px) {
  .compare-grid {
    grid-template-columns: 1fr;
  }
  .compare-selectors {
    flex-direction: column;
    align-items: stretch;
  }
  .compare-vs {
    text-align: center;
    padding: 0;
  }
}
