:root {
  --bg: #f5f5f8; --surface: #ffffff; --surface-2: #ebebf0; --text: #1d1b22; --muted: #63616e; --border: #e0dfe7;
  --accent: #6a3cc0; --accent-2: #8a5be0; --accent-soft: #f1eafc; --link: #6a3cc0;
  --warm: #a85a08; --warm-soft: #fdf0dc; --warm-border: #ecd3a4;
  --slot: #ededf1; --slot-b: #d3d2db;
  --add-bg: #d9f5dc; --add-fg: #14532d; --del-bg: #fbdcdc; --del-fg: #7f1d1d;
  --shadow: 0 1px 2px rgba(30, 20, 50, .05), 0 6px 20px rgba(30, 20, 50, .05);
  --radius: 12px; --top-h: 58px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
/* the theme is set on <html> before first paint (see layout.tsx): the reader's choice, else the system's */
:root[data-theme=dark] {
  --bg: #111015; --surface: #1a1920; --surface-2: #24222b; --text: #ece9f2; --muted: #9a96a6; --border: #2e2b37;
  --accent: #b794f6; --accent-2: #9a74e8; --accent-soft: #2a2140; --link: #c3a6f8;
  --warm: #f0b25c; --warm-soft: #33260f; --warm-border: #5c4a22;
  --slot: #26242d; --slot-b: #3a3745;
  --add-bg: #173a22; --add-fg: #b9f0c6; --del-bg: #3e1d1d; --del-fg: #f3b9b9;
  --shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 8px 24px rgba(0, 0, 0, .25);
  color-scheme: dark;
}

* { box-sizing: border-box; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: color-mix(in srgb, var(--accent) 28%, transparent); }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--top-h) + 60px); }
body {
  margin: 0; background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased;
  font: 15px/1.6 system-ui, -apple-system, "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
code, .id { font-family: var(--mono); font-size: .82em; color: var(--muted); }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; letter-spacing: .01em; }
h1 { font-size: 2rem; }
h2 { font-size: 1.3rem; margin-top: 1.8em; }
h3 { font-size: 1rem; }
kbd {
  font: 11px var(--mono); padding: 2px 6px; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 5px;
  color: var(--muted); background: var(--surface-2);
}

/* ---------------------------------------------------------------- layout */
.top {
  position: sticky; top: 0; z-index: 20; border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.top-in { max-width: 1180px; margin: 0 auto; padding: 0 20px; min-height: var(--top-h); display: flex; gap: 14px; align-items: center; }
.backbtn { display: inline-flex; align-items: center; gap: 5px; flex: none; padding: 6px 9px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); color: var(--muted); font: inherit; font-size: .86rem; cursor: pointer; }
.backbtn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.backbtn span:first-child { font-size: 1.1rem; line-height: 1; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; color: var(--text); font-size: 1.05rem; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand i { width: 22px; height: 22px; border-radius: 6px; background: var(--accent); transform: rotate(45deg) scale(.72); }
.nav { display: flex; gap: 2px; }
.nav a { padding: 6px 10px; border-radius: 8px; color: var(--muted); font-size: .93rem; white-space: nowrap; }
.nav a:hover, .nav a.cur { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav a.cur { font-weight: 600; }
.search { flex: 1; min-width: 140px; max-width: 420px; margin-left: auto; display: flex; position: relative; }
.search input[name=q] {
  width: 100%; height: 36px; padding: 0 40px 0 12px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); color: var(--text); font: inherit; font-size: .93rem; outline: 0;
}
.search input[name=q]:hover, .search input[name=q]:focus { border-color: var(--accent); }
.search input[name=q]:focus { box-shadow: 0 0 0 3px var(--accent-soft); }
.search kbd { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.search input:focus ~ kbd { display: none; }
.suggest {
  position: absolute; top: 100%; left: 0; right: 0; margin-top: 6px; z-index: 30; background: var(--surface); text-align: left;
  border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 16px 40px rgba(0, 0, 0, .22); overflow: hidden; padding: 6px;
}
.suggest a { display: flex; gap: 10px; align-items: center; padding: 6px 10px; border-radius: 8px; color: var(--text); font-size: .93rem; }
.suggest a.on, .suggest a:hover { background: var(--accent-soft); text-decoration: none; }
.suggest b { font-weight: 600; }
.suggest small { display: block; color: var(--muted); font-size: .75rem; }
.suggest .icon { width: 24px; height: 24px; }
.iconbtn {
  width: 34px; height: 34px; display: grid; place-items: center; flex: none; border: 1px solid var(--border); border-radius: 9px;
  background: var(--surface); color: var(--text); cursor: pointer; font-size: 15px; padding: 0;
}
.iconbtn:hover { border-color: var(--accent); }
.crumbs { font-size: .85rem; color: var(--muted); margin-bottom: 14px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--accent); }
.lang { font-size: .85rem; color: var(--muted); white-space: nowrap; }
.lang a { color: var(--muted); }
.lang a.cur { color: var(--text); font-weight: 600; }
main { max-width: 1180px; margin: 0 auto; padding: 22px 20px 64px; }
.foot { max-width: 1180px; margin: 0 auto; padding: 16px 20px 30px; color: var(--muted); font-size: .82rem; text-align: center; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.pill {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; border-radius: 999px;
  background: var(--surface-2); color: var(--text); font-size: .82rem; white-space: nowrap;
}
a.pill:hover { background: var(--accent-soft); color: var(--accent); text-decoration: none; }
.pill.warn { background: var(--warm-soft); color: var(--warm); }
.pill.cur { background: var(--accent-soft); color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); font-weight: 600; }
.pill code { font-size: .95em; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.row { display: flex; gap: 10px; align-items: center; }
.sech { display: flex; align-items: baseline; gap: 10px; margin: 40px 0 14px; }
.sech h2 { margin: 0; }
.sech .more { margin-left: auto; font-size: .85rem; }

/* ---------------------------------------------------------------- icons and slots */
.icon {
  display: inline-block; width: 32px; height: 32px; flex: none;
  background-size: 100% auto; background-position: top center; background-repeat: no-repeat;
  image-rendering: pixelated; vertical-align: middle;
}
.icon.big { width: 64px; height: 64px; }
/* game-rendered icons (URL ends in #g) are 128px renders, not pixel art */
.icon[style*="#g"] { image-rendering: auto; }
.icon.sm { width: 20px; height: 20px; }
.icon.none {
  background: var(--surface-2); border-radius: 4px; color: var(--muted);
  font-size: 11px; line-height: 32px; text-align: center; overflow: hidden;
}
.icon.big.none { line-height: 64px; font-size: 20px; }
.icon.sm.none { line-height: 20px; font-size: 9px; }

.slot {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; flex: none; border-radius: 7px; background: var(--slot); box-shadow: inset 0 0 0 1px var(--slot-b);
}
.slot:not(.empty):not(.air):hover { box-shadow: inset 0 0 0 2px var(--accent); background: var(--accent-soft); }
.slot.empty { opacity: .5; }
.slot .opt { display: none; }
.slot .opt.on, .slot:not(.cycle) .opt { display: inline-flex; }
.slot .n {
  position: absolute; right: 3px; bottom: 1px; font: 700 12px/1 var(--mono); color: #fff;
  text-shadow: 1px 1px 0 #000, -1px 0 0 #0006; pointer-events: none;
}
.slot .badge {
  position: absolute; left: 3px; top: 2px; font: 700 10px/1 var(--mono); color: var(--accent); pointer-events: none;
}
.slot.kept { outline: 2px dashed var(--accent); outline-offset: 1px; }
.slot.out { width: 54px; height: 54px; border-radius: 10px; box-shadow: inset 0 0 0 1px var(--slot-b), 0 0 0 3px var(--accent-soft); }
.slot.out .icon { width: 40px; height: 40px; }
.outs { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.slot.special { color: var(--muted); font-weight: 700; }

.aspect {
  display: inline-flex; align-items: center; gap: 4px; font-size: .82rem; color: var(--text); padding: 2px 9px 2px 5px; border-radius: 999px;
  background: color-mix(in srgb, var(--c, var(--muted)) 14%, var(--surface)); border: 1px solid color-mix(in srgb, var(--c, var(--muted)) 35%, var(--border));
}
a.aspect:hover { text-decoration: none; border-color: var(--c, var(--accent)); }
.aspect .icon { width: 18px; height: 18px; }
.aspicon {
  image-rendering: auto; background-size: contain; background-blend-mode: multiply;
  -webkit-mask-size: contain; mask-size: contain; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-position: center; mask-position: center; background-position: center;
}
.aspect .amt { font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- recipes */
.recipes { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.recipe {
  position: relative; display: flex; flex-direction: column; min-width: 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
.recipe:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); }
.recipe > header { display: flex; align-items: center; gap: 6px; padding: 10px 12px 0; flex-wrap: wrap; font-size: .82rem; }
.recipe > header .t { color: var(--text); font-weight: 600; font-size: .93rem; }
.recipe > header a.t:hover { color: var(--accent); text-decoration: none; }
.recipe > header .t .x { color: var(--muted); font-weight: 400; }
.recipe > header .cat { display: inline-flex; gap: 4px; align-items: center; color: var(--muted); }
.recipe > header .cat .icon { width: 16px; height: 16px; }
.recipe .body { flex: 1; display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; padding: 14px 12px; min-height: 150px; }
.recipe .arrow { font-size: 20px; color: var(--muted); }
/* the infusion ring is as wide as a card: its result goes below */
.recipe .body.col { flex-direction: column; flex-wrap: nowrap; gap: 6px; }
.recipe .body.col .arrow { line-height: 1; }
.recipe > footer { border-top: 1px dashed var(--border); padding: 9px 12px; display: flex; flex-direction: column; gap: 6px; font-size: .85rem; }
.recipe .meta { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.recipe .k { color: var(--muted); font-size: .78rem; margin-right: 4px; }
.recipe .note { color: var(--muted); font-size: .82rem; }
/* where the data comes from: tucked behind (i) */
.recipe .info { margin-left: auto; }
.recipe .info > summary {
  list-style: none; cursor: pointer; color: var(--muted); width: 22px; height: 22px; display: grid; place-items: center;
  border-radius: 6px; opacity: .7;
}
.recipe .info > summary::-webkit-details-marker { display: none; }
.recipe:hover .info > summary, .recipe .info[open] > summary { opacity: 1; }
.recipe .info > summary:hover { background: var(--surface-2); }
.recipe .pop {
  position: absolute; z-index: 5; left: 8px; right: 8px; top: 36px; padding: 10px 12px; border-radius: 10px; font-size: .8rem;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 4px;
}
.recipe .pop code { word-break: break-all; }
.recipe .pop .new { color: var(--accent); }
/* recipes of one item, by workstation */
.rgroup { margin-bottom: 18px; }
.rgroup > summary {
  list-style: none; display: flex; align-items: center; gap: 8px; padding: 6px 4px; cursor: pointer; font-weight: 600; border-radius: 8px;
}
.rgroup > summary::-webkit-details-marker, details.more > summary::-webkit-details-marker { display: none; }
.rgroup > summary:hover { background: var(--surface-2); }
.rgroup > summary .icon { width: 24px; height: 24px; }
.count { font-weight: 400; font-size: .78rem; color: var(--muted); padding: 1px 7px; border-radius: 999px; background: var(--surface-2); }
.chev {
  margin: 0 6px 0 auto; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(-135deg); transition: transform .15s;
}
.rgroup[open] > summary .chev { transform: rotate(45deg); }
.rgroup > .recipes, .rgroup > details.more { margin-top: 8px; }
details.more > summary {
  list-style: none; margin-top: 10px; padding: 9px; border-radius: 10px; border: 1px dashed var(--border); color: var(--accent);
  font-size: .93rem; cursor: pointer; text-align: center;
}
details.more > summary:hover { background: var(--accent-soft); }
details.more[open] > summary { display: none; }
details.more > .recipes { margin-top: 12px; }
.diff { margin-top: 40px; }
.diff h2 { font-size: 1.15rem; margin: 0 0 4px; }
.diff > p { margin: 0 0 12px; max-width: 46em; }
.stat { display: flex; gap: 10px; flex-wrap: wrap; margin: 12px 0 4px; }
.gridslots { display: grid; gap: 3px; }
.shapeless { display: grid; grid-template-columns: repeat(3, 40px); gap: 3px; }
.smithing { display: flex; gap: 4px; }
.infusion { position: relative; width: 168px; height: 168px; flex: none; border-radius: 50%; background: radial-gradient(circle, var(--accent-soft) 0 28%, transparent 29%); }
.infusion .slot { position: absolute; }
.infusion .center { left: 64px; top: 64px; }
.crucible { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.flame { width: 18px; height: 18px; color: var(--warm); }
.iconbtn svg, .recipe .info svg { width: 16px; height: 16px; }
.dyn { flex: 1; padding: 14px 12px; font-size: .85rem; color: var(--muted); }
details.family { grid-column: 1 / -1; }
details.family > summary { cursor: pointer; color: var(--link); font-size: .9rem; padding: 0 4px; }
details.family > .recipes { margin-top: 8px; }

/* ---------------------------------------------------------------- item page */
.itemhead { display: flex; gap: 18px; align-items: center; margin-bottom: 8px; }
.itemhead h1 { margin: 0; }
.itemhead .sub { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.bigicon {
  width: 88px; height: 88px; border-radius: 18px; flex: none; display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
}
.bigicon + .bigicon { margin-left: -8px; }
.idchip { font: 12px var(--mono); padding: 3px 8px; border-radius: 6px; background: var(--surface-2); color: var(--muted); border: 0; cursor: pointer; overflow-wrap: anywhere; text-align: left; }
.idchip:hover { color: var(--accent); }
.idchip::after { content: ""; display: inline-block; width: 12px; height: 12px; margin-left: 6px; vertical-align: -1px; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.5'%3E%3Crect x='5.5' y='5.5' width='8' height='8' rx='1.5'/%3E%3Cpath d='M10.5 3.5v-1h-8v8h1'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.5'%3E%3Crect x='5.5' y='5.5' width='8' height='8' rx='1.5'/%3E%3Cpath d='M10.5 3.5v-1h-8v8h1'/%3E%3C/svg%3E") center / contain no-repeat; }
.idchip.done::after { color: var(--accent); -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M3 8.5l3.5 3.5L13 4.5'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M3 8.5l3.5 3.5L13 4.5'/%3E%3C/svg%3E"); }
.secnav {
  position: sticky; top: var(--top-h); z-index: 10; margin: 20px 0 0; display: flex; gap: 4px; overflow-x: auto;
  background: var(--bg); border-bottom: 1px solid var(--border);
}
.secnav a { padding: 11px 14px; font-size: .93rem; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.secnav a:hover { color: var(--text); text-decoration: none; }
.secnav a.cur { color: var(--text); border-color: var(--accent); font-weight: 600; }
.secnav a .count { margin-left: 4px; }
section.blk { padding-top: 28px; }
section.blk > h2 { margin-top: 0; display: flex; align-items: baseline; gap: 8px; }
section.blk > h2 .n { font-size: .93rem; color: var(--muted); font-weight: 400; }
.props { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: .93rem; margin: 0; }
.props dt { color: var(--muted); }
.props dd { margin: 0; min-width: 0; text-align: right; }
.props dd code { overflow-wrap: anywhere; }
.props.stats dd { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.props.stats .chips { justify-content: flex-end; }
.props.stats small { font-size: .78rem; }
.layout2 { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 32px; align-items: start; }
.side { position: sticky; top: calc(var(--top-h) + 62px); margin-top: 28px; max-height: calc(100vh - var(--top-h) - 80px); overflow-y: auto; scrollbar-width: thin; }
.side > .card { padding: 14px 16px; box-shadow: none; }
.side > .card + .card { margin-top: 12px; }
.side h3 { font-size: .8rem; letter-spacing: 0; color: var(--muted); font-weight: 600; margin-bottom: 10px; }
@media (max-width: 860px) {
  .layout2 { grid-template-columns: 1fr; gap: 0; }
  .side { position: static; max-height: none; margin-top: 20px; order: -1; }
  .bigicon { width: 64px; height: 64px; border-radius: 14px; }
  .bigicon .icon.big { width: 44px; height: 44px; }
}

.itemlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 2px 12px; margin: 0 -10px; }
.itemrow { display: flex; gap: 10px; align-items: center; padding: 6px 10px; border-radius: 10px; min-width: 0; color: var(--text); line-height: 1.35; }
.itemrow:hover { background: var(--accent-soft); text-decoration: none; }
.itemrow:hover .nm { color: var(--accent); }
.catsec > h3 { margin: 32px 0 8px; font-size: 1.05rem; }
.catsec > h3 a { color: var(--text); }
.catsec > p { margin: 8px 0 0; }
.itemrow .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.itemrow .amt { margin-left: auto; font-weight: 600; font-size: .85rem; font-variant-numeric: tabular-nums; color: var(--muted); }

/* ---------------------------------------------------------------- thaumonomicon */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.tabs a { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); color: var(--text); }
.tabs a.cur { background: var(--accent-soft); border-color: var(--accent); }
.tree-wrap { overflow: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); background-size: cover; max-height: 75vh; }
.tree { position: relative; margin: 24px; }
.tree svg { position: absolute; inset: 0; overflow: visible; pointer-events: none; }
.tree svg line { stroke: var(--muted); stroke-width: 2; opacity: .55; }
.tree svg line.hidden { stroke-dasharray: 4 4; opacity: .35; }
.node {
  position: absolute; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
  background: var(--surface); border: 2px solid var(--border); border-radius: 8px; transform: translate(-50%, -50%);
}
.node.round { border-radius: 50%; }
.node.special { border-color: var(--accent); }
.node.flagged { opacity: .7; border-style: dashed; }
.node:hover { border-color: var(--accent); z-index: 2; text-decoration: none; }
.node .lbl {
  display: none; position: absolute; top: 100%; left: 50%; transform: translateX(-50%); margin-top: 4px;
  white-space: nowrap; font-size: .75rem; background: var(--text); color: var(--bg); padding: 1px 6px; border-radius: 4px;
}
.node:hover .lbl { display: block; }
.booktext { line-height: 1.85; }
.booktext hr { border: 0; border-top: 1px dashed var(--border); margin: 12px 0; }
.bookimg { display: inline-block; vertical-align: middle; background-repeat: no-repeat; image-rendering: pixelated; }
.bookimg.big { display: block; margin: 12px auto; max-width: 100%; }
.page { margin-top: 20px; }
.page.prose { max-width: 46em; }
.page > h2 { margin-top: 0; }
.mc-l { font-weight: 700; } .mc-o { font-style: italic; } .mc-n { text-decoration: underline; } .mc-m { text-decoration: line-through; }
.mc-0 { color: inherit; } .mc-1 { color: #2a2ab0; } .mc-2 { color: #1f8f1f; } .mc-3 { color: #1f8f8f; }
.mc-4 { color: #a51d1d; } .mc-5 { color: #8a2a9a; } .mc-6 { color: #b98400; } .mc-7 { color: #7a7a7a; }
.mc-8 { color: #555; } .mc-9 { color: #4a4ae0; } .mc-a { color: #2fae2f; } .mc-b { color: #2aa8b8; }
.mc-c { color: #d84848; } .mc-d { color: #c04bd0; } .mc-e { color: #b0a000; } .mc-f { color: inherit; }
:root[data-theme=dark] .mc-1 { color: #8a8af0; } :root[data-theme=dark] .mc-5 { color: #d38ae0; }
:root[data-theme=dark] .mc-8 { color: #aaa; } :root[data-theme=dark] .mc-4 { color: #f07070; }

/* ---------------------------------------------------------------- aspects */
.aspgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.aspcard { display: flex; gap: 10px; align-items: center; padding: 8px 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; color: var(--text); }
.aspcard .icon { width: 32px; height: 32px; image-rendering: auto; }
.aspcard small { display: block; color: var(--muted); }
/* ---------------------------------------------------------------- home */
.home-head { padding: 36px 0 4px; text-align: center; }
.home-head h1 { font-size: 2.4rem; margin: 0 0 8px; letter-spacing: 0; }
.home-head > p { color: var(--muted); margin: 0 auto 24px; max-width: 72ch; }
.search.big { max-width: 640px; margin: 0 auto; gap: 8px; }
.search.big input[name=q] { height: 52px; padding: 0 18px; border-radius: 14px; font-size: 1rem; }
.search.big button {
  flex: none; height: 52px; padding: 0 24px; border: 0; border-radius: 14px; background: var(--accent); color: var(--surface);
  font: inherit; font-weight: 600; cursor: pointer;
}
.search.big button:hover { background: var(--accent-2); }
.hot { margin-top: 14px; display: flex; gap: 6px 12px; justify-content: center; flex-wrap: wrap; font-size: .85rem; color: var(--muted); }
/* each mod is its own framed block, numbered on the top edge, so where one mod ends and the next begins is plain */
#mods { counter-reset: hmod; }
.hmod {
  counter-increment: hmod; position: relative; margin-top: 40px; padding: 26px 22px 22px;
  border: 1.5px solid var(--border); border-left: 4px solid var(--accent); border-radius: var(--radius);
  transition: border-color .15s;
}
.hmod::before {
  content: "MOD-" counter(hmod, decimal-leading-zero); position: absolute; top: -.75em; left: 16px; padding: 0 8px;
  background: var(--bg); color: var(--accent); font: 700 12px/1.5 var(--mono); letter-spacing: .08em;
}
.hmod:hover, .hmod:focus-within { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); border-left-color: var(--accent); }
.hmod-h { display: flex; gap: 14px; align-items: center; margin-bottom: 16px; min-width: 0; }
.hmod-h h2 { margin: 0 0 2px; font-size: 1.4rem; }
.hmod-h h2 a { color: inherit; }
.hmod-h .more { margin-left: auto; font-size: .85rem; white-space: nowrap; }
.micon { width: 52px; height: 52px; border-radius: 12px; background: var(--surface-2); display: grid; place-items: center; flex: none; font-weight: 700; color: var(--muted); font-size: 1.3rem; }
.micon:hover { text-decoration: none; }
.micon .icon { width: 36px; height: 36px; }
/* mod logos are banners of any shape (Thaumcraft 265x36, Singularity Iteration 480x128, vanilla's 64x64 pack.png):
   fit them to a height and let the width follow */
.micon.mlogo { width: auto; min-width: 52px; max-width: 200px; padding: 6px 10px; }
.micon.mlogo img, .modlogo img { display: block; height: 100%; max-height: 40px; max-width: 100%; object-fit: contain; }
.modlogo { flex: none; display: flex; align-items: center; height: 64px; max-width: 260px; padding: 8px 12px; background: var(--surface-2); border-radius: 12px; }
.modlogo img { max-height: 48px; }
.modsw .ml { width: 56px; height: 20px; display: flex; align-items: center; justify-content: center; flex: none; }
.modsw .ml img { max-width: 56px; max-height: 20px; object-fit: contain; }
.modbar .mname { display: flex; align-items: center; gap: 8px; }
.modbar .mname img { max-height: 22px; max-width: 90px; object-fit: contain; }
.topics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.topics a { display: flex; gap: 14px; align-items: center; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); min-width: 0; }
.topics a:hover { border-color: var(--accent); background: var(--accent-soft); text-decoration: none; }
.topics .icon { width: 40px; height: 40px; flex: none; }
.topics b { display: block; }
.topics span span { font-size: .85rem; color: var(--muted); }
.dirlabel { margin: 22px 0 6px; font-size: .85rem; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.dir { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 2px 12px; margin: 0 -10px; }
.dir a { display: flex; gap: 10px; align-items: center; padding: 7px 10px; border-radius: 10px; color: var(--text); min-width: 0; }
.dir a:hover { background: var(--accent-soft); color: var(--accent); text-decoration: none; }
.dir .icon { flex: none; }
.dir .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dir i { flex: none; font-style: normal; font-size: .85rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.home-head a:focus-visible, .hmod a:focus-visible, .search.big button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.two { display: grid; grid-template-columns: 1.6fr 1fr; gap: 28px; }
.eicon { width: 36px; height: 36px; border-radius: 8px; background: var(--surface-2); display: grid; place-items: center; flex: none; }
.eicon .icon { width: 24px; height: 24px; }
.glist { display: grid; gap: 6px; }
.wanted { display: block; padding: 10px 12px; border-radius: 10px; background: var(--warm-soft); color: var(--warm); font-size: .85rem; }
/* item tooltip, filled by the script in layout.tsx */
#tip {
  position: fixed; z-index: 50; pointer-events: none; padding: 8px 11px; border-radius: 9px; max-width: 280px; display: none;
  background: #191222; color: #fff; border: 1px solid #5b3ea0; box-shadow: 0 8px 24px rgba(0, 0, 0, .35); font-size: 13px; line-height: 1.45;
}
#tip b { display: block; font-size: 14px; }
#tip code { color: #b6a8d6; font-size: 11px; display: block; overflow-wrap: anywhere; }
#tip u { text-decoration: none; color: #f0b25c; font-size: 12px; display: block; white-space: pre-line; }
#tip i { color: #8fa8ff; font-size: 12px; display: block; }
@media (max-width: 860px) {
  .top { position: static; }
  .top-in { flex-wrap: wrap; padding: 8px 16px; gap: 8px 10px; }
  .nav { order: 5; width: 100%; overflow-x: auto; }
  .search kbd { display: none; }
  .secnav { top: 0; }
  html { scroll-padding-top: 56px; }
  main { padding: 16px 16px 48px; }
  .home-head { padding-top: 20px; }
  .home-head h1 { font-size: 1.9rem; }
  .search.big button { padding: 0 16px; }
  .two, .topics { grid-template-columns: 1fr; }
  .hmod { margin-top: 32px; padding: 22px 14px 16px; }
  .hmod-h { flex-wrap: wrap; }
  .hmod-h > div { flex: 1 1 170px; }
  .hmod-h .more { margin-left: 66px; width: 100%; }
  .dir { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* ---------------------------------------------------------------- structures */
.iso { position: relative; flex: none; margin: 8px; }
.isocell { position: absolute; }
.isocell .icon { width: 64px; height: 64px; }
.isocell.off { visibility: hidden; }
.isocell.dim { filter: saturate(.5) brightness(.75); }
.stmats { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
.stmat { display: inline-flex; align-items: center; gap: 8px; font-size: .9rem; }
.stbody { display: flex; flex-wrap: wrap; gap: 20px 32px; align-items: flex-start; }
.stview { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.ststeps { display: flex; gap: 4px; align-items: center; }
.ststep {
  font: inherit; font-size: .82rem; min-width: 30px; padding: 3px 9px; border-radius: 8px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
}
.ststep:hover { border-color: var(--accent); }
.ststep.cur { background: var(--accent-soft); border-color: var(--accent); font-weight: 600; }
.layers { display: flex; gap: 16px; flex-wrap: wrap; }
.layer { padding: 6px 8px 8px; border-radius: 10px; border: 1px solid transparent; }
.layer.cur { border-color: var(--accent); background: var(--accent-soft); }
.layer.off { opacity: .4; }
.slot.air.mini { display: inline-flex; width: 18px; height: 18px; vertical-align: middle; align-items: center; justify-content: center; }
.sthint { margin: 10px 0 0; }
.layer .gridslots { margin-top: 4px; }
.slot.air { color: var(--muted); font-weight: 700; background: transparent; box-shadow: none; outline: 1px dashed var(--slot-b); outline-offset: -1px; }
.structure .rid { font-size: .72rem; margin-top: 8px; color: var(--muted); font-family: var(--mono); }

/* ---------------------------------------------------------------- guides, forms */
.guide { margin: 16px 0; }
section.blk > .guide { margin: 0; }
.md { line-height: 1.8; overflow-wrap: anywhere; }
.md h1, .md h2, .md h3 { margin: 1em 0 .4em; }
.md pre { background: var(--surface-2); padding: 10px; border-radius: 8px; overflow-x: auto; }
.md code { color: var(--text); }
.md blockquote { margin: 0; padding-left: 12px; border-left: 3px solid var(--border); color: var(--muted); }
.md table { border-collapse: collapse; } .md th, .md td { border: 1px solid var(--border); padding: 4px 8px; }
.md .embed-recipe { max-width: 520px; margin: 10px 0; }
.form { display: flex; flex-direction: column; gap: 10px; }
.form label { display: flex; flex-direction: column; gap: 4px; font-size: .9rem; color: var(--muted); }
.form input, .form select, .form textarea, .inline select, .inline input[type=password] {
  font: inherit; padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text);
}
.editor textarea { font-family: var(--mono); font-size: .9rem; line-height: 1.5; width: 100%; min-height: 360px; }
.btn { font: inherit; padding: 7px 16px; border-radius: 8px; border: 1px solid var(--accent); background: var(--accent); color: var(--surface); cursor: pointer; }
.btn.ghost { background: transparent; color: var(--accent); }
.linkbtn { font: inherit; border: 0; background: none; padding: 0; color: var(--muted); cursor: pointer; }
.linkbtn:hover { text-decoration: underline; }
form.inline { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: 0; }
.diffview { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 10px; white-space: pre-wrap; font-size: .85rem; overflow-x: auto; }
.diffview .add { background: var(--add-bg); color: var(--add-fg); }
.diffview .del { background: var(--del-bg); color: var(--del-fg); text-decoration: line-through; }
.warnbox { border-color: var(--warm-border); margin-bottom: 12px; }

table.packs { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.packs th, table.packs td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--border); }
table.packs th { color: var(--muted); font-weight: 500; }

.hatnote { margin: 14px 0 0; font-size: .9rem; color: var(--muted); }
.disambig { list-style: none; padding: 0; }
.disambig li { display: flex; align-items: center; gap: 8px; padding: 5px 0; }
.mentions ul { margin: 6px 0 0; padding-left: 18px; }
.mentions li { padding: 2px 0; }
/* the Mods menu in the top bar, and the bar of the mod a page belongs to */
.modsw { position: relative; }
.modsw summary { cursor: pointer; list-style: none; padding: 6px 10px; border-radius: 8px; color: var(--muted); font-size: .93rem; white-space: nowrap; }
.modsw summary::-webkit-details-marker { display: none; }
.modsw summary:hover, .modsw.cur summary, .modsw[open] summary { background: var(--surface-2); color: var(--text); }
.modsw > div { position: absolute; z-index: 30; top: 100%; left: 0; margin-top: 4px; min-width: 200px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 4px; box-shadow: 0 4px 14px #0002; }
.modsw > div a { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 6px; color: var(--text); white-space: nowrap; }
.modsw > div a:hover { background: var(--accent-soft); text-decoration: none; }
.modsw > div a.cur { background: var(--accent-soft); font-weight: 600; }
.modbar { border-bottom: 1px solid var(--border); background: var(--surface); }
.modbar-in { max-width: 1180px; margin: 0 auto; padding: 0 20px; display: flex; gap: 2px; align-items: center; overflow-x: auto; min-height: 42px; }
.modbar a { padding: 6px 10px; border-radius: 8px; color: var(--muted); font-size: .9rem; white-space: nowrap; }
.modbar a:hover, .modbar a.cur { color: var(--text); background: var(--surface-2); text-decoration: none; }
.modbar a.cur { font-weight: 600; }
.modbar .mname { color: var(--text); font-weight: 700; margin-right: 8px; padding-left: 0; }
.envsw { position: relative; font-size: .85rem; }
.envsw summary { cursor: pointer; height: 34px; display: flex; align-items: center; padding: 0 10px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); list-style: none; white-space: nowrap; }
.envsw summary::-webkit-details-marker { display: none; }
.envsw summary::after { content: ""; width: 6px; height: 6px; margin: -3px 2px 0 8px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(45deg); }
.envsw > div { position: absolute; z-index: 20; top: 100%; right: 0; margin-top: 4px; min-width: 180px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 4px; box-shadow: 0 4px 14px #0002; }
.envsw > div a { display: block; padding: 4px 8px; border-radius: 6px; color: var(--text); white-space: nowrap; }
.envsw > div a.cur { background: var(--accent-soft); font-weight: 600; }
.oldver { background: var(--warm-soft); color: var(--warm); border-bottom: 1px solid var(--warm-border); padding: 6px 16px; font-size: .9rem; text-align: center; }
.oldver span { display: block; }
/* some aspect colours (perditio, praecantatio) are nearly black: lift them off a dark page */
:root[data-theme=dark] .aspicon { filter: brightness(1.7); }

/* item intro: the game's own words about the item */
.intro { margin: 16px 0 0; max-width: 46em; }
.intro .tip { margin: 0 0 8px; font-style: italic; color: var(--muted); }
.intro > .small { margin: 10px 0 0; }

/* loot tables on the item page */
.tablewrap { overflow-x: auto; }
table.loot { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.loot th, table.loot td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.loot th { color: var(--muted); font-weight: 500; font-size: .85rem; white-space: nowrap; }
table.loot td:nth-child(2), table.loot td:nth-child(3) { white-space: nowrap; }
table.loot tr:last-child td { border-bottom: 0; }
.lootsrc { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.lootcap { margin: 14px 0 6px; }

ul.worldgen { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
ul.worldgen li { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: baseline; }
ul.worldgen p { margin: 0; line-height: 1.7; }
.wgkind { font-size: 12px; padding: 2px 8px; border: 1px solid var(--border); border-radius: 999px; color: var(--muted); white-space: nowrap; }
.wgnote { margin: 12px 0 0; font-size: 12.5px; }

/* a recipe family as rod x cap table */
.family-matrix { grid-column: 1 / -1; }
.family-matrix .scroll-x { overflow-x: auto; }
.matrix { border-collapse: collapse; font-size: .9rem; }
.matrix th, .matrix td { padding: 5px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.matrix thead th { font-weight: 500; text-align: right; vertical-align: bottom; }
.matrix tbody th { text-align: left; font-weight: 500; }
.matrix td { text-align: right; font-variant-numeric: tabular-nums; }
.matrix tbody tr:hover { background: var(--surface-2); }

/* mobs */
table.mobs td { white-space: normal; }
table.mobs td:nth-child(2), table.mobs td:nth-child(3), table.mobs td:nth-child(4) { white-space: nowrap; }
.moblink { display: inline-flex; gap: 8px; align-items: center; font-weight: 500; margin-right: 6px; }
.matrix tbody th, .matrix thead th:first-child { position: sticky; left: 0; background: var(--bg); z-index: 1; }
.unlock ul { margin: 6px 0 0; padding-left: 18px; }
.unlock li { margin: 4px 0; }
.unlock li .chips { display: flex; }

/* articles */
.articles { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin-top: 18px; }
a.article { display: flex; flex-direction: column; gap: 8px; color: inherit; text-decoration: none; }
a.article h2 { margin: 0; font-size: 1.15rem; }
a.article p { margin: 0; color: var(--muted); font-size: .92rem; line-height: 1.6; flex: 1; }
a.article:hover h2 { color: var(--accent); }
.article-body { max-width: 46em; font-size: 1.02rem; }
.article-body h2 { margin-top: 1.8em; padding-bottom: .25em; border-bottom: 1px solid var(--border); }
.article-body table { display: block; overflow-x: auto; max-width: 100%; }
ul.plain { list-style: none; margin: 0; padding: 0; }
ul.plain li + li { margin-top: 6px; }

/* the summary under an entry's title */
.lede { margin: 14px 0 0; max-width: 46em; font-size: 1.08rem; }
.lede .md { line-height: 1.75; }
.lede .md > p { margin: 0; }
.lede > .small { margin: 4px 0 0; }

/* what an item is for, besides recipes */
.jobs { list-style: none; margin: 0 0 18px; padding: 0; display: grid; gap: 8px; }
.jobs li { line-height: 1.7; }
.jobkind { display: inline-block; min-width: 5em; margin-right: 10px; font-size: .8rem; color: var(--muted); }
.subh { font-size: 1rem; margin: 18px 0 10px; }
.subh .n { color: var(--muted); font-weight: 400; font-size: .85em; }

/* comments */
.comments { margin-top: 22px; }
.comments h2 { margin-top: 0; }
.cmt { padding: 10px 0; border-top: 1px solid var(--border); }
.cmt:first-of-type { border-top: 0; }
.cmt header { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.cmt .cbody { margin: 6px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.cmt.hidden { opacity: .55; }
.comments .form { margin-top: 12px; display: grid; gap: 8px; }
.comments textarea { width: 100%; min-height: 80px; resize: vertical; }

/* a mod without a logo: the item standing in for it (pixel art, square) */
img.emb, .modlogo.emblem img { image-rendering: pixelated; aspect-ratio: 1; }
.modlogo.emblem { width: 64px; justify-content: center; padding: 8px; }
.modlogo.emblem img { max-height: 48px; width: 48px; }
.modinfo { max-width: 760px; margin: 4px 0 18px; }
.modinfo dd { overflow-wrap: anywhere; }
.modinfo dd { text-align: left; }

/* privacy / about page */
.legal { max-width: 760px; }
.legal h2 { font-size: 1.05rem; margin: 18px 0 6px; }
.legal p { line-height: 1.7; }

/* the Revival Project: home banner, about page, downloads */
.revival { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 16px; margin: 18px 0; padding: 14px 18px;
  border: 1px solid var(--border); border-left: 4px solid var(--accent, #c0392b); border-radius: 12px; background: var(--surface); color: var(--text); }
.revival:hover { text-decoration: none; border-color: var(--accent, #c0392b); }
.revival span { color: var(--muted); font-size: .9rem; white-space: nowrap; }
a.gauge { color: inherit; display: block; }
a.gauge:hover { text-decoration: none; }
.about-hero { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; margin: 8px 0 22px; }
.about-logo { width: 140px; height: 140px; object-fit: contain; flex: none; }
.about-hero .tagline { font-size: 1.1rem; line-height: 1.8; max-width: 760px; margin: 6px 0 0; }
.charter ul { padding-left: 1.2em; line-height: 1.8; }
.charter li { margin: 6px 0; }
.charter .closing { font-weight: 600; margin-top: 12px; }
.members { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.member { display: flex; gap: 14px; align-items: flex-start; }
.member h3 { margin: 0 0 2px; }
.member p { margin: 4px 0; }
.avatar { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; flex: none; background: var(--surface-2); }
.avatar.none { display: grid; place-items: center; font-size: 1.6rem; font-weight: 700; color: var(--muted); }
.dlist { display: grid; gap: 12px; }
.dlhead { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.dlhead h2 { margin: 0; font-size: 1.15rem; }
.dlhead > div { flex: 1 1 260px; }
.dlicon { width: 56px; height: 40px; display: grid; place-items: center; flex: none; }
.dlicon img { max-width: 56px; max-height: 40px; object-fit: contain; }
.dlicon img.emb { width: 32px; height: 32px; }
.btn.dl { display: inline-flex; flex-direction: column; align-items: center; padding: 8px 16px; text-align: center; white-space: nowrap; }
.btn.dl small { font-size: .72rem; opacity: .85; font-weight: 400; }
.itemhead .btn.dl { margin-left: auto; }
.dlrow details { margin-top: 8px; }

/* mob spawning */
.spawn { border-top: 1px solid var(--border); padding: 10px 0; }
.spawn:first-of-type { border-top: 0; }
.spawn .props { margin: 0; }
.spawn-events li { margin: 6px 0; }
table.combat { width: 100%; border-collapse: collapse; }
table.combat th { text-align: left; white-space: nowrap; vertical-align: top; padding: 8px 16px 8px 0; font-weight: 600; width: 1%; }
table.combat td { padding: 8px 0; line-height: 1.6; }
table.combat tr + tr th, table.combat tr + tr td { border-top: 1px solid var(--border); }
.spawn .props dd, .props dd p { text-align: left; }

/* AcademyCraft abilities */
.accats { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.accat { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 18px 12px; text-align: center; color: var(--text); }
.accat:hover { text-decoration: none; border-color: var(--accent); }
.acicon { width: 32px; height: 32px; image-rendering: pixelated; object-fit: contain; vertical-align: middle; }
.acicon.none { display: inline-grid; place-items: center; background: var(--surface-2); font-weight: 700; color: var(--muted); }
.bigicon .acicon { width: 64px; height: 64px; }
.accat .acicon { width: 56px; height: 56px; }
.actable .acicon { width: 20px; height: 20px; }
.actree { position: relative; width: 100%; max-width: 900px; border: 1px solid var(--border); background: var(--surface-2); }
.actree svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.actree line { stroke: var(--muted); stroke-width: 1.5; opacity: .6; }
.acnode { position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: .72rem; color: var(--text); text-align: center; width: 84px; line-height: 1.2; }
.acnode .acicon { width: 36px; height: 36px; padding: 3px; background: var(--surface); border: 2px solid var(--accent); }
.acnode.passive .acicon { border-style: dashed; }
.acnode:hover { text-decoration: none; }
.acnode:hover span { color: var(--red-text, var(--accent)); }

/* a mob turned by dragging (frames rendered by the game) */
.turntable { margin: 0; flex: none; width: 200px; cursor: grab; touch-action: pan-y; user-select: none; text-align: center; }
.turntable.turning { cursor: grabbing; }
.turntable img { width: 200px; height: 200px; display: block; image-rendering: pixelated; background: var(--surface-2); }
.turntable:focus-visible { outline: 2px solid var(--accent); }
.turntable figcaption { margin-top: 4px; }
img.mobthumb { width: 32px; height: 32px; object-fit: contain; image-rendering: pixelated; flex: none; }
@media (max-width: 600px) { .turntable, .turntable img { width: 150px; height: auto; } }

/* ---------------------------------------------------------------- Fallout 4 board: an ASCII phosphor terminal */
.fo-term {
  --fo-bg: #07120a; --fo-fg: #5cf58a; --fo-dim: #3a9e5c; --fo-hi: #c8ffd8; --fo-warn: #ffd166;
  position: relative; overflow: hidden; margin: 8px 0 24px; padding: 28px clamp(16px, 4vw, 40px) 32px;
  background: radial-gradient(ellipse at 50% 40%, #0d2214 0%, var(--fo-bg) 75%);
  color: var(--fo-fg); border: 1px solid var(--fo-dim); border-radius: 10px;
  font: 15px/1.7 ui-monospace, "SFMono-Regular", Menlo, Consolas, "Sarasa Mono SC", "Noto Sans Mono CJK SC", monospace;
  text-shadow: 0 0 6px rgba(92, 245, 138, .45);
  box-shadow: inset 0 0 60px rgba(0, 0, 0, .7), 0 0 0 4px #0a0f0b;
}
/* scanlines over everything, never in the way of clicks */
.fo-term::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgba(0, 0, 0, .22) 0 1px, transparent 1px 3px);
  animation: fo-flicker 6s infinite steps(1);
}
@keyframes fo-flicker { 0%, 97% { opacity: 1 } 98% { opacity: .85 } 99% { opacity: 1 } }
.fo-term a { color: var(--fo-hi); text-decoration: none; }
.fo-term a:hover, .fo-term a:focus-visible { background: var(--fo-fg); color: var(--fo-bg); text-shadow: none; outline: none; }
.fo-term h1, .fo-term h2, .fo-term h3 { color: var(--fo-hi); font: inherit; font-weight: 700; margin: 14px 0 6px; }
.fo-title { font-size: 1.35rem !important; letter-spacing: .04em; }
.fo-banner { margin: 0 0 10px; font: 12px/1.05 ui-monospace, Menlo, Consolas, monospace; color: var(--fo-fg); overflow-x: auto; }
.fo-sys { color: var(--fo-dim); text-transform: uppercase; letter-spacing: .05em; margin: 0 0 4px; }
.fo-dim { color: var(--fo-dim); }
.fo-prompt { font-size: 1rem !important; }
.fo-rule { height: 1.7em; overflow: hidden; color: var(--fo-dim); white-space: nowrap; }
.fo-rule::before { content: "========================================================================================================================================"; }
.fo-list, .fo-links { list-style: none; padding: 0; margin: 6px 0; }
.fo-list { counter-reset: fo-mod; }
/* each mod sits in its own double-line box (like ╔═╗), numbered on the top edge like a terminal panel title */
.fo-list li {
  counter-increment: fo-mod; position: relative; margin: 18px 0 0; padding: 14px 2ch 10px;
  border: 3px double var(--fo-dim); background: rgba(92, 245, 138, .03);
}
.fo-list li::before {
  content: "[ MOD-" counter(fo-mod, decimal-leading-zero) " ]"; position: absolute; top: -.8em; left: 1.5ch;
  padding: 0 .5ch; background: var(--fo-bg); color: var(--fo-dim); font-size: .85em; line-height: 1.4;
}
.fo-list li:hover, .fo-list li:focus-within { border-color: var(--fo-fg); }
.fo-list li:hover::before, .fo-list li:focus-within::before { color: var(--fo-fg); }
.fo-list li p { margin: 4px 0 0 2ch; }
.fo-list li > a::before, .fo-links li > a::before { content: "> "; color: var(--fo-dim); }
.fo-status { color: var(--fo-warn); margin-right: 1ch; }
.fo-status.released { color: var(--fo-hi); }
.fo-name { font-weight: 700; }
.fo-fields { display: grid; grid-template-columns: max-content 1fr; gap: 2px 2ch; margin: 10px 0; }
.fo-fields dt { color: var(--fo-dim); }
.fo-fields dt::after { content: ":"; }
.fo-fields dd { margin: 0; }
.fo-body p, .fo-body ul, .fo-body ol { margin: 0 0 10px; }
.fo-body code, .fo-body pre { background: rgba(92, 245, 138, .08); color: var(--fo-hi); border-radius: 0; }
.fo-body pre { padding: 8px 12px; overflow-x: auto; }
.fo-body blockquote { margin: 0 0 10px; padding-left: 2ch; border-left: 1px dashed var(--fo-dim); color: var(--fo-dim); }
.fo-body img { max-width: 100%; filter: grayscale(1) sepia(1) hue-rotate(80deg) saturate(2.5) brightness(.9); }
.fo-body table { border-collapse: collapse; }
.fo-body th, .fo-body td { border: 1px dashed var(--fo-dim); padding: 2px 1ch; }
.fo-empty { color: var(--fo-hi); }
.fo-cursor { animation: fo-blink 1s steps(1) infinite; }
@keyframes fo-blink { 50% { opacity: 0 } }
.fo-term .small { font-size: .82rem; }
@media (prefers-reduced-motion: reduce) {
  .fo-term::after, .fo-cursor { animation: none; }
}
@media (max-width: 560px) {
  .fo-term { font-size: 14px; }
  .fo-banner { font-size: 9px; }
  .fo-fields { grid-template-columns: 1fr; }
  .fo-fields dd { margin-bottom: 4px; }
}

/*
 * The "technical manual" look, laid over style.css: paper and ink, one signal colour, hairlines instead of cards, hard
 * edges, pixel icons left sharp, numbered sections, and motion that shows something (a count, a ratio, an order).
 * style.css keeps the structure of every page; this file changes its tokens and the pieces that carry the look.
 * Content never depends on an animation running: every keyframe animates from a hidden state to the styled one.
 */
:root {
  /* the Revival Project's palette (content/team/LOGO.md): molten orange on paper white, cold-iron ink.
     --red is the signal colour (fills, rules, underlines); --red-text the same hue dark enough to read as text. */
  --bg: #f4efe8; --surface: #f4efe8; --surface-2: #e9e2d8; --text: #1f2329; --muted: #5f6168; --border: rgba(31, 35, 41, .18);
  --rule: rgba(31, 35, 41, .9); --red: #e8742a; --red-text: #b4531a; --red-ink: #1f2329; --magic: #6a3cc0;
  --iron: #3a3f47; --ember: #f7a257;
  --accent: var(--red); --accent-2: var(--red); --accent-soft: #e9e2d8; --link: var(--text);
  --slot: #e9e2d8; --slot-b: rgba(31, 35, 41, .28);
  --shadow: none; --radius: 0px; --top-h: 56px;
  --display: "Helvetica Neue", Helvetica, "PingFang SC", "Noto Sans SC", "Microsoft YaHei", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --ease: cubic-bezier(.2, .7, .1, 1);
}
:root[data-theme=dark] {
  --bg: #111317; --surface: #111317; --surface-2: #1f2329; --text: #f4efe8; --muted: #9097a1; --border: rgba(244, 239, 232, .18);
  --rule: rgba(244, 239, 232, .9); --red: #e8742a; --red-text: #f7a257; --red-ink: #111317; --magic: #b794f6;
  --accent-soft: #1f2329; --slot: #1f2329; --slot-b: rgba(244, 239, 232, .28);
}
*:not(.node):not(.infusion), *::before, *::after { border-radius: 0 !important; }
body { font-family: var(--display); }
::selection { background: var(--red); color: var(--red-ink); }
:focus-visible { outline-color: var(--red); }
a:hover { color: var(--red-text); text-decoration: none; }
h1, h2, h3 { font-weight: 800; }
h1 { font-size: clamp(2rem, 4.2vw, 3.4rem); line-height: 1.06; letter-spacing: 0; }
.md a, .lede a, .prose a, .intro a, .unlock a, .jobs a, .worldgen a { text-decoration: underline; text-decoration-color: var(--red); text-underline-offset: 3px; }
.small.muted, .crumbs, .dirlabel, .jobkind, .side h3, kbd, .count, .foot { font-family: var(--mono); letter-spacing: .04em; }
main { max-width: 1320px; padding-left: clamp(16px, 3.2vw, 44px); padding-right: clamp(16px, 3.2vw, 44px); }

/* ---------------------------------------------------------------- header, status strip, footer */
.top { border-bottom: 2px solid var(--rule); }
.top-in { max-width: 1320px; padding: 0 clamp(16px, 3.2vw, 44px); gap: 0; align-items: stretch; }
.brand { font-weight: 800; font-size: 1.1rem; letter-spacing: .02em; gap: 12px; padding-right: 22px; }
.brand:hover { color: var(--text); }
.brand .mark { width: 26px; height: auto; transition: transform .4s var(--ease); }
.brand:hover .mark { transform: translateY(-2px); }
.brand .mark.dark, :root[data-theme=dark] .brand .mark.light { display: none; }
:root[data-theme=dark] .brand .mark.dark { display: block; }
.brand small { font: 400 .72rem var(--mono); color: var(--muted); letter-spacing: .06em; margin-left: -4px; align-self: center; padding-top: 3px; }
.nav { gap: 0; align-items: stretch; }
.nav a { display: flex; align-items: center; padding: 0 14px; border-left: 1px solid var(--border); color: var(--text); font-weight: 600; font-size: .9rem; position: relative; }
.nav a:last-child { border-right: 1px solid var(--border); }
.nav a:hover, .nav a.cur { background: none; color: var(--text); }
.nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 4px; background: var(--red); transform: scaleX(0); transform-origin: left; transition: transform .35s var(--ease); }
.nav a:hover::after, .nav a.cur::after { transform: scaleX(1); }
.top .search { align-self: center; margin-left: 18px; }
.top .search input[name=q] { border: 0; border-bottom: 2px solid var(--rule); background: none; padding-left: 2px; }
.top .search input[name=q]:focus { border-bottom-color: var(--red); }
.top .iconbtn, .top .lang, .top .envsw { align-self: center; margin-left: 12px; }
.lang { font-family: var(--mono); font-size: .74rem; letter-spacing: .04em; }
.strip { border-bottom: 1px solid var(--border); overflow: hidden; white-space: nowrap; font: .7rem var(--mono); letter-spacing: .08em; color: var(--muted); text-transform: uppercase; }
.strip div { display: inline-block; padding: 6px 0; animation: tick 60s linear infinite; }
.strip span { margin-right: 44px; }
.strip b { color: var(--red-text); font-weight: 400; }
@keyframes tick { to { transform: translateX(-50%); } }
.foot { max-width: 1320px; text-align: left; border-top: 2px solid var(--rule); margin-top: 40px; padding: 16px clamp(16px, 3.2vw, 44px) 36px; font-size: .72rem; }

/* ---------------------------------------------------------------- common pieces */
.card { border: 1px solid var(--border); background: none; }
.pill { border: 1px solid var(--border); background: none; }
.pill.cur { background: var(--text); color: var(--bg); box-shadow: none; }
.pill.warn { border-color: var(--warm-border); }
a.pill:hover { border-color: var(--red); color: var(--red-text); }
.btn { background: var(--text); border-color: var(--text); color: var(--bg); font-weight: 700; }
.btn:hover { background: var(--red); border-color: var(--red); color: var(--red-ink); }
.btn.ghost { color: var(--text); }
kbd { border: 1px solid var(--rule); border-bottom-width: 1px; background: none; color: var(--text); }
.icon:not([style*="#g"]):not([style*=".svg"]) { image-rendering: pixelated; }
.crumbs { font-size: .72rem; text-transform: uppercase; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.crumbs a:hover { color: var(--red-text); }
.src { font: .64rem var(--mono); letter-spacing: .04em; color: var(--muted); border: 1px solid var(--border); padding: 1px 6px; white-space: nowrap; font-weight: 400; }
.src::before { content: "SRC "; color: var(--red-text); }
.src { text-transform: none; }
.itemrow:hover { background: var(--surface-2); }
.itemrow:hover .nm { color: var(--red-text); }
.slot { transition: transform .2s var(--ease), background .2s; }
.slot:not(.empty):not(.air):hover { box-shadow: inset 0 0 0 2px var(--red); background: var(--bg); transform: translateY(-2px); }
.slot.out { box-shadow: inset 0 0 0 2px var(--rule); }
.rgroup > summary { border-bottom: 1px solid var(--border); }

/* numbered sections with a rule that sweeps across once, when the section is first read */
.blk, .hsec { position: relative; }
.layout2 > div, .hsecs { counter-reset: sec; }
.blk > h2, .hsec > header h2 { border-top: 2px solid var(--rule); padding-top: 12px; font-size: 1.45rem; }
.blk > h2::before, .hsec > header h2::before { counter-increment: sec; content: counter(sec, decimal-leading-zero); font: 400 .8rem var(--mono); color: var(--red-text); margin-right: 16px; vertical-align: .2em; }
.blk > h2 .n { font: 400 .85rem var(--mono); color: var(--muted); }
.blk:not(:has(> h2)) { counter-increment: none; }
.blk::before, .hsec::before { content: ""; position: absolute; left: 0; top: 0; height: 2px; width: 100%; background: var(--red); transform: scaleX(0); z-index: 1; pointer-events: none; }
.blk:not(:has(> h2))::before { display: none; }
.blk.in::before, .hsec.in::before { animation: sweep 1.1s var(--ease); }
@keyframes sweep { 0% { transform: scaleX(0); transform-origin: left; } 50% { transform: scaleX(1); transform-origin: left; } 51% { transform: scaleX(1); transform-origin: right; } 100% { transform: scaleX(0); transform-origin: right; } }
.secnav { border-bottom: 1px solid var(--border); background: var(--bg); }
.secnav a { font-weight: 600; color: var(--muted); }
.secnav a.cur { border-color: var(--red); }

/* ---------------------------------------------------------------- item page: the spec sheet */
.itemhead { gap: 28px; align-items: stretch; margin: 18px 0 0; padding-bottom: 22px; border-bottom: 2px solid var(--rule); }
.itemhead .sub { margin-top: 12px; }
.bigicon {
  width: 132px; height: 132px; border: 0; position: relative; overflow: hidden; view-transition-name: hero-icon;
  background: linear-gradient(var(--border) 1px, transparent 1px) 0 0 / 100% 12.5%, linear-gradient(90deg, var(--border) 1px, transparent 1px) 0 0 / 12.5% 100%, var(--surface-2);
}
.bigicon .icon.big { width: 80px; height: 80px; animation: pop .7s var(--ease) backwards; }
@keyframes pop { from { transform: scale(.4); opacity: 0; } }
.bigicon::before, .bigicon::after { content: ""; position: absolute; width: 14px; height: 14px; border: 2px solid var(--red); z-index: 1; }
.bigicon::before { left: 6px; top: 6px; border-right: 0; border-bottom: 0; }
.bigicon::after { right: 6px; bottom: 6px; border-left: 0; border-top: 0; }
.bigicon .scan { position: absolute; left: 0; right: 0; top: -4px; height: 2px; background: var(--red); opacity: .7; animation: scan 3.6s var(--ease) infinite; }
@keyframes scan { 0% { top: -2%; } 55%, 100% { top: 102%; } }
.bigicon + .bigicon { margin-left: -14px; }
.itemhead h1 { font-size: clamp(2.2rem, 5vw, 4rem); }
.idchip { background: none; border: 1px solid var(--rule); color: var(--text); padding: 3px 10px; }
.idchip:hover { background: var(--text); color: var(--bg); }
.idchip.done { background: var(--red); border-color: var(--red); color: var(--red-ink); }
.idchip.done::after { color: inherit; }
.lede { font-size: 1.14rem; margin-top: 20px; }
.lede .md > p::first-letter { color: var(--red-text); font-weight: 800; }
.intro { border-left: 4px solid var(--text); padding-left: 20px; color: var(--muted); margin-top: 22px; }
.side > .card { border: 0; border-top: 2px solid var(--rule); padding: 12px 0 6px; }
.side > .card + .card { margin-top: 18px; }
.side h3 { display: flex; justify-content: space-between; align-items: center; gap: 8px; text-transform: uppercase; font-size: .72rem; color: var(--text); }
.props { gap: 0 16px; }
.props dt, .props dd { padding: 7px 0; border-bottom: 1px solid var(--border); }
.props dd { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: .86rem; }
.aspbars { display: grid; gap: 2px; }
.aspbar { display: grid; grid-template-columns: 22px minmax(3em, auto) 1fr 22px; align-items: center; gap: 10px; padding: 4px 0; color: var(--text); }
.aspbar .icon { width: 20px; height: 20px; }
.aspbar .bar { height: 8px; background: var(--border); }
.aspbar .bar i { display: block; height: 100%; background: var(--c, var(--text)); transform: scaleX(var(--v, 1)); transform-origin: left; animation: grow 1s var(--ease) .4s backwards; }
.aspbar .n { font: .86rem var(--mono); text-align: right; }
@keyframes grow { from { transform: scaleX(0); } }
.jobs li { padding: 10px 0; border-bottom: 1px solid var(--border); }
.jobkind { text-transform: uppercase; font-size: .7rem; }

/* ---------------------------------------------------------------- home */
.hero { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); border-bottom: 2px solid var(--rule); margin-top: -22px; }
.hero .l { padding: 52px 40px 44px 0; min-width: 0; }
.hero .label { display: flex; gap: 14px; align-items: center; margin-bottom: 24px; font: .72rem var(--mono); letter-spacing: .08em; color: var(--muted); text-transform: uppercase; }
.hero .label::before { content: ""; width: 44px; height: 2px; background: var(--text); }
.hero h1 { margin: 0; font-size: clamp(2.6rem, 6.4vw, 5.4rem); line-height: 1.04; letter-spacing: -.01em; }
.hero h1 span { display: block; overflow: hidden; }
.hero h1 span b { display: block; font-weight: inherit; animation: up .9s var(--ease) backwards; }
.hero h1 span:nth-child(2) b { animation-delay: .12s; }
.hero h1 em { font-style: normal; background: var(--red); color: var(--red-ink); padding: 0 .12em; margin: 0 .04em; display: inline-block; transform: skewX(-8deg); }
.hero h1 em u { text-decoration: none; display: inline-block; transform: skewX(8deg); }
@keyframes up { from { transform: translateY(105%); } }
.hero .l > p { max-width: 36em; margin: 24px 0 0; color: var(--muted); font-size: 1.02rem; }
.hero .search.big { margin: 30px 0 0; max-width: 640px; border-bottom: 3px solid var(--rule); align-items: center; position: relative; }
.hero .search.big::before { content: ">"; font: 1.3rem var(--mono); color: var(--red-text); padding-right: 12px; }
.hero .search.big::after { content: ""; position: absolute; left: 0; bottom: -3px; height: 3px; width: 100%; background: var(--red); transform: scaleX(0); transform-origin: left; transition: transform .45s var(--ease); }
.hero .search.big:focus-within::after { transform: scaleX(1); }
.hero .search.big input[name=q] { border: 0; background: none; box-shadow: none; height: auto; padding: 14px 0; font: 600 1.2rem var(--display); }
.hero .search.big button { border: 1px solid var(--rule); background: none; color: var(--text); font: .72rem var(--mono); letter-spacing: .08em; padding: 5px 10px; cursor: pointer; white-space: nowrap; }
.hero .search.big button:hover { background: var(--text); color: var(--bg); }
.hero .hot { justify-content: flex-start; margin-top: 14px; }
.hero .hot a { border-bottom: 1px dotted var(--muted); }
.hero .r { border-left: 2px solid var(--rule); display: grid; grid-template-rows: repeat(3, 1fr); }
.gauge { padding: 20px 0 18px 32px; border-bottom: 1px solid var(--border); display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 6px 20px; }
.gauge:last-child { border-bottom: 0; }
.gauge .n { font: 800 clamp(2.4rem, 5vw, 4.2rem)/1 var(--display); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.gauge .k { font-weight: 700; text-align: right; }
.gauge .k small { display: block; font: 400 .68rem var(--mono); letter-spacing: .08em; color: var(--muted); }
.gauge .bar { grid-column: 1 / -1; height: 6px; background: var(--border); }
.gauge .bar i { display: block; height: 100%; background: var(--text); transform: scaleX(var(--v, 1)); transform-origin: left; animation: grow 1.6s var(--ease) .3s backwards; }
.gauge:first-child .bar i { background: var(--red); }

.hsec { margin-top: 64px; }
.hsec > header { display: flex; align-items: baseline; gap: 16px; margin-bottom: 20px; }
.hsec > header h2 { margin: 0; flex: 1; }
.hsec > header .more { font: .72rem var(--mono); letter-spacing: .06em; border-bottom: 1px solid var(--rule); }
.hmod { margin-top: 0; }
.hmod + .hmod { margin-top: 28px; }
.hmod-h { border-bottom: 1px solid var(--border); padding-bottom: 14px; }
.hmod-h h2 { font-size: 1.15rem; border: 0; padding: 0; margin: 0; }
.hmod-h h2::before { content: none; }
.topics a { background: none; border: 1px solid var(--border); transition: background .25s, color .25s; }
.topics a:hover { background: var(--text); color: var(--bg); border-color: var(--text); }
.topics a:hover span span { color: var(--bg); }
.dirlabel { text-transform: uppercase; font-size: .7rem; color: var(--muted); }
.dir { gap: 0; margin: 0; border-top: 1px solid var(--border); border-left: 1px solid var(--border); }
.dir a { padding: 13px 14px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); position: relative; transition: background .25s, color .25s; }
.dir a .icon { width: 32px; height: 32px; transition: transform .35s var(--ease); }
.dir a .nm { font-weight: 600; flex: 1; }
.dir a i { font-family: var(--mono); }
.dir a::after { content: ""; position: absolute; right: 0; top: 0; border: 7px solid transparent; border-top-color: var(--red); border-right-color: var(--red); opacity: 0; transition: opacity .2s; }
.dir a:hover { background: var(--text); color: var(--bg); }
.dir a:hover i { color: var(--bg); }
.dir a:hover .icon { transform: scale(1.2) rotate(-6deg); }
.dir a:hover::after { opacity: 1; }

.rank { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 48px; }
.rk { display: grid; grid-template-columns: 30px 32px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); position: relative; color: var(--text); }
.rk .i { font: .76rem var(--mono); color: var(--muted); }
.rk .nm { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rk .amt { font: .86rem var(--mono); }
.rk .bar { position: absolute; left: 0; bottom: -1px; height: 2px; width: 100%; }
.rk .bar i { display: block; height: 100%; background: var(--text); transform: scaleX(var(--v)); transform-origin: left; }
.js .hsec:not(.in) .rk .bar i { transform: scaleX(0); }
.hsec.in .rk .bar i { transition: transform 1.2s var(--ease); transition-delay: calc(var(--i) * 60ms); }
.rk:hover .bar i { background: var(--red); }
.rk:hover .nm { color: var(--red-text); }

/* article covers: the article's own main items, drawn large and pixel-sharp as the game draws them, on a block of
   the mod's colour (--cv), with the mod's logo in a corner. Three arrangements, fixed per article (data-l). */
.posters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.poster, .cover {
  --cv: var(--red); --grid-c: rgba(17, 17, 16, .07);
  position: relative; overflow: hidden; isolation: isolate; border: 2px solid var(--rule); color: var(--text);
  background: linear-gradient(var(--grid-c) 1px, transparent 1px) 0 0 / 16px 16px,
    linear-gradient(90deg, var(--grid-c) 1px, transparent 1px) 0 0 / 16px 16px, var(--surface-2);
}
:root[data-theme=dark] .poster, :root[data-theme=dark] .cover { --grid-c: rgba(236, 232, 221, .07); }
.poster[data-mod=mio_icif], .cover[data-mod=mio_icif] { --cv: #1f6fff; }
.poster { aspect-ratio: 4 / 3; display: flex; flex-direction: column; justify-content: flex-end; padding: 16px 18px; }
.poster:hover { color: var(--text); }
.cv-art { position: absolute; inset: 0; z-index: -1; }
.cv-art::before { content: ""; position: absolute; background: var(--cv); transition: transform .7s var(--ease); }
.cv-main { position: absolute; aspect-ratio: 1; background: center / contain no-repeat; image-rendering: pixelated; transition: transform .7s var(--ease); }
.cv-rest { position: absolute; display: flex; gap: 8px; }
.poster .cv-rest span:nth-child(n+3) { display: none; } /* a card has room for two beside the logo */
.cv-rest span { width: 44px; height: 44px; background: var(--bg) center / 32px no-repeat; image-rendering: pixelated; border: 2px solid var(--rule); }
/* 0: a colour column at the left, the main item standing in it */
[data-l="0"] .cv-art::before { left: 0; top: 0; bottom: 0; width: 42%; }
[data-l="0"] .cv-main { left: 6%; top: 8%; height: 62%; }
[data-l="0"] .cv-rest { right: 12px; top: 44px; flex-direction: column; }
/* 1: a colour band across, the main item over it on the right */
[data-l="1"] .cv-art::before { left: 0; right: 0; top: 22%; height: 34%; }
[data-l="1"] .cv-main { right: 8%; top: 6%; height: 64%; }
[data-l="1"] .cv-rest { left: 14px; top: 14px; }
/* 2: a colour block at the right, the main item in the middle */
[data-l="2"] .cv-art::before { right: 0; top: 0; bottom: 0; width: 36%; }
[data-l="2"] .cv-main { left: 30%; top: 10%; height: 58%; }
[data-l="2"] .cv-rest { left: 14px; top: 14px; flex-direction: column; }
.poster:hover .cv-main, .pcard:hover .cv-main { transform: scale(1.08) rotate(-3deg); }
.poster:hover .cv-art::before, .pcard:hover .cv-art::before { transform: scale(1.04); }
.cv-logo { position: absolute; right: 10px; bottom: 10px; max-height: 26px; max-width: 40%; object-fit: contain; background: var(--bg); padding: 3px 6px; border: 1px solid var(--rule); }
[data-l="1"] .cv-logo, [data-l="2"] .cv-logo { bottom: auto; top: 10px; }
[data-l="2"] .cv-logo { right: 10px; }
.poster h3 { margin: 0; font-size: 1.3rem; background: var(--bg); align-self: flex-start; padding: 2px 10px; border: 2px solid var(--rule); }
.poster p { margin: 8px 0 0; align-self: flex-start; background: var(--bg); padding: 1px 8px; font: .7rem var(--mono); letter-spacing: .04em; }
a.card.article { border: 2px solid var(--rule); transition: background .25s, color .25s; }
a.card.article:hover { background: var(--text); color: var(--bg); }
a.card.article:hover h2, a.card.article:hover p, a.card.article:hover .muted { color: var(--bg); }

/* things that rise into place as they are reached; only when the script is there to reveal them */
.js .rise { opacity: 0; transform: translateY(14px); }
.js .in .rise, .js .rise.in { opacity: 1; transform: none; transition: opacity .6s var(--ease), transform .6s var(--ease); transition-delay: calc(var(--i, 0) * 45ms); }

@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .3s; }
::view-transition-group(hero-icon) { animation-duration: .5s; animation-timing-function: var(--ease); }

@media (max-width: 900px) {
  .brand { padding-right: 12px; }
  .nav { overflow-x: auto; scrollbar-width: none; }
  .hero { grid-template-columns: 1fr; }
  .hero .l { padding-right: 0; padding-top: 36px; }
  .hero .r { border-left: 0; border-top: 2px solid var(--rule); grid-template-rows: none; grid-template-columns: repeat(3, 1fr); }
  .gauge { padding: 14px 10px 14px 0; grid-template-columns: 1fr; border-bottom: 0; }
  .gauge .k { text-align: left; }
  .rank, .posters { grid-template-columns: 1fr; }
  .bigicon { width: 96px; height: 96px; }
  .bigicon .icon.big { width: 56px; height: 56px; }
  .itemhead { gap: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
  .strip div, .bigicon .scan { animation: none; }
  .js .rise { opacity: 1; transform: none; }
  @view-transition { navigation: none; }
}

/* ---------------------------------------------------------------- item page: section rail, ingredient rows, recipes as a process */
.secnav .prog { display: none; }
.secnav { counter-reset: rl; }
@media (min-width: 1180px) {
  .layout2:has(> .secnav) { grid-template-columns: 168px minmax(0, 1fr) 300px; gap: 28px; }
  .layout2 > .secnav { position: sticky; top: calc(var(--top-h) + 36px); display: block; border: 0; margin: 28px 0 0; padding: 0; background: none; overflow: visible; }
  .layout2 > .secnav a { display: grid; grid-template-columns: 26px 1fr auto; align-items: baseline; padding: 9px 0 9px 12px; margin: 0; border: 0; border-left: 2px solid var(--border); transition: color .25s, border-color .25s, padding .25s var(--ease); }
  .layout2 > .secnav a::before { counter-increment: rl; content: counter(rl, decimal-leading-zero); font: .7rem var(--mono); }
  .layout2 > .secnav a.cur { border-left-color: var(--red); padding-left: 20px; font-weight: 700; }
  .layout2 > .secnav .prog { display: block; margin-top: 18px; height: 2px; background: var(--border); }
  .layout2 > .secnav .prog i { display: block; height: 100%; background: var(--red); transform: scaleX(var(--p, 0)); transform-origin: left; transition: transform .2s linear; }
}
@media (max-width: 1179px) { .layout2 > .secnav { grid-column: 1 / -1; order: -2; } }

.userows { border-top: 1px solid var(--border); }
.userow { display: grid; grid-template-columns: 34px minmax(0, 1.1fr) minmax(0, .7fr) minmax(0, 1.6fr) auto; gap: 12px; align-items: center; padding: 9px 0 9px 12px; border-bottom: 1px solid var(--border); position: relative; color: var(--text); }
.userow::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--red); transform: scaleY(0); transition: transform .25s var(--ease); }
.userow:hover { background: var(--surface-2); color: var(--text); }
.userow:hover::before { transform: scaleY(1); }
.userow .nm { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.userow .ty { font: .7rem var(--mono); letter-spacing: .04em; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.userow .ins { display: flex; flex-wrap: wrap; gap: 4px; }
.userow .ins > span { width: 26px; height: 26px; border: 1px solid var(--border); display: grid; place-items: center; background: var(--surface-2); font: .7rem var(--mono); transition: transform .25s var(--ease); transition-delay: calc(var(--i) * 25ms); }
.userow .ins > span.me { border: 2px solid var(--red); }
.userow:hover .ins > span { transform: translateY(-3px); }
.userow .ins .icon { width: 18px; height: 18px; }
details.ascards { margin-top: 16px; }
details.ascards > summary { cursor: pointer; font: .74rem var(--mono); letter-spacing: .05em; display: inline-block; border-bottom: 1px solid var(--rule); padding-bottom: 2px; list-style: none; }
details.ascards > summary:hover { color: var(--red-text); border-color: var(--red); }
details.ascards[open] > summary { margin-bottom: 14px; }
@media (max-width: 700px) {
  .userow { grid-template-columns: 34px minmax(0, 1fr); }
  .userow > :nth-child(n+3) { grid-column: 2; }
}

/* a recipe plays once when its section is reached, and again under the pointer: inputs in, arrow, result */
.js .blk.in .recipe .body .slot:not(.out), .recipe:hover .body .slot:not(.out) { animation: feed .45s var(--ease) backwards; }
.recipe:hover .body .slot:not(.out) { animation-name: feed2; }
.recipe .body .slot:nth-child(2) { animation-delay: 50ms; } .recipe .body .slot:nth-child(3) { animation-delay: 100ms; }
.recipe .body .slot:nth-child(4) { animation-delay: 150ms; } .recipe .body .slot:nth-child(5) { animation-delay: 200ms; }
.recipe .body .slot:nth-child(6) { animation-delay: 250ms; } .recipe .body .slot:nth-child(7) { animation-delay: 300ms; }
.recipe .body .slot:nth-child(8) { animation-delay: 350ms; } .recipe .body .slot:nth-child(n+9) { animation-delay: 400ms; }
.js .blk.in .recipe .arrow, .recipe:hover .arrow { animation: nudge .5s var(--ease) .45s backwards; color: var(--red-text); }
.recipe:hover .arrow { animation-name: nudge2; }
.js .blk.in .recipe .slot.out, .recipe:hover .slot.out { animation: lit .8s var(--ease) .8s backwards; }
.recipe:hover .slot.out { animation-name: lit2; }
@keyframes feed { from { opacity: 0; transform: translateY(8px) scale(.9); } }
@keyframes feed2 { from { opacity: .2; transform: translateY(8px) scale(.9); } }
@keyframes nudge { from { opacity: 0; transform: translateX(-10px); } }
@keyframes nudge2 { from { opacity: 0; transform: translateX(-10px); } }
@keyframes lit { from { background: var(--red); transform: scale(1.12); } }
@keyframes lit2 { from { background: var(--red); transform: scale(1.12); } }

/* ---------------------------------------------------------------- research map: a wiring diagram on graph paper */
.tabs a { background: none; border: 1px solid var(--border); font-weight: 600; }
.tabs a.cur { background: var(--text); color: var(--bg); border-color: var(--text); }
.tabs a.cur .muted { color: var(--bg); }
.rbar { display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: center; margin: 0 0 12px; font: .72rem var(--mono); letter-spacing: .04em; }
.rfilters { display: inline-flex; }
.rfilters button { font: inherit; letter-spacing: inherit; color: var(--text); background: none; border: 1px solid var(--rule); margin-left: -1px; padding: 5px 10px; cursor: pointer; }
.rfilters button.cur { background: var(--text); color: var(--bg); }
.rlabels { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
.rlegend { display: inline-flex; flex-wrap: wrap; gap: 6px 16px; color: var(--muted); margin-left: auto; }
.rlegend span { display: inline-flex; align-items: center; gap: 6px; }
.lg { display: inline-grid; place-items: center; width: 16px; height: 16px; border: 2px solid var(--rule); font: 700 .62rem var(--mono); font-style: normal; color: var(--text); }
.lg.clue { border-style: dashed; }
.lg.buy { border-width: 1px; }
.lg.auto { background: var(--text); }
.lg.warp { border: 0; background: var(--magic); color: #fff; }
.lg.port { border: 0; background: var(--red); color: var(--red-ink); }
.rmap { display: grid; grid-template-columns: minmax(0, 1fr) 320px; border: 2px solid var(--rule); }
.tree-wrap {
  border: 0; max-height: 78vh; cursor: grab; scrollbar-width: thin;
  background: linear-gradient(var(--border) 1px, transparent 1px) 0 0 / 76px 76px, linear-gradient(90deg, var(--border) 1px, transparent 1px) 0 0 / 76px 76px,
    linear-gradient(color-mix(in srgb, var(--border) 45%, transparent) 1px, transparent 1px) 0 0 / 19px 19px,
    linear-gradient(90deg, color-mix(in srgb, var(--border) 45%, transparent) 1px, transparent 1px) 0 0 / 19px 19px, var(--bg);
  background-attachment: local;
}
.tree-wrap.drag { cursor: grabbing; user-select: none; }
.tree { margin: 38px; }
.tree svg path { fill: none; stroke: var(--text); stroke-width: 2; opacity: .5; stroke-linejoin: miter; transition: opacity .25s, stroke .25s; }
.tree svg path:not(.hidden) { stroke-dasharray: 1; animation: draw 1.1s var(--ease) backwards; }
.tree svg path.hidden { stroke-dasharray: 4 5; opacity: .35; }
@keyframes draw { from { stroke-dashoffset: 1; } }
.node { width: 48px; height: 48px; background: var(--bg); border: 2px solid var(--rule); transition: opacity .25s, transform .25s var(--ease), border-color .25s, background .25s; }
.node .icon { width: 32px; height: 32px; }
.node.special { border-color: var(--rule); box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--rule); }
.node.clue { border-style: dashed; }
.node.buy:not(.clue) { border-width: 1px; }
.node.auto { background: var(--surface-2); }
.node.auto::before { content: ""; position: absolute; left: -2px; top: -2px; border: 6px solid transparent; border-left-color: var(--rule); border-top-color: var(--rule); }
.node.flagged { opacity: .6; }
.node:hover, .node:focus-visible { border-color: var(--red); transform: translate(-50%, -50%) scale(1.12); z-index: 3; }
.node .lbl { background: var(--text); color: var(--bg); font: .7rem var(--mono); padding: 2px 6px; z-index: 4; pointer-events: none; }
.tree.labels .node .lbl, .node.sel .lbl, .node:focus-visible .lbl { display: block; }
.tree.labels .node .lbl { background: var(--bg); color: var(--text); border: 1px solid var(--border); font-size: .62rem; max-width: 84px; overflow: hidden; text-overflow: ellipsis; }
.node .wb { position: absolute; right: -9px; top: -9px; min-width: 16px; height: 16px; background: var(--magic); color: #fff; font: 700 .62rem/16px var(--mono); text-align: center; }
.node .port { position: absolute; left: -11px; bottom: -9px; height: 16px; padding: 0 3px; background: var(--red); color: var(--red-ink); font: 700 .62rem/16px var(--mono); }
.node.sel { border-color: var(--red); background: var(--red); z-index: 3; }
/* the chain of the research in focus: its prerequisites in red, nearest first; what it leads to in ink; the rest recedes */
.tree.focus .node:not(.anc):not(.des):not(.self) { opacity: .22; }
.tree.focus svg path:not(.anc):not(.des) { opacity: .1; }
.tree.focus .node.anc { border-color: var(--red); animation: step .45s var(--ease) backwards; animation-delay: calc(var(--d, 1) * 70ms); }
.tree.focus svg path.anc { stroke: var(--red); opacity: 1; stroke-width: 3; stroke-dasharray: none; animation: none; }
.tree.focus svg path.des { opacity: .9; }
.tree.focus .node.self { border-color: var(--red); }
@keyframes step { from { transform: translate(-50%, -50%) scale(.7); opacity: .2; } }
.tree[data-f=clue] .node:not(.clue), .tree[data-f=buy] .node:not(.buy), .tree[data-f=warp] .node:not(.w) { opacity: .15; }
.tree[data-f=clue] svg path, .tree[data-f=buy] svg path, .tree[data-f=warp] svg path { opacity: .12; }

.rinfo { border-left: 2px solid var(--rule); padding: 18px 18px 22px; max-height: 78vh; overflow-y: auto; scrollbar-width: thin; }
.rinfo.in > * { animation: up2 .4s var(--ease) backwards; }
.rinfo.in > :nth-child(2) { animation-delay: 40ms; } .rinfo.in > :nth-child(3) { animation-delay: 80ms; }
.rinfo.in > :nth-child(n+4) { animation-delay: 120ms; }
@keyframes up2 { from { opacity: 0; transform: translateY(8px); } }
.rinfo .k, .rinfo h4, .rinfo .rhow, .rinfo .rcat { font: .7rem var(--mono); letter-spacing: .05em; color: var(--muted); }
.rinfo .k { margin: 0 0 4px; text-transform: uppercase; }
.rinfo h3 { font-size: 1.5rem; margin: 0 0 6px; }
.rinfo .how { margin: 0 0 10px; }
.rinfo .warp { color: var(--magic); }
.rinfo h4 { margin: 20px 0 8px; padding-top: 10px; border-top: 2px solid var(--rule); color: var(--text); text-transform: uppercase; }
.rinfo h4 .n { color: var(--red-text); }
.rroute { margin: 0; padding: 0; list-style: none; counter-reset: st; }
.rroute li { counter-increment: st; padding: 7px 0 7px 30px; border-bottom: 1px solid var(--border); position: relative; line-height: 1.4; }
.rroute li::before { content: counter(st, decimal-leading-zero); position: absolute; left: 0; top: 9px; font: .68rem var(--mono); color: var(--red-text); }
.rroute a { font-weight: 600; }
.rroute .rhow { display: block; }
.rinfo .rcat { border: 1px solid var(--border); padding: 0 4px; }
.rsum { display: grid; grid-template-columns: 1fr auto; gap: 0 12px; margin: 0 0 10px; }
.rsum dt, .rsum dd { margin: 0; padding: 6px 0; border-bottom: 1px solid var(--border); }
.rsum dd { font-family: var(--mono); }
@media (max-width: 900px) {
  .rmap { grid-template-columns: 1fr; }
  .rinfo { border-left: 0; border-top: 2px solid var(--rule); max-height: none; }
  .rlegend { margin-left: 0; }
}

/* ---------------------------------------------------------------- aspect chart: rows of combining steps */
.rfilters a { font: inherit; color: var(--text); border: 1px solid var(--rule); margin-left: -1px; padding: 5px 10px; }
.rfilters a.cur { background: var(--text); color: var(--bg); }
.agraph { position: relative; margin: 20px 24px 20px 78px; }
.agraph svg { position: absolute; inset: 0; overflow: visible; pointer-events: none; }
.agraph svg path { fill: none; stroke: var(--text); stroke-width: 1.5; opacity: .13; transition: opacity .25s, stroke .25s; }
.agraph .tier { position: absolute; left: -84px; width: 70px; transform: translateY(-50%); font: .66rem var(--mono); letter-spacing: .05em; color: var(--muted); text-transform: uppercase; }
.agraph .tier::after { content: ""; position: absolute; left: 100%; top: 50%; width: 2000px; border-top: 1px dashed var(--border); }
.anode { position: absolute; width: 44px; height: 44px; transform: translate(-50%, -50%); display: grid; place-items: center; background: var(--bg); border: 2px solid var(--rule); border-bottom: 5px solid var(--c, var(--rule)); color: var(--text); transition: opacity .25s, transform .25s var(--ease), border-color .25s, background .25s; z-index: 1; }
.anode .icon { width: 26px; height: 26px; }
.anode .lbl { position: absolute; top: 100%; left: 50%; transform: translateX(-50%); margin-top: 6px; white-space: nowrap; font-size: .74rem; font-weight: 600; background: var(--bg); padding: 0 3px; }
.anode.opt { border-style: dashed; border-bottom-style: solid; }
.anode:hover, .anode:focus-visible { transform: translate(-50%, -50%) scale(1.14); z-index: 3; color: var(--text); }
.anode.sel { background: var(--text); }
.anode.sel .lbl { background: var(--text); color: var(--bg); }
.agraph.focus .anode:not(.anc):not(.des):not(.self) { opacity: .2; }
.agraph.focus svg path:not(.anc):not(.des) { opacity: .04; }
.agraph.focus svg path.anc { stroke: var(--red); stroke-width: 3; opacity: 1; }
.agraph.focus svg path.des { opacity: .85; stroke-width: 2; }
.agraph.focus .anode.anc { border-color: var(--red); border-bottom-color: var(--c); animation: step .45s var(--ease) backwards; animation-delay: calc(var(--d, 1) * 70ms); }
.agraph.focus .anode.self { border-color: var(--red); border-bottom-color: var(--c); }
.rinfo .how a, .rinfo .pill a { font-weight: 700; text-decoration: underline; text-decoration-color: var(--red); text-underline-offset: 3px; }
.rinfo .aspbar { grid-template-columns: 0 minmax(3em, auto) 1fr 22px; }

/* the connection helper and its route on the chart */
.linker { margin-top: 44px; }
.linker > h2 { border-top: 2px solid var(--rule); padding-top: 12px; }
.linkform { display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: end; margin: 14px 0 18px; }
.linkform label { display: grid; gap: 4px; font: .72rem var(--mono); letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.linkform select, .linkform input { font: 600 1rem var(--display); color: var(--text); background: var(--bg); border: 0; border-bottom: 2px solid var(--rule); padding: 6px 2px; min-width: 9em; text-transform: none; letter-spacing: 0; }
.linkform input { min-width: 6em; width: 6em; }
.linkform select:focus, .linkform input:focus { outline: 0; border-bottom-color: var(--red); }
.chain { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-wrap: wrap; gap: 10px 0; }
.chain li { display: grid; grid-template-columns: auto auto; grid-template-rows: auto auto; column-gap: 8px; align-items: center; padding: 10px 34px 10px 14px; border: 2px solid var(--rule); border-bottom: 5px solid var(--c, var(--rule)); margin-right: 22px; position: relative; background: var(--bg); }
.chain li:not(:last-child)::after { content: "→"; position: absolute; right: -19px; top: 50%; transform: translateY(-50%); color: var(--red-text); font-weight: 800; }
.chain .no { grid-column: 1 / -1; font: .66rem var(--mono); color: var(--red-text); }
.chain .icon { width: 26px; height: 26px; }
.chain a { font-weight: 700; }
.chain .why { position: absolute; right: 8px; top: 8px; font: .62rem var(--mono); color: var(--muted); }
.agraph.routed:not(.focus) .anode:not(.onroute) { opacity: .25; }
.agraph.routed:not(.focus) svg path:not(.route) { opacity: .05; }
.agraph svg path.route { stroke: var(--red); stroke-width: 3; opacity: 1; }
.anode.onroute { border-color: var(--red); border-bottom-color: var(--c); }
.anode .step { position: absolute; right: -10px; top: -10px; min-width: 16px; height: 16px; padding: 0 3px; background: var(--red); color: var(--red-ink); font: 700 .62rem/16px var(--mono); text-align: center; }
.setends { display: flex; flex-wrap: wrap; gap: 6px; }
.setends button { font: .7rem var(--mono); letter-spacing: .04em; color: var(--text); background: none; border: 1px solid var(--rule); padding: 4px 8px; cursor: pointer; }
.setends button:hover { background: var(--text); color: var(--bg); }

/* ---------------------------------------------------------------- the catalogue: one kind of list for every list of entries */
.chead { display: flex; align-items: baseline; gap: 14px; border-top: 2px solid var(--rule); padding-top: 12px; margin: 34px 0 6px; }
.chead h2 { margin: 0; font-size: 1.3rem; flex: 1; }
.chead h2 .n { font: 400 .85rem var(--mono); color: var(--red-text); margin-left: 6px; }
.chead .more { font: .72rem var(--mono); letter-spacing: .05em; border-bottom: 1px solid var(--rule); }
.crows { border-bottom: 1px solid var(--border); }
.crow { display: grid; grid-template-columns: 32px minmax(8em, 15em) minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 9px 0 9px 12px; border-top: 1px solid var(--border); position: relative; color: var(--text); }
.crow::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--red); transform: scaleY(0); transition: transform .25s var(--ease); }
.crow:hover { background: var(--surface-2); color: var(--text); }
.crow:hover::before { transform: scaleY(1); }
.crow .icon { transition: transform .3s var(--ease); }
.crow:hover .icon { transform: scale(1.18) rotate(-5deg); }
.crow .nm { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crow .sum { color: var(--muted); font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crow:hover .sum { color: var(--text); white-space: normal; }
.crow .fig { font: .7rem var(--mono); letter-spacing: .04em; color: var(--muted); white-space: nowrap; text-align: right; }
mark { background: var(--red); color: var(--red-ink); padding: 0 2px; }
.catalog { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 36px; align-items: start; margin-top: 26px; }
.catalog .catsec:first-child .chead, .catalog > div > .chead:first-child { margin-top: 0; }
.catrail { position: sticky; top: calc(var(--top-h) + 20px); max-height: calc(100vh - var(--top-h) - 40px); overflow-y: auto; scrollbar-width: none; }
.catrail h2 { font: .72rem var(--mono); letter-spacing: .06em; text-transform: uppercase; border-top: 2px solid var(--rule); padding-top: 12px; margin: 0 0 6px; }
.catrail a { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0 7px 12px; border-left: 2px solid var(--border); color: var(--muted); transition: color .2s, border-color .2s, padding .25s var(--ease); }
.catrail a:hover { color: var(--text); border-left-color: var(--text); }
.catrail a.cur { color: var(--text); font-weight: 700; border-left-color: var(--red); padding-left: 20px; }
.catrail i { font: normal .72rem var(--mono); color: var(--muted); }
table.mobs td .sum { display: block; color: var(--muted); font-size: .86rem; max-width: 46em; margin-top: 2px; }
table.mobs td.mstat { min-width: 110px; white-space: nowrap; }
table.mobs td.mstat b { display: inline-block; min-width: 2.6em; font: 700 .9rem var(--mono); }
table.mobs td.mstat .bar { display: inline-block; width: 64px; height: 6px; background: var(--border); vertical-align: middle; }
table.mobs td.mstat .bar i { display: block; height: 100%; background: var(--text); transform: scaleX(var(--v)); transform-origin: left; animation: grow 1s var(--ease) backwards; }
table.mobs tr:hover td.stat .bar i { background: var(--red); }
.tagboss { font: 700 .64rem var(--mono); letter-spacing: .08em; background: var(--red); color: var(--red-ink); padding: 1px 6px; margin-left: 8px; vertical-align: 2px; }
@media (max-width: 900px) {
  .catalog { grid-template-columns: 1fr; gap: 0; }
  .catrail { position: static; max-height: none; display: flex; flex-wrap: wrap; gap: 0 14px; }
  .catrail h2 { width: 100%; }
  .catrail a { border-left: 0; border-bottom: 2px solid transparent; padding: 6px 0; gap: 6px; }
  .catrail a.cur { padding-left: 0; border-bottom-color: var(--red); }
  .crow { grid-template-columns: 32px minmax(0, 1fr) auto; }
  .crow .sum { grid-column: 2 / -1; white-space: normal; }
}

/* ---------------------------------------------------------------- detail pages: rankings, routes in the side column, a glyph for the faceless */
.rank.three { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 36px; }
.rk.noicon { grid-template-columns: minmax(0, 1fr) auto; }
.rk.one { grid-template-columns: 28px minmax(0, 1fr) auto; }
.rk.one .icon { width: 24px; height: 24px; }
.side .rroute li { font-size: .92rem; }
.side .card h3 .src::before { content: none; }
.side .card h3 .src { color: var(--red-text); font-size: .72rem; }
.bigicon.glyph { font: 800 4.4rem/1 var(--display); color: var(--text); }
.aspbar > span:first-child:empty { display: none; }
.aspbar:has(> span:first-child:empty) { grid-template-columns: minmax(3em, auto) 1fr 34px; }
.aspbar .bar i { background: var(--c, var(--text)); }
@media (max-width: 900px) { .rank.three { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- articles: posters in the list, a cover and an index on the page */
.pcards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 34px 26px; margin-top: 22px; }
.pcard { display: block; color: var(--text); }
.pcard:hover { color: var(--text); }
.pcard .poster { display: block; padding: 0; }
.pcard h2 { font-size: 1.35rem; margin: 14px 0 6px; border: 0; padding: 0; transition: color .25s; }
.pcard:hover h2 { color: var(--red-text); }
.pcard p { margin: 0 0 8px; color: var(--muted); line-height: 1.65; }
/* the article list, one section per mod */
.agroup + .agroup { margin-top: 44px; }
.agh { display: flex; align-items: center; gap: 12px; margin: 28px 0 0; font-size: 1.15rem; }
.agh img { max-height: 28px; max-width: 160px; object-fit: contain; }
.agh .n { font: .8rem var(--mono); color: var(--muted); }
/* the article's own cover: the title is part of the page, never waiting on an animation */
.cover { min-height: 250px; display: flex; align-items: flex-end; padding: 22px 26px; margin: 16px 0 6px; }
.cover .cv-main { height: 78%; }
[data-l="0"].cover .cv-art::before { width: 30%; }
[data-l="0"].cover .cv-main { left: 4%; }
[data-l="1"].cover .cv-main { right: 6%; }
[data-l="2"].cover .cv-main { left: auto; right: 10%; }
[data-l="2"].cover .cv-art::before { width: 26%; }
.cover .cv-rest { gap: 6px; }
.cover .cv-rest span { width: 52px; height: 52px; background-size: 36px; }
.cover .cv-logo { max-height: 34px; }
[data-l="0"].cover .cv-logo { bottom: auto; top: 12px; }
[data-l="0"].cover .cv-rest { top: 56px; }
.cover h1 { margin: 0; background: var(--bg); border: 2px solid var(--rule); padding: 4px 16px; font-size: clamp(2rem, 4.6vw, 3.6rem); position: relative; }
.layout2 > .secnav + article .article-body { margin-top: 0; }
@media (max-width: 900px) { .pcards { grid-template-columns: 1fr; } .cover { min-height: 200px; } .cover .cv-rest { display: none; } }

/* ---------------------------------------------------------------- the rest: page titles, warnings, forms, the comparison, a dead end */
:root, :root[data-theme=dark] { --warm: var(--red); --warm-soft: transparent; --warm-border: var(--red); }
.pill.warn { border-color: var(--red); color: var(--red-text); background: none; }
main > h1, .crumbs + h1 { border-bottom: 2px solid var(--rule); padding: 14px 0 16px; margin: 0 0 18px; }
main > h1 .muted, .crumbs + h1 .muted { font: 400 .9rem var(--mono); color: var(--red-text); margin-left: 8px; vertical-align: .5em; }
.form input, .form select, .form textarea, .inline select, .inline input[type=password] { border: 0; border-bottom: 2px solid var(--rule); background: none; padding: 8px 2px; color: var(--text); font: 1rem var(--display); }
.form input:focus, .form select:focus, .form textarea:focus { outline: 0; border-bottom-color: var(--red); }
.form label { font: .72rem var(--mono); letter-spacing: .05em; text-transform: uppercase; }
.editor textarea { border: 2px solid var(--rule); padding: 12px; font: .9rem/1.6 var(--mono); }
.editor textarea:focus { border-color: var(--red); }
.card:has(> .form), main > .card:has(form) { border: 2px solid var(--rule); padding: 22px 24px; }
.warnbox { border: 2px solid var(--red); }
.diffview { background: none; border: 1px solid var(--border); font-family: var(--mono); }
table.packs th, table.loot th { font: .7rem var(--mono); letter-spacing: .05em; text-transform: uppercase; color: var(--muted); border-bottom: 2px solid var(--rule); }
.diff { margin-top: 0; }
.diffentry { padding: 14px 0 18px; border-bottom: 1px solid var(--border); }
.diffentry .reason { margin: 0 0 12px; max-width: 60em; color: var(--muted); font: .78rem/1.6 var(--mono); }
.diffentry .reason span { color: var(--red-text); margin-right: 10px; text-transform: uppercase; letter-spacing: .05em; }
.stat .pill { font-family: var(--mono); font-size: .76rem; }

.nf { position: relative; overflow: hidden; isolation: isolate; border: 2px solid var(--rule); background: var(--surface-2); padding: 40px 36px 34px; margin-top: 18px; min-height: 500px; display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-start; gap: 12px; }
.nf .a, .nf .b, .nf .c { position: absolute; z-index: -1; }
.nf .a { background: var(--red); width: 130%; height: 42%; left: -15%; top: 10%; transform: rotate(-9deg); animation: slidein 1s var(--ease) backwards; }
.nf .b { background: var(--text); height: 62%; aspect-ratio: 1; border-radius: 50% !important; right: 6%; top: 8%; animation: pop .9s var(--ease) .15s backwards; }
.nf .c { background: var(--text); width: 10px; height: 180%; left: 46%; top: -40%; transform: rotate(31deg); }
.nf .code { position: absolute; left: 26px; top: 0; z-index: -1; font: 800 clamp(6rem, 17vw, 13rem)/1 var(--display); letter-spacing: -.04em; }
.nf h1 { margin: 0; background: var(--bg); border: 2px solid var(--rule); padding: 4px 16px; font-size: clamp(1.8rem, 4vw, 3rem); }
.nf .what { margin: 0; background: var(--bg); padding: 2px 10px; border: 1px solid var(--rule); }
.nfsearch { display: flex; align-items: center; background: var(--bg); border: 2px solid var(--rule); width: min(560px, 100%); }
.nfsearch input[name=q] { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--text); font: 600 1.05rem var(--display); padding: 12px 14px; }
.nfsearch button { border: 0; border-left: 2px solid var(--rule); background: var(--text); color: var(--bg); font: .74rem var(--mono); letter-spacing: .08em; padding: 0 16px; align-self: stretch; cursor: pointer; }
.nfsearch button:hover { background: var(--red); color: var(--red-ink); }
.nf .ways { margin: 0; display: flex; flex-wrap: wrap; gap: 0; }
.nf .ways a { background: var(--bg); border: 1px solid var(--rule); margin: 0 -1px -1px 0; padding: 5px 12px; font-weight: 600; }
.nf .ways a:hover { background: var(--text); color: var(--bg); }

/* Mods menu and mod bar in the manual look: a nav item with the red underline, hairlines, hard edges */
.modsw { display: flex; align-items: stretch; border-left: 1px solid var(--border); }
.modsw summary { display: flex; align-items: center; padding: 0 14px; color: var(--text); font-weight: 600; font-size: .9rem; border-radius: 0; position: relative; }
.modsw summary:hover, .modsw.cur summary, .modsw[open] summary { background: none; }
.modsw summary::after { content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 4px; background: var(--red); transform: scaleX(0); transform-origin: left; transition: transform .35s var(--ease); }
.modsw summary:hover::after, .modsw.cur summary::after, .modsw[open] summary::after { transform: scaleX(1); }
.modsw > div { border: 1px solid var(--rule); box-shadow: none; }
.modbar { background: var(--bg); border-bottom: 1px solid var(--rule); }
.modbar-in { max-width: 1320px; padding: 0 clamp(16px, 3.2vw, 44px); font-family: var(--mono); letter-spacing: .03em; }
.modbar a.cur { background: none; color: var(--red-text); }
.modbar .mname { font-family: var(--display); letter-spacing: 0; }


/* home hero: the Revival Project's mark and calls to action */
.hero .label .mark { width: 22px; height: auto; }
.hero .label .mark.dark, :root[data-theme=dark] .hero .label .mark.light { display: none; }
:root[data-theme=dark] .hero .label .mark.dark { display: block; }
.hero .label:has(.mark)::before { display: none; }
.hero .cta { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0 6px; }
.btn.ghost { background: none; color: var(--text); }
