/* ==========================================================================
   BLAME! — Городской архив
   Статическая вики. Без JavaScript, без растровых изображений.
   ========================================================================== */

@font-face {
  font-family: "Unbounded";
  src: url("../fonts/unbounded-cyr.woff2") format("woff2");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Unbounded";
  src: url("../fonts/unbounded-lat.woff2") format("woff2");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Manrope";
  src: url("../fonts/manrope-cyr.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Manrope";
  src: url("../fonts/manrope-lat.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/plex-mono-400-cyr.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/plex-mono-400-lat.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/plex-mono-500-cyr.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/plex-mono-500-lat.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

/* --------------------------------------------------------------------------
   Токены
   -------------------------------------------------------------------------- */

:root {
  --bg: #0a0a0a;
  --bg-deep: #050505;
  --bg-raised: #111111;
  --bg-panel: #161616;
  --paper: #f2f2f2;
  --paper-soft: #c8c8c8;
  --muted: #979797;
  --dim: #808080;
  --line: #2a2a2a;
  --line-strong: #454545;
  --acid: #ffffff;
  --acid-soft: rgba(255, 255, 255, 0.1);
  --rust: #a1a1a1;
  --rust-soft: rgba(161, 161, 161, 0.1);
  --font-display: "Unbounded", "Arial Black", sans-serif;
  --font-body: "Manrope", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", "Courier New", monospace;
  --gutter: clamp(18px, 4vw, 64px);
  --content-max: 1540px;
  --radius: 2px;
  --header-h: 73px;
}

/* --------------------------------------------------------------------------
   База
   -------------------------------------------------------------------------- */

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

html {
  scroll-behavior: smooth;
  scrollbar-color: var(--line-strong) var(--bg-deep);
  scrollbar-width: thin;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--paper-soft);
  background:
    radial-gradient(ellipse 80% 46% at 72% -12%, rgba(255, 255, 255, 0.07), transparent 62%),
    radial-gradient(ellipse 60% 40% at -10% 28%, rgba(255, 255, 255, 0.03), transparent 65%),
    var(--bg);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  position: fixed;
  z-index: 0;
  inset: 0;
  content: "";
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(245, 245, 245, 0.035) 1px, transparent 1px);
  background-size: calc((100vw - (var(--gutter) * 2)) / 12) 100%;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.8), transparent 82%);
}

body::after {
  position: fixed;
  z-index: 90;
  inset: 0;
  content: "";
  pointer-events: none;
  opacity: 0.45;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 3px,
    rgba(0, 0, 0, 0.12) 3px,
    rgba(0, 0, 0, 0.12) 4px
  );
}

::selection {
  color: var(--bg-deep);
  background: var(--acid);
}

:focus-visible {
  outline: 2px solid var(--acid);
  outline-offset: 3px;
}

a {
  color: var(--paper);
  text-decoration-color: rgba(255, 255, 255, 0.4);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 160ms ease, text-decoration-color 160ms ease, border-color 160ms ease,
    background-color 160ms ease;
}

a:hover {
  color: var(--acid);
  text-decoration-color: var(--acid);
}

p,
ul,
ol,
dl,
blockquote,
table {
  margin-top: 0;
}

h1,
h2,
h3,
h4,
p {
  overflow-wrap: break-word;
}

h1,
h2,
h3,
h4 {
  color: var(--paper);
  text-wrap: balance;
}

h2,
h3,
h4 {
  font-weight: 750;
  line-height: 1.18;
  letter-spacing: -0.025em;
}

img,
svg {
  max-width: 100%;
}

hr {
  height: 1px;
  margin: 42px 0;
  border: 0;
  background: var(--line);
}

.skip-link {
  position: fixed;
  z-index: 200;
  top: 12px;
  left: 12px;
  padding: 10px 16px;
  color: var(--bg-deep);
  background: var(--acid);
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* --------------------------------------------------------------------------
   Служебная строка и шапка
   -------------------------------------------------------------------------- */

.netbar {
  position: relative;
  z-index: 60;
  border-bottom: 1px solid var(--line);
  background: var(--bg-deep);
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  line-height: 1.4;
  text-transform: uppercase;
}

.netbar__inner {
  display: flex;
  max-width: var(--content-max);
  min-height: 31px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.netbar__group {
  display: flex;
  align-items: center;
  gap: 20px;
}

.netbar__signal {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}

.netbar__signal::before {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--acid);
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.65);
  content: "";
}

.site-header {
  position: sticky;
  z-index: 55;
  top: 0;
  border-bottom: 1px solid var(--line);
  background: rgba(10, 10, 10, 0.9);
  backdrop-filter: blur(18px);
}

.site-header__inner {
  display: flex;
  max-width: var(--content-max);
  min-height: var(--header-h);
  align-items: center;
  gap: clamp(18px, 3vw, 42px);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.brand {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand:hover {
  color: var(--paper);
}

.brand__mark {
  position: relative;
  display: grid;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line-strong);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.15), transparent 62%),
    var(--bg-raised);
  color: var(--paper);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -0.08em;
  place-items: center;
}

.brand__mark::before,
.brand__mark::after {
  position: absolute;
  width: 4px;
  height: 4px;
  border: 1px solid var(--acid);
  content: "";
}

.brand__mark::before {
  top: 4px;
  left: 4px;
  border-right: 0;
  border-bottom: 0;
}

.brand__mark::after {
  right: 4px;
  bottom: 4px;
  border-top: 0;
  border-left: 0;
}

.brand__mark b {
  color: var(--acid);
  font-weight: inherit;
}

.brand__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand__title {
  color: var(--paper);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.12em;
  line-height: 1;
}

.brand__sub {
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.18em;
  line-height: 1.4;
  text-transform: uppercase;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
}

.site-nav a {
  padding: 8px 11px;
  border: 1px solid transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 550;
  line-height: 1.4;
  text-decoration: none;
  white-space: nowrap;
}

.site-nav a:hover {
  border-color: var(--line);
  color: var(--paper);
}

.site-nav a[aria-current="page"] {
  border-color: rgba(255, 255, 255, 0.22);
  color: var(--acid);
  background: rgba(255, 255, 255, 0.07);
}

.header-stamp {
  flex: 0 0 auto;
  padding-left: 20px;
  border-left: 1px solid var(--line);
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.13em;
  line-height: 1.7;
  text-align: right;
  text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   Каркас вики
   -------------------------------------------------------------------------- */

.page-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  gap: clamp(34px, 5vw, 78px);
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.sidebar {
  min-width: 0;
  padding-top: 48px;
}

.sidebar__inner {
  position: sticky;
  top: calc(var(--header-h) + 24px);
  max-height: calc(100vh - var(--header-h) - 46px);
  padding-bottom: 32px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.sidebar__block + .sidebar__block {
  margin-top: 32px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}

.sidebar__label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 12px;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.16em;
  line-height: 1.5;
  text-transform: uppercase;
}

.sidebar__label::after {
  width: 20px;
  height: 1px;
  background: var(--line-strong);
  content: "";
}

.side-nav {
  display: flex;
  flex-direction: column;
}

.side-nav a {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 9px;
  align-items: baseline;
  padding: 9px 10px 9px 0;
  border-left: 1px solid transparent;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.45;
  text-decoration: none;
}

.side-nav a:hover {
  padding-left: 10px;
  border-left-color: var(--acid);
  color: var(--paper);
  background: rgba(255, 255, 255, 0.03);
}

.side-nav a[aria-current="page"] {
  padding-left: 10px;
  border-left-color: var(--acid);
  color: var(--acid);
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.075), transparent);
}

.side-nav__num {
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.06em;
}

.side-nav a[aria-current="page"] .side-nav__num {
  color: var(--acid);
}

.sidebar__note {
  padding: 14px 15px;
  border: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.04), transparent 55%),
    rgba(17, 17, 17, 0.7);
}

.sidebar__note p {
  margin: 0;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.65;
}

.sidebar__note strong {
  display: block;
  margin-bottom: 6px;
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.sidebar__status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.1em;
  line-height: 1.5;
  text-transform: uppercase;
}

.sidebar__status::before {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--rust);
  content: "";
}

.main {
  min-width: 0;
  padding: 43px 0 92px;
}

/* --------------------------------------------------------------------------
   Хлебные крошки и заголовок статьи
   -------------------------------------------------------------------------- */

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-bottom: 25px;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.13em;
  line-height: 1.6;
  text-transform: uppercase;
}

.breadcrumbs a {
  color: var(--muted);
  text-decoration: none;
}

.breadcrumbs a:hover {
  color: var(--acid);
}

.breadcrumbs__sep {
  color: var(--line-strong);
}

.article-header {
  max-width: 100%;
  padding-bottom: 29px;
  border-bottom: 1px solid var(--line-strong);
}

.eyebrow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0 0 16px;
  color: var(--acid);
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 500;
  letter-spacing: 0.16em;
  line-height: 1.5;
  text-transform: uppercase;
}

.eyebrow::before {
  width: 22px;
  height: 1px;
  background: currentColor;
  content: "";
}

.eyebrow--muted {
  color: var(--muted);
}

.page-title {
  margin: 0 0 19px;
  color: var(--paper);
  font-family: var(--font-body);
  font-size: clamp(2.45rem, 5.2vw, 4.6rem);
  font-weight: 800;
  letter-spacing: -0.055em;
  line-height: 0.98;
}

.page-title--wordmark {
  margin: 4px 0 23px;
  font-family: var(--font-display);
  font-size: clamp(3.65rem, 9.2vw, 8.4rem);
  font-weight: 800;
  letter-spacing: -0.085em;
  line-height: 0.82;
  text-transform: uppercase;
}

.page-title--wordmark .bang {
  color: var(--acid);
}

.page-dek {
  max-width: 790px;
  margin: 0;
  color: #c6c6c6;
  font-size: clamp(1.03rem, 1.5vw, 1.25rem);
  font-weight: 450;
  letter-spacing: -0.012em;
  line-height: 1.55;
  text-wrap: pretty;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 0;
  margin: 23px 0 0;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.11em;
  line-height: 1.6;
  text-transform: uppercase;
}

.article-meta span {
  display: inline-flex;
  align-items: center;
}

.article-meta span + span::before {
  display: inline-block;
  width: 1px;
  height: 10px;
  margin: 0 12px;
  background: var(--line-strong);
  content: "";
}

.article-meta .accent {
  color: var(--acid);
}

/* --------------------------------------------------------------------------
   Содержание
   -------------------------------------------------------------------------- */

.toc {
  margin: 31px 0 35px;
  border: 1px solid var(--line-strong);
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.04), transparent 45%),
    rgba(17, 17, 17, 0.72);
}

.toc__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.15em;
  line-height: 1.5;
  text-transform: uppercase;
}

.toc__head span:last-child {
  color: var(--dim);
}

.toc ol {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 26px;
  margin: 0;
  padding: 7px 18px 12px;
  list-style: none;
  counter-reset: toc;
}

.toc li {
  border-top: 1px solid var(--line);
  counter-increment: toc;
}

.toc li:nth-child(-n + 2) {
  border-top: 0;
}

.toc a {
  display: flex;
  gap: 11px;
  align-items: baseline;
  padding: 8px 0;
  color: var(--paper-soft);
  font-size: 12.5px;
  line-height: 1.45;
  text-decoration: none;
}

.toc a::before {
  flex: 0 0 auto;
  color: var(--acid);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.05em;
  content: counter(toc, decimal-leading-zero);
}

.toc a:hover {
  color: var(--acid);
}

.toc--single ol {
  grid-template-columns: 1fr;
}

.toc--single li:nth-child(2) {
  border-top: 1px solid var(--line);
}

/* --------------------------------------------------------------------------
   Двухколоночная статья с инфобоксом
   -------------------------------------------------------------------------- */

.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 306px;
  gap: clamp(28px, 3.8vw, 48px);
  align-items: start;
  margin-top: 34px;
}

.article-main {
  min-width: 0;
}

.article-body {
  min-width: 0;
  color: #c5c5c5;
  font-size: 15.5px;
  line-height: 1.78;
}

.article-body > p,
.article-body > .section-lead {
  max-width: 72ch;
  margin-bottom: 1.2em;
  text-wrap: pretty;
}

.article-body > p:first-of-type {
  color: #dedede;
  font-size: 16.5px;
  line-height: 1.72;
}

.article-body strong,
.article-body b {
  color: var(--paper);
  font-weight: 700;
}

.article-body em {
  color: var(--paper-soft);
}

.article-body a {
  color: #ededed;
}

.article-body a:hover {
  color: var(--acid);
}

.article-body h2 {
  display: flex;
  gap: 13px;
  align-items: baseline;
  margin: 48px 0 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: clamp(1.45rem, 2.4vw, 1.95rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.15;
  scroll-margin-top: calc(var(--header-h) + 24px);
}

.article-body h2 .h-num {
  flex: 0 0 auto;
  color: var(--acid);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.05em;
}

.article-body h3 {
  margin: 30px 0 10px;
  color: var(--paper);
  font-size: 1.08rem;
  font-weight: 750;
  letter-spacing: -0.018em;
  line-height: 1.35;
  scroll-margin-top: calc(var(--header-h) + 24px);
}

.article-body h3 .h-num {
  margin-right: 8px;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 400;
  letter-spacing: 0.06em;
}

.article-body ul,
.article-body ol {
  max-width: 72ch;
  margin: 0 0 1.3em;
  padding-left: 1.2em;
}

.article-body li {
  margin-bottom: 0.45em;
  padding-left: 0.2em;
}

.article-body li::marker {
  color: var(--acid);
  font-family: var(--font-mono);
  font-size: 0.8em;
}

.article-body blockquote {
  position: relative;
  max-width: 72ch;
  margin: 27px 0;
  padding: 5px 0 5px 24px;
  border-left: 2px solid var(--acid);
  color: var(--paper);
  font-size: 1.03rem;
  font-style: normal;
  line-height: 1.65;
}

.article-body blockquote p {
  margin: 0;
}

.article-body blockquote cite {
  display: block;
  margin-top: 10px;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 8px;
  font-style: normal;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.article-body .external::after {
  margin-left: 2px;
  color: var(--acid);
  font-size: 0.75em;
  content: "↗";
}

.section-lead {
  color: #d2d2d2;
  font-size: 16px;
}

/* --------------------------------------------------------------------------
   Инфобокс
   -------------------------------------------------------------------------- */

.infobox {
  position: sticky;
  top: calc(var(--header-h) + 22px);
  max-height: calc(100vh - var(--header-h) - 44px);
  overflow-y: auto;
  border: 1px solid var(--line-strong);
  background: rgba(17, 17, 17, 0.94);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.24);
  scrollbar-width: thin;
}

.infobox__cover {
  position: relative;
  display: flex;
  min-height: 186px;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px;
  overflow: hidden;
  border-bottom: 1px solid var(--line-strong);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.12), transparent 52%),
    linear-gradient(165deg, #1d1d1d 0%, #0b0b0b 68%);
}

.infobox__cover::before {
  position: absolute;
  inset: 0;
  content: "";
  opacity: 0.85;
  background:
    repeating-linear-gradient(
      to right,
      transparent 0,
      transparent 19px,
      rgba(245, 245, 245, 0.06) 19px,
      rgba(245, 245, 245, 0.06) 20px
    ),
    linear-gradient(to top, rgba(5, 5, 5, 0.55), transparent 70%);
}

.infobox__cover::after {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 34px;
  height: 34px;
  border-top: 1px solid rgba(255, 255, 255, 0.55);
  border-right: 1px solid rgba(255, 255, 255, 0.55);
  content: "";
}

.cover-code,
.cover-title,
.cover-sub {
  position: relative;
  z-index: 1;
}

.cover-code {
  color: rgba(245, 245, 245, 0.55);
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.16em;
  line-height: 1.5;
  text-transform: uppercase;
}

.cover-title {
  display: block;
  margin: auto 0;
  color: var(--paper);
  font-family: var(--font-display);
  font-size: clamp(2rem, 3.4vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.08em;
  line-height: 0.85;
}

.cover-title span {
  color: var(--acid);
}

.cover-sub {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 7.5px;
  letter-spacing: 0.12em;
  line-height: 1.5;
  text-transform: uppercase;
}

.infobox__data {
  min-width: 0;
}

.infobox__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--acid);
  font-family: var(--font-mono);
  font-size: 7.5px;
  letter-spacing: 0.14em;
  line-height: 1.5;
  text-transform: uppercase;
}

.infobox__head span:last-child {
  color: var(--dim);
}

.infobox dl {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 9px 12px;
  margin: 0;
  padding: 15px 16px 17px;
  font-size: 12px;
  line-height: 1.5;
}

.infobox dt {
  padding-top: 2px;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 7.5px;
  letter-spacing: 0.08em;
  line-height: 1.5;
  text-transform: uppercase;
}

.infobox dd {
  margin: 0;
  color: var(--paper-soft);
}

.infobox dd a {
  color: var(--paper);
  text-decoration-color: rgba(255, 255, 255, 0.28);
}

.infobox ul {
  margin: 0;
  padding-left: 1.1em;
}

.infobox li {
  margin-bottom: 3px;
}

.infobox li::marker {
  color: var(--acid);
}

.infobox__note {
  margin: 0;
  padding: 12px 16px 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.55;
}

.infobox__note strong {
  color: var(--paper);
}

/* --------------------------------------------------------------------------
   Факты, карточки, таблицы
   -------------------------------------------------------------------------- */

.fact-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 27px 0 31px;
  border: 1px solid var(--line-strong);
  background: rgba(16, 16, 16, 0.55);
}

.fact {
  min-width: 0;
  padding: 14px 15px 13px;
}

.fact + .fact {
  border-left: 1px solid var(--line);
}

.fact__value {
  display: block;
  margin-bottom: 4px;
  color: var(--paper);
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 1.9vw, 1.4rem);
  font-weight: 550;
  letter-spacing: -0.05em;
  line-height: 1.1;
}

.fact__value .unit {
  color: var(--acid);
  font-family: var(--font-body);
  font-size: 0.55em;
  font-weight: 600;
  letter-spacing: 0;
}

.fact__label {
  display: block;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.1em;
  line-height: 1.5;
  text-transform: uppercase;
}

.callout {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 13px;
  margin: 26px 0;
  padding: 17px 18px;
  border: 1px solid var(--line);
  border-left: 2px solid var(--acid);
  background:
    linear-gradient(105deg, rgba(255, 255, 255, 0.07), transparent 55%),
    rgba(15, 15, 15, 0.65);
  font-size: 13px;
  line-height: 1.65;
}

.callout__mark {
  display: grid;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: var(--acid);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1;
  place-items: center;
}

.callout p {
  margin: 0;
}

.callout p + p {
  margin-top: 7px;
}

.callout strong {
  color: var(--paper);
}

.callout--rust {
  border-left-color: var(--rust);
  background:
    linear-gradient(105deg, rgba(161, 161, 161, 0.06), transparent 55%),
    rgba(15, 15, 15, 0.65);
}

.callout--rust .callout__mark {
  border-color: rgba(161, 161, 161, 0.42);
  color: var(--rust);
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin: 24px 0 30px;
  border: 1px solid var(--line-strong);
  background: var(--line);
}

.media-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 17px 16px 18px;
  background: var(--bg-raised);
}

.media-card__tag {
  color: var(--acid);
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.13em;
  line-height: 1.5;
  text-transform: uppercase;
}

.media-card__year {
  margin: 15px 0 6px;
  color: var(--paper);
  font-family: var(--font-display);
  font-size: 1.18rem;
  font-weight: 550;
  letter-spacing: -0.05em;
  line-height: 1.15;
}

.media-card h3 {
  margin: 0 0 8px;
  font-size: 13.5px;
  letter-spacing: -0.015em;
}

.media-card p {
  margin: 0;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.65;
}

.media-card--rust .media-card__tag {
  color: var(--rust);
}

.table-wrap {
  max-width: 100%;
  margin: 22px 0 29px;
  overflow-x: auto;
  border: 1px solid var(--line-strong);
  scrollbar-width: thin;
}

table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  font-size: 12.5px;
  line-height: 1.55;
}

caption {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 7.5px;
  letter-spacing: 0.11em;
  line-height: 1.5;
  text-align: left;
  text-transform: uppercase;
}

th {
  padding: 10px 13px;
  border-bottom: 1px solid var(--line-strong);
  color: var(--muted);
  background: #151515;
  font-family: var(--font-mono);
  font-size: 7.5px;
  font-weight: 500;
  letter-spacing: 0.08em;
  line-height: 1.5;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

td {
  padding: 11px 13px;
  border-bottom: 1px solid var(--line);
  color: var(--paper-soft);
  vertical-align: top;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.035);
}

td .mono,
.mono {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.84em;
  letter-spacing: 0.02em;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 19px;
  padding: 2px 7px;
  border: 1px solid var(--line-strong);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.07em;
  line-height: 1.4;
  text-transform: uppercase;
  white-space: nowrap;
}

.tag--acid {
  border-color: rgba(255, 255, 255, 0.35);
  color: var(--acid);
  background: rgba(255, 255, 255, 0.07);
}

.tag--rust {
  border-color: rgba(161, 161, 161, 0.38);
  color: var(--rust);
  background: rgba(161, 161, 161, 0.07);
}

/* --------------------------------------------------------------------------
   Схема доступа и фракции
   -------------------------------------------------------------------------- */

.access-chain {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 18px minmax(0, 1fr) 18px minmax(0, 1fr) 18px minmax(0, 1fr);
  align-items: stretch;
  margin: 25px 0 29px;
}

.chain-node {
  min-width: 0;
  padding: 13px 12px;
  border: 1px solid var(--line-strong);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.035), transparent 58%),
    var(--bg-raised);
}

.chain-node__num {
  display: block;
  margin-bottom: 9px;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.08em;
}

.chain-node strong {
  display: block;
  margin-bottom: 4px;
  color: var(--paper);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
}

.chain-node span:last-child {
  display: block;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.chain-arrow {
  display: grid;
  color: var(--acid);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1;
  place-items: center;
}

.chain-note {
  margin: -16px 0 30px;
  padding: 10px 13px;
  border: 1px solid rgba(161, 161, 161, 0.28);
  color: var(--muted);
  background: rgba(161, 161, 161, 0.05);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.06em;
  line-height: 1.6;
  text-transform: uppercase;
}

.chain-note strong {
  color: var(--rust);
}

.faction-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 22px 0 30px;
}

.faction {
  position: relative;
  min-width: 0;
  padding: 17px 17px 16px;
  border: 1px solid var(--line);
  background: rgba(17, 17, 17, 0.7);
}

.faction__num {
  position: absolute;
  top: 12px;
  right: 14px;
  color: var(--line-strong);
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 500;
  letter-spacing: -0.06em;
  line-height: 1;
}

.faction h3 {
  margin: 0 0 7px;
  padding-right: 30px;
  font-size: 13px;
}

.faction p {
  margin: 0;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.62;
}

.faction__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 11px;
}

/* --------------------------------------------------------------------------
   Персонажи
   -------------------------------------------------------------------------- */

.character {
  margin-top: 42px;
  padding-top: 30px;
  border-top: 1px solid var(--line-strong);
  scroll-margin-top: calc(var(--header-h) + 20px);
}

.character:first-of-type {
  margin-top: 28px;
  padding-top: 0;
  border-top: 0;
}

.character__head {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.character__index {
  display: grid;
  flex: 0 0 auto;
  width: 35px;
  height: 35px;
  margin-top: 2px;
  border: 1px solid var(--line-strong);
  color: var(--acid);
  font-family: var(--font-mono);
  font-size: 8px;
  line-height: 1;
  place-items: center;
}

.character--rust .character__index {
  border-color: rgba(161, 161, 161, 0.42);
  color: var(--rust);
}

.article-body .character__name {
  display: block;
  margin: 0;
  padding: 0;
  border: 0;
  font-family: var(--font-body);
  font-size: clamp(1.65rem, 3.2vw, 2.25rem);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1.05;
  scroll-margin-top: calc(var(--header-h) + 22px);
}

.character__latin {
  margin: 5px 0 0;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.13em;
  line-height: 1.5;
  text-transform: uppercase;
}

.character__layout {
  display: grid;
  grid-template-columns: 196px minmax(0, 1fr);
  gap: 22px;
  margin-top: 18px;
}

.character-panel {
  align-self: start;
  border: 1px solid var(--line);
  background: rgba(17, 17, 17, 0.7);
}

.character-portrait {
  position: relative;
  margin: 0;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: var(--bg-deep);
}

.character-portrait img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center 28%;
}

.character-portrait::after {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
  background: linear-gradient(180deg, transparent 72%, rgba(5, 5, 5, 0.22));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.character-panel dl {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  margin: 0;
  padding: 0 12px 9px;
}

.character-panel dt {
  margin-top: 9px;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.09em;
  line-height: 1.4;
  text-transform: uppercase;
}

.character-panel dd {
  margin: 2px 0 0;
  color: var(--paper-soft);
  font-size: 10.5px;
  line-height: 1.5;
}

.character__prose p {
  max-width: 68ch;
  margin: 0 0 11px;
}

.character__prose p:last-child {
  margin-bottom: 0;
}

.character__facts {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 0 0 12px;
}

.character__prose h3 {
  margin-top: 0;
}

.character-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 22px 0 30px;
}

.character-tile {
  display: block;
  min-width: 0;
  padding: 15px 16px;
  border: 1px solid var(--line);
  background: var(--bg-raised);
  text-decoration: none;
}

.character-tile:hover {
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.035);
}

.character-tile strong {
  display: block;
  color: var(--paper);
  font-size: 13px;
  font-weight: 700;
}

.character-tile span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.5;
}

/* --------------------------------------------------------------------------
   Тома
   -------------------------------------------------------------------------- */

.cover-shelf {
  margin: 24px 0 4px;
  padding: 13px 14px 12px;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent 55%),
    var(--bg-deep);
}

.cover-shelf__head {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.11em;
  line-height: 1.5;
  text-transform: uppercase;
}

.cover-shelf__head strong {
  color: var(--paper-soft);
  font-weight: 500;
}

.cover-shelf__grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 17px 11px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.cover-card {
  display: block;
  color: inherit;
  text-decoration: none;
}

.cover-card__frame {
  position: relative;
  display: block;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  background: var(--bg-panel);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35);
}

.cover-card__frame::after {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.07);
}

.cover-card img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  transition: opacity 180ms ease, transform 300ms ease;
}

.cover-card:hover img {
  opacity: 0.82;
  transform: scale(1.015);
}

.cover-card:focus-visible {
  outline: 1px solid var(--acid);
  outline-offset: 3px;
}

.cover-card__meta {
  display: flex;
  gap: 5px;
  justify-content: space-between;
  margin-top: 7px;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.06em;
  line-height: 1.4;
  text-transform: uppercase;
}

.cover-card__meta span:first-child {
  color: var(--paper-soft);
}

.volume-list {
  margin: 25px 0 8px;
  border-top: 1px solid var(--line-strong);
}

.volume {
  border-bottom: 1px solid var(--line-strong);
  background: transparent;
  scroll-margin-top: calc(var(--header-h) + 24px);
}

.volume summary {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 118px 24px;
  gap: 15px;
  align-items: center;
  padding: 17px 10px;
  cursor: pointer;
  list-style: none;
  transition: background-color 160ms ease;
}

.volume summary::-webkit-details-marker {
  display: none;
}

.volume summary:hover {
  background: rgba(255, 255, 255, 0.035);
}

.volume[open] summary {
  background: rgba(255, 255, 255, 0.045);
}

.volume__num {
  color: var(--acid);
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 500;
  letter-spacing: -0.06em;
  line-height: 1;
}

.volume__title {
  display: block;
  color: var(--paper);
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.4;
}

.volume__meta {
  display: block;
  margin-top: 3px;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.08em;
  line-height: 1.5;
  text-transform: uppercase;
}

.volume__date {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.03em;
  line-height: 1.5;
  text-align: right;
  white-space: nowrap;
}

.volume__toggle {
  display: grid;
  width: 22px;
  height: 22px;
  border: 1px solid var(--line-strong);
  color: var(--acid);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1;
  place-items: center;
}

.volume__toggle::before {
  content: "+";
}

.volume[open] .volume__toggle::before {
  content: "−";
}

.volume__body {
  display: grid;
  grid-template-columns: minmax(0, 0.68fr) minmax(0, 1.32fr);
  gap: 24px;
  padding: 5px 10px 24px 73px;
}

.volume__summary {
  min-width: 0;
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.65;
}

.volume__summary strong {
  color: var(--paper-soft);
}

.volume__summary .tag {
  margin-bottom: 9px;
}

.chapter-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.chapter-list li {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 8px;
  padding: 6px 0;
  border-top: 1px solid var(--line);
  color: var(--paper-soft);
  font-size: 11px;
  line-height: 1.45;
}

.chapter-list li[id] {
  scroll-margin-top: calc(var(--header-h) + 24px);
}

.chapter-list li:nth-child(-n + 2) {
  border-top: 0;
}

.chapter-list .ch-num {
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 7.5px;
  letter-spacing: 0.02em;
  line-height: 1.6;
}

.chapter-list .ch-note {
  display: block;
  margin-top: 1px;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.volume-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  align-items: center;
  margin: 16px 0 0;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 7.5px;
  letter-spacing: 0.06em;
  line-height: 1.6;
  text-transform: uppercase;
}

.volume-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.volume-legend span::before {
  width: 5px;
  height: 5px;
  border: 1px solid var(--line-strong);
  content: "";
}

.edition-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 22px 0 30px;
}

.edition {
  padding: 17px;
  border: 1px solid var(--line);
  background: var(--bg-raised);
}

.edition h3 {
  margin: 0 0 7px;
  font-size: 13px;
}

.edition p {
  margin: 0;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.6;
}

.edition .mono {
  display: block;
  margin-bottom: 9px;
  color: var(--acid);
  font-size: 7.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   Конец статьи и подвал
   -------------------------------------------------------------------------- */

.article-footer {
  margin-top: 44px;
  padding-top: 17px;
  border-top: 1px solid var(--line-strong);
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 7.5px;
  letter-spacing: 0.07em;
  line-height: 1.7;
  text-transform: uppercase;
}

.article-footer__row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px 24px;
}

.article-footer a {
  color: var(--muted);
  text-decoration: none;
}

.article-footer a:hover {
  color: var(--acid);
}

.article-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin-top: 30px;
  border: 1px solid var(--line-strong);
  background: var(--line);
}

.article-nav a {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 4px;
  padding: 15px 17px;
  background: var(--bg-raised);
  text-decoration: none;
}

.article-nav a:hover {
  background: rgba(255, 255, 255, 0.045);
}

.article-nav span {
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.1em;
  line-height: 1.5;
  text-transform: uppercase;
}

.article-nav strong {
  overflow: hidden;
  color: var(--paper);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.article-nav .next {
  text-align: right;
}

.site-footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--line-strong);
  background: var(--bg-deep);
}

.site-footer__main {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 0.8fr) minmax(0, 1fr);
  gap: clamp(26px, 5vw, 72px);
  max-width: var(--content-max);
  margin: 0 auto;
  padding: clamp(35px, 5vw, 58px) var(--gutter);
}

.site-footer__brand .brand {
  margin-bottom: 15px;
}

.site-footer__brand p {
  max-width: 380px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.footer-label {
  margin: 0 0 12px;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 7.5px;
  letter-spacing: 0.13em;
  line-height: 1.5;
  text-transform: uppercase;
}

.footer-nav {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
}

.footer-nav a {
  color: var(--muted);
  font-size: 12px;
  text-decoration: none;
}

.footer-nav a:hover {
  color: var(--acid);
}

.site-footer__meta p {
  margin: 0 0 9px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.65;
}

.site-footer__meta p:last-child {
  margin-bottom: 0;
}

.site-footer__meta a {
  color: var(--paper-soft);
  text-decoration-color: rgba(255, 255, 255, 0.25);
}

/* --------------------------------------------------------------------------
   Адаптивность
   -------------------------------------------------------------------------- */

@media (max-width: 1280px) {
  .article-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
  }

  .infobox {
    position: static;
    display: grid;
    grid-template-columns: 222px minmax(0, 1fr);
    max-height: none;
    overflow: visible;
    order: -1;
  }

  .infobox__cover {
    min-height: 100%;
    border-right: 1px solid var(--line-strong);
    border-bottom: 0;
  }

  .infobox dl {
    grid-template-columns: 106px minmax(0, 1fr);
  }
}

@media (max-width: 1080px) {
  .page-shell {
    grid-template-columns: 205px minmax(0, 1fr);
    gap: 34px;
  }

  .header-stamp {
    display: none;
  }

  .site-nav a {
    padding-inline: 9px;
    font-size: 11.5px;
  }
}

@media (max-width: 960px) {
  .page-shell {
    display: block;
  }

  .sidebar {
    display: none;
  }

  .main {
    padding-top: 34px;
  }

  .netbar__group > span:nth-child(2) {
    display: none;
  }

  .site-header__inner {
    flex-wrap: wrap;
    gap: 7px 18px;
    padding-top: 10px;
    padding-bottom: 9px;
  }

  .brand {
    margin-right: auto;
  }

  .site-nav {
    order: 3;
    width: calc(100% + var(--gutter) * 2);
    margin: 0 calc(var(--gutter) * -1) -9px;
    padding: 2px var(--gutter) 8px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .site-nav::-webkit-scrollbar {
    display: none;
  }

  .site-nav a {
    padding: 8px 11px;
    font-size: 11.5px;
  }

  .site-header {
    position: relative;
  }

  .article-body h2 {
    scroll-margin-top: 22px;
  }

  .character {
    scroll-margin-top: 22px;
  }
}

@media (max-width: 760px) {
  :root {
    --header-h: 64px;
  }

  body::before {
    background-size: calc((100vw - (var(--gutter) * 2)) / 6) 100%;
  }

  .netbar {
    font-size: 7.5px;
  }

  .netbar__inner {
    min-height: 28px;
  }

  .netbar__group {
    gap: 12px;
  }

  .netbar__group > span:nth-child(3) {
    display: none;
  }

  .site-header__inner {
    min-height: 0;
  }

  .brand__mark {
    width: 34px;
    height: 34px;
  }

  .brand__title {
    font-size: 11px;
  }

  .brand__sub {
    font-size: 6.5px;
  }

  .page-title {
    font-size: clamp(2.15rem, 10.6vw, 3.5rem);
  }

  .page-title--wordmark {
    font-size: clamp(3.25rem, 18vw, 5.4rem);
  }

  .article-meta span + span::before {
    margin-inline: 8px;
  }

  .toc ol {
    grid-template-columns: 1fr;
    padding-top: 3px;
  }

  .toc li:nth-child(2) {
    border-top: 1px solid var(--line);
  }

  .infobox {
    display: block;
  }

  .infobox__cover {
    min-height: 145px;
    border-right: 0;
    border-bottom: 1px solid var(--line-strong);
  }

  .cover-title {
    font-size: 2.45rem;
  }

  .fact-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .fact:nth-child(3) {
    border-left: 0;
  }

  .fact:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }

  .media-grid {
    grid-template-columns: 1fr;
  }

  .media-card {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    column-gap: 12px;
    padding: 14px 15px;
  }

  .media-card__tag {
    grid-column: 1 / -1;
  }

  .media-card__year {
    grid-row: span 2;
    align-self: start;
    margin: 10px 0 0;
    font-size: 0.98rem;
  }

  .media-card h3,
  .media-card p {
    grid-column: 2;
    margin-top: 8px;
  }

  .media-card h3 {
    margin-bottom: 0;
  }

  .media-card p {
    margin-top: 0;
  }

  .access-chain {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .chain-arrow {
    min-height: 30px;
    transform: rotate(90deg);
  }

  .faction-grid,
  .character-list,
  .edition-grid {
    grid-template-columns: 1fr;
  }

  .character__layout {
    grid-template-columns: 1fr;
  }

  .character-panel {
    display: grid;
    grid-template-columns: 168px minmax(0, 1fr);
  }

  .character-portrait {
    height: 100%;
    border-right: 1px solid var(--line);
    border-bottom: 0;
  }

  .character-portrait img {
    height: 100%;
    aspect-ratio: auto;
    object-position: center 24%;
  }

  .character-panel dl {
    padding: 9px 12px;
  }

  .character-panel dt:first-child {
    margin-top: 0;
  }

  .volume summary {
    grid-template-columns: 37px minmax(0, 1fr) 22px;
    gap: 10px;
    padding: 14px 7px;
  }

  .volume__date {
    display: none;
  }

  .volume__body {
    grid-template-columns: 1fr;
    gap: 17px;
    padding: 3px 7px 20px 54px;
  }

  .chapter-list {
    grid-template-columns: 1fr;
  }

  .chapter-list li:nth-child(2) {
    border-top: 1px solid var(--line);
  }

  .article-nav {
    grid-template-columns: 1fr;
  }

  .article-nav .next {
    display: none;
  }

  .site-footer__main {
    grid-template-columns: 1fr 1fr;
  }

  .site-footer__brand {
    grid-column: 1 / -1;
  }

  .site-footer__meta {
    grid-column: 1 / -1;
    padding-top: 18px;
    border-top: 1px solid var(--line);
  }

}

@media (max-width: 380px) {
  .article-meta {
    gap: 4px 14px;
  }

  .article-meta span {
    white-space: nowrap;
  }

  .article-meta span + span::before {
    display: none;
  }
}

@media (max-width: 480px) {
  .netbar__group > span:nth-child(3) {
    display: none;
  }

  .netbar__signal {
    font-size: 0;
  }

  .netbar__signal::before {
    margin-right: 2px;
  }

  .site-nav a {
    font-size: 10.5px;
  }

  .page-dek {
    font-size: 1rem;
  }

  .article-meta {
    font-size: 7px;
  }

  .fact {
    padding: 12px;
  }

  .fact__value {
    font-size: 1.08rem;
  }

  .volume__body {
    padding-left: 7px;
  }

  .cover-shelf {
    padding: 11px 10px 10px;
  }

  .cover-shelf__head {
    margin-bottom: 11px;
    font-size: 6.5px;
  }

  .cover-shelf__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 10px;
  }

  .cover-card__meta {
    font-size: 6px;
  }

  .character-panel {
    grid-template-columns: 1fr;
  }

  .character-portrait {
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .character-portrait img {
    height: auto;
    aspect-ratio: 4 / 3;
    object-position: center 38%;
  }

  .character-panel dl {
    grid-template-columns: 84px minmax(0, 1fr);
    column-gap: 14px;
    padding: 10px 12px 12px;
  }

  .character-panel dt {
    margin-top: 8px;
  }

  .character-panel dd {
    margin-top: 8px;
  }

  .character-panel dt:first-child,
  .character-panel dd:first-of-type {
    margin-top: 0;
  }

  .chapter-list {
    grid-template-columns: 1fr;
  }

  .site-footer__main {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  body {
    color: #111;
    background: #fff;
    font-size: 11pt;
  }

  body::before,
  body::after,
  .netbar,
  .site-header,
  .sidebar,
  .toc,
  .infobox__cover,
  .article-nav,
  .site-footer {
    display: none;
  }

  .page-shell,
  .article-layout {
    display: block;
    max-width: none;
    padding: 0;
  }

  .main {
    padding: 0;
  }

  .page-title,
  .article-body h2,
  .article-body h3,
  .article-body strong,
  a {
    color: #111;
  }

  .article-body {
    color: #222;
    font-size: 11pt;
  }

  .infobox {
    position: static;
    display: block;
    max-height: none;
    break-inside: avoid;
    border-color: #999;
    background: #fff;
  }

  .cover-shelf {
    border-color: #999;
    background: #fff;
  }

  .cover-shelf__head,
  .cover-card__meta {
    color: #555;
  }

  .cover-card__frame {
    box-shadow: none;
  }

  .cover-card,
  .character-panel {
    break-inside: avoid;
  }

  .character-portrait::after {
    display: none;
  }
}
