:root {
  --bg: #07141c;
  --bg-raise: #0d2230;
  --ivory: #f4efe4;
  --text: #e5eef2;
  --muted: #93a7b2;
  --line: rgba(190, 220, 228, 0.16);
  --teal: #8ed9d4;
  --mint: #7fe89a;
  --amber: #e7a64a;
  --sand: #f6e2c2;
  --serif: "Iowan Old Style", Palatino, "Palatino Linotype", "Book Antiqua", Georgia, "Times New Roman", serif;
  --sans: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --gutter: 20px;
  --wide: 1160px;
  --measure: 42rem;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font: 17.5px/1.7 var(--sans);
  color: var(--text);
  background:
    radial-gradient(880px 460px at 100% -8%, rgba(94, 176, 178, 0.16), transparent 58%),
    radial-gradient(640px 360px at -8% 0%, rgba(231, 166, 74, 0.08), transparent 52%),
    var(--bg);
}

main { flex: 1; }

::selection { background: var(--amber); color: #1c1408; }

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

.skip {
  position: fixed;
  left: 12px;
  top: 12px;
  z-index: 40;
  transform: translateY(-160%);
  background: var(--amber);
  color: #1c1408;
  text-decoration: none;
  font-weight: 700;
  padding: 8px 12px;
  border-radius: 8px;
}

.skip:focus { transform: none; }

a { color: var(--teal); text-underline-offset: 3px; }
a:hover { color: var(--sand); }
p a { text-decoration-thickness: 1px; }

.wrap {
  width: min(var(--wide), calc(100% - 2 * var(--gutter)));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-top: 2px solid var(--amber);
  border-bottom: 1px solid var(--line);
  background: rgba(7, 20, 28, 0.9);
  backdrop-filter: blur(16px);
}

.header-in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px 28px;
  min-height: 72px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ivory);
  text-decoration: none;
  flex: 0 0 auto;
}

.brand img {
  width: 46px;
  height: auto;
  display: block;
}

.brand-name {
  display: flex;
  flex-direction: column;
  gap: 3px;
  line-height: 1;
}

.brand-name strong {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.brand-name small {
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

nav[aria-label="Основная навигация"] {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px 16px;
}

nav[aria-label="Основная навигация"] a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14.5px;
  padding: 8px 0;
}

nav[aria-label="Основная навигация"] a:hover { color: var(--ivory); }

nav[aria-label="Основная навигация"] a[aria-current="page"] {
  color: var(--ivory);
  box-shadow: inset 0 -2px 0 var(--amber);
}

.hero {
  width: min(var(--wide), calc(100% - 2 * var(--gutter)));
  margin: 22px auto 8px;
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: clamp(22px, 4vw, 52px);
  align-items: center;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--amber);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hero h1,
.page main h1 {
  margin: 0 0 14px;
  color: var(--ivory);
  font-family: var(--serif);
  font-weight: 560;
  letter-spacing: -0.03em;
  line-height: 1.06;
  text-wrap: balance;
}

.hero h1 { font-size: clamp(2.15rem, 3.5vw, 3.35rem); }

.lede {
  margin: 0;
  color: #d5e4ea;
  font-size: 1.05rem;
  line-height: 1.65;
  text-wrap: pretty;
}

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

.stats div { border-top: 1px solid var(--line); padding-top: 10px; }

.stats dt {
  margin: 0;
  color: var(--sand);
  font-family: var(--serif);
  font-size: clamp(1.35rem, 2vw, 1.8rem);
  font-weight: 560;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.stats dd {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.35;
}

.hero-media {
  margin: 0;
  min-width: 0;
}

.hero-media img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 18px;
  background: #0c2834;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
}

.hero-media figcaption {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.prose-media {
  margin: 0.35rem 0 1.35rem;
}

.prose-media img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 16px;
  background: #0c2834;
}

.hero-copy aside[role="note"] { margin: 20px 0 0; }

.wrap.prose { width: min(var(--measure), calc(100% - 2 * var(--gutter))); }

.home .prose > h2:first-child { margin-top: 1.5rem; }

.page main.wrap {
  width: min(var(--measure), calc(100% - 2 * var(--gutter)));
  padding-top: 42px;
  padding-bottom: 80px;
}

.page main h1 { font-size: clamp(2rem, 4vw, 3.05rem); }

.page main h1::after {
  content: "";
  display: block;
  width: 48px;
  height: 2px;
  margin-top: 16px;
  background: linear-gradient(90deg, var(--amber), var(--teal));
}

main { counter-reset: part; }

main h2 {
  margin: 2.5rem 0 0.75rem;
  color: var(--ivory);
  font-family: var(--serif);
  font-size: clamp(1.45rem, 2vw, 1.8rem);
  font-weight: 560;
  letter-spacing: -0.02em;
  line-height: 1.2;
  text-wrap: balance;
  scroll-margin-top: 88px;
}

main h2::before {
  content: counter(part, decimal-leading-zero);
  counter-increment: part;
  display: block;
  margin-bottom: 0.35rem;
  color: var(--amber);
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
}

main h3 {
  margin: 1.45rem 0 0.4rem;
  color: var(--ivory);
  font-family: var(--serif);
  font-size: 1.22rem;
  font-weight: 560;
  line-height: 1.3;
  scroll-margin-top: 88px;
}

p { margin: 0 0 14px; text-wrap: pretty; }

.page main > h1 + p,
.page main > .updated + p,
.page main > .article-meta + p {
  font-size: 1.12rem;
  line-height: 1.65;
  color: #d5e4ea;
}

.article-meta {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 18px;
  margin: 0 0 16px;
}

.updated {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.04em;
}

.article-meta .updated,
.byline { margin: 0; }

.byline {
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.02em;
}

.byline a { color: var(--sand); }

aside[role="note"] {
  margin: 0 0 8px;
  padding: 12px 14px;
  border-left: 2px solid var(--amber);
  border-radius: 0 12px 12px 0;
  background: linear-gradient(90deg, rgba(231, 166, 74, 0.1), transparent 82%);
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.55;
}

aside[role="note"] p { margin: 0; }

ul, ol { margin: 0 0 16px; padding-left: 1.15rem; }
li { margin: 0 0 8px; padding-left: 2px; }
li::marker { color: var(--amber); }

.timeline {
  list-style: none;
  margin: 4px 0 18px;
  padding: 2px 0 0 2px;
  border-left: 1px solid var(--line);
}

.timeline li {
  position: relative;
  margin: 0 0 12px;
  padding-left: 16px;
}

.timeline li::marker { content: ""; }

.timeline li::before {
  content: "";
  position: absolute;
  left: -4px;
  top: 0.62em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--amber);
}

.catalog-block {
  width: min(var(--wide), calc(100% - 2 * var(--gutter)));
  margin: 28px auto 8px;
}

.catalog {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 48px;
  margin: 8px 0 0;
  padding: 0;
}

.catalog li {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  padding: 15px 0 13px;
  border-top: 1px solid var(--line);
}

.catalog a {
  color: var(--ivory);
  font-family: var(--serif);
  font-size: 1.28rem;
  line-height: 1.25;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.catalog a:hover { color: var(--sand); }

.catalog span {
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.45;
}

.catalog-note { margin-top: 18px; color: var(--muted); }

table {
  width: 100%;
  margin: 8px 0 18px;
  border-collapse: collapse;
  font-size: 15.5px;
  line-height: 1.45;
}

th, td {
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-bottom-color: rgba(142, 217, 212, 0.45);
}

.onion-addr {
  color: var(--mint);
  font-weight: 700;
  font-size: 1.04em;
  letter-spacing: 0.01em;
  overflow-wrap: anywhere;
}

.sources {
  margin-top: 2.4rem;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14.5px;
}

.sources p { margin: 0; }

.editorial-note {
  margin-top: 1rem;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.editorial-note p { margin: 0; }
.editorial-note strong { color: var(--text); }

.profile-lede {
  max-width: var(--measure);
  margin-bottom: 24px;
}

.author-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 24px 0 34px;
}

.author-facts div {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.author-facts strong {
  color: var(--sand);
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 560;
}

.author-facts span {
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.45;
}

.method-list li { margin-bottom: 12px; }
.method-list strong { color: var(--ivory); }

footer {
  border-top: 1px solid var(--line);
  padding: 26px 0 40px;
  color: var(--muted);
  font-size: 14px;
}

footer .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px 28px;
  flex-wrap: wrap;
}

footer p { margin: 0; }

footer nav { display: flex; flex-wrap: wrap; gap: 8px 16px; }
footer nav a { color: var(--muted); text-decoration: none; }
footer nav a:hover { color: var(--ivory); }

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 18px;
    margin-top: 16px;
  }

  .hero-media { order: -1; }
  .hero-media figcaption { margin-bottom: 4px; }
  .catalog { grid-template-columns: 1fr; column-gap: 0; }
}

@media (max-width: 760px) {
  body { font-size: 17px; }

  .header-in {
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    min-height: 0;
    padding: 12px 0 0;
  }

  nav[aria-label="Основная навигация"] {
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: 16px;
    overflow-x: auto;
    padding: 4px 0 10px;
    scrollbar-width: none;
    mask-image: linear-gradient(90deg, #000 calc(100% - 36px), transparent);
  }

  nav[aria-label="Основная навигация"]::-webkit-scrollbar { display: none; }
  nav[aria-label="Основная навигация"] a { white-space: nowrap; }

  .stats { gap: 8px; }
  .author-facts { grid-template-columns: 1fr; gap: 0; }
  .hero-media img, .prose-media img { border-radius: 14px; }
  footer .wrap { align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}

@media print {
  body { display: block; background: #fff; color: #161616; }
  .site-header, .skip, .hero-media, footer nav { display: none; }
  a { color: #161616; }
  main h2, .hero h1, .page main h1, main h3 { color: #161616; }
}
