/* =========================================================================
   EscapeBook — палитра с логотипа: золото #d19721 / #ffd873,
   лёд #4cc8d6 / #d0fbe7, тени #063332 и #391d26, чёрный контур.
   ========================================================================= */

:root {
  --bg-950: #04100f;
  --bg-900: #061615;
  --bg-850: #0a1f1d;
  --bg-800: #0e2a27;
  --card: #0b211f;

  --gold: #f0b429;
  --gold-hi: #ffd873;
  --gold-deep: #8f5f0c;
  --ice: #4cc8d6;
  --ice-hi: #d0fbe7;

  --txt: #eaf3ef;
  --txt-mid: #a6bab5;
  --txt-dim: #6f8a85;

  --line: rgba(208, 251, 231, 0.1);
  --line-strong: rgba(208, 251, 231, 0.2);

  --radius: 8px;
  --radius-sm: 5px;

  --font-display: "Unbounded", "Trebuchet MS", sans-serif;
  --font-body: "Onest", "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "Consolas", monospace;

  --header-h: 74px;
  --pad-x: clamp(18px, 4vw, 40px);

  --shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), inset 0 -1px 0 rgba(0, 0, 0, 0.4),
    0 24px 50px -34px rgba(0, 0, 0, 0.95);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 18px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg-950);
  color: var(--txt);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

p { margin: 0; }
img { max-width: 100%; height: auto; display: block; }
ul, ol { margin: 0; padding: 0; list-style: none; }

a { color: inherit; text-decoration: none; }

button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

::selection { background: var(--gold); color: #140a05; }

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

.wrap {
  width: min(1180px, 100% - var(--pad-x) * 2);
  margin-inline: auto;
}

.mono { font-family: var(--font-mono); font-size: 0.86em; letter-spacing: 0.02em; }

.accent { color: var(--gold); }

/* ------------------------------------------------------------------ прочее */
.section { padding-block: clamp(48px, 6.4vw, 92px); }

.section--line { border-top: 1px solid var(--line); }

.section-head {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: clamp(24px, 3vw, 38px);
}

.section-title {
  font-size: clamp(26px, 3.4vw, 42px);
  letter-spacing: -0.04em;
}

.lead {
  max-width: 58ch;
  color: var(--txt-mid);
  font-size: clamp(15px, 1.15vw, 17px);
}

.slot {
  display: block;
  padding: 10px 12px;
  border: 1px dashed rgba(208, 251, 231, 0.18);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--txt-dim);
}

/* ----------------------------------------------------------------- кнопки */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 13px 20px;
  border-radius: 6px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.005em;
  border: 1px solid transparent;
  transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.btn svg { width: 16px; height: 16px; flex: none; opacity: 0.95; }

.btn--wide { width: 100%; }

.btn--ghost {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--line-strong);
  color: var(--txt);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.btn--ghost:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(240, 180, 41, 0.45);
}

.btn--discord {
  background: #5865f2;
  color: #fff;
  box-shadow: 0 16px 38px -24px rgba(88, 101, 242, 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.btn--discord:hover { background: #4752c4; }

.btn--telegram {
  background: linear-gradient(180deg, #2aabee, #229ed9);
  color: #fff;
  border-color: rgba(42, 171, 238, 0.45);
  box-shadow: 0 16px 38px -24px rgba(42, 171, 238, 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn--telegram:hover { background: linear-gradient(180deg, #38b5f1, #1e96ce); }

.btn[aria-disabled="true"],
.btn.is-pending {
  opacity: 0.78;
  pointer-events: none;
  cursor: default;
}

.btn--ghost.is-pending { opacity: 0.6; }

/* ---------------------------------------------------------------- шапка */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(4, 16, 15, 0.82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2.4vw, 34px);
  min-height: var(--header-h);
}

.brand { display: inline-flex; align-items: center; }
.brand img { height: 29px; width: auto; }

.nav {
  display: flex;
  align-items: center;
  gap: clamp(12px, 1.7vw, 26px);
  margin-left: auto;
  font-size: 13.5px;
  color: var(--txt-mid);
}

.nav > a:not(.btn) { transition: color 0.18s ease; }
.nav > a:not(.btn):hover,
.nav > a:not(.btn).is-active { color: var(--txt); }

.nav .btn { padding: 9px 15px; font-size: 13px; }

.header-actions { display: flex; align-items: center; gap: 10px; }
.header-actions .btn { padding: 9px 15px; font-size: 13px; }

.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  position: relative;
}

.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  position: absolute;
  left: 50%;
  width: 16px;
  height: 1.5px;
  background: var(--txt);
  transform: translateX(-50%);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle span { top: 50%; margin-top: -0.75px; }
.nav-toggle span::before { content: ""; top: -5px; }
.nav-toggle span::after { content: ""; top: 5px; }
.nav-toggle[aria-expanded="true"] span { background: transparent; }
.nav-toggle[aria-expanded="true"] span::before { transform: translateX(-50%) translateY(5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span::after { transform: translateX(-50%) translateY(-5px) rotate(-45deg); }

/* ------------------------------------------------------------------ hero */
.hero {
  position: relative;
  padding-top: clamp(38px, 5.5vw, 70px);
  padding-bottom: clamp(30px, 4vw, 56px);
  overflow: hidden;
  isolation: isolate;
}

#shader-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  opacity: 0.85;
  pointer-events: none;
  mask-image: radial-gradient(115% 120% at 70% 48%, #000 32%, transparent 84%);
  -webkit-mask-image: radial-gradient(115% 120% at 70% 48%, #000 32%, transparent 84%);
}

.hero__fallback {
  position: absolute;
  inset: 0;
  z-index: -3;
  background:
    linear-gradient(180deg, rgba(6, 22, 21, 0) 52%, var(--bg-950) 100%),
    radial-gradient(ellipse 60% 55% at 18% 8%, rgba(240, 180, 41, 0.14), transparent 62%),
    radial-gradient(ellipse 55% 60% at 88% 72%, rgba(76, 200, 214, 0.13), transparent 62%);
}

.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(26px, 4vw, 56px);
  align-items: center;
}

.hero-copy { display: flex; flex-direction: column; gap: 22px; align-items: flex-start; }

.hero h1 {
  font-size: clamp(30px, 4.1vw, 54px);
  line-height: 1.04;
  letter-spacing: -0.04em;
}

.hero h1 .accent { color: var(--gold); }

.hero .lead { max-width: 50ch; }

.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

.hero-art { position: relative; display: flex; justify-content: center; isolation: isolate; }

/* тёмный ореол: шейдер не просвечивает в зазорах между буквами */
.hero-art::before {
  content: "";
  position: absolute;
  inset: -18% -10%;
  z-index: -1;
  background: radial-gradient(ellipse 62% 58% at 50% 50%, rgba(4, 16, 15, 0.95) 26%, rgba(4, 16, 15, 0) 74%);
}

.hero-art img {
  width: 100%;
  max-width: 520px;
}

/* --------------------------------------------------------------- манифест */
.manifesto {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: clamp(24px, 4vw, 60px);
  align-items: center;
}

.manifesto__text {
  max-width: 24ch;
  font-family: var(--font-display);
  font-size: clamp(20px, 2.6vw, 33px);
  font-weight: 400;
  line-height: 1.32;
  letter-spacing: -0.03em;
  color: var(--paper, #e9f2ee);
  max-width: 30ch;
}

.manifesto__text strong { color: var(--gold); font-weight: 600; }

.manifesto__art {
  width: clamp(110px, 14vw, 170px);
  height: auto;
  filter: drop-shadow(0 24px 48px rgba(0, 0, 0, 0.6));
}

/* --------------------------------------------------------------- карточки */
.cards-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(12px, 1.6vw, 20px);
}

.card {
  position: relative;
  padding: clamp(20px, 2.2vw, 28px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.012) 52%, rgba(255, 255, 255, 0.022)),
    var(--card);
  box-shadow: var(--shadow);
  transition: border-color 0.2s ease;
}

.card:hover { border-color: rgba(240, 180, 41, 0.32); }

.card__icon {
  width: 62px;
  height: 62px;
  object-fit: contain;
  margin-bottom: 16px;
}

.card h3 { font-size: 18px; margin-bottom: 10px; }
.card p { color: var(--txt-mid); font-size: 14.5px; line-height: 1.62; }

/* ----------------------------------------------------------------- биомы */
.biome-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(10px, 1.2vw, 14px);
}

.biome-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.01) 60%, rgba(255, 255, 255, 0.02)),
    var(--card);
  box-shadow: var(--shadow);
  transition: border-color 0.2s ease;
}

.biome-tile:hover { border-color: rgba(76, 200, 214, 0.32); }

.biome-tile__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

.biome-tile__name {
  font-family: var(--font-display);
  font-size: 15px;
  letter-spacing: -0.02em;
  color: var(--txt);
}

.biome-tile__list { display: flex; flex-direction: column; gap: 6px; }

.biome-tile__item {
  position: relative;
  padding-left: 14px;
  font-size: 13px;
  color: var(--txt-mid);
}

.biome-tile__item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 5px;
  height: 5px;
  background: var(--ice);
  opacity: 0.7;
}

/* ------------------------------------------------------------------ wiki */
.wiki-section {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.section-shader {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  opacity: 0.9;
  pointer-events: none;
  mask-image: radial-gradient(120% 100% at 78% 40%, #000 34%, transparent 82%);
  -webkit-mask-image: radial-gradient(120% 100% at 78% 40%, #000 34%, transparent 82%);
}

.wiki-section > .wrap { position: relative; z-index: 1; }

.wiki-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: clamp(24px, 3vw, 36px);
}

.wiki-head .lead { margin-top: 10px; }

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

.wiki-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 198px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background-color: var(--bg-800);
  box-shadow: var(--shadow);
  transition: border-color 0.2s ease;
}

.wiki-card--wide { grid-column: span 2; min-height: 232px; }

.wiki-card__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

.wiki-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(4, 16, 15, 0.1) 0%, rgba(4, 16, 15, 0.45) 46%, rgba(4, 16, 15, 0.94) 100%);
}

.wiki-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(208, 251, 231, 0.05);
  pointer-events: none;
}

.wiki-card:hover { border-color: rgba(240, 180, 41, 0.45); }

.wiki-card__title {
  position: relative;
  z-index: 3;
  font-family: var(--font-display);
  font-size: clamp(15px, 1.5vw, 19px);
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: #fff;
  max-width: 22ch;
}

.wiki-card--wide .wiki-card__title { font-size: clamp(19px, 2.1vw, 27px); }

/* ---------------------------------------------------------------- коннект */
.connect-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(20px, 3vw, 48px);
  align-items: start;
}

.connect-card {
  padding: clamp(22px, 2.6vw, 32px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.012) 52%, rgba(255, 255, 255, 0.022)),
    var(--card);
  box-shadow: var(--shadow);
}

.connect-card h3 { font-size: 20px; margin-bottom: 8px; }
.connect-card > p { color: var(--txt-mid); font-size: 14.5px; }

.connect-links {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: 20px;
}

.connect-version {
  margin-top: 18px;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--txt-dim);
}

.connect-version span { color: var(--txt); }

/* ------------------------------------------------------------------ шаги */
.steps { display: flex; flex-direction: column; }

.step {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.step:first-child { padding-top: 6px; }
.step:last-child { border-bottom: 0; padding-bottom: 6px; }

.step__img {
  width: 58px;
  height: auto;
  object-fit: contain;
  justify-self: center;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.45));
}

.step__title { font-size: 15px; font-weight: 600; color: var(--txt); }

.step__text {
  margin-top: 3px;
  font-size: 14px;
  color: var(--txt-mid);
}

/* ---------------------------------------------------------------- подвал */
.site-footer {
  border-top: 1px solid var(--line);
  padding-block: clamp(30px, 4vw, 46px) clamp(24px, 3vw, 34px);
}

.footer-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  font-size: 13.5px;
  color: var(--txt-mid);
}

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

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  padding-top: 20px;
  font-size: 11.5px;
  color: var(--txt-dim);
}

.footer-note { max-width: 46ch; line-height: 1.6; }

/* ---------------------------------------------------------------- появление */
.js .reveal {
  opacity: 0;
  transition: opacity 0.55s ease;
}

.js .reveal.is-in { opacity: 1; }

/* ===================================================================== wiki */
.wiki-page { padding-block: clamp(26px, 3.6vw, 50px) clamp(56px, 7vw, 96px); min-height: 60vh; }

.wiki-shell {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  gap: clamp(24px, 3.4vw, 56px);
  align-items: start;
}

.wiki-side {
  position: sticky;
  top: calc(var(--header-h) + 26px);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.wiki-search {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.wiki-search svg { width: 14px; height: 14px; color: var(--txt-dim); flex: none; }

.wiki-search input {
  flex: 1;
  min-width: 0;
  background: none;
  border: 0;
  color: var(--txt);
  font: inherit;
  font-size: 14px;
  padding: 0;
  outline: none;
}

.wiki-search input::placeholder { color: var(--txt-dim); }

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

.wiki-nav__link {
  display: block;
  padding: 8px 0 8px 12px;
  border-left: 1px solid transparent;
  font-size: 14px;
  color: var(--txt-mid);
  transition: color 0.18s ease, border-color 0.18s ease;
}

.wiki-nav__link:hover { color: var(--txt); }

.wiki-nav__link.is-active {
  color: var(--gold);
  border-left-color: var(--gold);
}

.wiki-nav__empty { font-size: 13px; color: var(--txt-dim); padding-left: 12px; }

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

.prose { max-width: 72ch; }

.prose__head {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 8px;
  min-height: clamp(170px, 22vw, 220px);
  padding: clamp(18px, 2.2vw, 26px);
  margin-bottom: clamp(22px, 2.6vw, 30px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background-color: var(--bg-800);
  background-size: cover;
  background-position: center;
  box-shadow: var(--shadow);
}

.prose__head > * { position: relative; z-index: 1; }

.prose h1 { font-size: clamp(24px, 3vw, 36px); }

.prose__summary { color: var(--txt-mid); font-size: 15px; max-width: 60ch; }

.prose__meta {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--txt-dim);
}

.prose__edit {
  color: var(--gold);
  border-bottom: 1px solid rgba(240, 180, 41, 0.4);
}

.prose__body > * + * { margin-top: 16px; }

.prose__body h2 {
  margin-top: 36px;
  font-size: clamp(18px, 2.1vw, 24px);
}

.prose__body h3 { margin-top: 24px; font-size: 16.5px; color: var(--txt); }

.prose__body p,
.prose__body li { color: var(--txt-mid); font-size: 15px; line-height: 1.72; }

.prose__body strong { color: var(--txt); font-weight: 600; }

.prose__body a {
  color: var(--gold-hi);
  border-bottom: 1px solid rgba(240, 180, 41, 0.35);
}

.prose__body ul { display: flex; flex-direction: column; gap: 7px; }

.prose__body ul li { position: relative; padding-left: 16px; }

.prose__body ul li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.68em;
  width: 4px;
  height: 4px;
  background: var(--ice);
  opacity: 0.8;
}

.prose__body ol { counter-reset: li; display: flex; flex-direction: column; gap: 7px; }

.prose__body ol li { position: relative; padding-left: 26px; counter-increment: li; }

.prose__body ol li::before {
  content: counter(li) ".";
  position: absolute;
  left: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--gold);
}

.prose__body blockquote {
  border-left: 2px solid rgba(240, 180, 41, 0.45);
  padding-left: 16px;
}

.prose__body hr { border: 0; border-top: 1px solid var(--line); margin: 28px 0; }

.prose__body code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  padding: 1px 5px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.05);
}

.prose__body pre {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-950);
  overflow-x: auto;
}

.prose__body pre code { border: 0; background: none; padding: 0; font-size: 12.5px; line-height: 1.7; }

.prose__table { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); }

.prose__table table { width: 100%; border-collapse: collapse; font-size: 13.5px; }

.prose__table th {
  padding: 9px 12px;
  text-align: left;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--txt-mid);
  border-bottom: 1px solid var(--line);
}

.prose__table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--txt-mid);
  vertical-align: top;
}

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

.wiki-pager {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.pager-link {
  flex: 1 1 220px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  transition: border-color 0.18s ease;
}

.pager-link:hover { border-color: rgba(240, 180, 41, 0.4); }

.pager-link--next { text-align: right; margin-left: auto; }

.pager-link__dir {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--txt-dim);
}

.pager-link__title { font-size: 13.5px; color: var(--txt); }

/* ================================================================= адаптив */
@media (max-width: 1020px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .hero-art { order: -1; }
  .hero-art img { max-width: 420px; }
  .hero-copy { align-items: flex-start; }

  .manifesto { grid-template-columns: minmax(0, 1fr); }
  .manifesto__art { width: 96px; order: -1; }

  .cards-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .biome-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wiki-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .connect-grid { grid-template-columns: minmax(0, 1fr); }

  .wiki-shell { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .wiki-side { position: static; }
  .wiki-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2px 16px;
  }
  .prose { max-width: none; }
}

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

  .nav {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    margin: 0;
    padding: 14px var(--pad-x) 22px;
    background: var(--bg-900);
    border-bottom: 1px solid var(--line);
    max-height: calc(100dvh - var(--header-h));
    overflow-y: auto;
  }

  .nav.is-open { display: flex; }

  .nav > a:not(.btn) {
    padding: 11px 0;
    font-size: 15px;
    border-bottom: 1px solid var(--line);
  }

  .nav .btn { margin-top: 12px; }

  .nav-toggle { display: block; }
  .header-actions { margin-left: auto; }
}

@media (max-width: 720px) {
  .header-actions .btn--telegram { display: none; }
  .brand img { height: 25px; }
}

@media (max-width: 620px) {
  .cards-3,
  .biome-grid,
  .wiki-cards { grid-template-columns: minmax(0, 1fr); }

  .wiki-card--wide { grid-column: auto; min-height: 198px; }

  .hero-art img { max-width: 260px; }

  .wiki-nav { grid-template-columns: minmax(0, 1fr); }

  .manifesto__text { max-width: none; }
  .manifesto__art { display: none; }

  .footer-top { flex-direction: column; align-items: flex-start; }
}
