/* svVe Companion — docs shell, storyboards, diagrams */

:root {
  --bg: #ffffff;
  --bg-soft: #f6f8f7;
  --bg-sunk: #eef2f0;
  --ink: #17201b;
  --ink-2: #3b4741;
  --muted: #5d6a63;
  --line: #e3e8e5;
  --line-2: #d2dad6;
  --accent: #19744a;
  --accent-ink: #ffffff;
  --accent-soft: #e5f3ec;
  --accent-2: #0f5a38;
  --warn-bg: #fff6e0;
  --warn-ink: #6b4a00;
  --warn-line: #f1d48a;
  --danger-bg: #fdecec;
  --danger-ink: #8a1f1f;
  --danger-line: #f0b9b9;
  --info-bg: #eaf2fb;
  --info-ink: #1d4f86;
  --info-line: #bdd5ef;
  --shadow: 0 1px 2px rgba(16, 32, 24, .06), 0 6px 18px -6px rgba(16, 32, 24, .12);
  --shadow-lg: 0 2px 4px rgba(16, 32, 24, .06), 0 18px 40px -12px rgba(16, 32, 24, .22);
  --radius: 12px;
  --radius-sm: 8px;
  --font: "Figtree", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --top: 60px;
  --side: 264px;
  --rail: 220px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1411;
    --bg-soft: #141c18;
    --bg-sunk: #1a2420;
    --ink: #e6ece8;
    --ink-2: #c4cec8;
    --muted: #93a29a;
    --line: #233029;
    --line-2: #2e3d35;
    --accent: #4fc488;
    --accent-ink: #06170e;
    --accent-soft: #15301f;
    --accent-2: #7bd9a6;
    --warn-bg: #2a2210;
    --warn-ink: #f2d38a;
    --warn-line: #54431b;
    --danger-bg: #2c1515;
    --danger-ink: #f3b0b0;
    --danger-line: #5a2626;
    --info-bg: #12223a;
    --info-ink: #a9c9ef;
    --info-line: #24406a;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 18px -6px rgba(0, 0, 0, .5);
    --shadow-lg: 0 2px 4px rgba(0, 0, 0, .4), 0 18px 40px -12px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1411;
  --bg-soft: #141c18;
  --bg-sunk: #1a2420;
  --ink: #e6ece8;
  --ink-2: #c4cec8;
  --muted: #93a29a;
  --line: #233029;
  --line-2: #2e3d35;
  --accent: #4fc488;
  --accent-ink: #06170e;
  --accent-soft: #15301f;
  --accent-2: #7bd9a6;
  --warn-bg: #2a2210;
  --warn-ink: #f2d38a;
  --warn-line: #54431b;
  --danger-bg: #2c1515;
  --danger-ink: #f3b0b0;
  --danger-line: #5a2626;
  --info-bg: #12223a;
  --info-ink: #a9c9ef;
  --info-line: #24406a;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 18px -6px rgba(0, 0, 0, .5);
  --shadow-lg: 0 2px 4px rgba(0, 0, 0, .4), 0 18px 40px -12px rgba(0, 0, 0, .7);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--top) + 16px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16.5px/1.6 var(--font);
  font-feature-settings: "tnum" 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: var(--accent); color: var(--accent-ink); }
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent); }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
* { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
code, kbd, pre { font-family: var(--mono); font-size: .86em; }
:not(pre) > code { background: var(--bg-sunk); border: 1px solid var(--line); border-radius: 6px; padding: .08em .36em; color: var(--ink); overflow-wrap: anywhere; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--accent); color: var(--accent-ink); padding: 8px 12px; border-radius: 8px; }
.skip:focus { left: 8px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  height: var(--top);
  display: flex; align-items: center; gap: 16px;
  padding: 0 20px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--accent); display: grid; place-items: center; color: var(--accent-ink); }
.brand-mark svg { width: 18px; height: 18px; }
.brand small { font-weight: 500; color: var(--muted); font-size: 12px; border: 1px solid var(--line-2); border-radius: 999px; padding: 1px 8px; }
.search { margin-left: auto; position: relative; width: min(340px, 34vw); }
.search input {
  width: 100%; height: 36px; border-radius: 10px; border: 1px solid var(--line-2);
  background: var(--bg-soft); color: var(--ink); font: inherit; font-size: 14px; padding: 0 12px 0 34px;
}
.search input::placeholder { color: var(--muted); }
.search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); background: var(--bg); }
.search .icon { position: absolute; left: 10px; top: 9px; color: var(--muted); width: 17px; height: 17px; }
.top-actions { display: flex; align-items: center; gap: 6px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px;
  border: 1px solid transparent; background: transparent; color: var(--ink-2); cursor: pointer;
}
.icon-btn:hover { background: var(--bg-soft); border-color: var(--line); color: var(--ink); }
.menu-btn { display: none; }

/* ---------- layout ---------- */
.layout { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: calc(100vh - var(--top)); }
.sidebar {
  position: sticky; top: var(--top); height: calc(100vh - var(--top)); overflow-y: auto;
  border-right: 1px solid var(--line); padding: 22px 14px 28px; background: var(--bg);
}
.nav-group + .nav-group { margin-top: 22px; }
.nav-title { font-size: 12.5px; font-weight: 650; color: var(--ink); padding: 0 10px 6px; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 8px;
  color: var(--ink-2); text-decoration: none; font-size: 14.5px; line-height: 1.35;
}
.nav a .icon { width: 16px; height: 16px; color: var(--muted); }
.nav a:hover { background: var(--bg-soft); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-2); font-weight: 600; }
.nav a[aria-current="page"] .icon { color: var(--accent); }
.nav .count { margin-left: auto; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.side-foot { margin-top: 28px; padding: 14px 10px 0; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.side-foot a { color: var(--ink-2); }

.page { display: grid; grid-template-columns: minmax(0, 1fr) var(--rail); gap: 48px; padding: 40px 48px 96px; max-width: 1180px; }
.content { min-width: 0; max-width: 780px; }
.toc { position: sticky; top: calc(var(--top) + 36px); align-self: start; font-size: 13.5px; }
.toc-title { font-weight: 650; color: var(--ink); margin-bottom: 8px; font-size: 12.5px; }
.toc a { display: block; color: var(--muted); text-decoration: none; padding: 4px 0 4px 12px; border-left: 1px solid var(--line); line-height: 1.35; }
.toc a:hover { color: var(--ink); }
.toc a.active { color: var(--accent-2); border-left-color: var(--accent); }

/* ---------- type ---------- */
.breadcrumb { font-size: 13.5px; color: var(--muted); margin: 0 0 10px; display: flex; gap: 6px; align-items: center; }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--ink); }
h1, h2, h3, h4 { color: var(--ink); text-wrap: balance; }
h1 { font-size: clamp(30px, 3.6vw, 42px); line-height: 1.12; letter-spacing: -.025em; font-weight: 750; margin: 0 0 14px; }
h2 { font-size: 26px; line-height: 1.2; letter-spacing: -.018em; font-weight: 700; margin: 64px 0 12px; }
h3 { font-size: 19px; line-height: 1.3; letter-spacing: -.01em; font-weight: 650; margin: 36px 0 8px; }
h4 { font-size: 15.5px; font-weight: 650; margin: 0 0 4px; }
h2 + p, h3 + p { margin-top: 0; }
.lead { font-size: 19px; line-height: 1.55; color: var(--ink-2); margin: 0 0 18px; max-width: 64ch; }
p { margin: 0 0 14px; max-width: 70ch; }
.muted { color: var(--muted); }
.anchor { color: inherit; text-decoration: none; }
.anchor:hover::after { content: " #"; color: var(--muted); font-weight: 400; }
.facts { display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--muted); font-size: 14.5px; margin: 0 0 24px; padding: 0; list-style: none; font-variant-numeric: tabular-nums; }
.facts li { display: flex; align-items: center; gap: 6px; }
.facts strong { color: var(--ink); font-weight: 650; }
.facts .icon { width: 15px; height: 15px; color: var(--accent); }

/* ---------- buttons ---------- */
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 30px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 10px;
  font: 600 15px/1 var(--font); text-decoration: none; cursor: pointer; border: 1px solid transparent;
  transition: background-color .15s, border-color .15s, box-shadow .15s;
}
.btn .icon { width: 17px; height: 17px; }
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.btn-primary:hover { background: var(--accent-2); }
:root[data-theme="dark"] .btn-primary:hover { background: #6fd39f; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn-primary:hover { background: #6fd39f; } }
.btn-ghost { background: var(--bg); color: var(--ink); border-color: var(--line-2); }
.btn-ghost:hover { background: var(--bg-soft); }
.btn-sm { height: 32px; padding: 0 11px; font-size: 13.5px; border-radius: 8px; }

/* ---------- figures ---------- */
.shot { margin: 0; }
.shot .frame {
  border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line);
  background: var(--bg-sunk); box-shadow: var(--shadow); position: relative;
}
.shot img { width: 100%; height: 100%; object-fit: cover; image-rendering: auto; }
.shot.pixel img { image-rendering: pixelated; }
.shot.contain img { object-fit: contain; }
.shot figcaption { font-size: 13.5px; color: var(--muted); margin-top: 8px; line-height: 1.45; }
.shot figcaption strong { color: var(--ink); font-weight: 600; }
.shot figcaption a { color: var(--muted); }
.ratio-16x9 .frame { aspect-ratio: 16 / 9; }
.ratio-3x2 .frame { aspect-ratio: 3 / 2; }
.ratio-4x3 .frame { aspect-ratio: 4 / 3; }
.ratio-1 .frame { aspect-ratio: 1; }
.img-missing .frame { display: grid; place-items: center; }
.img-missing .frame::after { content: "Image unavailable — see the mod page"; font-size: 13px; color: var(--muted); }
.img-missing img { display: none; }

.hero-art { margin: 6px 0 0; }
.hero-art .frame { aspect-ratio: 16 / 8; box-shadow: var(--shadow-lg); }

.mosaic { display: grid; grid-template-columns: 1.35fr 1fr; grid-template-rows: auto auto; gap: 14px; margin: 18px 0 8px; }
.mosaic .shot:first-child { grid-row: span 2; }
.mosaic .shot:first-child { display: flex; flex-direction: column; }
.mosaic .shot:first-child .frame { flex: 1; min-height: 300px; }
.mosaic .shot .frame { aspect-ratio: auto; }
.mosaic .shot:not(:first-child) .frame { aspect-ratio: 16 / 9; }

.gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 18px; margin: 18px 0 8px; }
.gallery.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* ---------- callouts ---------- */
.callout {
  display: grid; grid-template-columns: 22px 1fr; gap: 12px; align-items: start;
  padding: 14px 16px; border-radius: var(--radius-sm); margin: 20px 0;
  background: var(--info-bg); color: var(--info-ink); border: 1px solid var(--info-line); font-size: 15px;
}
.callout .icon { width: 20px; height: 20px; margin-top: 2px; }
.callout p { margin: 0; max-width: none; }
.callout p + p { margin-top: 6px; }
.callout strong { color: inherit; }
.callout a { color: inherit; text-decoration-color: currentColor; }
.callout.warn { background: var(--warn-bg); color: var(--warn-ink); border-color: var(--warn-line); }
.callout.danger { background: var(--danger-bg); color: var(--danger-ink); border-color: var(--danger-line); }
.callout.tip { background: var(--accent-soft); color: var(--accent-2); border-color: color-mix(in srgb, var(--accent) 30%, transparent); }

/* ---------- storyboard ---------- */
.storyboard { list-style: none; padding: 0; margin: 22px 0 10px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 26px 18px; counter-reset: panel; }
.storyboard.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.storyboard > li { counter-increment: panel; display: flex; flex-direction: column; gap: 10px; }
.panel-art {
  position: relative; aspect-ratio: 4 / 3; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--line); background: var(--bg-soft); box-shadow: var(--shadow);
}
.panel-art > img { width: 100%; height: 100%; object-fit: cover; }
.panel-art.contain > img { object-fit: contain; background: var(--bg-sunk); }
.panel-art::before {
  content: counter(panel); position: absolute; z-index: 2; left: 10px; top: 10px;
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink); font: 700 13px/1 var(--font); box-shadow: 0 1px 3px rgba(0,0,0,.25);
}
.storyboard h3 { font-size: 15.5px; margin: 0; line-height: 1.35; }
.storyboard p { font-size: 14.5px; color: var(--ink-2); margin: 0; line-height: 1.5; }

/* code block with copy */
.codeblock { position: relative; margin: 12px 0; }
.codeblock pre { margin: 0; background: var(--bg-sunk); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; padding-right: 76px; overflow-x: auto; font-size: 13px; line-height: 1.6; color: var(--ink); }
.copy { position: absolute; top: 7px; right: 7px; height: 28px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--bg); color: var(--ink-2); font: 600 12.5px/1 var(--font); cursor: pointer; }
.copy:hover { color: var(--ink); border-color: var(--muted); }
.copy.ok { color: var(--accent-2); border-color: var(--accent); }

/* ---------- expansions ---------- */
.xp { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 24px; align-items: start; margin: 18px 0 8px; }
.xp-facts { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.xp-facts li { display: grid; grid-template-columns: 20px 1fr; gap: 10px; font-size: 15px; color: var(--ink-2); line-height: 1.45; }
.xp-facts .icon { width: 18px; height: 18px; color: var(--accent); margin-top: 2px; }
.xp-facts strong { color: var(--ink); }
.getthere { margin-top: 14px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--bg-soft); border: 1px solid var(--line); font-size: 14.5px; display: grid; grid-template-columns: 20px 1fr; gap: 10px; }
.getthere .icon { color: var(--accent); width: 18px; height: 18px; margin-top: 2px; }
.byline { font-size: 13.5px; color: var(--muted); margin: -4px 0 0; }

.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 22px 18px; margin: 18px 0; }
.person .frame { aspect-ratio: 16 / 10; }
.person h3 { margin: 10px 0 2px; font-size: 15.5px; }
.person p { font-size: 14px; color: var(--ink-2); margin: 0; }
.person .where { font-size: 13px; color: var(--muted); margin-top: 4px; }

.valley-map { margin: 18px 0 6px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-soft); padding: 8px; box-shadow: var(--shadow); }
.valley-map svg { width: 100%; height: auto; display: block; }
.vm-land { fill: var(--accent-soft); stroke: color-mix(in srgb, var(--accent) 35%, transparent); }
.vm-sea { fill: color-mix(in srgb, #3b82c4 18%, var(--bg-soft)); }
.vm-road { stroke: var(--line-2); stroke-width: 4; fill: none; stroke-linecap: round; }
.vm-link { stroke: var(--muted); stroke-width: 1.5; stroke-dasharray: 4 4; fill: none; }
.vm-node circle { fill: var(--bg); stroke: var(--ink-2); stroke-width: 2; }
.vm-node.new circle { fill: var(--accent); stroke: var(--accent); }
.vm-node text { font: 600 13px var(--font); fill: var(--ink); }
.vm-node text.sub { font-weight: 400; font-size: 11.5px; fill: var(--muted); }
.vm-node a:hover text { fill: var(--accent); text-decoration: underline; }
.legend { display: flex; gap: 18px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin: 4px 0 0; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--ink-2); display: inline-block; }
.legend i.new { background: var(--accent); border-color: var(--accent); }

/* ---------- overview journey ---------- */
.journey { list-style: none; padding: 0; margin: 20px 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.journey li { padding: 16px; position: relative; background: var(--bg); }
.journey li + li { border-left: 1px solid var(--line); }
.journey a { text-decoration: none; color: inherit; display: block; }
.journey h3 { font-size: 15.5px; margin: 0; display: flex; align-items: center; gap: 8px; }
.journey h3 .icon { color: var(--accent); width: 18px; height: 18px; }
.journey p { font-size: 13.5px; color: var(--muted); margin: 4px 0 0 26px; line-height: 1.45; }
.journey li:hover { background: var(--bg-soft); }
.journey li:hover h3 { color: var(--accent-2); }

.xp-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 18px; margin: 18px 0; }
.xp-tile { text-decoration: none; color: inherit; display: block; }
.xp-tile .frame { aspect-ratio: 16 / 9; transition: box-shadow .2s, transform .2s cubic-bezier(.16, 1, .3, 1); }
.xp-tile:hover .frame { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.xp-tile h3 { margin: 12px 0 2px; display: flex; align-items: center; gap: 6px; font-size: 16px; }
.xp-tile p { font-size: 14px; color: var(--muted); margin: 0; }
.xp-tile:hover h3 { color: var(--accent-2); }

.checklist { list-style: none; padding: 0; margin: 14px 0; display: grid; gap: 10px; }
.checklist li { display: grid; grid-template-columns: 22px 1fr; gap: 10px; font-size: 15px; color: var(--ink-2); }
.checklist .icon { color: var(--accent); width: 20px; height: 20px; margin-top: 1px; }
.checklist .no .icon, .checklist li.no .icon { color: var(--danger-ink); }

/* ---------- keys ---------- */
kbd, .key {
  display: inline-flex; align-items: center; justify-content: center; min-width: 1.9em; height: 1.75em; padding: 0 .45em;
  border-radius: 6px; border: 1px solid var(--line-2); border-bottom-width: 2px; background: var(--bg);
  font: 600 .8em/1 var(--mono); color: var(--ink); white-space: nowrap; vertical-align: .08em;
}
.keyboard { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; margin: 18px 0; }
.keytile { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg); }
.keytile .cap {
  min-width: 46px; height: 46px; padding: 0 8px; border-radius: 10px; display: grid; place-items: center;
  font: 700 15px/1 var(--mono); color: var(--ink); background: var(--bg-soft);
  border: 1px solid var(--line-2); border-bottom-width: 4px; white-space: nowrap;
}
.keytile b { display: block; font-size: 14px; color: var(--ink); line-height: 1.3; }
.keytile span { font-size: 12.5px; color: var(--muted); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); margin: 16px 0; }
table { border-collapse: collapse; width: 100%; font-size: 14.5px; font-variant-numeric: tabular-nums; }
th { text-align: left; font-weight: 650; font-size: 13px; color: var(--muted); background: var(--bg-soft); padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; color: var(--ink-2); }
tr:last-child td { border-bottom: 0; }
td:first-child { color: var(--ink); font-weight: 600; }

/* ---------- mod list ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 8px; }
.chip {
  appearance: none; border: 1px solid var(--line-2); background: var(--bg); color: var(--ink-2);
  font: 600 13.5px/1 var(--font); padding: 8px 12px; border-radius: 99px; cursor: pointer; display: inline-flex; gap: 7px; align-items: center;
}
.chip:hover { border-color: var(--muted); color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip .n { font-weight: 500; opacity: .7; font-variant-numeric: tabular-nums; }
.modsearch { position: relative; margin: 10px 0 0; max-width: 420px; }
.modsearch input { width: 100%; height: 42px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--bg); color: var(--ink); font: inherit; font-size: 15px; padding: 0 12px 0 38px; }
.modsearch input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.modsearch .icon { position: absolute; left: 12px; top: 12px; color: var(--muted); }
.result-count { font-size: 13.5px; color: var(--muted); margin: 14px 0 0; font-variant-numeric: tabular-nums; }
.modgroup h2 { display: flex; align-items: baseline; gap: 10px; margin-top: 44px; }
.modgroup h2 .n { font-size: 15px; color: var(--muted); font-weight: 500; font-variant-numeric: tabular-nums; }
.modgroup > p { color: var(--muted); font-size: 15px; }
.modlist { list-style: none; padding: 0; margin: 12px 0 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.mod { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: 16px; padding: 14px 16px; align-items: center; background: var(--bg); }
.mod + .mod { border-top: 1px solid var(--line); }
.mod:hover { background: var(--bg-soft); }
.mod .thumb { width: 96px; aspect-ratio: 16/10; border-radius: 8px; overflow: hidden; background: var(--bg-sunk); border: 1px solid var(--line); }
.mod .thumb img { width: 100%; height: 100%; object-fit: cover; }
.mod h3 { margin: 0; font-size: 15.5px; line-height: 1.3; }
.mod h3 a { color: var(--ink); text-decoration: none; }
.mod h3 a:hover { color: var(--accent-2); text-decoration: underline; }
.mod .meta { font-size: 12.5px; color: var(--muted); margin-top: 2px; font-variant-numeric: tabular-nums; }
.mod .sum { font-size: 14px; color: var(--ink-2); margin: 5px 0 0; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: none; }
.mod .stats { text-align: right; font-size: 12.5px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; line-height: 1.6; }
.mod .stats b { color: var(--ink); font-weight: 600; }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); border: 1px dashed var(--line-2); border-radius: var(--radius); margin-top: 18px; }
.empty .btn { margin-top: 12px; }

/* ---------- help ---------- */
.issue { border: 1px solid var(--line); border-radius: var(--radius); margin: 12px 0; background: var(--bg); }
.issue > summary { list-style: none; cursor: pointer; padding: 14px 16px; display: grid; grid-template-columns: 22px 1fr 18px; gap: 12px; align-items: center; font-weight: 600; color: var(--ink); }
.issue > summary::-webkit-details-marker { display: none; }
.issue > summary .icon { color: var(--muted); }
.issue > summary .chev { transition: transform .2s; }
.issue[open] > summary .chev { transform: rotate(180deg); }
.issue[open] > summary { border-bottom: 1px solid var(--line); }
.issue-body { padding: 14px 16px 16px 50px; font-size: 15px; color: var(--ink-2); }
.issue-body ol, .issue-body ul { margin: 0 0 8px; padding-left: 18px; }
.issue-body li + li { margin-top: 4px; }

.support { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 18px 0; }
.support a { display: grid; grid-template-columns: 40px 1fr; gap: 12px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: inherit; background: var(--bg); }
.support a:hover { border-color: var(--accent); background: var(--bg-soft); }
.support .j-icon { width: 40px; height: 40px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.support b { display: block; color: var(--ink); }
.support span { font-size: 13.5px; color: var(--muted); }

/* ---------- pager & footer ---------- */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 72px 0 0; }
.pager a { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; text-decoration: none; color: var(--ink); display: block; }
.pager a:hover { border-color: var(--accent); }
.pager small { display: block; font-size: 12.5px; color: var(--muted); }
.pager b { font-weight: 650; }
.pager .next { text-align: right; grid-column: 2; }
.site-foot { margin-top: 56px; padding-top: 22px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); line-height: 1.6; }
.site-foot p { max-width: none; margin: 0 0 6px; }
.site-foot a { color: var(--ink-2); }

/* ---------- motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  .content > * { animation: rise .5s cubic-bezier(.16, 1, .3, 1) both; }
  .content > *:nth-child(2) { animation-delay: .03s; }
  .content > *:nth-child(3) { animation-delay: .06s; }
  .content > *:nth-child(4) { animation-delay: .09s; }
  .content > *:nth-child(5) { animation-delay: .12s; }
  .content > *:nth-child(n+6) { animation-delay: .15s; }
}
@keyframes rise { from { opacity: .001; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .page { grid-template-columns: minmax(0, 1fr); padding: 36px 36px 80px; }
  .toc { display: none; }
}
@media (max-width: 900px) {
  :root { --top: 56px; }
  .answers { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .layout { grid-template-columns: 1fr; }
  .menu-btn { display: inline-grid; }
  .sidebar {
    position: fixed; z-index: 40; top: var(--top); left: 0; bottom: 0; width: min(300px, 86vw); height: auto;
    transform: translateX(-102%); transition: transform .28s cubic-bezier(.16, 1, .3, 1); box-shadow: var(--shadow-lg);
  }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { opacity: 1; pointer-events: auto; }
  .scrim { position: fixed; inset: var(--top) 0 0 0; background: rgba(8, 14, 11, .45); z-index: 35; opacity: 0; pointer-events: none; transition: opacity .2s; }
  .search { width: auto; flex: 1; max-width: 300px; }
  .brand small { display: none; }
  .page { padding: 28px 16px 64px; }
  .storyboard { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .journey { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .journey li:nth-child(3) { border-left: 0; }
  .journey li:nth-child(n+3) { border-top: 1px solid var(--line); }
  .gallery.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .lead { font-size: 17.5px; }
  h2 { font-size: 23px; margin-top: 52px; }
  .topbar { padding: 0 12px; gap: 8px; }
  .brand-name { display: none; }
  .top-actions .btn-sm { width: 36px; padding: 0; justify-content: center; font-size: 0; gap: 0; }
  .top-actions .btn-sm .icon { width: 17px; height: 17px; }
  .search { max-width: none; }
  .storyboard, .storyboard.two, .gallery, .gallery.three, .xp-grid, .xp, .support { grid-template-columns: minmax(0, 1fr); }
  .mosaic { grid-template-columns: 1fr; }
  .mosaic .shot:first-child { grid-row: auto; }
  .mosaic .shot:first-child .frame { min-height: 0; aspect-ratio: 16 / 10; }
  .journey { grid-template-columns: 1fr; }
  .journey li + li { border-left: 0; border-top: 1px solid var(--line); }
  .mod { grid-template-columns: 64px minmax(0, 1fr); gap: 12px; padding: 12px; }
  .mod .thumb { width: 64px; }
  .mod .stats { grid-column: 2; text-align: left; display: flex; gap: 12px; }
  .pager { grid-template-columns: 1fr; }
  .pager .next { grid-column: 1; }
  .hero-art .frame { aspect-ratio: 16 / 10; }
  .valley-map .map-list { display: block; }
  .valley-map svg text { display: none; }
  .friends { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .answers { grid-template-columns: minmax(0, 1fr); }
  .table-wrap td { padding: 10px 12px; }
}

/* image focus for crops that would cut labels */
.pos-left img { object-position: left center; }
.pos-left-top img { object-position: left top; }
.chord { white-space: nowrap; }

/* map places list: the readable version of the map on phones */
.map-list { display: none; list-style: none; margin: 10px 4px 4px; padding: 0; font-size: 14.5px; color: var(--ink-2); }
.map-list li { padding: 8px 0; border-top: 1px solid var(--line); }
.map-list b { display: block; color: var(--ink); font-weight: 650; }

/* old friends picture strip */
.friends { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px 14px; margin: 18px 0; }
.friends .frame { aspect-ratio: 16 / 10; }

/* quick answers as yes / no tiles */
.answers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 16px 0; }
.answer { display: grid; grid-template-columns: 22px 1fr; gap: 10px; padding: 14px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--bg); }
.answer .icon { width: 20px; height: 20px; margin-top: 1px; }
.answer b { display: block; color: var(--ink); font-size: 15px; }
.answer span { font-size: 13.5px; color: var(--muted); }
.answer.yes .icon { color: var(--accent); }
.answer.maybe .icon { color: var(--warn-ink); }
.answer.no .icon { color: var(--danger-ink); }

/* still frames for animated GIFs under reduced motion */
.gif-still { position: relative; display: block; width: 100%; height: 100%; padding: 0; border: 0; background: none; cursor: pointer; }
.gif-still canvas { width: 100%; height: 100%; object-fit: cover; display: block; }
.gif-still .play { position: absolute; left: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 99px; background: rgba(10, 16, 13, .78); color: #fff; font: 600 12.5px/1 var(--font); }
@media (max-width: 640px) {
  .keyboard { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .keytile { grid-template-columns: 1fr; gap: 8px; padding: 10px; }
  .keytile .cap { justify-self: start; min-width: 40px; height: 40px; }
}

/* generated art is always labeled so it can't be mistaken for a game capture */
.art { position: relative; }
.art::after {
  content: "Illustration"; position: absolute; right: 8px; bottom: 8px; z-index: 2;
  padding: 3px 8px; border-radius: 99px; background: rgba(10, 16, 13, .72); color: #fff;
  font: 600 11px/1.3 var(--font); letter-spacing: .01em; pointer-events: none;
}
