:root {
  color-scheme: dark;
  --page: #121019;
  --panel: #1b1725;
  --panel-deep: #16121f;
  --panel-hover: #231d31;
  --line: #30283e;
  --text: #f1edf7;
  --muted: #b1a9c0;
  --accent: #d1b6ff;
  --accent-strong: #b892fa;
  --sans: Inter, "Segoe UI", system-ui, sans-serif;
  --serif: "PT Serif", Georgia, serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  margin: 0;
  color: var(--text);
  background: var(--page);
  font: 15px/1.55 var(--sans);
}
main { flex: 1; min-width: 0; }
[hidden] { display: none !important; }
a { color: inherit; }
button, input { font: inherit; }
button, a, input { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.wrap, .header-inner { width: min(1232px, calc(100% - 64px)); margin-inline: auto; }
.sr-only, .skip-link:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip-link:focus {
  position: fixed;
  inset: 12px auto auto 12px;
  z-index: 3;
  padding: 8px 12px;
  background: var(--panel);
  color: var(--text);
}

.site-header {
  background: #171320;
  border-bottom: 1px solid var(--line);
}
.header-inner {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--text);
  text-decoration: none;
  font-weight: 780;
  font-size: 18px;
  letter-spacing: -.035em;
}
.book-mark {
  --mark-size: 36px;
  display: inline-block;
  flex: none;
  width: var(--mark-size);
  height: var(--mark-size);
  position: relative;
  color: var(--accent);
  background: #302343;
  border: 1px solid #664a85;
  border-radius: 8px;
}
.book-mark::before, .book-mark::after {
  content: "";
  position: absolute;
  top: 29%;
  width: 27%;
  height: 38%;
  border: 1.4px solid currentColor;
}
.book-mark::before { left: 22%; border-radius: 2px 4px 1px 2px; transform: skewY(9deg); }
.book-mark::after { right: 22%; border-radius: 4px 2px 2px 1px; transform: skewY(-9deg); }
.site-header nav { display: flex; align-items: center; gap: 8px; }
.site-header nav a {
  padding: 9px 13px;
  color: var(--muted);
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 660;
  text-decoration: none;
  white-space: nowrap;
}
.site-header nav a:hover, .site-header nav a[aria-current] {
  color: var(--text);
  border-color: var(--line);
  background: var(--panel-hover);
}

.hero {
  position: relative;
  isolation: isolate;
  display: flex;
  min-height: 372px;
  margin-top: 26px;
  overflow: hidden;
  border: 1px solid #514060;
  border-radius: 16px;
  background:
    linear-gradient(90deg, #14101df5 0%, #181225ed 22%, #1b1428a0 49%, #1711201c 75%),
    linear-gradient(0deg, #110e1b8c, transparent 48%),
    url("./assets/chronicles-dusk.jpg") center 16% / cover no-repeat #231933;
}
.hero-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  width: 100%;
  padding: 47px clamp(24px, 5.2vw, 68px);
}
.hero-kicker {
  margin: 0 0 11px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 740;
  letter-spacing: .11em;
  text-transform: uppercase;
}
.hero h1 {
  margin: 0;
  font-size: clamp(43px, 6.8vw, 82px);
  font-weight: 820;
  line-height: 1.01;
  letter-spacing: -.065em;
  text-wrap: balance;
}
.hero-description {
  max-width: 35ch;
  margin: 16px 0 25px;
  color: #ddd4e8;
  font-size: clamp(14px, 1.8vw, 17px);
  text-wrap: pretty;
}
.primary {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-height: 42px;
  padding: 9px 16px;
  color: #1a1027;
  background: var(--accent);
  border: 1px solid #dbc8f7;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 760;
  text-decoration: none;
  transition: background .15s;
}
.primary:hover { background: #e5d4ff; }

.library { padding-block: 34px 64px; scroll-margin-top: 20px; }
.library-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 15px;
}
h2 { margin: 0; font-size: clamp(26px, 3.5vw, 38px); line-height: 1.15; letter-spacing: -.045em; }
.article-count { color: var(--muted); font-size: 13px; white-space: nowrap; }
.library-grid {
  display: grid;
  grid-template-columns: minmax(166px, 225px) minmax(0, 1fr);
  align-items: start;
  gap: 16px;
}
.library-sidebar {
  padding: 14px 10px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}
.library-sidebar h3 { margin: 0 10px 7px; color: var(--muted); font-size: 12px; font-weight: 730; }
.filters { display: grid; gap: 4px; }
.filter, .quiet-button {
  cursor: pointer;
  min-height: 38px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  font-size: 13px;
  font-weight: 630;
}
.filter {
  display: flex;
  gap: 11px;
  align-items: center;
  text-align: left;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}
.filter::before {
  content: "";
  display: block;
  flex: none;
  width: 7px;
  height: 7px;
  border: 1px solid currentColor;
  border-radius: 2px;
  transform: rotate(45deg);
}
.filter:hover, .quiet-button:hover { background: var(--panel-hover); color: var(--text); }
.filter[aria-pressed="true"] {
  color: #e6d6ff;
  background: #322344;
  border-color: #57426b;
}
.filter[aria-pressed="true"]::before { background: var(--accent); }
.library-content { min-width: 0; }
.search {
  display: flex;
  align-items: center;
  gap: 13px;
  padding-inline: 15px;
  color: var(--muted);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.search:focus-within { outline: 2px solid var(--accent-strong); outline-offset: 2px; }
.search input {
  width: 100%;
  min-height: 46px;
  border: 0;
  outline: none;
  padding: 8px 0;
  background: transparent;
  color: var(--text);
}
.search input::placeholder { color: var(--muted); }
.search-mark {
  position: relative;
  flex: none;
  width: 14px;
  height: 14px;
  border: 1.6px solid currentColor;
  border-radius: 50%;
}
.search-mark::after {
  content: "";
  position: absolute;
  width: 6px;
  height: 1.6px;
  background: currentColor;
  right: -5px;
  bottom: -3px;
  transform: rotate(45deg);
}
.results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 244px), 1fr));
  gap: 12px;
  margin-top: 12px;
}
.empty {
  grid-column: 1 / -1;
  min-height: 227px;
  padding: 26px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  border: 1px dashed #443651;
  border-radius: 10px;
  background: radial-gradient(ellipse at 50% 0%, #251b33, var(--panel-deep) 75%);
}
.empty .book-mark { --mark-size: 43px; margin-bottom: 12px; }
.empty h3 { margin: 0; font-size: 19px; line-height: 1.22; letter-spacing: -.025em; }
.empty p { max-width: 43ch; color: var(--muted); font-size: 13px; margin: 7px 0 0; text-wrap: pretty; }
.empty button { margin-top: 11px; }
.record {
  --section-accent: #c9abff;
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-height: 189px;
  padding: 17px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 9px;
  text-decoration: none;
  transition: border-color .16s, background .16s;
}
.record[data-category="events"] { --section-accent: #efc191; }
.record[data-category="places"] { --section-accent: #a8d6bd; }
.record[data-category="people"] { --section-accent: #aebffb; }
.record[data-category="factions"] { --section-accent: #f2abc9; }
.record:hover { border-color: #725689; background: var(--panel-hover); }
.record small, .category {
  width: fit-content;
  max-width: 100%;
  padding: 3px 8px;
  color: var(--section-accent, var(--accent));
  background: #2c2339;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 740;
}
.record h3 { margin: 0; font-size: 20px; line-height: 1.25; letter-spacing: -.025em; overflow-wrap: anywhere; }
.record p { margin: 0; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.record-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding-top: 9px;
  color: var(--muted);
  font-size: 12px;
}
.record-footer span { color: var(--accent); font-size: 17px; }

.article-panel { padding-block: 34px 68px; }
.article-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.article-actions a { color: var(--accent); font-weight: 680; font-size: 14px; text-underline-offset: 4px; }
.article-actions input { max-width: 52%; }
.article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 220px; align-items: start; gap: 18px; }
.article-layout:has(.article-toc[hidden]) { grid-template-columns: minmax(0, 850px); }
.article-content {
  min-width: 0;
  padding: clamp(20px, 4.5vw, 52px);
  overflow-wrap: anywhere;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.article-content h1 {
  margin: 12px 0 9px;
  font-size: clamp(32px, 5.3vw, 57px);
  font-weight: 790;
  line-height: 1.1;
  letter-spacing: -.05em;
}
.article-meta { margin: 0; color: var(--muted); font-size: 13px; }
.prose {
  margin-top: 23px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
  color: #e6deef;
  font: 17px/1.8 var(--serif);
}
.prose h2, .prose h3 { margin: 1.2em 0 .4em; color: var(--text); font-family: var(--sans); line-height: 1.23; }
.prose h2 { font-size: 28px; }
.prose h3 { font-size: 22px; }
.prose a { color: var(--accent); text-underline-offset: 3px; }
.prose img { display: block; max-width: 100%; height: auto; margin-block: 12px; border-radius: 6px; }
.prose blockquote { margin: 1em 0; padding: 11px 15px; border-left: 3px solid var(--accent-strong); background: #271e34; }
.prose blockquote p { margin: 0; }
.prose pre { padding: 13px; background: var(--panel-deep); overflow: auto; }
.prose code { padding: .1em .25em; background: var(--panel-deep); font-size: .9em; }
.prose hr { border: 0; border-top: 1px solid var(--line); }
.table-scroll { overflow: auto; }
.prose table { border-collapse: collapse; width: 100%; }
.prose td, .prose th { padding: 7px 11px; text-align: left; border: 1px solid var(--line); }
.prose th { background: #281f36; }
.article-toc {
  position: sticky;
  top: 18px;
  min-width: 0;
  overflow-wrap: anywhere;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel);
}
.article-toc strong { display: block; font-size: 15px; }
.article-toc ul { padding-left: 19px; margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.article-toc li + li { margin-top: 6px; }
.toc-link {
  background: none;
  border: 0;
  padding: 0;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  color: var(--accent);
}

.site-footer { background: #171320; border-top: 1px solid var(--line); }
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 77px;
  padding-block: 12px;
}
.footer-inner .brand { font-size: 15px; }
.footer-inner .book-mark { --mark-size: 30px; }
.footer-link { color: var(--muted); font-size: 13px; text-decoration: none; }
.footer-link:hover { color: var(--text); }

@media (max-width: 800px) {
  .wrap, .header-inner { width: calc(100% - 36px); }
  .hero { min-height: 320px; margin-top: 18px; }
  .article-layout { grid-template-columns: minmax(0, 1fr); }
  .article-toc { position: static; grid-row: 1; }
}
@media (max-width: 620px) {
  .wrap, .header-inner { width: calc(100% - 28px); }
  .header-inner { flex-wrap: wrap; gap: 3px 12px; padding-block: 9px; }
  .site-header nav { gap: 2px; }
  .site-header nav a { padding: 7px 8px; font-size: 12px; }
  .hero {
    min-height: 296px;
    border-radius: 11px;
    background:
      linear-gradient(90deg, #15101eed, #1b1328a0 58%, #18122335),
      linear-gradient(0deg, #15101eda, transparent 75%),
      url("./assets/chronicles-dusk.jpg") 62% center / cover no-repeat #231933;
  }
  .hero-inner { padding: 24px 19px; }
  .hero-kicker { font-size: 10px; }
  .hero h1 { max-width: 8ch; font-size: clamp(42px, 12vw, 59px); }
  .hero-description { margin: 11px 0 16px; }
  .library { padding-block: 26px 42px; }
  .library-grid { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .library-sidebar { padding: 9px; }
  .filters { display: flex; flex-wrap: wrap; gap: 4px; }
  .filter { min-height: 36px; gap: 7px; padding: 5px 7px; font-size: 12px; }
  .empty { min-height: 185px; }
  .article-panel { padding-block: 25px 45px; }
  .article-actions { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}

/* Между путями: stone, moss and warm parchment. */
:root {
  --page: #171c1b; --panel: #202824; --panel-deep: #19211e;
  --panel-hover: #2c3730; --line: #3c4a40; --text: #f2eadb;
  --muted: #bcbfae; --accent: #d7b58b; --accent-strong: #c49768;
}
.site-header, .site-footer { background: #1b2420; }
.book-mark { background: url('./assets/brand-mark.png') center / contain no-repeat; border: 0; border-radius: 0; }
.book-mark::before, .book-mark::after { display: none; }
.hero {
  border-color: #526052;
  background: linear-gradient(90deg, #151d1af7 0%, #17201ce8 30%, #17201c72 65%, #17201c25),
    linear-gradient(0deg, #131b1790, transparent 65%),
    url('./assets/brand-landscape.png') 62% center / cover no-repeat #252d27;
}
.hero h1 { font-family: Georgia, 'Times New Roman', serif; font-weight: 700; letter-spacing: -.045em; }
.hero-description { color: #e3e0d4; }
.primary { color: #222018; border-color: #e3c49c; }
.primary:hover { background: #ebd2ad; }
.filter[aria-pressed="true"] { color: #f3ebda; background: #3a493a; border-color: #71816a; }
.empty { border-color: #4a594b; background: radial-gradient(ellipse at 50% 0%, #2b382c, var(--panel-deep) 75%); }
.record { --section-accent: #ddbd92; }
.record:hover { border-color: #8c987e; }
.record small, .category { background: #344036; }
.prose { color: #e5e0d4; }
.prose blockquote, .prose th { background: #303b31; }
@media (max-width: 620px) {
  .hero { background: linear-gradient(90deg, #151d1af5, #17201cbb 65%, #17201c70),
    linear-gradient(0deg, #151d1adb, transparent 75%),
    url('./assets/brand-landscape.png') 62% center / cover no-repeat #252d27; }
  .hero h1 { max-width: 9ch; }
}
