/* ──────────────────────────────────────────────────────────────
   Reaperborn Forge · Case study pages
   Shared dossier styling for /projects/<slug>/
   Mirrors the tokens used by the root index.html.
   ────────────────────────────────────────────────────────────── */

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

html { scroll-behavior: smooth; }

body {
  background: #0A0C10;
  color: #E8E4D8;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.5;
  background-image:
    linear-gradient(rgba(232,228,216,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(232,228,216,0.025) 1px, transparent 1px);
  background-size: 64px 64px;
  min-height: 100vh;
  overflow-x: hidden;
}

img { max-width: 100%; }

/* ── STATUS BAR ── */
.status-bar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 24px;
  align-items: center;
  padding: 14px 32px;
  border-bottom: 1px solid #1a1d24;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: rgba(232,228,216,.55);
  background: rgba(13,16,22,.8);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 100;
}
.status-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.status-brand-text {
  font-family: 'Cinzel', serif;
  letter-spacing: .32em;
  color: #E8E4D8;
}
.status-crumbs {
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: center;
  color: rgba(232,228,216,.4);
}
.status-crumbs a { color: rgba(232,228,216,.6); text-decoration: none; transition: color .2s; }
.status-crumbs a:hover { color: #C8102E; }
.status-crumbs .current { color: #E8E4D8; }

.back-btn {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  padding: 6px 14px;
  border: 1px solid #2a2f3a;
  color: rgba(232,228,216,.7);
  text-decoration: none;
  white-space: nowrap;
  transition: border-color .2s, color .2s;
}
.back-btn:hover { border-color: rgba(200,16,46,.5); color: #E8E4D8; }

/* ── HERO ── */
.case-hero {
  padding: 72px 64px;
  border-bottom: 1px solid #1a1d24;
  background: radial-gradient(ellipse 70% 70% at 25% 45%, rgba(200,16,46,.09), transparent 62%);
}
.case-hero-grid {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 64px;
  align-items: start;
}
.case-eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  letter-spacing: .32em;
  text-transform: uppercase;
  color: #C8102E;
  margin-bottom: 22px;
}
.case-title {
  font-family: 'Cinzel', serif;
  font-size: 67px;
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -.005em;
  color: #E8E4D8;
  margin-bottom: 22px;
}
.case-logline {
  font-size: 19px;
  line-height: 1.6;
  font-weight: 300;
  color: rgba(232,228,216,.78);
  max-width: 620px;
  border-left: 2px solid #C8102E;
  padding-left: 20px;
  margin-bottom: 32px;
}

/* Hero meta rows */
.case-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: #1a1d24;
  border: 1px solid #1a1d24;
  margin-bottom: 32px;
  max-width: 720px;
}
.case-meta-cell {
  background: rgba(13,16,22,.85);
  padding: 16px 18px;
}
.case-meta-key {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: #C8102E;
  margin-bottom: 8px;
}
.case-meta-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  letter-spacing: .04em;
  color: rgba(232,228,216,.82);
  line-height: 1.45;
}

/* HVC-style meta: two cells on top, a full-width row underneath */
.case-meta-hvc { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.case-meta-wide { grid-column: 1 / -1; }

/* Chips */
.chips { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 32px; }
.chip {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  padding: 8px 14px;
  border: 1px solid #1f2530;
  color: rgba(232,228,216,.75);
  background: rgba(15,18,25,.6);
}
.chip-accent {
  border-color: rgba(200,16,46,.5);
  color: #C8102E;
  background: rgba(200,16,46,.06);
}

/* PLAY button (shared vocabulary with the recruiter cards) */
.case-actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.play-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 20px 40px;
  background: #C8102E;
  border: 1px solid #C8102E;
  color: #0A0C10;
  font-family: 'JetBrains Mono', monospace;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .24em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background .2s, border-color .2s, box-shadow .2s, transform .1s;
}
.play-btn:hover {
  background: #e01530;
  border-color: #e01530;
  box-shadow: 0 0 26px rgba(200,16,46,.32);
}
.play-btn:active { transform: translateY(1px); }
.play-icon { font-size: 12px; line-height: 1; letter-spacing: 0; }

.ghost-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 20px 28px;
  background: transparent;
  border: 1px solid #2a2f3a;
  color: rgba(232,228,216,.78);
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  letter-spacing: .18em;
  text-transform: uppercase;
  text-decoration: none;
  transition: border-color .2s, color .2s;
}
.ghost-btn:hover { border-color: rgba(200,16,46,.5); color: #E8E4D8; }

.case-cover {
  display: block;
  aspect-ratio: 630 / 500;
  overflow: hidden;
  border: 1px solid #1a1d24;
  background: #0b0d12;
}
.case-cover img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* ── SECTIONS ── */
.case-section {
  padding: 72px 64px;
  border-bottom: 1px solid #15181f;
}
.section-head {
  margin-bottom: 40px;
  display: flex;
  align-items: baseline;
  gap: 24px;
  border-bottom: 1px solid #15181f;
  padding-bottom: 24px;
}
.section-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  letter-spacing: .24em;
  color: #C8102E;
  flex-shrink: 0;
}
.section-title {
  font-family: 'Cinzel', serif;
  font-size: 37px;
  font-weight: 500;
  letter-spacing: .01em;
  color: #E8E4D8;
}
.section-line { flex: 1; height: 1px; background: #15181f; align-self: center; }

.case-body { max-width: 780px; }
.case-body p {
  font-size: 17px;
  line-height: 1.68;
  font-weight: 300;
  color: rgba(232,228,216,.78);
  margin-bottom: 20px;
}
.case-body p:last-child { margin-bottom: 0; }
.case-body strong { color: #E8E4D8; font-weight: 600; }

.case-lead {
  font-size: 19px;
  color: rgba(232,228,216,.88);
}

/* Sub-heading inside a section */
.case-sub {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: #C8102E;
  margin: 36px 0 12px;
}
.case-body > .case-sub:first-child { margin-top: 0; }

/* Bullet list, dossier styled */
.case-list { list-style: none; margin: 0 0 20px; }
.case-list li {
  position: relative;
  padding: 12px 0 12px 26px;
  border-bottom: 1px solid #15181f;
  font-size: 16px;
  line-height: 1.6;
  font-weight: 300;
  color: rgba(232,228,216,.78);
}
.case-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 21px;
  width: 12px;
  height: 1px;
  background: rgba(200,16,46,.7);
}

/* Placeholder block: clearly marked, on theme, easy to replace */
.case-placeholder {
  border: 1px dashed #2a2f3a;
  background: rgba(15,18,25,.4);
  padding: 24px 26px;
  max-width: 780px;
}
.case-placeholder-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: rgba(232,228,216,.38);
  margin-bottom: 12px;
}
.case-placeholder p {
  font-size: 15px;
  line-height: 1.65;
  font-weight: 300;
  color: rgba(232,228,216,.5);
  margin-bottom: 12px;
}
.case-placeholder p:last-child { margin-bottom: 0; }

/* Artifact slots (screenshots, spreadsheets, diagrams) */
.artifact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 28px;
  max-width: 780px;
}
.artifact-slot {
  border: 1px dashed #2a2f3a;
  background: rgba(15,18,25,.4);
  aspect-ratio: 4 / 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  padding: 20px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: rgba(232,228,216,.32);
}
.artifact-slot .artifact-mark { color: rgba(200,16,46,.55); font-size: 18px; }

/* ── PAGE FOOT NAV ── */
.case-nav {
  padding: 56px 64px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  background: radial-gradient(ellipse 60% 100% at 50% 50%, rgba(200,16,46,.06), transparent 62%);
  border-bottom: 1px solid #15181f;
}
.case-nav-link {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: rgba(232,228,216,.6);
  text-decoration: none;
  transition: color .2s;
}
.case-nav-link:hover { color: #C8102E; }
.case-nav-key {
  display: block;
  font-size: 10px;
  letter-spacing: .24em;
  color: rgba(232,228,216,.32);
  margin-bottom: 6px;
}

footer {
  padding: 20px 64px;
  border-top: 1px solid #15181f;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: rgba(232,228,216,.4);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

/* ── RESPONSIVE ── */
@media (max-width: 1024px) {
  .case-hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .case-title { font-size: 54px; }
}

@media (max-width: 768px) {
  .status-crumbs { display: none; }
  .status-bar { grid-template-columns: 1fr auto; padding: 12px 20px; }
  .case-hero { padding: 44px 24px; }
  .case-title { font-size: 40px; }
  .case-meta { grid-template-columns: 1fr; }
  .case-section { padding: 48px 24px; }
  .section-title { font-size: 28px; }
  .case-actions { flex-direction: column; align-items: stretch; }
  .play-btn, .ghost-btn { width: 100%; justify-content: center; }
  .case-nav { padding: 40px 24px; flex-direction: column; align-items: flex-start; }
  footer { padding: 20px 24px; flex-direction: column; gap: 6px; }
}

/* ══════════════════════════════════════════════════════════════
   LANGUAGE SWITCH
   ══════════════════════════════════════════════════════════════ */
html[data-lang="en"] .i18n-pt,
html[data-lang="pt"] .i18n-en { display: none !important; }

.header-controls { display: flex; align-items: center; gap: 10px; }
.lang-toggle, .view-toggle {
  display: flex;
  border: 1px solid #2a2f3a;
  overflow: hidden;
  flex-shrink: 0;
}
.toggle-btn {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  padding: 6px 14px;
  background: transparent;
  border: none;
  color: rgba(232,228,216,.45);
  cursor: pointer;
  transition: background .2s, color .2s;
  text-decoration: none;
  display: inline-block;
  line-height: 1.4;
}
.toggle-btn:hover { color: rgba(232,228,216,.85); }
.toggle-btn.active {
  background: #C8102E;
  color: #0A0C10;
  font-weight: 600;
}

/* ══════════════════════════════════════════════════════════════
   DESIGN DECISIONS · numbered running text, no punchy headings
   ══════════════════════════════════════════════════════════════ */
.decisions { max-width: 820px; }
.decision {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 24px;
  padding: 32px 0;
  border-bottom: 1px solid #15181f;
}
.decision:first-child { padding-top: 0; }
.decision:last-child { border-bottom: none; padding-bottom: 0; }
.decision-idx {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: .24em;
  color: rgba(200,16,46,.85);
  padding-top: 5px;
  white-space: nowrap;
}
.decision-body p {
  font-size: 17px;
  line-height: 1.7;
  font-weight: 300;
  color: rgba(232,228,216,.8);
}

/* ══════════════════════════════════════════════════════════════
   GDD QUOTE · reads as a document excerpt, not body copy
   ══════════════════════════════════════════════════════════════ */
.gdd-quote {
  position: relative;
  max-width: 780px;
  margin: 32px 0 0;
  padding: 30px 34px 26px 44px;
  border: 1px solid #1f2530;
  border-left: 2px solid #C8102E;
  background:
    linear-gradient(rgba(200,16,46,.035), rgba(200,16,46,0)),
    rgba(15,18,25,.55);
}
.gdd-quote::before {
  content: "\201C";
  position: absolute;
  top: 4px;
  left: 12px;
  font-family: 'Cinzel', serif;
  font-size: 62px;
  line-height: 1;
  color: rgba(200,16,46,.35);
}
.gdd-quote blockquote p {
  font-family: 'JetBrains Mono', monospace;
  font-size: 16px;
  line-height: 1.72;
  font-weight: 400;
  letter-spacing: .01em;
  color: #E8E4D8;
  font-style: normal;
}
.gdd-quote figcaption {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px dashed #2a2f3a;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: rgba(232,228,216,.4);
}

/* ══════════════════════════════════════════════════════════════
   ARTIFACT TABLE · a page torn out of the design document
   ══════════════════════════════════════════════════════════════ */
.artifact-doc {
  max-width: 780px;
  margin: 36px 0 0;
  border: 1px solid #1f2530;
  background: rgba(13,16,22,.75);
}
.artifact-doc-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 14px 22px;
  border-bottom: 1px solid #1f2530;
  background: rgba(200,16,46,.05);
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: rgba(232,228,216,.55);
}
.artifact-doc-head .stamp { color: #C8102E; }
.artifact-table { width: 100%; border-collapse: collapse; }
.artifact-table th {
  text-align: left;
  padding: 14px 22px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: rgba(232,228,216,.4);
  border-bottom: 1px dashed #2a2f3a;
}
.artifact-table td {
  padding: 16px 22px;
  border-bottom: 1px dashed #1f2530;
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  font-weight: 300;
  line-height: 1.5;
  color: rgba(232,228,216,.78);
  vertical-align: top;
}
.artifact-table tr:last-child td { border-bottom: none; }
.artifact-table .tier {
  color: #E8E4D8;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-size: 12px;
  white-space: nowrap;
}
.artifact-table tr:last-child .tier { color: #C8102E; }

/* Inline artifacts sitting inside a decision block */
.decision-body .artifact-doc { margin-top: 26px; }

/* Effects roster: a light list, deliberately not a table */
.artifact-roster {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 20px 22px;
}
.roster-item {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 7px 12px;
  border: 1px solid #1f2530;
  background: rgba(15,18,25,.5);
  color: rgba(232,228,216,.78);
}

/* First column of the rewards table. Same weight as .tier, but no accent on
   the last row: there the final row is just the last row, not a top tier. */
.artifact-table .event {
  color: #E8E4D8;
  letter-spacing: .06em;
  font-size: 13px;
}

/* ══════════════════════════════════════════════════════════════
   GALLERY
   ══════════════════════════════════════════════════════════════ */
.gallery { max-width: 1180px; margin: 36px 0 0; outline: none; }
.gallery:focus-visible { outline: 1px solid rgba(200,16,46,.6); outline-offset: 6px; }
.gallery-stage {
  position: relative;
  aspect-ratio: 16 / 9;
  border: 1px solid #1f2530;
  background:
    repeating-linear-gradient(45deg, rgba(232,228,216,.012) 0 8px, transparent 8px 16px),
    #0b0d12;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.gallery-img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}
.gallery-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10,12,16,.78);
  border: 1px solid #2a2f3a;
  color: #E8E4D8;
  font-family: 'JetBrains Mono', monospace;
  font-size: 17px;
  cursor: pointer;
  transition: background .2s, border-color .2s, color .2s;
}
.gallery-arrow:hover { background: #C8102E; border-color: #C8102E; color: #0A0C10; }
.gallery-prev { left: 12px; }
.gallery-next { right: 12px; }
.gallery-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 14px;
}
.gallery-dots { display: flex; gap: 8px; flex-wrap: wrap; }
.gallery-dot {
  width: 26px;
  height: 3px;
  padding: 0;
  border: none;
  background: #2a2f3a;
  cursor: pointer;
  transition: background .2s;
}
.gallery-dot:hover { background: rgba(200,16,46,.55); }
.gallery-dot.active { background: #C8102E; }
.gallery-count {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: .22em;
  color: rgba(232,228,216,.38);
  margin-left: auto;
}
.gallery-caption {
  margin-top: 12px;
  font-size: 14px;
  font-weight: 300;
  line-height: 1.6;
  color: rgba(232,228,216,.55);
}
.gallery-single .gallery-bar { justify-content: flex-end; }
.gallery-empty {
  border: 1px dashed #2a2f3a;
  background: rgba(15,18,25,.4);
  padding: 44px 26px;
  text-align: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: .12em;
  line-height: 1.8;
  color: rgba(232,228,216,.32);
}

/* ══════════════════════════════════════════════════════════════
   CHARTS · single series, single accent, direct-labelled
   ══════════════════════════════════════════════════════════════ */
.chart-figure {
  max-width: 780px;
  margin: 40px 0 0;
  border: 1px solid #1f2530;
  background: rgba(13,16,22,.6);
  padding: 26px 28px 22px;
}
.chart-title {
  font-family: 'Cinzel', serif;
  font-size: 20px;
  font-weight: 500;
  letter-spacing: .02em;
  color: #E8E4D8;
  margin-bottom: 6px;
}
.chart-sub {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: rgba(232,228,216,.38);
  margin-bottom: 30px;
}

/* Vertical bars */
.bars-v {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 10px;
  align-items: end;
  height: 240px;
  border-bottom: 1px solid #2a2f3a;
}
.bar-v {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr;
  height: 100%;
  cursor: default;
}
.bar-track { display: flex; align-items: flex-end; }
.bar-v .bar-fill { width: 100%; }
.bar-v .bar-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  letter-spacing: .04em;
  color: rgba(232,228,216,.62);
  text-align: center;
  margin-bottom: 8px;
  transition: color .2s;
}
.bar-v .bar-fill {
  background: #C8102E;
  border-radius: 4px 4px 0 0;
  transition: background .2s, box-shadow .2s;
  min-height: 3px;
}
.bar-v:hover .bar-fill { background: #e01530; box-shadow: 0 0 20px rgba(200,16,46,.35); }
.bar-v:hover .bar-value { color: #E8E4D8; }
.bars-labels {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 10px;
  margin-top: 12px;
}
.bars-labels span {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: rgba(232,228,216,.45);
  text-align: center;
}

/* Keep the 7-bar plot legible on narrow screens: one shared scroll area,
   so bars and their labels can never drift out of alignment. */
.chart-plot { overflow-x: auto; }
.chart-plot .bars-v,
.chart-plot .bars-labels { min-width: 440px; }

/* Horizontal bars */
.bars-h { display: flex; flex-direction: column; gap: 22px; }
.bar-h-row { cursor: default; }
.bar-h-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 10px;
}
.bar-h-name {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: rgba(232,228,216,.7);
}
.bar-h-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  letter-spacing: .04em;
  color: #E8E4D8;
}
.bar-h-value .pct { color: rgba(232,228,216,.4); margin-left: 8px; }
.bar-h-track { height: 16px; background: rgba(232,228,216,.05); }
.bar-h-fill {
  height: 100%;
  background: #C8102E;
  border-radius: 0 4px 4px 0;
  transition: background .2s, box-shadow .2s;
  min-width: 3px;
}
.bar-h-row:hover .bar-h-fill { background: #e01530; box-shadow: 0 0 20px rgba(200,16,46,.32); }

/* Data table fallback under every chart */
.chart-data {
  margin-top: 24px;
  border-top: 1px solid #1f2530;
  padding-top: 14px;
}
.chart-data summary {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: rgba(232,228,216,.4);
  cursor: pointer;
  list-style: none;
}
.chart-data summary::-webkit-details-marker { display: none; }
.chart-data summary::before { content: "+ "; color: #C8102E; }
.chart-data[open] summary::before { content: "- "; }
.chart-data summary:hover { color: rgba(232,228,216,.75); }
.chart-data table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
}
.chart-data th, .chart-data td {
  text-align: left;
  padding: 9px 12px 9px 0;
  border-bottom: 1px solid #15181f;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 400;
  color: rgba(232,228,216,.7);
}
.chart-data th {
  font-size: 10px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: rgba(232,228,216,.38);
}
.chart-data td:last-child, .chart-data th:last-child { text-align: right; padding-right: 0; }

/* ══════════════════════════════════════════════════════════════
   PAIRED TEXT + ARTIFACT
   A paragraph and the artifact that belongs to it sit side by side
   from 900px up, and stack back into reading order below that.
   Paragraphs with no artifact keep the narrow measure they had.
   ══════════════════════════════════════════════════════════════ */
.paired { display: grid; gap: 24px; align-items: start; }
.paired-text > p:last-child { margin-bottom: 0; }
.paired-art > * { margin-top: 0; }
.paired-art > * + * { margin-top: 22px; }

@media (min-width: 900px) {
  .paired { grid-template-columns: minmax(0, 55fr) minmax(0, 45fr); gap: 44px; }
  /* A one-line lead-in next to a full table leaves most of a 55% column
     empty. These pairs give the artifact the room instead. */
  .paired-lead { grid-template-columns: minmax(0, 35fr) minmax(0, 65fr); }

  /* Widen only the containers that actually hold a pair. */
  .decisions { max-width: 1180px; }
  .decision-body { max-width: 732px; }
  .decision-body.has-pair { max-width: none; }
  .case-body-wide { max-width: 1180px; }
  /* Two pairs in a row: without this the second artifact butts straight
     into the bottom of the first one and they read as a single block. */
  .case-body-wide > .paired + .paired { margin-top: 52px; }

  /* The artifact column is roughly 470px, so the things built for a
     780px column need to be told how to behave in half that. */
  .paired-art .chart-figure { padding: 20px 18px 18px; }
  .paired-art .chart-plot .bars-v,
  .paired-art .chart-plot .bars-labels { min-width: 340px; }
  .paired-art .bars-v { height: 200px; }
  .paired-art .gdd-quote { padding: 26px 22px 22px 32px; }
  .paired-art .artifact-table th { padding: 12px 16px; }
  .paired-art .artifact-table td { padding: 12px 16px; }
  .paired-art .artifact-table.table-tight { min-width: 430px; }
  .paired-art .artifact-table.table-tight th,
  .paired-art .artifact-table.table-tight td { padding-left: 11px; padding-right: 11px; font-size: 12px; }
  .paired-art .diagram-body { padding: 20px 16px 16px; }
  .paired-art .diagram-pair { gap: 12px; }
  .paired-art .diagram-panel { padding: 14px 12px 12px; }
  /* Four slots across a half-width column would be unreadable; 2x2 keeps
     the two builds comparable side by side, which is the point. */
  .paired-art .sliver-slots { grid-template-columns: repeat(2, 1fr); }
  .paired-art .radial-stage { height: 176px; }
  .paired-art .artifact-roster.roster-flush { gap: 5px; }
  .paired-art .roster-flush .roster-item { font-size: 9px; padding: 5px 7px; }
}

/* Caption under an artifact, in a normal sentence. Only where it earns it. */
.artifact-caption {
  margin-top: 12px;
  font-size: 14px;
  font-weight: 300;
  line-height: 1.6;
  color: rgba(232,228,216,.5);
}

/* ══════════════════════════════════════════════════════════════
   SYSTEM DIAGRAMS · built in HTML/CSS, framed like the artifacts
   Reuses .artifact-doc for the frame and header stamp.
   ══════════════════════════════════════════════════════════════ */
.diagram-body { padding: 26px 22px 22px; }
.diagram-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.diagram-panel {
  border: 1px solid #1f2530;
  background: rgba(15,18,25,.5);
  padding: 18px 16px 16px;
}
.diagram-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: #E8E4D8;
  margin-bottom: 16px;
}
.diagram-note {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  line-height: 1.7;
  color: rgba(232,228,216,.42);
  margin-top: 14px;
}
.diagram-legend {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px dashed #2a2f3a;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: rgba(232,228,216,.55);
}
.legend-swatch { width: 13px; height: 13px; flex-shrink: 0; }

/* Class colours. Kept off the #C8102E accent so a class never reads
   as site chrome, and never as another class. */
.cls-hunter { --cls: #6FA96A; }
.cls-mage   { --cls: #8A6BC4; }
.cls-priest { --cls: #D8C48A; }
.cls-warrior{ --cls: #C86A4A; }

.legend-swatch { border: 1px solid var(--cls); background: color-mix(in srgb, var(--cls) 18%, transparent); }

/* Sliver: four ability slots, each one sourced from any class */
.sliver-slots { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.slot {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--cls);
  background:
    linear-gradient(180deg,
      color-mix(in srgb, var(--cls) 20%, transparent),
      color-mix(in srgb, var(--cls) 6%, transparent));
}
.slot-key {
  font-family: 'JetBrains Mono', monospace;
  font-size: 17px;
  font-weight: 500;
  letter-spacing: .06em;
  color: #E8E4D8;
  line-height: 1;
}
.slot-cls {
  font-family: 'JetBrains Mono', monospace;
  font-size: 8px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--cls);
  line-height: 1;
}

/* Critical: damage area vs terrain destroyed, concentric */
.radial-stage {
  position: relative;
  height: 196px;
}
.radial-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
}
.ring-terrain {
  border: 1px dashed rgba(232,228,216,.45);
  background: rgba(232,228,216,.05);
}
.ring-damage {
  border: 1px solid rgba(200,16,46,.8);
  background: rgba(200,16,46,.18);
}
.ring-hit {
  width: 5px;
  height: 5px;
  background: #E8E4D8;
  border-radius: 50%;
}
.sw-damage { border: 1px solid rgba(200,16,46,.8); background: rgba(200,16,46,.18); }
.sw-terrain { border: 1px dashed rgba(232,228,216,.45); background: rgba(232,228,216,.05); }

/* Roster chips sitting inside a diagram panel: the panel already pads */
.artifact-roster.roster-flush { padding: 0; gap: 7px; }
.roster-flush .roster-item { font-size: 10px; padding: 6px 9px; letter-spacing: .08em; }
.roster-item.roster-spent {
  border-style: dashed;
  border-color: rgba(42,47,58,.9);
  background: transparent;
  color: rgba(232,228,216,.42);
}
.roster-item.roster-open {
  border-color: rgba(200,16,46,.45);
  background: rgba(200,16,46,.07);
  color: #E8E4D8;
}

/* ── LINE CHART · single series, drawn in SVG ── */
.line-chart { display: block; width: 100%; height: auto; overflow: visible; }
.lc-grid { stroke: #171b23; stroke-width: 1; }
.lc-axis { stroke: #2a2f3a; stroke-width: 1; }
.lc-line { fill: none; stroke: #C8102E; stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.lc-dot { fill: #0A0C10; stroke: #C8102E; stroke-width: 2; }
/* Sized in viewBox units: the chart scales down to roughly 0.6 in the
   paired column, so 15 here lands near 9px on screen. */
.lc-tick {
  font-family: 'JetBrains Mono', monospace;
  font-size: 15px;
  letter-spacing: .06em;
  fill: rgba(232,228,216,.42);
}
.lc-tick-y { text-anchor: end; }
.lc-tick-x { text-anchor: middle; }

/* Charts and diagrams sitting inside a decision block */
.decision-body .chart-figure { margin-top: 26px; }

/* Five-column artifact tables need to breathe less */
.artifact-doc-scroll { overflow-x: auto; }
.artifact-table.table-tight { min-width: 560px; }
.artifact-table.table-tight th,
.artifact-table.table-tight td { padding-left: 16px; padding-right: 16px; font-size: 13px; }
.artifact-table .cls-cell {
  letter-spacing: .14em;
  text-transform: uppercase;
  font-size: 11px;
  color: var(--cls, rgba(232,228,216,.78));
}
.artifact-table .num { color: #E8E4D8; letter-spacing: .06em; }

/* ── RESPONSIVE additions ── */
@media (max-width: 640px) {
  .diagram-pair { grid-template-columns: 1fr; }
  .diagram-body { padding: 20px 16px 18px; }
  .radial-stage { height: 176px; }
  .slot-cls { font-size: 7px; letter-spacing: .1em; }
  .slot-key { font-size: 15px; }
}

@media (max-width: 768px) {
  .decision { grid-template-columns: 1fr; gap: 10px; padding: 26px 0; }
  .decision-idx { padding-top: 0; }
  .gdd-quote { padding: 26px 22px 22px 30px; }
  .gdd-quote blockquote p { font-size: 14px; }
  .artifact-table th, .artifact-table td { padding-left: 16px; padding-right: 16px; }
  .artifact-table td { font-size: 13px; }
  .artifact-table .event { font-size: 12px; }
  .artifact-roster { padding: 16px; gap: 6px; }
  .roster-item { font-size: 11px; padding: 6px 9px; letter-spacing: .06em; }
  .chart-figure { padding: 20px 18px 18px; }
  .bars-v { height: 190px; gap: 6px; }
  .bars-labels { gap: 6px; }
  .bar-v .bar-value { font-size: 10px; }
  .bars-labels span { font-size: 9px; letter-spacing: .08em; }
  .gallery-arrow { width: 36px; height: 36px; }
  .header-controls { gap: 6px; }
  .toggle-btn { padding: 6px 9px; letter-spacing: .1em; }
}

/* ══════════════════════════════════════════════════════════════
   TWO-SERIES LINE CHART · a before/after comparison
   The accent series is the one that shipped; the muted dashed
   series is the curve it replaced. Same geometry as .lc-line.
   ══════════════════════════════════════════════════════════════ */
.lc-line-alt {
  fill: none;
  stroke: rgba(232,228,216,.42);
  stroke-width: 2.5;
  stroke-dasharray: 9 7;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.lc-dot-alt { fill: #0A0C10; stroke: rgba(232,228,216,.42); stroke-width: 2; }

/* Legend under a chart, same shape as .diagram-legend */
.chart-legend {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px dashed #2a2f3a;
}
.sw-line { border: 1px solid #C8102E; background: rgba(200,16,46,.38); }
.sw-line-alt { border: 1px dashed rgba(232,228,216,.45); background: rgba(232,228,216,.06); }

/* A horizontal bar that reads as the remainder, not as a result */
.bar-h-fill.fill-muted { background: rgba(232,228,216,.16); }
.bar-h-row:hover .bar-h-fill.fill-muted { background: rgba(232,228,216,.24); box-shadow: none; }

/* Three-column data tables under a chart keep the last column right-aligned
   by the existing rule; the middle one needs to follow it. */
.chart-data td:nth-last-child(2), .chart-data th:nth-last-child(2) { text-align: right; }

/* A long decision can carry more than one paired row */
.decision-body .paired + .paired { margin-top: 34px; }

/* Two values on one track: the muted fill is the limit, the accent
   fill is the measured value that has to fit inside it. */
.bar-h-track.track-pair { position: relative; }
.track-pair .bar-h-fill { position: absolute; left: 0; top: 0; }
