/* Nuke Tycoon Wiki — theme colours come from the game logo (purple + neon green, cyan/magenta glitch edge). */
:root {
  --bg: #090a11;
  --surface: #11131d;
  --surface-2: #181b29;
  --surface-3: #20243a;
  --border: #262a40;
  --border-strong: #363b58;
  --text: #e7e9f3;
  --muted: #9aa1bb;
  --purple: #8b5cf6;
  --purple-soft: #b69cff;
  --green: #3dff2e;
  --green-soft: #8dff84;
  --cyan: #22d3ee;
  --pink: #ff4fd8;
  --danger: #ff6b7a;
  --radius: 12px;
  --topbar-h: 62px;
  --font-display: 'Chakra Petch', 'Segoe UI', system-ui, sans-serif;
  --font-body: 'Inter', 'Segoe UI', system-ui, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--topbar-h) + 16px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.65 var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; }
a { color: var(--purple-soft); text-decoration: none; }
a:hover { color: var(--green-soft); }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.2; margin: 0; }
kbd {
  font: 600 12px var(--font-body); padding: 2px 7px; border-radius: 6px;
  border: 1px solid var(--border-strong); color: var(--muted); background: var(--surface);
}
.muted { color: var(--muted); }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 12px; top: 12px; z-index: 100; background: var(--surface-3); padding: 8px 12px; border-radius: 8px; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; border-radius: 4px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 10px; border: 1px solid transparent;
  font: 600 15px var(--font-body); cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: transform .12s, box-shadow .12s, background .12s, border-color .12s;
}
.btn-sm { padding: 7px 12px; font-size: 14px; }
.btn-play { background: var(--green); color: #06120a; box-shadow: -2px 2px 0 var(--cyan), 2px -2px 0 var(--pink); }
.btn-play:hover { color: #06120a; transform: translateY(-1px); box-shadow: -3px 3px 0 var(--cyan), 3px -3px 0 var(--pink); }
.btn-ghost { background: var(--surface-2); color: var(--text); border-color: var(--border-strong); }
.btn-ghost:hover { color: var(--text); border-color: var(--purple); background: var(--surface-3); }
.btn-primary { background: var(--purple); color: #fff; }
.btn-primary:hover { color: #fff; background: #7c4cf0; }
.btn-danger { background: transparent; color: var(--danger); border-color: #5a2a35; }
.btn-danger:hover { color: #fff; background: #8f2a3a; border-color: #8f2a3a; }
.icon-btn { background: none; border: 0; color: var(--text); padding: 8px; border-radius: 8px; cursor: pointer; display: inline-flex; }
.icon-btn:hover { background: var(--surface-2); }
.badge {
  display: inline-block; vertical-align: middle; padding: 2px 8px; border-radius: 999px;
  font: 600 11px var(--font-body); letter-spacing: .03em; text-transform: uppercase;
  background: #3a2c12; color: #ffc861; border: 1px solid #5c4519;
}

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40; height: var(--topbar-h);
  display: flex; align-items: center; gap: 14px; padding: 0 18px;
  background: rgba(9, 10, 17, .88); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.brand img { display: block; width: 46px; height: 46px; object-fit: contain; }
.brand-tag {
  font: 700 13px var(--font-display); letter-spacing: .18em; color: var(--bg);
  background: var(--green); padding: 2px 7px 2px 9px; border-radius: 5px;
}
.nav-toggle { display: none; }
.search-trigger {
  flex: 1; max-width: 520px; margin: 0 auto; height: 40px;
  display: flex; align-items: center; gap: 10px; padding: 0 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  color: var(--muted); font: 15px var(--font-body); cursor: pointer; text-align: left;
}
.search-trigger span { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.search-trigger:hover { border-color: var(--purple); color: var(--text); }
.top-links { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.top-link { color: var(--muted); font-weight: 500; font-size: 15px; padding: 10px 4px; }
.top-links .btn { padding: 8px 14px; font-size: 14px; }

.staffbar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 18px;
  padding: 7px 18px; font-size: 14px; background: #1a1433; border-bottom: 1px solid #33276a; color: #cfc3ff;
}
.staffbar-actions { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.staffbar a { color: #fff; font-weight: 600; }
.staffbar a:hover { color: var(--green-soft); }

.announce {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 9px 18px; font-size: 14.5px; font-weight: 500; text-align: center;
  background: linear-gradient(90deg, rgba(139, 92, 246, .22), rgba(61, 255, 46, .12));
  border-bottom: 1px solid var(--border);
}
.announce a { color: var(--text); text-decoration: underline; text-decoration-color: var(--green); text-underline-offset: 3px; }
.announce-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px var(--green); flex-shrink: 0; }

/* ---------- layout ---------- */
/* The menu sits against the left edge, under the logo, on any screen width.
   The content keeps a comfortable reading width instead of stretching across very wide monitors. */
.shell { display: grid; grid-template-columns: 272px minmax(0, 1fr); }
main { min-width: 0; max-width: 1300px; padding: 28px 36px 60px; }
.sidebar {
  position: sticky; top: var(--topbar-h); align-self: start;
  height: calc(100vh - var(--topbar-h)); overflow-y: auto;
  padding: 18px 12px 40px; border-right: 1px solid var(--border);
  scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent;
}
.side-home, .side-cat summary {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px;
  color: var(--text); font: 600 15px var(--font-display); cursor: pointer; list-style: none;
}
.side-home { padding-left: 14px; }
.side-allpages { margin-top: 10px; color: var(--muted); font-weight: 500; }
.side-cat summary::-webkit-details-marker { display: none; }
.side-home:hover, .side-cat summary:hover { background: var(--surface-2); color: var(--text); }
.side-icon { width: 22px; text-align: center; }
.side-name { flex: 1; }
.side-count { font: 500 12px var(--font-body); color: var(--muted); }
.side-cat[open] summary .side-count { color: var(--green-soft); }
.side-body { margin: 2px 0 10px 20px; padding-left: 12px; border-left: 1px solid var(--border); display: flex; flex-direction: column; }
.side-group { margin: 10px 0 2px; font: 600 11px var(--font-body); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding-left: 8px; }
.side-link, .side-all { padding: 4px 8px; border-radius: 6px; color: #c3c8de; font-size: 14.5px; }
.side-all { color: var(--muted); }
.side-link:hover, .side-all:hover { background: var(--surface-2); color: var(--text); }
.is-current { background: rgba(139, 92, 246, .18) !important; color: #fff !important; }
.side-link.is-current { box-shadow: inset 2px 0 0 var(--green); }
.side-link.is-draft { font-style: italic; opacity: .7; }
.scrim { display: none; }

.footer { border-top: 1px solid var(--border); padding: 26px 20px 34px; text-align: center; color: var(--muted); font-size: 14px; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 22px; margin-bottom: 8px; }
.footer p { margin: 0; }

/* ---------- home ---------- */
.hero {
  position: relative; display: flex; align-items: center; gap: 34px;
  padding: 34px 38px; margin-bottom: 34px; border-radius: 18px; border: 1px solid var(--border); overflow: hidden;
  background:
    radial-gradient(600px 300px at 12% 20%, rgba(139, 92, 246, .30), transparent 70%),
    radial-gradient(500px 280px at 92% 90%, rgba(61, 255, 46, .14), transparent 70%),
    linear-gradient(var(--surface), var(--surface));
}
.hero::before {
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 36px 36px; mask-image: linear-gradient(to right, transparent, #000 40%, transparent);
}
.hero-logo { position: relative; width: 220px; height: 220px; object-fit: contain; flex-shrink: 0; filter: drop-shadow(0 10px 30px rgba(139, 92, 246, .35)); }
.hero-text { position: relative; min-width: 0; }
.hero h1 { font-size: clamp(30px, 4vw, 46px); font-weight: 700; letter-spacing: -.01em; }
.hero-tagline { margin: 10px 0 20px; color: #c9cde0; font-size: 17px; max-width: 56ch; }
.hero-search {
  display: flex; align-items: center; gap: 12px; width: min(100%, 480px); height: 50px; padding: 0 16px;
  background: rgba(9, 10, 17, .7); border: 1px solid var(--border-strong); border-radius: 12px;
  color: var(--muted); font: 16px var(--font-body); cursor: pointer;
}
.hero-search:hover { border-color: var(--green); color: var(--text); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 20px; }

.section { margin-bottom: 36px; }
.section-title {
  font-size: 21px; font-weight: 600; margin-bottom: 16px; display: flex; align-items: center; gap: 12px;
}
.section-title::before { content: ''; width: 5px; height: 20px; border-radius: 3px; background: linear-gradient(var(--green), var(--purple)); }

.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.cat-card {
  display: flex; flex-direction: column; gap: 6px; padding: 20px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  transition: transform .14s, box-shadow .14s, border-color .14s;
}
.cat-card:hover { color: var(--text); transform: translate(2px, -2px); border-color: var(--purple); box-shadow: -4px 4px 0 var(--cyan), 4px -4px 0 var(--pink); }
.cat-icon { font-size: 30px; line-height: 1; }
.cat-name { font: 600 19px var(--font-display); margin-top: 6px; }
.cat-desc { color: var(--muted); font-size: 14.5px; line-height: 1.5; flex: 1; }
.cat-count { color: var(--green-soft); font-size: 13.5px; font-weight: 600; margin-top: 6px; }

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.jump-row { margin-bottom: 26px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 13px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text); font-size: 14.5px; font-weight: 500;
}
.chip:hover { border-color: var(--green); color: var(--text); }
.chip-count { color: var(--muted); font-size: 12.5px; }

.home-cols { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 20px; margin-bottom: 36px; align-items: start; }
.home-side { display: grid; gap: 20px; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.panel-title { font-size: 18px; font-weight: 600; margin-bottom: 16px; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 18px; border-left: 2px solid var(--border-strong); display: grid; gap: 18px; }
.timeline li { position: relative; display: flex; flex-direction: column; gap: 2px; }
.timeline li::before { content: ''; position: absolute; left: -24px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--bg); border: 2px solid var(--purple); }
.timeline li:first-child::before { border-color: var(--green); box-shadow: 0 0 10px var(--green); }
.timeline-date { font: 600 12px var(--font-body); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.timeline-text { color: #c3c8de; font-size: 14.5px; }
.link-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.link-list a { display: block; padding: 9px 12px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text); font-size: 14.5px; }
.link-list a::after { content: ' ↗'; color: var(--muted); }
.link-list a:hover { border-color: var(--purple); }

/* ---------- cards ---------- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.card {
  display: flex; flex-direction: column; border-radius: var(--radius); overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  transition: transform .14s, border-color .14s, box-shadow .14s;
}
.card:hover { color: var(--text); transform: translateY(-3px); border-color: var(--purple); box-shadow: 0 10px 26px rgba(0, 0, 0, .45); }
.card.is-draft { border-style: dashed; }
.card-thumb {
  position: relative; display: flex; align-items: center; justify-content: center; aspect-ratio: 16 / 10; overflow: hidden;
  background: radial-gradient(circle at 50% 40%, #232742, #141624 75%);
}
.card-thumb img { position: absolute; inset: 12px; width: calc(100% - 24px); height: calc(100% - 24px); object-fit: contain; }
.card-thumb-empty { font-size: 38px; color: var(--border-strong); }
.card-body { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px 14px; border-top: 1px solid var(--border); }
.card-title { font: 600 16px var(--font-display); }
.card-text { color: var(--muted); font-size: 13.5px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.cat-header { display: flex; align-items: center; gap: 18px; margin-bottom: 24px; }
.cat-header > div { flex: 1; }
.cat-header p { margin: 4px 0 0; }
.cat-header-icon { font-size: 44px; line-height: 1; }
.az-list { list-style: none; margin: 0; padding: 0; columns: 3 220px; column-gap: 24px; }
.az-list li { padding: 3px 0; break-inside: avoid; }

/* ---------- article ---------- */
.page-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 40px; }
.page-layout.has-toc { grid-template-columns: minmax(0, 1fr) 220px; }
.article { min-width: 0; max-width: 900px; }
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; color: var(--muted); font-size: 14px; margin-bottom: 10px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--green-soft); }
.article-title { font-size: clamp(28px, 3.4vw, 40px); font-weight: 700; margin-bottom: 20px; }
.article-title .badge { font-size: 12px; }

.infobox {
  float: right; width: 300px; margin: 0 0 20px 28px; border-radius: var(--radius); overflow: hidden;
  background: var(--surface); border: 1px solid var(--border-strong);
  box-shadow: -3px 3px 0 rgba(34, 211, 238, .55), 3px -3px 0 rgba(255, 79, 216, .55);
}
.infobox-img { display: block; width: 100%; max-height: 320px; object-fit: contain; padding: 14px; background: radial-gradient(circle at 50% 40%, #232742, #141624 75%); cursor: zoom-in; }
.infobox-stats { margin: 0; }
.infobox-stats div { display: grid; grid-template-columns: 42% 1fr; gap: 10px; padding: 9px 14px; border-top: 1px solid var(--border); font-size: 14.5px; }
.infobox-stats dt { color: var(--muted); font-weight: 500; }
.infobox-stats dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }

.prose { font-size: 16.5px; overflow-wrap: break-word; }
.prose > :first-child { margin-top: 0; }
.prose h1, .prose h2 { font-size: 26px; margin: 38px 0 14px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.prose h3 { font-size: 21px; margin: 30px 0 10px; color: #f1edff; }
.prose h4 { font-size: 17.5px; margin: 24px 0 8px; color: var(--purple-soft); }
.prose h2 a, .prose h3 a, .prose h4 a { color: inherit; text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 4px; }
.prose p { margin: 0 0 16px; }
.prose ul, .prose ol { margin: 0 0 18px; padding-left: 24px; }
.prose li { margin: 5px 0; }
.prose li::marker { color: var(--green); }
.prose a { text-decoration: underline; text-decoration-color: rgba(182, 156, 255, .4); text-underline-offset: 3px; }
.prose a.missing { color: var(--danger); text-decoration-style: dashed; }
.prose a.external::after { content: '↗'; font-size: .8em; margin-left: 2px; color: var(--muted); }
.prose img { border-radius: 10px; border: 1px solid var(--border); background: var(--surface); cursor: zoom-in; max-height: 520px; }
.img-missing { display: none !important; }
/* Roblox avatar beside a profile link */
.prose img.rbx-avatar { width: 28px; height: 28px; max-height: none; margin-right: 8px; vertical-align: middle; border-radius: 50%; border: 1px solid var(--border-strong); background: var(--surface-3); cursor: pointer; }
.prose a[data-roblox-user] { text-decoration: none; font-weight: 600; }
.prose a[data-roblox-user]:hover { text-decoration: underline; }
.prose li:has(> a[data-roblox-user]:first-child) { list-style: none; margin-left: -24px; padding: 4px 0; }
.prose > iframe, .prose :not(.video) > iframe { max-width: 100%; border: 0; border-radius: 10px; }
.prose blockquote {
  margin: 0 0 18px; padding: 14px 18px; border-radius: 10px; border: 1px solid #3a2f6e; border-left: 4px solid var(--purple);
  background: rgba(139, 92, 246, .10); color: #ded6ff;
}
.prose blockquote > :last-child { margin-bottom: 0; }
.prose code {
  font: 600 .9em ui-monospace, 'Cascadia Code', Consolas, monospace; padding: 3px 8px; border-radius: 6px;
  background: var(--surface-3); border: 1px solid var(--border-strong); color: var(--green-soft);
}
.prose :not(pre) > code { cursor: copy; }
.prose :not(pre) > code:hover { border-color: var(--green); }
.prose code.copied { background: #123d17; border-color: var(--green); }
.prose pre { padding: 14px 16px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); overflow-x: auto; }
.prose pre code { padding: 0; border: 0; background: none; font-weight: 400; }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 30px 0; }
.table-wrap { overflow-x: auto; margin: 0 0 20px; border: 1px solid var(--border); border-radius: 10px; }
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; }
.prose th { text-align: left; font: 600 13px var(--font-body); letter-spacing: .05em; text-transform: uppercase; color: var(--muted); background: var(--surface-2); }
.prose th, .prose td { padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.prose tr:last-child td { border-bottom: 0; }
.prose tbody tr:hover { background: rgba(255, 255, 255, .025); }
.prose td img { max-height: 70px; border: 0; background: none; }
.prose-sm { font-size: 15px; }
.video { position: relative; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); margin: 0 0 18px; background: #000; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.panel .video { margin: 0; }

.related { clear: both; margin-top: 40px; padding-top: 22px; border-top: 1px solid var(--border); }
.related h2 { font-size: 17px; margin-bottom: 12px; color: var(--muted); font-weight: 600; }
.article-meta { clear: both; margin-top: 26px; color: var(--muted); font-size: 13.5px; }

.toc { position: sticky; top: calc(var(--topbar-h) + 24px); align-self: start; max-height: calc(100vh - var(--topbar-h) - 48px); overflow-y: auto; display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.toc-title { font: 600 12px var(--font-body); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.toc a { color: #b9bed6; padding: 3px 0 3px 12px; border-left: 2px solid var(--border); }
.toc a:hover { color: var(--text); border-color: var(--green); }
.toc .toc-l3 { padding-left: 24px; font-size: 13.5px; }

.empty { text-align: center; padding: 60px 20px; }
.empty-icon { font-size: 70px; line-height: 1; color: var(--purple); text-shadow: -3px 3px 0 var(--cyan), 3px -3px 0 var(--pink); margin-bottom: 18px; }
.empty .hero-actions { justify-content: center; }

/* ---------- search ---------- */
.search {
  width: min(680px, calc(100vw - 24px)); margin: 9vh auto 0; padding: 0; border: 1px solid var(--border-strong); border-radius: 16px;
  background: var(--surface); color: var(--text); box-shadow: 0 30px 80px rgba(0, 0, 0, .7); overflow: hidden;
}
.search::backdrop { background: rgba(4, 5, 10, .72); backdrop-filter: blur(3px); }
.search-box { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border); color: var(--muted); }
.search-box input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; color: var(--text); font: 18px var(--font-body); }
.search-box input::-webkit-search-cancel-button { display: none; }
.search-close { background: var(--surface-2); border: 1px solid var(--border-strong); color: var(--muted); border-radius: 6px; padding: 3px 9px; font: 600 12px var(--font-body); cursor: pointer; }
.search-results { max-height: min(60vh, 520px); overflow-y: auto; padding: 8px; }
.search-hint { padding: 22px 14px; color: var(--muted); text-align: center; font-size: 15px; }
.search-item { display: flex; align-items: center; gap: 14px; padding: 9px 10px; border-radius: 10px; color: var(--text); }
.search-item.is-active, .search-item:hover { background: var(--surface-3); color: var(--text); }
.search-thumb { width: 52px; height: 40px; border-radius: 6px; background: #141624; flex-shrink: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; color: var(--border-strong); }
.search-thumb img { width: 100%; height: 100%; object-fit: contain; }
.search-text { min-width: 0; display: flex; flex-direction: column; }
.search-title { font: 600 15.5px var(--font-display); }
.search-sub { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.lightbox { position: fixed; inset: 0; z-index: 90; background: rgba(4, 5, 10, .9); display: flex; align-items: center; justify-content: center; padding: 24px; cursor: zoom-out; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 10px; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .page-layout.has-toc { grid-template-columns: minmax(0, 1fr); }
  .toc { display: none; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  main { padding: 20px 16px 48px; }
  .nav-toggle { display: inline-flex; }
  .sidebar {
    position: fixed; top: 0; left: 0; z-index: 60; width: min(300px, 86vw); height: 100vh;
    background: var(--bg); transform: translateX(-102%); transition: transform .2s;
  }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(4, 5, 10, .7); }
  .top-link, .hide-sm, .search-trigger kbd { display: none; }
  /* finger-sized buttons on phones and tablets */
  .icon-btn { min-width: 44px; min-height: 44px; align-items: center; justify-content: center; }
  .search-trigger { height: 44px; }
  .top-links .btn { min-height: 44px; }
  .side-link, .side-all { padding-top: 9px; padding-bottom: 9px; }
  .topbar { gap: 8px; padding: 0 10px; }
  .hero { flex-direction: column; text-align: center; padding: 26px 20px; gap: 12px; }
  .hero-logo { width: 150px; height: 150px; }
  .hero-search { margin: 0 auto; }
  .hero-actions { justify-content: center; }
  .home-cols { grid-template-columns: minmax(0, 1fr); }
  .infobox { float: none; width: 100%; margin: 0 0 22px; }
  .cat-header { flex-wrap: wrap; }
}
@media (max-width: 520px) {
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .brand-tag { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
