/* Self-hosted (OFL) Latin subsets; Plex Sans is one variable file for 400-600. */
@font-face { font-family: 'EB Garamond'; font-style: italic; font-weight: 400; font-display: swap; src: url('/static/eb-garamond-400-italic.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'EB Garamond'; font-style: normal; font-weight: 500; font-display: swap; src: url('/static/eb-garamond-500.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url('/static/ibm-plex-mono-400.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 500; font-display: swap; src: url('/static/ibm-plex-mono-500.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 400 600; font-display: swap; src: url('/static/ibm-plex-sans.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --bg: #0b0b0c;
  --surface: #121214;
  --line: #232326;
  --line-strong: #34343a;
  --text: #e7e4df;
  --muted: #9d9ba5;
  --faint: #807e88; /* >= 4.5:1 on --bg and --surface */
  --accent: #b52a3e;
  --accent-text: #e2697b;
  --serif: 'EB Garamond', Garamond, 'Times New Roman', serif;
  --sans: 'IBM Plex Sans', system-ui, -apple-system, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, Menlo, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--bg); color: var(--text);
  font: 15px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}
main { flex: 1; padding-block: 40px 96px; }
a { color: inherit; text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
a:hover { color: var(--accent-text); text-decoration-color: currentColor; }
h1, h2, h3, p { margin: 0; }
/* height:auto so width/height attributes reserve space without distorting the image */
img { max-width: 100%; height: auto; display: block; }
.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }
.mono { font-family: var(--mono); font-size: .9em; font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Header */
.bar { border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: 0; z-index: 10; }
.bar-inner { display: flex; align-items: center; gap: 32px; height: 56px; }
.brand { font: 500 21px/1 var(--serif); text-decoration: none; letter-spacing: -.01em; }
.brand span { color: var(--faint); }
.brand:hover { color: var(--text); }
.nav { display: flex; gap: 24px; height: 100%; }
.nav a { display: flex; align-items: center; text-decoration: none; color: var(--muted); border-bottom: 1px solid transparent; margin-bottom: -1px; }
.nav a:hover { color: var(--text); }
.nav a[aria-current] { color: var(--text); border-bottom-color: var(--accent); }
.search { margin-left: auto; }
input, select {
  font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--line); border-radius: 2px; padding: 7px 10px; height: 36px;
}
input::placeholder { color: var(--faint); }
input:focus, select:focus { outline: none; border-color: var(--line-strong); }
.search input { width: 220px; }

/* Home */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.release { color: var(--muted); margin-bottom: 24px; }
.release strong { color: var(--accent-text); font-weight: 500; }

.home-cols { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 56px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.section-head h2 { font-size: 14px; font-weight: 600; }
.section-head a { font-size: 13px; color: var(--muted); }

.log { list-style: none; margin: 0; padding: 0; }
.log li { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.log time { color: var(--muted); padding-top: 1px; }
.log a { font-weight: 500; text-decoration: none; }
.log p { color: var(--muted); margin-top: 2px; }

.index { list-style: none; margin: 0; padding: 0; }
.index li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 16px; align-items: baseline; padding: 12px 0; border-bottom: 1px solid var(--line); }
.index a { font-weight: 500; text-decoration: none; }
.index-cols { color: var(--faint); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.index .mono { color: var(--muted); }

.empty { color: var(--muted); padding: 14px 0; border-bottom: 1px solid var(--line); }

/* Page heads + compendium */
.page-head { margin-bottom: 24px; }
.page-head h1 { font: 500 44px/1 var(--serif); letter-spacing: -.02em; }
.eyebrow { font-size: 13px; margin-bottom: 8px; }
.eyebrow a { color: var(--muted); text-decoration: none; }
.eyebrow a:hover { color: var(--text); }
.page-head > p { margin-top: 12px; }
.page-desc { max-width: 64ch; color: var(--muted); font-size: 16px; margin-top: 16px; }
.page-desc p + p { margin-top: .75em; }
.tabs + .page-desc { margin: 20px 0 4px; }
.tabs { display: flex; gap: 28px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs a { padding: 10px 0; white-space: nowrap; text-decoration: none; color: var(--muted); border-bottom: 1px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--text); }
.tabs a[aria-current] { color: var(--text); border-bottom-color: var(--accent); }
.tabs .mono { color: var(--faint); margin-left: 2px; }

.filters { display: flex; gap: 8px; align-items: center; padding: 16px 0; flex-wrap: wrap; }
.filters input { width: 280px; }
.filters [data-count] { margin-left: auto; }

.table-wrap { overflow-x: auto; border-top: 1px solid var(--line); }
.entries { width: 100%; border-collapse: collapse; }
.entries th { text-align: left; font-weight: 500; font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--line); padding: 10px 12px; white-space: nowrap; }
.entries th button { all: unset; cursor: pointer; }
.entries th button:hover { color: var(--text); }
.entries th:first-child { padding-left: 0; }
.entries th[aria-sort] button { color: var(--text); }
.entries th[aria-sort="ascending"] button::after { content: ' ↑'; }
.entries th[aria-sort="descending"] button::after { content: ' ↓'; }
.entries td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.entries td:first-child { padding-left: 0; }
.entries tbody tr:hover { background: var(--surface); }
.entries td.num { font-family: var(--mono); font-size: 13.5px; text-align: right; font-variant-numeric: tabular-nums; }
.entries th.num { text-align: right; }
.entry-name { min-width: 260px; }
.entry-name a { display: flex; gap: 12px; align-items: center; text-decoration: none; }
.entry-name img { width: 40px; height: 40px; object-fit: cover; border: 1px solid var(--line); flex: none; }
.entry-name strong { font-weight: 500; display: block; }
.entry-name small { display: block; color: var(--muted); font-size: 13px; max-width: 48ch; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.entry-name a:hover strong { color: var(--accent-text); }
.tags-cell { color: var(--muted); font-size: 13px; }

/* Entry */
.crumbs { display: flex; gap: 8px; font-size: 13px; color: var(--faint); margin-bottom: 20px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.entry { display: grid; grid-template-columns: minmax(0, 680px); gap: 28px; }
.entry--image { grid-template-columns: minmax(0, 320px) minmax(0, 640px); column-gap: 48px; }
.entry--image .entry-head { grid-column: 1 / -1; }
.entry-head h1 { font: 500 clamp(36px, 6vw, 56px)/1 var(--serif); letter-spacing: -.02em; }
.entry-head time { display: block; color: var(--muted); margin-bottom: 10px; }
.entry-tags { color: var(--muted); margin-top: 12px; font-size: 14px; }
.entry-figure { margin: 0; }
.entry-figure img { width: 100%; border: 1px solid var(--line); }
.flavor { font: italic 400 21px/1.5 var(--serif); color: #cfc9c0; padding-left: 18px; border-left: 2px solid var(--accent); margin-bottom: 28px; }
.stats { margin: 0 0 28px; border-top: 1px solid var(--line); }
.stats div { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 16px; align-items: baseline; padding: 9px 0; border-bottom: 1px solid var(--line); }
.stats dt { color: var(--muted); }
.stats dd { margin: 0; white-space: pre-line; }
.prose { max-width: 66ch; }
.prose p + p { margin-top: 1em; }
.legal h2 { font: 500 24px/1.2 var(--serif); margin: 2em 0 .6em; }
.legal ul { padding-left: 1.2em; }
.legal li + li, .legal ul { margin-top: 1em; }
.source { font-size: 14px; color: var(--muted); }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 64px; border-top: 1px solid var(--line); padding-top: 16px; max-width: 1008px; }
.pager a { text-decoration: none; }
.pager a[rel="next"] { text-align: right; }
.pager small { display: block; font-size: 12px; color: var(--muted); }

/* Portrait grid (character-select style) */
.portraits { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-top: 8px; }
.home-roster { margin-bottom: 48px; }
.home-roster .portraits { margin-top: 16px; }
.portrait { display: flex; flex-direction: column; text-decoration: none; }
.portrait img, .portrait-blank {
  width: 100%; aspect-ratio: 3 / 6; object-fit: cover; object-position: top;
  background: var(--surface); border: 1px solid var(--line); transition: border-color .15s, filter .15s;
  filter: saturate(.85) brightness(.92);
}
.portrait-blank { display: grid; place-items: center; font: 500 48px var(--serif); color: var(--faint); }
.portrait:hover img, .portrait:hover .portrait-blank { border-color: var(--accent); filter: none; }
.portrait-text { padding: 10px 2px 0; }
.portrait strong { display: block; font: 500 19px/1.2 var(--serif); }
.portrait:hover strong { color: var(--accent-text); }
.portrait small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 3px; }

/* Stacked list */
.list { border-top: 1px solid var(--line); }
.list-entry { padding: 24px 0; border-bottom: 1px solid var(--line); scroll-margin-top: 72px; }
.list-entry--image { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 20px; }
/* Tall portraits become a square head-and-shoulders icon, the same footprint as item icons. */
.list-thumb { width: 72px; aspect-ratio: 1; object-fit: cover; object-position: 50% 20%; border: 1px solid var(--line); }
.list-thumb--square { aspect-ratio: auto; object-fit: contain; background: #000; }
.list-main { max-width: 860px; }
.list-main h2 { font: 500 28px/1.1 var(--serif); letter-spacing: -.01em; }
.list-main h2 a { text-decoration: none; }
.list-main .entry-tags { margin-top: 6px; }
.flavor--sm { font-size: 18px; margin: 12px 0 0; padding-left: 14px; }
.inline-stats { display: flex; flex-wrap: wrap; gap: 8px 32px; margin: 14px 0 0; }
.inline-stats dt { font-size: 12px; color: var(--muted); }
.inline-stats dd { margin: 0; }
.list .abilities { margin-top: 16px; }
.more { margin-top: 14px; }
.more summary { cursor: pointer; color: var(--muted); font-size: 13px; width: max-content; list-style: none; }
.more summary::-webkit-details-marker { display: none; }
.more summary::before { content: '+ '; font-family: var(--mono); }
.more[open] summary::before { content: '− '; }
.more summary:hover { color: var(--text); }
.more .prose { margin-top: 8px; font: italic 400 18px/1.55 var(--serif); color: #cfc9c0; }

/* Abilities (paired "X" + "X Description" columns) */
.abilities { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px 32px; }
.ability { border-top: 1px solid var(--line); padding-top: 12px; }
.ability-label { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.ability h3 { font: 500 22px/1.2 var(--serif); margin: 4px 0 6px; }
.ability h3 a { text-decoration: none; }
.ability p:not(.ability-label) { color: #c9c6c1; font-size: 14.5px; }
.list .ability h3 { font-size: 19px; }
.list .ability p:not(.ability-label) { color: var(--muted); }
.ability-cell { min-width: 200px; max-width: 320px; }
.ability-cell strong { display: block; font-weight: 500; }
.ability-cell small { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--muted); font-size: 13px; }

/* Entry sections */
.entry-section { margin-top: 36px; }
.entry-section > h2 { font-size: 13px; font-weight: 600; color: var(--muted); padding-bottom: 10px; margin-bottom: 4px; }
.entry-section .abilities { gap: 24px 40px; }
.prose--lore { font: italic 400 19px/1.6 var(--serif); color: #cfc9c0; }
.also-in { margin-top: 36px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.xref { text-decoration-color: var(--accent); }
.entry--image .entry-figure { position: sticky; top: 80px; align-self: start; }
/* Icons show at their own size (never upscaled into a blur), not stretched to the portrait column. */
.entry--icon .entry-figure img { width: auto; max-width: 100%; background: #000; }
.portrait--square img { aspect-ratio: 1; object-fit: contain; background: #000; }

/* Section badges */
.with-badge { display: inline-flex; align-items: center; gap: 8px; }
.badge { display: inline-grid; place-items: center; flex: none; width: 20px; height: 20px; border-radius: 4px; color: #fff; }
.badge svg { width: 13px; height: 13px; }
.badge span { font: 600 11px/1 var(--sans); }
.badge--red { background: #b4283b; }
.badge--amber { background: #b8771a; }
.badge--green { background: #3f8a3a; }
.badge--teal { background: #1f8580; }
.badge--blue { background: #3a66b5; }
.badge--violet { background: #7a45b8; }
.badge--rose { background: #b33a78; }
.badge--grey { background: #5b5862; }
.crumbs .badge, .also-in .badge, .tabs .badge { width: 18px; height: 18px; }
.crumbs .badge svg, .also-in .badge svg, .tabs .badge svg { width: 12px; height: 12px; }
.also-in a { margin-left: 12px; }
.entry-section > h2.with-badge { display: flex; }
.tabs a.with-badge { display: inline-flex; }

/* Report a problem */
.report { margin-top: 72px; border-top: 1px solid var(--line); padding-top: 14px; max-width: 680px; }
.report summary { cursor: pointer; color: var(--muted); font-size: 13px; width: max-content; list-style: none; }
.report summary::-webkit-details-marker { display: none; }
.report summary::before { content: '⚑ '; color: var(--accent-text); }
.report summary:hover { color: var(--text); }
.report form { display: grid; gap: 10px; margin-top: 14px; }
.report label { font-size: 14px; }
.report label .muted { display: block; font-size: 13px; margin-top: 2px; }
.report textarea { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 2px; padding: 10px; resize: vertical; min-height: 84px; }
.report textarea:focus { outline: none; border-color: var(--line-strong); }
.report-actions { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.report button { font: 500 14px var(--sans); color: #fff; background: var(--accent); border: 0; border-radius: 2px; padding: 9px 16px; cursor: pointer; }
.report button:hover { filter: brightness(1.15); }
.report button:disabled { opacity: .6; cursor: progress; }
.report-note { font-size: 12.5px; color: var(--muted); }
.report-status { font-size: 14px; color: var(--accent-text); min-height: 1em; }
.report-status:empty { display: none; }
.report-status--error { color: #e8a33d; }
/* Honeypot: invisible to people, irresistible to form-filling bots */
.report-trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Footer */
.foot { border-top: 1px solid var(--line); padding-block: 20px; font-size: 13px; color: var(--faint); }
.foot-inner { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.foot a { color: var(--muted); margin-left: 8px; }

@media (max-width: 800px) {
  main { padding-block: 28px 64px; }
  .bar-inner { height: auto; flex-wrap: wrap; gap: 4px 24px; padding-top: 12px; }
  .nav { height: 40px; }
  .search { margin: 0 0 12px; width: 100%; }
  .search input { width: 100%; }
  .home-cols, .entry--image { grid-template-columns: minmax(0, 1fr); }
  .home-cols { gap: 40px; }
  .log li { grid-template-columns: 1fr; gap: 2px; }
  .index-cols { display: none; }
  .index li { grid-template-columns: minmax(0, 1fr) auto; }
  .filters input { width: 100%; }
  .filters [data-count] { margin-left: 0; }
  .stats div { grid-template-columns: 120px minmax(0, 1fr); }
  .entry-name { min-width: 0; }
  .portraits { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .portrait strong { font-size: 16px; }
  .portrait small { display: none; }
  .list-entry--image { grid-template-columns: 52px minmax(0, 1fr); gap: 14px; }
  .list-thumb { width: 52px; }
  .entry--image .entry-figure { position: static; max-width: 200px; }
  .entry-name small { max-width: 52vw; }
}
