:root {
  --bg: #0e0e0e;
  --bg-2: #161616;
  --panel: #1a1a1a;
  --panel-2: #1f1f1f;
  --line: #2a2a2a;
  --ink: #f2f4f5;
  --muted: #9aa3a8;
  --teal: #48b8cc;
  --teal-soft: rgba(72, 184, 204, 0.18);
  --teal-deep: #2a8fa0;
  --green: #2f9e44;
  --green-hi: #3bb554;
  --red: #e03131;
  --red-hi: #f03e3e;
  --telegram: #229ed9;
  --telegram-hi: #2eb0ef;
  --warn-bg: #f5f5f5;
  --warn-ink: #1a1a1a;
  --max: 1120px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100%;
  font-family: "Outfit", system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--teal);
  text-decoration: none;
}

a:hover,
a:focus-visible {
  color: #7ad4e4;
}

strong {
  color: var(--ink);
  font-weight: 650;
}

.container {
  width: min(100% - 1.5rem, var(--max));
  margin-inline: auto;
}

/* —— Top bar —— */
.topbar {
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--line);
  background: #0a0a0a;
}

.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.topbar__logo {
  width: min(220px, 52vw);
  height: auto;
}

.topbar__auth {
  display: flex;
  gap: 0.85rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
}

.topbar__auth a {
  color: inherit;
}

.topbar__auth a:hover {
  color: var(--teal);
}

/* —— Nav —— */
.nav {
  background: #121212;
  border-bottom: 1px solid var(--line);
}

.nav__row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.15rem;
  padding: 0.35rem 0;
}

.nav__link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.75rem;
  border-radius: 0.35rem;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 600;
}

.nav__link svg {
  width: 1.05rem;
  height: 1.05rem;
  color: var(--teal);
}

.nav__link.is-active,
.nav__link:hover {
  background: var(--teal-soft);
  color: var(--teal);
}

.subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  padding: 0.45rem 0 0.65rem;
  border-top: 1px solid var(--line);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
}

.subnav a {
  color: inherit;
}

.subnav a:hover {
  color: var(--teal);
}

/* —— Alerts —— */
.alerts {
  display: grid;
  gap: 0.55rem;
  padding: 0.9rem 0 0;
}

.alert {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--teal);
  border-radius: 0.35rem;
  background: rgba(20, 36, 40, 0.85);
  font-size: 0.88rem;
  color: #d7e0e3;
}

.alert--warn {
  background: var(--warn-bg);
  color: var(--warn-ink);
  border-color: #d0d0d0;
}

.alert--warn a {
  color: var(--teal-deep);
  font-weight: 700;
}

.alert__icon {
  flex: 0 0 auto;
  width: 1.35rem;
  height: 1.35rem;
  margin-top: 0.1rem;
  color: var(--teal);
}

.alert--warn .alert__icon {
  color: #c92a2a;
}

/* —— Entry gate (blurred forum screenshots + 3 buttons) —— */
.gate {
  position: relative;
  margin: 1rem 0 1.25rem;
  border: 1px solid rgba(72, 184, 204, 0.35);
  border-radius: 0.55rem;
  overflow: hidden;
  min-height: 28rem;
  display: grid;
  place-items: center;
  isolation: isolate;
}

.gate__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.gate__img {
  position: absolute;
  inset: -20px;
  background-position: top center;
  background-size: cover;
  background-repeat: no-repeat;
  transform: scale(1.06);
  filter: blur(14px) saturate(0.85) brightness(0.5);
}

.gate__img--desktop {
  background-image: url("assets/bg-desktop.png");
}

.gate__img--mobile {
  display: none;
  background-image: url("assets/bg-mobile.jpg");
}

.gate__veil {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 55% at 50% 35%, rgba(7, 8, 9, 0.25), transparent 70%),
    linear-gradient(180deg, rgba(7, 8, 9, 0.55) 0%, rgba(7, 8, 9, 0.78) 55%, rgba(7, 8, 9, 0.92) 100%);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.gate__inner {
  position: relative;
  z-index: 1;
  width: min(100% - 2rem, 26rem);
  padding: 2rem 0;
  text-align: center;
}

.gate__logo {
  width: min(100%, 18rem);
  margin: 0 auto 0.65rem;
  filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.55));
}

.gate__title {
  margin: 0;
  font-family: "Bebas Neue", "Outfit", sans-serif;
  font-size: clamp(1.9rem, 6vw, 2.55rem);
  letter-spacing: 0.08em;
  font-weight: 400;
  line-height: 1;
  text-shadow: 0 2px 24px rgba(72, 184, 204, 0.25);
}

.gate__lede {
  margin: 0.55rem auto 1.15rem;
  max-width: 24rem;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 500;
}

.gate__lede strong {
  color: var(--teal);
}

.actions {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.btn {
  --accent: var(--green);
  --accent-hi: var(--green-hi);
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-height: 3.35rem;
  padding: 0.85rem 1.1rem 0.85rem 0.95rem;
  border-radius: 0.55rem;
  background: linear-gradient(180deg, var(--accent-hi) 0%, var(--accent) 100%);
  color: #fff !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    0 10px 28px rgba(0, 0, 0, 0.35);
  transition:
    transform 0.28s var(--ease),
    box-shadow 0.28s var(--ease),
    filter 0.28s var(--ease);
}

.btn--private {
  --accent: var(--red);
  --accent-hi: var(--red-hi);
}

.btn--telegram {
  --accent: var(--telegram);
  --accent-hi: var(--telegram-hi);
}

.btn:hover,
.btn:focus-visible {
  transform: translateY(-3px) scale(1.015);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 16px 36px rgba(0, 0, 0, 0.45);
  filter: brightness(1.05);
  outline: none;
}

.btn:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
}

.btn__icon {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 1.6rem;
  height: 1.6rem;
}

.btn__icon svg {
  width: 100%;
  height: 100%;
}

.btn__label {
  flex: 1;
  text-align: center;
  font-size: clamp(0.8rem, 3.2vw, 0.92rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.25;
  padding-right: 1.6rem;
}

/* —— Layout —— */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 1rem;
  align-items: start;
  padding-bottom: 2.5rem;
}

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 0.35rem 0 0.85rem;
}

.page-head h1 {
  margin: 0;
  font-size: clamp(1.35rem, 3vw, 1.85rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.new-posts {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.75rem;
  border-radius: 0.35rem;
  background: #252525;
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 650;
  white-space: nowrap;
}

.new-posts svg {
  width: 0.95rem;
  height: 0.95rem;
  color: var(--teal);
}

/* —— Forum category block (visual) —— */
.board {
  border: 1px solid var(--line);
  border-radius: 0.4rem;
  overflow: hidden;
  background: var(--panel);
  margin-bottom: 1rem;
}

.board__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  background: #222;
  border-bottom: 1px solid var(--line);
  font-weight: 700;
}

.board__row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.8rem 0.85rem;
  border-top: 1px solid var(--line);
}

.board__row:first-of-type {
  border-top: 0;
}

.board__icon {
  width: 48px;
  height: 48px;
  border-radius: 0.35rem;
  background:
    linear-gradient(145deg, rgba(72, 184, 204, 0.35), rgba(72, 184, 204, 0.05)),
    #111;
  border: 1px solid rgba(72, 184, 204, 0.45);
  display: grid;
  place-items: center;
  color: var(--teal);
  font-family: "Bebas Neue", sans-serif;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
}

.board__title {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 700;
}

.board__title a {
  color: var(--ink);
}

.board__title a:hover {
  color: var(--teal);
}

.board__desc {
  margin: 0.15rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.board__meta {
  text-align: right;
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
}

.board__meta strong {
  display: block;
  color: var(--ink);
  font-size: 0.88rem;
}

/* —— Article / blog —— */
.thread {
  border: 1px solid var(--line);
  border-radius: 0.4rem;
  background: var(--panel);
  overflow: hidden;
}

.thread__head {
  padding: 0.85rem 1rem;
  background: #222;
  border-bottom: 1px solid var(--line);
}

.thread__head h2 {
  margin: 0;
  font-size: 1.15rem;
}

.thread__meta {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.prose {
  padding: 1.15rem 1.1rem 1.5rem;
}

.prose h2 {
  margin: 1.75rem 0 0.65rem;
  font-size: 1.28rem;
  letter-spacing: -0.01em;
  color: var(--ink);
  scroll-margin-top: 1rem;
}

.prose h2:first-child {
  margin-top: 0;
}

.prose h3 {
  margin: 1.25rem 0 0.45rem;
  font-size: 1.05rem;
  color: var(--teal);
}

.prose p,
.prose li {
  color: #c6cecf;
  font-size: 0.96rem;
  line-height: 1.65;
}

.prose p {
  margin: 0 0 0.9rem;
}

.prose ul {
  margin: 0 0 1rem;
  padding-left: 1.2rem;
}

.prose li + li {
  margin-top: 0.35rem;
}

.toc {
  margin: 0 0 1.25rem;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(72, 184, 204, 0.28);
  border-radius: 0.4rem;
  background: rgba(72, 184, 204, 0.06);
}

.toc h2 {
  margin: 0 0 0.45rem;
  font-size: 0.95rem;
  color: var(--teal);
}

.toc ol {
  margin: 0;
  padding-left: 1.15rem;
  columns: 2;
  gap: 1.5rem;
}

.toc li {
  margin: 0.2rem 0;
  font-size: 0.86rem;
  break-inside: avoid;
}

.toc a {
  color: #d7e4e7;
}

.toc a:hover {
  color: var(--teal);
}

/* —— Sidebar —— */
.sidebar {
  display: grid;
  gap: 0.85rem;
  position: sticky;
  top: 0.75rem;
}

.widget {
  border: 1px solid var(--line);
  border-radius: 0.4rem;
  background: var(--panel);
  overflow: hidden;
}

.widget__head {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.65rem 0.8rem;
  background: #222;
  border-bottom: 1px solid var(--line);
  font-weight: 700;
  font-size: 0.92rem;
}

.widget__head svg {
  width: 1.05rem;
  height: 1.05rem;
  color: var(--teal);
}

.widget__body {
  padding: 0.75rem 0.85rem 0.9rem;
}

.stat {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.4rem 0;
  border-top: 1px solid var(--line);
  font-size: 0.88rem;
}

.stat:first-child {
  border-top: 0;
  padding-top: 0;
}

.stat span {
  color: var(--muted);
}

.stat strong {
  font-variant-numeric: tabular-nums;
}

.widget p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.5;
}

.widget p + p {
  margin-top: 0.65rem;
}

/* —— Footer —— */
.site-foot {
  border-top: 1px solid var(--line);
  background: #0a0a0a;
  padding: 1.25rem 0 1.5rem;
  text-align: center;
  color: rgba(168, 180, 187, 0.7);
  font-size: 0.78rem;
}

.site-foot p {
  margin: 0;
}

.site-foot a {
  color: var(--muted);
}

/* —— Responsive —— */
@media (max-width: 920px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .toc ol {
    columns: 1;
  }
}

@media (max-width: 720px) {
  .gate__img--desktop {
    display: none;
  }

  .gate__img--mobile {
    display: block;
    filter: blur(12px) saturate(0.9) brightness(0.48);
  }

  .board__row {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .board__meta {
    grid-column: 2;
    text-align: left;
  }

  .sidebar {
    grid-template-columns: 1fr;
  }

  .page-head {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 520px) {
  .nav__link span.label {
    /* keep icons readable */
  }

  .topbar__auth {
    font-size: 0.8rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .btn:hover,
  .btn:focus-visible {
    transform: none;
  }
}
