/* Общие стили Norvix: цвета, шрифты, шапка, кнопки. Подключается на всех страницах. */

@font-face {
  font-family: "Unbounded";
  src: url("fonts/unbounded-cyrillic.woff2") format("woff2");
  font-weight: 200 900;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Unbounded";
  src: url("fonts/unbounded-latin.woff2") format("woff2");
  font-weight: 200 900;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2190-2193, U+2212, U+2215;
}

:root {
  color-scheme: dark;

  --ink: #0a0e1f;
  --ink-2: #10152b;
  --ink-3: #181f3b;
  --line: #232a47;
  --line-2: #343d62;

  --text: #f1f3ff;
  --soft: #b9bfd9;
  --muted: #7f88a8;

  --accent: #8f9bff;
  --accent-hi: #c3caff;
  --accent-lo: #5c68d6;
  --accent-ink: #0b0f24;
  --accent-wash: #8f9bff14;
  --live: #5ed3a2;
  --lag: #e2604f;

  --body: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", sans-serif;
  --display: "Unbounded", var(--body);
  --mono: ui-monospace, "Cascadia Mono", "JetBrains Mono", Consolas, monospace;

  --r: 12px;
  --r-sm: 8px;
  --bar: 68px;
  --wrap: 1160px;
  --out: cubic-bezier(.2, .8, .2, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--bar) + 20px);
  scrollbar-color: var(--line-2) var(--ink);
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--soft);
  font: 17px/1.65 var(--body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, p, dl, dd, ol, ul { margin: 0; }
h1, h2, h3 { color: var(--text); font-family: var(--display); font-weight: 600; text-wrap: balance; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
button { border: 0; background: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
img, canvas, svg { display: block; }
[hidden] { display: none !important; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: var(--r-sm); }

.px { image-rendering: pixelated; }

/* ---------- шапка ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--bar);
  display: flex;
  align-items: center;
  gap: 36px;
  padding: 0 max(24px, calc((100% - var(--wrap)) / 2));
  background: #0a0e1fe6;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s;
  view-transition-name: topbar;
}
.topbar.is-stuck { border-bottom-color: var(--line); }

.logo {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  flex: none;
  color: var(--text);
  font: 600 16px/1 var(--display);
  letter-spacing: -.01em;
}
.logo svg { width: 34px; height: 34px; border-radius: 9px; transition: transform .35s var(--out); }
.logo:hover svg { transform: rotate(-8deg) scale(1.08); }

.topbar nav { display: flex; align-items: center; gap: 4px; }
.topbar nav a {
  position: relative;
  padding: 8px 12px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
  transition: color .2s;
}
.topbar nav a::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 2px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .3s var(--out);
}
.topbar nav a:hover { color: var(--text); }
.topbar nav a.current { color: var(--text); }
.topbar nav a.current::after { transform: none; }

.header-play {
  margin-left: auto;
  padding: 9px 16px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  transition: border-color .2s, color .2s;
}
.header-play:hover { border-color: var(--accent); color: var(--accent); }
.header-play { display: inline-flex; align-items: center; gap: 8px; }
.header-play svg { width: 18px; height: 18px; flex: none; fill: currentColor; transition: transform .3s var(--out); }
.header-play:hover svg { transform: rotate(-8deg) scale(1.1); }

/* на узких экранах от кнопки Discord остаётся только иконка */
@media (max-width: 480px) {
  .header-play { width: 42px; height: 42px; padding: 0; justify-content: center; font-size: 0; gap: 0; }
  .header-play svg { width: 20px; height: 20px; }
}

.mobile-menu {
  display: none;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
}
.mobile-menu svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; }
.mobile-menu path { transition: transform .3s var(--out), opacity .2s; transform-origin: 12px 12px; }
.mobile-menu[aria-expanded="true"] path:nth-child(1) { transform: translateY(5px) rotate(45deg); }
.mobile-menu[aria-expanded="true"] path:nth-child(2) { opacity: 0; }
.mobile-menu[aria-expanded="true"] path:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }

/* ---------- кнопки ---------- */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 52px;
  padding: 0 22px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 16px;
  font-weight: 700;
  white-space: nowrap;
  border-radius: var(--r);
  box-shadow: 0 8px 24px #8f9bff2b;
  transition: transform .3s var(--out), box-shadow .3s, background-color .2s;
}
.btn:hover { background: #a8b1ff; transform: translateY(-2px); box-shadow: 0 12px 30px #8f9bff40; }
.btn:active { transform: scale(.98); }
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; transition: transform .25s var(--out); }
.btn:hover svg { transform: translateX(3px); }

.btn-quiet {
  background: var(--ink-3);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--line-2);
}
.btn-quiet:hover { background: #202848; box-shadow: inset 0 0 0 1px var(--muted); }

/* кнопка с адресом сервера */
.address {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  height: 52px;
  padding: 0 16px;
  background: var(--ink-2);
  border-radius: var(--r);
  box-shadow: inset 0 0 0 1px var(--line-2);
  text-align: left;
  transition: transform .3s var(--out), box-shadow .2s;
}
.address:hover { transform: translateY(-2px); box-shadow: inset 0 0 0 1px var(--accent); }
.address:active { transform: scale(.98); }
.address span { display: grid; gap: 1px; }
.address small { color: var(--muted); font-size: 12px; line-height: 1.2; }
.address strong { color: var(--text); font: 600 15px/1.3 var(--mono); }
.address svg { width: 18px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 1.8; transition: stroke .2s; }
.address:hover svg { stroke: var(--accent); }
.address .tick { stroke-dasharray: 20; stroke-dashoffset: 20; stroke: var(--live); stroke-width: 2.4; }
.address.is-done { box-shadow: inset 0 0 0 1px var(--live); }
.address.is-done small { color: var(--live); }
.address.is-done .sheet { opacity: 0; }
.address.is-done .tick { stroke-dashoffset: 0; transition: stroke-dashoffset .35s var(--out); }

/* ---------- переход между страницами ---------- */

@view-transition { navigation: auto; }
::view-transition-old(root) { animation: .18s ease-in both page-out; }
::view-transition-new(root) { animation: .32s var(--out) both page-in; }
@keyframes page-out { to { opacity: 0; } }
@keyframes page-in { from { opacity: 0; transform: translateY(10px); } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0s !important;
    transition-duration: .01ms !important;
  }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}
