.hero--wiki {
  min-height: calc(100vh - 78px);
  position: relative;
  display: flex;
  align-items: center;
  padding: 24px 0 46px;
  overflow: visible;
}

.hero--wiki::before {
  content: "";
  position: absolute;
  inset: -28vh -24vw;
  background: radial-gradient(circle at 50% 48%, rgba(255, 255, 255, 0.26), transparent 66%);
  filter: blur(36px);
  pointer-events: none;
  z-index: 0;
}

.wiki-hero {
  width: 100%;
  position: relative;
  z-index: 1;
}

.wiki-hero-stage {
  position: relative;
  width: 100%;
  min-height: min(72vh, 700px);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background:
    radial-gradient(1200px 520px at 50% 50%, rgba(227, 122, 58, 0.12), transparent 62%);
}

.wiki-hero-stage::before {
  content: none;
}

.wiki-hero-center {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  text-align: center;
  gap: 18px;
  padding: 24px;
  z-index: 2;
}

.wiki-hero__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(3rem, 14vw, 11rem);
  line-height: 0.94;
  letter-spacing: -0.04em;
  text-transform: uppercase;
}

.wiki-hero__line {
  margin: 0;
  font-size: clamp(1rem, 2.1vw, 1.55rem);
  color: var(--muted);
  font-weight: 700;
  max-width: 780px;
}

.wiki-hero-words {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.wiki-fly-word {
  position: absolute;
  left: 0;
  top: 0;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.62);
  color: var(--ink);
  padding: 8px 13px;
  font-size: clamp(0.78rem, 1.15vw, 1rem);
  font-weight: 700;
  letter-spacing: 0.01em;
  box-shadow: var(--shadow-soft);
  white-space: nowrap;
  opacity: 0.88;
  transform: translate3d(0, 0, 0);
  will-change: transform;
}

:root[data-theme="dark"] .wiki-fly-word {
  background: rgba(255, 255, 255, 0.1);
}

.wiki {
  padding-top: 34px;
}

.wiki-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.wiki-auth-badge {
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: rgba(227, 122, 58, 0.14);
  font-weight: 700;
  white-space: nowrap;
}

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

.wiki-empty {
  grid-column: 1 / -1;
  padding: 22px;
  border-radius: var(--radius);
  border: 1px dashed var(--stroke);
  color: var(--muted);
  background: var(--card);
}

.wiki-card {
  border-radius: var(--radius);
  border: 1px solid var(--stroke);
  background: var(--card);
  box-shadow: var(--shadow-soft);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.wiki-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.wiki-card__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.08rem;
  line-height: 1.3;
}

.wiki-card__preview {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.wiki-card__foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.wiki-date {
  color: var(--soft);
  font-size: 0.88rem;
}

.wiki-kebab-wrap {
  position: relative;
}

.wiki-kebab {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.45);
  font-weight: 800;
  cursor: pointer;
}

:root[data-theme="dark"] .wiki-kebab {
  background: rgba(255, 255, 255, 0.08);
}

.wiki-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  width: 150px;
  border: 1px solid var(--stroke);
  border-radius: 14px;
  background: var(--card);
  box-shadow: var(--shadow-soft);
  padding: 6px;
  display: none;
  z-index: 6;
}

.wiki-menu.is-open {
  display: grid;
  gap: 4px;
}

.wiki-menu button {
  width: 100%;
  border: 0;
  text-align: left;
  border-radius: 10px;
  background: transparent;
  padding: 8px 10px;
  cursor: pointer;
}

.wiki-menu button:hover,
.wiki-menu button:focus-visible {
  background: rgba(227, 122, 58, 0.16);
  outline: none;
}

.wiki-post-content {
  white-space: pre-wrap;
  line-height: 1.6;
  color: var(--ink);
  max-height: min(30dvh, 300px);
  overflow-y: auto;
  padding-right: 6px;
  scrollbar-gutter: stable;
}

.modal-window--wide {
  width: min(860px, calc(100% - 24px));
}

#postModal {
  align-items: flex-start;
  overflow-y: auto;
  padding-top: 18px;
  padding-bottom: 18px;
}

#postModal .modal-window--wide {
  max-height: calc(100dvh - 36px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.post-actions {
  justify-content: flex-start;
}

.wiki-comments {
  margin-top: 18px;
  border-top: 1px solid var(--stroke);
  padding-top: 16px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1 1 auto;
}

.wiki-comments__title {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: 1.05rem;
}

.wiki-comments__list {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
  max-height: none;
  min-height: 110px;
  flex: 1 1 auto;
  overflow: auto;
  padding-right: 4px;
  scrollbar-gutter: stable;
}

.wiki-comments__empty {
  border: 1px dashed var(--stroke);
  border-radius: 12px;
  padding: 12px;
  color: var(--muted);
}

.wiki-comment {
  border: 1px solid var(--stroke);
  border-radius: 12px;
  background: var(--card);
  padding: 10px 12px;
}

.wiki-comment__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.wiki-comment__author {
  font-weight: 800;
}

.wiki-comment__date {
  color: var(--soft);
  font-size: 0.82rem;
}

.wiki-comment__text {
  margin: 0;
  white-space: pre-wrap;
  line-height: 1.45;
  color: var(--ink);
}

.wiki-comments__form {
  display: grid;
  gap: 8px;
}

.wiki-comments__line {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.wiki-comments__line input[type="text"] {
  width: min(300px, 100%);
}

.wiki-anon {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  color: var(--muted);
}

@media (max-width: 980px) {
  .wiki-hero-stage {
    min-height: min(66vh, 580px);
  }

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

@media (max-width: 760px) {
  .hero--wiki {
    min-height: auto;
    padding-top: 34px;
  }

  .wiki-hero-stage {
    min-height: 470px;
  }

  .wiki-fly-word {
    font-size: 0.8rem;
    padding: 7px 11px;
  }

  .wiki-head {
    flex-direction: column;
    align-items: flex-start;
  }

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

  .wiki-comments__line {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  #postModal .modal-window--wide {
    max-height: calc(100dvh - 24px);
    width: min(100%, calc(100% - 12px));
    padding: 16px 14px 14px;
  }

  .wiki-post-content {
    max-height: min(24dvh, 230px);
  }
}
