/* ===== Cube RolePlay — стили ===== */
:root {
  --black: #000000;
  --ink: #141414;
  --grey: #6E6E6E;
  --rule: #E3E3E3;
  --paper: #FFFFFF;
  --soft: #F4F4F4;
  --line-w: 6px;

  --f-display: "Unbounded", system-ui, sans-serif;
  --f-body: "Manrope", system-ui, sans-serif;

  --gutter: clamp(16px, 5vw, 64px);
  --max: 1200px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.6 var(--f-body);
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--f-display); margin: 0; line-height: 1.1; }
p { margin: 0; }
:focus-visible { outline: 3px solid #4169E1; outline-offset: 3px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 0 26px;
  background: var(--black); color: #fff;
  font: 600 15px/1 var(--f-display);
  border-radius: 999px; text-decoration: none; border: 2px solid var(--black);
  transition: background .2s, color .2s;
}
.btn:hover { background: #fff; color: var(--black); }
.btn--small { min-height: 40px; padding: 0 18px; font-size: 13px; }
.btn--ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.35); }
.btn--ghost:hover { background: #fff; color: var(--black); border-color: #fff; }

/* ---------- Навигация ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; gap: 32px;
  padding: 14px var(--gutter);
  color: #fff;
  transition: background .3s, color .3s, box-shadow .3s;
}
.nav.is-solid { background: rgba(255,255,255,.92); color: var(--ink); backdrop-filter: blur(12px); box-shadow: 0 1px 0 var(--rule); }
.nav.is-solid .nav__brand img { filter: invert(1); }
.nav.is-solid .nav__cta { background: var(--black); color: #fff; }
.nav__brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 600 15px var(--f-display); }
.nav__brand img { border-radius: 8px; transform: scale(1.35); transition: filter .3s; }
.nav__links { display: flex; gap: 26px; margin-left: auto; }
.nav__links a { text-decoration: none; font-weight: 500; font-size: 15px; opacity: .8; transition: opacity .2s; }
.nav__links a:hover { opacity: 1; }
.nav__cta { background: #fff; color: var(--black); border-color: currentColor; }
.nav__burger { display: none; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: grid; grid-template-columns: 1.1fr .9fr; align-items: center; gap: 32px;
  padding: 120px var(--gutter) 80px;
  background: var(--black); color: #fff;
  overflow: hidden;
}
.hero__title {
  font-size: clamp(56px, 10vw, 148px);
  font-weight: 800; letter-spacing: -0.04em; line-height: .92;
}
.hero__lead { margin-top: 28px; max-width: 30em; font-size: clamp(17px, 1.6vw, 20px); color: rgba(255,255,255,.72); }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }

.ip {
  display: inline-flex; align-items: center; gap: 14px;
  min-height: 52px; padding: 0 8px 0 24px;
  background: #fff; color: var(--black);
  border: 0; border-radius: 999px; cursor: pointer;
  font: 600 16px var(--f-display);
}
.ip__action { padding: 10px 14px; background: var(--soft); border-radius: 999px; font: 600 13px var(--f-body); transition: background .2s; }
.ip:hover .ip__action { background: #E6E6E6; }
.ip.is-copied .ip__action { background: #00B400; color: #fff; }

.status { display: flex; align-items: center; gap: 10px; margin-top: 28px; font-size: 15px; color: rgba(255,255,255,.72); }
.status__dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: #6E6E6E; }
.status.is-online .status__dot { background: #00B400; box-shadow: 0 0 0 0 rgba(0,180,0,.6); animation: pulse 2s infinite; }
.status.is-offline .status__dot { background: #B51118; }
.status b { color: #fff; font-weight: 700; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(0,180,0,0); } 100% { box-shadow: 0 0 0 0 rgba(0,180,0,0); } }

/* Куб — единственная «сцена» при загрузке */
.hero__cube { position: relative; display: grid; place-items: center; }
.cube { position: relative; width: min(100%, 520px); aspect-ratio: 1; }
/* Настоящий логотип, разрезанный на три грани */
.cube__face { position: absolute; inset: 0; width: 100%; height: 100%; }
.cube__face--top   { clip-path: polygon(50% 15%, 79% 32%, 50% 49%, 21% 32%); }
.cube__face--left  { clip-path: polygon(18% 37%, 49% 54.5%, 49% 85%, 18% 68%); }
.cube__face--right { clip-path: polygon(51% 54.5%, 82% 37%, 82% 68%, 51% 85%); }
.cube__face--top   { animation: inTop   1.1s var(--ease) .15s both; }
.cube__face--left  { animation: inLeft  1.1s var(--ease) .3s  both; }
.cube__face--right { animation: inRight 1.1s var(--ease) .45s both; }
@keyframes inTop   { from { opacity: 0; transform: translateY(-140px) rotate(-8deg); } }
@keyframes inLeft  { from { opacity: 0; transform: translate(-150px, 90px) rotate(6deg); } }
@keyframes inRight { from { opacity: 0; transform: translate(150px, 90px) rotate(-6deg); } }
.cube { transition: transform .4s var(--ease); }

.hero__text > * { animation: rise .9s var(--ease) both; }
.hero__text > :nth-child(2) { animation-delay: .7s; }
.hero__text > :nth-child(3) { animation-delay: .8s; }
.hero__text > :nth-child(4) { animation-delay: .9s; }
.hero__title { animation-delay: .55s; }
@keyframes rise { from { opacity: 0; transform: translateY(24px); } }

/* ---------- Секции ---------- */
.section { max-width: var(--max); margin: 0 auto; padding: clamp(72px, 10vw, 140px) var(--gutter); }
.section__head { max-width: 640px; margin-bottom: clamp(40px, 6vw, 72px); }
.section__head h2 { font-size: clamp(36px, 5.5vw, 64px); font-weight: 800; letter-spacing: -0.03em; }
.section__head p { margin-top: 16px; font-size: 19px; color: var(--grey); }

/* ---------- Линия «Как начать» ---------- */
.line {
  list-style: none; margin: 0; padding: 0;
  position: relative;
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 24px;
}
.line::before, .line::after {
  content: ""; position: absolute; left: 12px; right: 12px; top: 11px; height: var(--line-w); border-radius: 3px;
}
.line::before { background: var(--rule); }
.line::after { background: var(--black); transform-origin: left; transform: scaleX(0); transition: transform 1.8s var(--ease); }
.line.is-drawn::after { transform: scaleX(1); }

.station { position: relative; padding-top: 52px; }
.station__dot {
  position: absolute; top: 0; left: 0; z-index: 1;
  width: 28px; height: 28px; border-radius: 50%;
  background: #fff; border: var(--line-w) solid var(--rule);
  transition: border-color .3s, transform .3s var(--ease);
}
.line.is-drawn .station__dot { border-color: var(--black); }
.line.is-drawn .station:nth-child(1) .station__dot { transition-delay: .1s; }
.line.is-drawn .station:nth-child(2) .station__dot { transition-delay: .45s; }
.line.is-drawn .station:nth-child(3) .station__dot { transition-delay: .8s; }
.line.is-drawn .station:nth-child(4) .station__dot { transition-delay: 1.15s; }
.line.is-drawn .station:nth-child(5) .station__dot { transition-delay: 1.5s; }
.station--end .station__dot { width: 36px; height: 36px; top: -4px; left: -4px; background: var(--black); }
.station h3 { font-size: 19px; font-weight: 600; }
.station p { margin-top: 8px; color: var(--grey); font-size: 15px; max-width: 22ch; }

/* ---------- Город ---------- */
.section--city { max-width: none; background: var(--soft); }
.section--city > * { max-width: calc(var(--max) - 2 * var(--gutter)); margin-left: auto; margin-right: auto; }
.city { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; background: var(--rule); border: 2px solid var(--rule); border-radius: 20px; overflow: hidden; }
.city__item { background: #fff; padding: 36px 32px 40px; }
.city__item--wide { grid-column: span 3; display: grid; grid-template-columns: 1fr 1.4fr; gap: 32px; align-items: end; padding: 48px 32px; background: var(--black); color: #fff; }
.city__item--wide h3 { font-size: clamp(28px, 4vw, 44px); font-weight: 800; letter-spacing: -0.02em; }
.city__item--wide p { color: rgba(255,255,255,.72); font-size: 18px; }
.city__item h3 { font-size: 20px; font-weight: 600; }
.city__item p { margin-top: 12px; color: var(--grey); font-size: 16px; }
.city__item--wide p { margin-top: 0; }

/* ---------- Фракции ---------- */
.factions { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); }
.factions li {
  display: grid; grid-template-columns: 120px 1fr 1.3fr; align-items: center; gap: 24px;
  padding: 26px 0; border-bottom: 1px solid var(--rule);
}
.factions__line { position: relative; height: var(--line-w); background: var(--c); border-radius: 3px; }
.factions__line::after { content: ""; position: absolute; right: -4px; top: 50%; width: 22px; height: 22px; transform: translateY(-50%); border-radius: 50%; background: #fff; border: var(--line-w) solid var(--c); }
.factions h3 { font-size: clamp(22px, 3vw, 32px); font-weight: 600; letter-spacing: -0.01em; }
.factions p { color: var(--grey); }

/* ---------- Донат ---------- */
.donate { display: grid; grid-template-columns: 1.5fr 1fr; gap: 40px; align-items: start; }
.price { width: 100%; border-collapse: collapse; }
.price th, .price td { padding: 20px 0; border-bottom: 1px solid var(--rule); text-align: left; font-size: 17px; }
.price th { font-weight: 500; }
.price td { text-align: right; font-family: var(--f-display); font-weight: 600; white-space: nowrap; padding-left: 16px; }
.price tr:first-child th, .price tr:first-child td { border-top: 2px solid var(--ink); }
.vip { padding: 40px 36px; background: var(--black); color: #fff; border-radius: 24px; }
.vip h3 { font-size: 48px; font-weight: 800; letter-spacing: -0.03em; }
.vip ul { list-style: none; padding: 0; margin: 24px 0 32px; }
.vip li { padding: 12px 0; border-bottom: 1px solid rgba(255,255,255,.15); color: rgba(255,255,255,.85); }
.vip .btn { width: 100%; background: #fff; color: var(--black); border-color: #fff; }
.vip .btn:hover { background: transparent; color: #fff; }

/* ---------- Правила ---------- */
.rules { border-top: 2px solid var(--ink); max-width: 860px; }
.rules details { border-bottom: 1px solid var(--rule); }
.rules summary {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 24px 0; cursor: pointer; list-style: none;
  font: 600 clamp(18px, 2.2vw, 22px)/1.3 var(--f-display);
}
.rules summary::-webkit-details-marker { display: none; }
.rules summary::after { content: "+"; flex: none; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: var(--soft); font: 400 22px var(--f-body); transition: transform .3s var(--ease), background .2s; }
.rules details[open] summary::after { transform: rotate(45deg); background: var(--black); color: #fff; }
.rules details p { padding: 0 0 28px; max-width: 62ch; color: var(--grey); }
.rules details[open] p { animation: open .35s var(--ease); }
@keyframes open { from { opacity: 0; transform: translateY(-6px); } }

/* ---------- Команда ---------- */
.team { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.team li { padding: 28px 24px; border: 2px solid var(--rule); border-radius: 20px; }
.team__avatar { width: 64px; height: 64px; border-radius: 14px; background: var(--soft); image-rendering: pixelated; }
.team__name { margin-top: 20px; font: 600 18px var(--f-display); }
.team__role { margin-top: 4px; color: var(--grey); font-size: 15px; }

/* ---------- Футер ---------- */
.footer { background: var(--black); color: #fff; padding: 80px var(--gutter) 40px; }
.footer__brand { display: flex; align-items: center; gap: 20px; }
.footer__brand p { font: 800 clamp(28px, 5vw, 56px) var(--f-display); letter-spacing: -0.03em; }
.footer__links { list-style: none; padding: 0; margin: 48px 0; display: flex; flex-wrap: wrap; gap: 12px; }
.footer__links a {
  display: grid; place-items: center;
  width: 56px; height: 56px;
  border: 1px solid rgba(255,255,255,.3); border-radius: 50%;
  color: #fff; transition: background .2s, color .2s, border-color .2s, transform .2s var(--ease);
}
.footer__links a:hover { background: #fff; color: var(--black); border-color: #fff; transform: translateY(-3px); }

/* Иконки соцсетей (Simple Icons), окрашиваются через currentColor */
.icon {
  width: 24px; height: 24px; background: currentColor;
  -webkit-mask: var(--i) center / contain no-repeat; mask: var(--i) center / contain no-repeat;
}
.icon--discord  { --i: url("https://cdn.jsdelivr.net/npm/simple-icons@13.0.0/icons/discord.svg"); }
.icon--telegram { --i: url("https://cdn.jsdelivr.net/npm/simple-icons@13.0.0/icons/telegram.svg"); }
.icon--vk       { --i: url("https://cdn.jsdelivr.net/npm/simple-icons@13.0.0/icons/vk.svg"); }
.icon--youtube  { --i: url("https://cdn.jsdelivr.net/npm/simple-icons@13.0.0/icons/youtube.svg"); }
.icon--tiktok   { --i: url("https://cdn.jsdelivr.net/npm/simple-icons@13.0.0/icons/tiktok.svg"); }
.footer__note { margin-top: 16px; color: rgba(255,255,255,.45); font-size: 13px; max-width: 60ch; }
.footer__bottom {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px 32px;
  padding-top: 28px; border-top: 1px solid rgba(255,255,255,.15);
}
.footer__copy { color: rgba(255,255,255,.7); font-size: 14px; }
.footer__legal { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 28px; }
.footer__legal a { font-size: 14px; color: rgba(255,255,255,.7); text-underline-offset: 4px; transition: color .2s; }
.footer__legal a:hover, .footer__legal a[aria-current] { color: #fff; }
.footer--doc { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px 32px; padding-top: 40px; }

/* ---------- Страницы документов ---------- */
.page-doc .nav__back { margin-left: auto; }
.doc { max-width: 760px; margin: 0 auto; padding: 130px var(--gutter) 100px; box-sizing: content-box; }
.doc h1 { font-size: clamp(32px, 6vw, 56px); font-weight: 800; letter-spacing: -0.03em; }
.doc__meta { margin-top: 16px; color: var(--grey); }
.doc__toc { margin: 40px 0 16px; padding: 24px 28px; background: var(--soft); border-radius: 20px; }
.doc__toc ol { margin: 0; padding-left: 22px; columns: 2; column-gap: 32px; }
.doc__toc li { padding: 4px 0; break-inside: avoid; }
.doc__toc a { text-decoration: none; }
.doc__toc a:hover { text-decoration: underline; }
.doc section { padding-top: 40px; }
.doc h2 { font-size: clamp(20px, 3vw, 26px); font-weight: 600; margin-bottom: 16px; }
.doc section p, .doc li { line-height: 1.7; }
.doc section p + p { margin-top: 12px; }
.doc ul { margin: 12px 0; padding-left: 22px; }
.doc li { padding: 3px 0; }
.doc a { text-underline-offset: 3px; }
.doc__req { margin-top: 48px; padding: 28px !important; border: 2px solid var(--rule); border-radius: 20px; }
.doc__req p + p { margin-top: 4px !important; }
@media (max-width: 560px) {
  .doc { padding-top: 100px; }
  .doc__toc ol { columns: 1; }
  .doc__toc { padding: 20px; }
  .footer__bottom, .footer--doc { flex-direction: column; align-items: flex-start; }
}

/* ---------- Тост ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 60;
  width: max-content; max-width: calc(100vw - 32px); text-align: center;
  padding: 14px 22px; border-radius: 999px;
  background: var(--black); color: #fff; font-weight: 500;
  box-shadow: 0 0 0 1px rgba(255,255,255,.2);
  transform: translate(-50%, calc(100% + 48px)); visibility: hidden;
  transition: transform .35s var(--ease), visibility 0s .35s;
}
.toast.is-shown { transform: translate(-50%, 0); visibility: visible; transition: transform .35s var(--ease); }

/* ================= Адаптив ================= */
@media (max-width: 1024px) {
  .city { grid-template-columns: repeat(2, 1fr); }
  .city__item--wide { grid-column: span 2; }
  .team { grid-template-columns: repeat(2, 1fr); }
  .donate { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .nav { gap: 12px; }
  .nav__burger {
    margin-left: auto;
    display: grid; place-content: center; gap: 6px;
    width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%;
    background: transparent; color: inherit; cursor: pointer;
  }
  .nav__burger span { display: block; width: 22px; height: 2px; background: currentColor; transition: transform .3s var(--ease); }
  .nav.is-open .nav__burger span:first-child { transform: translateY(4px) rotate(45deg); }
  .nav.is-open .nav__burger span:last-child { transform: translateY(-4px) rotate(-45deg); }

  .nav__links {
    position: fixed; inset: 68px 0 auto 0;
    flex-direction: column; gap: 0;
    padding: 8px var(--gutter) 24px;
    background: #fff; color: var(--ink);
    box-shadow: 0 12px 24px rgba(0,0,0,.12);
    clip-path: inset(0 0 100% 0); visibility: hidden;
    transition: clip-path .35s var(--ease), visibility 0s .35s;
  }
  .nav.is-open .nav__links { clip-path: inset(0 0 0 0); visibility: visible; transition: clip-path .35s var(--ease); }
  .nav.is-open { background: #fff; color: var(--ink); }
  .nav.is-open .nav__brand img { filter: invert(1); }
  .nav.is-open .nav__cta { background: var(--black); color: #fff; }
  .nav__links a { padding: 16px 0; font: 600 20px var(--f-display); border-bottom: 1px solid var(--rule); opacity: 1; }

  .hero { grid-template-columns: 1fr; padding-top: 100px; text-align: left; }
  .hero__cube { order: -1; }
  .cube { width: min(70vw, 320px); margin: -24px 0; }

  /* Линия становится вертикальной */
  .line { grid-template-columns: 1fr; gap: 36px; }
  .line::before, .line::after { left: 11px; right: auto; top: 12px; bottom: 12px; width: var(--line-w); height: auto; }
  .line::after { transform-origin: top; transform: scaleY(0); }
  .line.is-drawn::after { transform: scaleY(1); }
  .station { padding: 0 0 0 52px; }
  .station p { max-width: none; }

  .factions li { grid-template-columns: 64px 1fr; gap: 6px 20px; }
  .factions p { grid-column: 2; }
}

@media (max-width: 560px) {
  body { font-size: 16px; }
  .nav__brand span { display: none; }
  .hero__actions { flex-direction: column; align-items: stretch; }
  .ip { justify-content: space-between; }
  .btn--ghost { width: 100%; }
  .city { grid-template-columns: 1fr; }
  .city__item--wide { grid-column: auto; grid-template-columns: 1fr; gap: 16px; padding: 36px 24px; }
  .city__item { padding: 28px 24px 32px; }
  .team { grid-template-columns: 1fr 1fr; gap: 10px; }
  .team li { padding: 20px 16px; }
  .price th, .price td { font-size: 15px; }
  .vip { padding: 32px 24px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
  .line::after { transform: none !important; }
  .line .station__dot { border-color: var(--black); }
}
