*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --bg: #0f1218;
  --surface: #181c26;
  --surface-hover: #1f2433;
  --border: rgba(255, 255, 255, 0.08);
  --text: #e8eaf0;
  --muted: #9aa3b5;
  --accent: #7eb8ff;
  --accent-soft: rgba(126, 184, 255, 0.14);
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "IBM Plex Sans", system-ui, sans-serif;
}

.theme-nom {
  --accent: #ff9f6b;
  --accent-soft: rgba(255, 159, 107, 0.14);
}

.theme-stomp {
  --accent: #7dffb2;
  --accent-soft: rgba(125, 255, 178, 0.12);
}

.theme-ramble {
  --accent: #c89bff;
  --accent-soft: rgba(200, 155, 255, 0.14);
}

.theme-looksie {
  --accent: #ffd56b;
  --accent-soft: rgba(255, 213, 107, 0.14);
}

html {
  height: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.glow {
  position: fixed;
  inset: -30% -20% auto;
  height: 55vh;
  background: radial-gradient(
    ellipse at 50% 0%,
    var(--accent-soft) 0%,
    transparent 70%
  );
  pointer-events: none;
  z-index: 0;
}

.glow--home {
  background: radial-gradient(
      ellipse at 20% 0%,
      rgba(255, 159, 107, 0.1) 0%,
      transparent 50%
    ),
    radial-gradient(
      ellipse at 80% 0%,
      rgba(200, 155, 255, 0.1) 0%,
      transparent 45%
    ),
    radial-gradient(
      ellipse at 50% 0%,
      rgba(125, 255, 178, 0.08) 0%,
      transparent 55%
    ),
    radial-gradient(
      ellipse at 65% 0%,
      rgba(255, 213, 107, 0.08) 0%,
      transparent 45%
    );
}

.site-header {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  max-width: 56rem;
  width: 100%;
  margin: 0 auto;
  padding: 1.25rem 1.5rem;
}

.logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
  text-decoration: none;
}

.logo:hover {
  color: var(--accent);
  text-decoration: none;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  font-size: 0.9rem;
  font-weight: 500;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a.is-active {
  color: var(--accent);
}

.page {
  position: relative;
  z-index: 1;
  flex: 1;
  width: 100%;
  max-width: 56rem;
  margin: 0 auto;
  padding: 1rem 1.5rem 3rem;
}

.page--home {
  padding-top: 0.5rem;
}

.hero {
  max-width: 40rem;
}

.hero--home {
  margin-bottom: 2.5rem;
}

.eyebrow {
  margin: 0 0 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

h1 {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.02em;
}

.lead {
  margin: 0;
  font-size: 1.125rem;
  color: var(--muted);
  max-width: 34rem;
}

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

@media (min-width: 640px) {
  .modules {
    grid-template-columns: repeat(2, 1fr);
    align-items: stretch;
  }
}

@media (min-width: 900px) {
  .modules {
    grid-template-columns: repeat(4, 1fr);
  }
}

.module-card {
  display: flex;
  flex-direction: column;
  padding: 1.35rem 1.25rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: inherit;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease,
    transform 0.15s ease;
}

.module-card:hover {
  text-decoration: none;
  background: var(--surface-hover);
  transform: translateY(-2px);
}

.module-card--nom:hover {
  border-color: rgba(255, 159, 107, 0.35);
}

.module-card--stomp:hover {
  border-color: rgba(125, 255, 178, 0.35);
}

.module-card--ramble:hover {
  border-color: rgba(200, 155, 255, 0.35);
}

.module-card--looksie:hover {
  border-color: rgba(255, 213, 107, 0.35);
}

.module-card__tag {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.module-card__title {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.2;
}

.module-card--nom .module-card__title {
  color: #ff9f6b;
}

.module-card--stomp .module-card__title {
  color: #7dffb2;
}

.module-card--ramble .module-card__title {
  color: #c89bff;
}

.module-card--looksie .module-card__title {
  color: #ffd56b;
}

.module-card__desc {
  margin: 0;
  flex: 1;
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.5;
}

.module-card__cta {
  margin-top: 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.section-intro {
  margin-bottom: 2rem;
  max-width: 36rem;
}

.posts {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.post-stub {
  padding: 1.25rem 1.35rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.post-stub__date {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.35rem;
}

.post-stub__title {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
}

.post-stub p {
  margin: 0;
  color: var(--muted);
  font-size: 0.98rem;
}

.post-card {
  display: block;
  padding: 1.25rem 1.35rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: inherit;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease,
    transform 0.15s ease;
}

.post-card:hover {
  text-decoration: none;
  background: var(--surface-hover);
  border-color: rgba(200, 155, 255, 0.35);
  transform: translateY(-1px);
}

.theme-nom .post-card:hover {
  border-color: rgba(255, 159, 107, 0.35);
}

.theme-looksie .post-card:hover {
  border-color: rgba(255, 213, 107, 0.35);
}

.post-card__date {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.35rem;
}

.post-card__title {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
}

.post-card__excerpt {
  margin: 0;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.5;
}

.page--post {
  max-width: 40rem;
}

.page--wide {
  max-width: 52rem;
}

.assembly-line {
  margin: 2rem 0 2.5rem;
  padding: 1.5rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: linear-gradient(
    165deg,
    rgba(255, 159, 107, 0.08) 0%,
    var(--surface) 45%
  );
}

.assembly-map {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.35rem 0.5rem;
  margin-bottom: 1.5rem;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.2);
}

.assembly-map__node {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 5.5rem;
  padding: 0.4rem 0.65rem;
  border-radius: 8px;
  border: 1px dashed rgba(255, 255, 255, 0.15);
  opacity: 0.75;
}

.assembly-map__node.is-filled {
  border-style: solid;
  border-color: rgba(255, 159, 107, 0.45);
  opacity: 1;
}

.assembly-map__label {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.assembly-map__value {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  text-align: center;
}

.assembly-map__arrow {
  color: var(--accent);
  font-size: 1.1rem;
  opacity: 0.8;
}

.assembly-stations {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 768px) {
  .assembly-stations {
    grid-template-columns: repeat(3, 1fr);
  }
}

.assembly-station__title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.25rem;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
}

.assembly-station__step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--accent-soft);
  color: var(--accent);
}

.assembly-station__hint {
  margin: 0 0 0.65rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.assembly-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.assembly-chip {
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease,
    transform 0.12s ease;
}

.assembly-chip:hover {
  border-color: rgba(255, 159, 107, 0.45);
  background: var(--surface-hover);
}

.assembly-chip.is-selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--text);
  transform: translateY(-1px);
}

.assembly-output {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  opacity: 0.92;
  transition: opacity 0.2s ease;
}

.assembly-output.is-ready {
  opacity: 1;
}

.assembly-path {
  margin: 0 0 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  text-align: center;
}

.assembly-output__stage {
  display: grid;
  gap: 1.25rem;
  align-items: center;
}

@media (min-width: 560px) {
  .assembly-output__stage {
    grid-template-columns: minmax(140px, 200px) 1fr;
  }
}

.assembly-art {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
}

.assembly-art svg {
  width: 100%;
  max-width: 200px;
  height: auto;
}

.assembly-hint {
  margin: 0 0 0.35rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.assembly-name {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 700;
  line-height: 1.15;
}

.assembly-region {
  margin: 0 0 0.65rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--accent);
}

.assembly-blurb {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.65;
  color: var(--muted);
}

.post-body--after {
  margin-top: 0.5rem;
}

.post-meta--sub {
  margin: -0.35rem 0 0;
  font-size: 0.95rem;
}

.spoiler-gate {
  margin: 1.75rem 0;
  padding: 1.25rem 1.35rem;
  border-radius: 12px;
  border: 1px dashed rgba(255, 213, 107, 0.45);
  background: rgba(255, 213, 107, 0.06);
  text-align: center;
}

.spoiler-gate__warn {
  margin: 0 0 1rem;
  font-size: 0.92rem;
  color: var(--muted);
}

.spoiler-gate__btn {
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 213, 107, 0.5);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.spoiler-gate__btn:hover {
  background: var(--surface-hover);
  border-color: var(--accent);
}

.character-chart {
  margin: 2rem 0 1rem;
  padding: 1.5rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: linear-gradient(
    165deg,
    rgba(255, 213, 107, 0.08) 0%,
    var(--surface) 50%
  );
}

.character-chart__title {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
}

.character-chart__lead {
  margin: 0 0 1.25rem;
  font-size: 0.92rem;
  color: var(--muted);
}

.character-grid {
  display: grid;
  gap: 1rem;
}

@media (min-width: 720px) {
  .character-grid {
    grid-template-columns: repeat(4, 1fr);
    align-items: start;
  }
}

.faction-column {
  padding: 0.85rem 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.15);
  border-top: 3px solid var(--faction-accent, var(--accent));
}

.faction-column__title {
  margin: 0 0 0.2rem;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
}

.faction-column__hint {
  margin: 0 0 0.65rem;
  font-size: 0.72rem;
  line-height: 1.35;
  color: var(--muted);
}

.faction-column__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.character-chip {
  padding: 0.4rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.character-chip:hover {
  border-color: var(--chip-accent, var(--accent));
  background: var(--surface-hover);
}

.character-chip.is-selected {
  border-color: var(--chip-accent, var(--accent));
  background: color-mix(in srgb, var(--chip-accent, var(--accent)) 18%, var(--bg));
  box-shadow: 0 0 0 1px var(--chip-accent, var(--accent));
}

.character-chip.is-linked {
  border-color: color-mix(in srgb, var(--chip-accent, var(--accent)) 55%, transparent);
  background: color-mix(in srgb, var(--chip-accent, var(--accent)) 10%, var(--bg));
}

.character-detail {
  margin-top: 1.35rem;
  padding: 1.15rem 1.25rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
}

.character-detail__empty {
  margin: 0;
  font-size: 0.92rem;
  color: var(--muted);
  text-align: center;
}

.character-detail__faction {
  margin: 0 0 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.character-detail__name {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 700;
}

.character-detail__role {
  margin: 0 0 1rem;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--muted);
}

.character-detail__links-title {
  margin: 0 0 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text);
}

.character-detail__links {
  margin: 0;
  padding-left: 1.2rem;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--text);
}

.character-detail__links li {
  margin-bottom: 0.5rem;
}

.character-link__dir {
  font-weight: 600;
  color: var(--accent);
}

.mermaid-wrap {
  overflow-x: auto;
  margin-bottom: 0.5rem;
  padding: 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.2);
}

.mermaid-wrap .mermaid {
  margin: 0;
  display: flex;
  justify-content: center;
  min-width: min(100%, 720px);
}

.mermaid-wrap svg {
  max-width: 100%;
  height: auto;
}

.plot-graph {
  margin-bottom: 0.5rem;
}

.plot-graph__scroll {
  overflow-x: auto;
  overflow-y: hidden;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
}

.plot-graph__stage {
  position: relative;
  width: 960px;
  height: 540px;
  margin: 0 auto;
}

.plot-edges {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  color: rgba(255, 213, 107, 0.55);
  pointer-events: none;
}

.plot-edge {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  transition: stroke 0.15s ease, opacity 0.15s ease;
}

.plot-edge--dashed {
  stroke-dasharray: 5 6;
  stroke-width: 1.5;
  opacity: 0.45;
}

.plot-edge.is-active {
  color: var(--accent);
  stroke-width: 2.5;
}

.plot-edge.is-dim {
  opacity: 0.12;
}

.plot-edge__label {
  font-family: var(--font-body);
  font-size: 11px;
  fill: var(--muted);
  paint-order: stroke;
  stroke: var(--bg);
  stroke-width: 3px;
  stroke-linejoin: round;
}

.plot-edge__label.is-active {
  fill: var(--accent);
  font-weight: 600;
}

.plot-edge__label.is-dim {
  opacity: 0.15;
}

.plot-nodes {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.plot-node {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0.2rem 0.45rem;
  border: 1px solid rgba(0, 0, 0, 0.35);
  border-radius: 10px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08);
  color: #1a1f28;
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.15;
  cursor: pointer;
  pointer-events: auto;
  transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.15s ease;
}

.plot-node:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.plot-node.is-selected {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  z-index: 2;
}

.plot-node.is-linked {
  outline: 2px solid color-mix(in srgb, var(--accent) 70%, white);
  outline-offset: 1px;
  z-index: 1;
}

.plot-node.is-dim {
  opacity: 0.35;
}

.plot-node__note {
  position: absolute;
  bottom: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: 140px;
  font-size: 0.62rem;
  font-weight: 500;
  text-align: center;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.2rem 0.35rem;
  pointer-events: none;
}

.plot-node__name {
  position: relative;
  z-index: 1;
}

.post-header {
  margin-bottom: 2rem;
}

.post-vibe {
  margin: 0 0 0.85rem;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.5;
  color: var(--accent);
}

.post-meta {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.post-meta__section {
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}

.post-meta__section:hover {
  text-decoration: underline;
}

.post-meta__sep {
  margin: 0 0.35rem;
}

.post-header h1 {
  margin: 0;
  font-size: clamp(1.85rem, 4.5vw, 2.35rem);
}

.post-body {
  font-size: 1.0625rem;
  line-height: 1.75;
  color: var(--text);
}

.post-body p {
  margin: 0 0 1.25rem;
}

.post-body p:last-child {
  margin-bottom: 0;
}

.post-body h2 {
  margin: 2.25rem 0 1rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text);
  letter-spacing: -0.01em;
}

.post-body h3 {
  margin: 1.75rem 0 0.75rem;
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
}

.post-body ul {
  margin: 0 0 1.25rem;
  padding-left: 1.35rem;
}

.post-body li {
  margin-bottom: 0.85rem;
  color: var(--text);
}

.post-body li:last-child {
  margin-bottom: 0;
}

.post-body blockquote {
  margin: 0 0 1.25rem;
  padding: 0.85rem 1.1rem;
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
  background: rgba(255, 255, 255, 0.04);
}

.post-body blockquote p {
  margin: 0;
  font-size: 0.98rem;
  font-style: italic;
  color: var(--muted);
}

.post-meta--sub em {
  font-style: italic;
}

.site-footer {
  position: relative;
  z-index: 1;
  max-width: 56rem;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem;
  font-size: 0.875rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
}

@media (prefers-reduced-motion: no-preference) {
  .hero--home,
  .modules {
    animation: fade-up 0.7s ease-out both;
  }

  .modules {
    animation-delay: 0.08s;
  }

  @keyframes fade-up {
    from {
      opacity: 0;
      transform: translateY(10px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}

@media (max-width: 639px) {
  .site-nav {
    width: 100%;
  }
}

/* Shown only when logged in to the publisher (see js/admin-bar.js). */
.author-toolbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  justify-content: center;
  padding: 0.65rem 1rem;
  font-size: 0.8125rem;
  font-weight: 500;
  background: rgba(15, 18, 24, 0.92);
  border-top: 1px solid var(--border);
  backdrop-filter: blur(8px);
}

.author-toolbar a {
  color: var(--accent, #ff9f6b);
  text-decoration: none;
}

.author-toolbar a:hover {
  text-decoration: underline;
}

body:has(.author-toolbar) {
  padding-bottom: 3rem;
}
