/* Docsify — тёмная CS-тема */
:root {
  --theme-color: #f0a500;
  --text-color-base: #f0f0f0;
  --text-color-secondary: #c4c4c4;
  --border-color: #4a4a4a;
  --background-color: #151821;
  --sidebar-background: rgba(28, 32, 42, 0.94);
  --panel-background: rgba(32, 36, 48, 0.9);
}

body {
  background-color: var(--background-color) !important;
  color: var(--text-color-base) !important;
  background-image:
    radial-gradient(ellipse 80% 60% at 15% 40%, rgba(240, 165, 0, 0.14) 0%, transparent 55%),
    radial-gradient(ellipse 60% 50% at 85% 15%, rgba(74, 158, 255, 0.12) 0%, transparent 50%),
    radial-gradient(ellipse 70% 55% at 70% 90%, rgba(240, 165, 0, 0.1) 0%, transparent 50%),
    linear-gradient(160deg, #171a24 0%, #1e2330 35%, #191d28 65%, #141720 100%) !important;
  background-attachment: fixed !important;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(240, 165, 0, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(240, 165, 0, 0.055) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at center, black 35%, transparent 88%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.06) 0%, transparent 45%),
    radial-gradient(ellipse at center, transparent 50%, rgba(0, 0, 0, 0.28) 100%);
}

#main {
  position: relative;
  z-index: 1;
}

.sidebar {
  background: var(--sidebar-background) !important;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-right: 1px solid rgba(240, 165, 0, 0.15) !important;
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.35);
}

.sidebar-nav li strong {
  color: #f0a500 !important;
  text-transform: uppercase;
  font-size: 0.72em;
  letter-spacing: 1px;
  display: inline-block;
  transition: letter-spacing 0.25s ease, text-shadow 0.25s ease, transform 0.25s ease;
}

.sidebar-nav li:hover > strong {
  letter-spacing: 2px;
  text-shadow: 0 0 12px rgba(240, 165, 0, 0.45);
  transform: translateX(2px);
}

.sidebar-nav ul ul {
  padding-left: 12px;
}

.sidebar-nav ul ul li a {
  font-size: 0.9em;
}

.sidebar-nav li a {
  position: relative;
  color: #d6d6d6 !important;
  border-radius: 8px;
  margin: 2px 6px;
  padding: 7px 12px 7px 14px !important;
  border-left: 3px solid transparent;
  transition:
    color 0.22s ease,
    background 0.22s ease,
    border-color 0.22s ease,
    transform 0.22s ease,
    box-shadow 0.22s ease;
}

.sidebar-nav li a::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: #f0a500;
  transform: translateY(-50%);
  opacity: 0;
  transition: width 0.22s ease, height 0.22s ease, opacity 0.22s ease, box-shadow 0.22s ease;
}

.sidebar-nav li a:hover {
  color: #ffc233 !important;
  background: rgba(240, 165, 0, 0.12);
  border-left-color: #f0a500;
  transform: translateX(6px);
  box-shadow: inset 0 0 0 1px rgba(240, 165, 0, 0.18);
}

.sidebar-nav li a:hover::before {
  width: 6px;
  height: 6px;
  left: 4px;
  opacity: 1;
  box-shadow: 0 0 10px rgba(240, 165, 0, 0.8);
}

.sidebar-nav li.active > a {
  color: #f0a500 !important;
  border-left: 3px solid #f0a500;
  font-weight: 600;
  background: rgba(240, 165, 0, 0.1);
  box-shadow: inset 0 0 0 1px rgba(240, 165, 0, 0.15);
}

.sidebar-nav li.active > a:hover {
  transform: translateX(4px);
  background: rgba(240, 165, 0, 0.16);
}

.app-name-link {
  color: #f0a500 !important;
  font-weight: 700;
  display: inline-block;
  transition: transform 0.25s ease, text-shadow 0.25s ease, filter 0.25s ease;
}

.app-name-link:hover {
  transform: scale(1.03);
  text-shadow: 0 0 16px rgba(240, 165, 0, 0.55);
  filter: brightness(1.1);
}

.search input {
  background: #2f3544 !important;
  border-color: #555 !important;
  color: #fff !important;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.search input:focus {
  border-color: #f0a500 !important;
  box-shadow: 0 0 0 3px rgba(240, 165, 0, 0.18) !important;
  background: #343b4d !important;
}

@media (prefers-reduced-motion: reduce) {
  .sidebar-nav li strong,
  .sidebar-nav li a,
  .sidebar-nav li a::before,
  .app-name-link,
  .search input {
    transition: none !important;
  }

  .sidebar-nav li a:hover,
  .sidebar-nav li.active > a:hover,
  .app-name-link:hover,
  .sidebar-nav li:hover > strong {
    transform: none !important;
  }
}

.content {
  background: transparent !important;
}

.markdown-section {
  color: #ececec !important;
  max-width: 900px;
  position: relative;
  background: var(--panel-background);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(240, 165, 0, 0.2);
  border-radius: 14px;
  padding: 36px 42px;
  margin: 24px auto 40px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.markdown-section::before,
.markdown-section::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border-color: rgba(240, 165, 0, 0.35);
  border-style: solid;
  pointer-events: none;
}

.markdown-section::before {
  top: 14px;
  left: 14px;
  border-width: 2px 0 0 2px;
  border-radius: 4px 0 0 0;
}

.markdown-section::after {
  bottom: 14px;
  right: 14px;
  border-width: 0 2px 2px 0;
  border-radius: 0 0 4px 0;
}

.markdown-section h1 {
  color: #ffffff !important;
  font-size: 2em;
  font-weight: 700;
  border-bottom: 2px solid #f0a500;
  padding-bottom: 0.35em;
}

.markdown-section h2 {
  color: #f0a500 !important;
  font-weight: 600;
  border-left: 4px solid #f0a500;
  padding-left: 12px;
  margin-top: 1.6em;
}

.markdown-section h3 {
  color: #7ec8ff !important;
  font-weight: 600;
}

.markdown-section h4 {
  color: #d0d0d0 !important;
}

.markdown-section p,
.markdown-section li {
  color: #ececec !important;
  line-height: 1.75;
}

.markdown-section strong {
  color: #ffffff !important;
}

.markdown-section a {
  color: #5eb3ff !important;
  text-decoration: none;
  border-bottom: 1px solid rgba(94, 179, 255, 0.35);
}

.markdown-section a:hover {
  color: #ffc233 !important;
  border-bottom-color: #ffc233;
}

.markdown-section hr {
  border-color: #333 !important;
}

.markdown-section blockquote {
  border-left: 4px solid #f0a500 !important;
  background: rgba(240, 165, 0, 0.08) !important;
  color: #d5d5d5 !important;
  border-radius: 0 8px 8px 0;
  padding: 14px 18px;
}

.markdown-section code {
  background: #2a2a2a !important;
  color: #ffc233 !important;
  padding: 2px 6px;
  border-radius: 4px;
}

.markdown-section pre {
  background: #1a1a1a !important;
  border: 1px solid #333 !important;
  border-radius: 8px;
}

.markdown-section pre code {
  color: #e8e8e8 !important;
  background: transparent !important;
}

.markdown-section table {
  border-collapse: collapse;
  width: 100%;
  margin: 1rem 0;
}

.markdown-section table th {
  background: #2e3340 !important;
  color: #f0a500 !important;
  border: 1px solid #4a4a4a !important;
  padding: 10px 14px;
}

.markdown-section table td {
  border: 1px solid #4a4a4a !important;
  padding: 8px 14px;
  color: #ececec !important;
}

.markdown-section table tr:nth-child(2n) {
  background: rgba(255, 255, 255, 0.06) !important;
}

.docsify-pagination-container {
  border-top: 1px solid #333 !important;
}

.pagination-item-title {
  color: #5eb3ff !important;
}

.pagination-item-label {
  color: #aaa !important;
}

@media (max-width: 768px) {
  .markdown-section {
    padding: 24px 20px;
    margin: 12px 10px 24px;
  }

  .markdown-section::before,
  .markdown-section::after {
    display: none;
  }
}

/* Miro embed */
.miro-embed-wrap {
  position: relative;
  width: 100%;
  padding-bottom: 62%;
  margin: 1.5rem 0 2rem;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(240, 165, 0, 0.2);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  background: #161b22;
}

.miro-embed-wrap iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.markdown-section img {
  max-width: min(100%, 720px);
  height: auto;
  display: block;
  margin: 1rem auto;
  border-radius: 8px;
  border: 1px solid rgba(240, 165, 0, 0.15);
}

/* Маскот у правого края экрана */
.guide-mascot {
  display: none;
  position: fixed;
  right: 4px;
  bottom: 12px;
  z-index: 2;
  width: 260px;
  pointer-events: none;
  user-select: none;
  filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.55));
  animation: mascot-float 4.5s ease-in-out infinite;
}

.guide-mascot img {
  display: block;
  width: 100%;
  height: auto;
  background: transparent;
  border: none;
  border-radius: 0;
  margin: 0;
  max-width: none;
}

.guide-mascot-welcome {
  display: none !important;
}

body.welcome-page .guide-mascot-default {
  display: none !important;
}

body.welcome-page .guide-mascot-welcome {
  display: block !important;
}

body.access-locked .guide-mascot {
  display: none !important;
}

@keyframes mascot-float {
  0%,
  100% {
    transform: translateY(0) rotate(-1deg);
  }
  50% {
    transform: translateY(-10px) rotate(1deg);
  }
}

@media (min-width: 1400px) {
  body:not(.access-locked) .guide-mascot {
    display: block;
  }
}

@media (min-width: 1700px) {
  .guide-mascot {
    right: 12px;
    width: 320px;
  }
}

/* Маскот слева на приветственной */
body.welcome-page .guide-mascot {
  display: block;
  width: min(38vw, 500px);
  left: max(0px, 1vw);
  right: auto;
  bottom: 0;
  z-index: 2;
  opacity: 1;
  filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.55));
}

@media (max-width: 900px) {
  body.welcome-page .guide-mascot {
    width: min(46vw, 200px);
    opacity: 0.85;
    z-index: 0;
  }
}

@media (min-width: 1400px) {
  body.welcome-page .guide-mascot {
    width: min(36vw, 560px);
  }
}

/* Приветственная страница — hero в духе лендинга */
body.welcome-page .sidebar,
body.welcome-page .sidebar-toggle,
body.welcome-page .search {
  display: none !important;
}

body.welcome-page {
  background-color: #07080c !important;
  background-image:
    radial-gradient(ellipse 70% 55% at 18% 20%, rgba(240, 120, 20, 0.22) 0%, transparent 55%),
    radial-gradient(ellipse 55% 50% at 82% 18%, rgba(90, 70, 180, 0.2) 0%, transparent 50%),
    radial-gradient(ellipse 50% 45% at 70% 75%, rgba(40, 120, 220, 0.14) 0%, transparent 55%),
    radial-gradient(ellipse 60% 50% at 30% 90%, rgba(240, 140, 0, 0.12) 0%, transparent 50%),
    radial-gradient(ellipse 40% 35% at 50% 45%, rgba(255, 160, 40, 0.08) 0%, transparent 60%),
    linear-gradient(180deg, #0a0b10 0%, #08090e 50%, #050608 100%) !important;
}

body.welcome-page::before {
  background-image: none;
  opacity: 0;
}

body.welcome-page::after {
  background:
    radial-gradient(ellipse at center, transparent 35%, rgba(0, 0, 0, 0.55) 100%);
  animation: none;
}

body.welcome-page .sidebar + .content,
body.welcome-page .content {
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
}

body.welcome-page .markdown-section {
  max-width: none;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  display: block;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

body.welcome-page .markdown-section::before,
body.welcome-page .markdown-section::after {
  display: none;
}

.welcome {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 100vh;
  box-sizing: border-box;
  padding: clamp(24px, 4vh, 48px) clamp(20px, 4vw, 56px);
  overflow: hidden;
}

.welcome-tag {
  position: absolute;
  top: clamp(24px, 4vh, 48px);
  left: clamp(20px, 4vw, 56px);
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 !important;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(16, 18, 24, 0.75);
  color: #f0a500 !important;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  animation: welcome-in 0.7s ease both;
}

.welcome-tag-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #f0a500;
  box-shadow: 0 0 10px rgba(240, 165, 0, 0.8);
  flex-shrink: 0;
}

.welcome-hero {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: clamp(28px, 5vh, 56px);
  pointer-events: none;
  z-index: 1;
}

.welcome-wordmark {
  margin: 0 !important;
  color: #fff !important;
  font-size: clamp(1.6rem, 4.5vw, 2.6rem);
  font-weight: 900;
  letter-spacing: 0.12em;
  line-height: 1;
  text-transform: uppercase;
  text-shadow: 0 0 40px rgba(240, 165, 0, 0.18);
  animation: welcome-in 0.8s ease 0.05s both;
}

.welcome-underline {
  display: block;
  width: min(28vw, 140px);
  height: 2px;
  margin-top: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, #f0a500 20%, #ffc233 50%, #f0a500 80%, transparent);
  box-shadow: 0 0 14px rgba(240, 165, 0, 0.7), 0 0 28px rgba(240, 165, 0, 0.35);
  animation: welcome-in 0.8s ease 0.15s both;
}

.welcome-orbs {
  position: absolute;
  inset: 0;
}

.welcome-orb {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  border: 1px solid rgba(240, 165, 0, 0.28);
  background: rgba(18, 20, 28, 0.82);
  color: #f0a500;
  font-size: 1.15rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35), inset 0 0 16px rgba(240, 165, 0, 0.08);
  animation: welcome-orb-float 5.5s ease-in-out infinite;
}

.welcome-orb--1 { top: 14%; left: 12%; animation-delay: 0s; }
.welcome-orb--2 { top: 18%; left: 78%; animation-delay: 0.4s; }
.welcome-orb--3 { top: 72%; left: 84%; animation-delay: 0.8s; }
.welcome-orb--4 { top: 78%; left: 18%; animation-delay: 1.1s; }
.welcome-orb--5 { top: 42%; left: 6%; animation-delay: 0.6s; }
.welcome-orb--6 { top: 38%; left: 90%; animation-delay: 1.3s; }

.welcome-copy {
  position: absolute;
  left: 50%;
  top: 52%;
  bottom: auto;
  z-index: 4;
  width: min(92%, 720px);
  text-align: center;
  transform: translate(-50%, -50%);
  animation: welcome-in-center 0.7s ease 0.25s both;
}

.welcome-copy h1 {
  margin: 0 0 18px !important;
  border-bottom: none !important;
  padding-bottom: 0 !important;
  color: #fff !important;
  font-size: clamp(2rem, 4.5vw, 3.1rem) !important;
  font-weight: 700 !important;
  line-height: 1.2;
}

.welcome-copy h1 span {
  color: #f0a500;
}

.welcome-lead {
  margin: 0 auto 28px !important;
  max-width: 36em;
  color: #c4c9d2 !important;
  font-size: clamp(1.05rem, 2.2vw, 1.3rem);
  line-height: 1.65;
}

.welcome-cta-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0 !important;
  justify-content: center;
}

.markdown-section a.welcome-cta,
.markdown-section a.welcome-cta:hover,
.markdown-section a.welcome-cta:visited,
.markdown-section a.welcome-cta:focus {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: 12px 22px;
  border-radius: 999px;
  border: none !important;
  border-bottom: none !important;
  background: #f0a500;
  color: #111 !important;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  text-decoration: none !important;
  text-shadow: none;
  box-shadow: 0 8px 24px rgba(240, 165, 0, 0.35);
  transition: transform 0.22s ease, box-shadow 0.22s ease, filter 0.22s ease;
}

.markdown-section a.welcome-cta:hover {
  color: #000 !important;
  transform: translateY(-2px);
  filter: brightness(1.06);
  box-shadow: 0 12px 28px rgba(240, 165, 0, 0.45);
}

.markdown-section a.welcome-cta-secondary,
.markdown-section a.welcome-cta-secondary:hover,
.markdown-section a.welcome-cta-secondary:visited,
.markdown-section a.welcome-cta-secondary:focus {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 22px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.22) !important;
  background: transparent;
  color: #e8e8e8 !important;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none !important;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.markdown-section a.welcome-cta-secondary:hover {
  color: #fff !important;
  border-color: rgba(240, 165, 0, 0.55) !important;
  background: rgba(240, 165, 0, 0.08);
}

.welcome-stats {
  position: absolute;
  right: clamp(20px, 4vw, 56px);
  bottom: clamp(28px, 6vh, 64px);
  z-index: 4;
  display: flex;
  gap: clamp(20px, 3vw, 40px);
  animation: welcome-in 0.7s ease 0.35s both;
}

.welcome-stat {
  text-align: left;
}

.welcome-stat strong {
  display: block;
  color: #fff !important;
  font-size: clamp(1.4rem, 2.4vw, 1.85rem);
  font-weight: 800;
  line-height: 1.1;
}

.welcome-stat span {
  display: block;
  margin-top: 4px;
  color: #8b919c !important;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

@keyframes welcome-in {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes welcome-in-center {
  from {
    opacity: 0;
    transform: translate(-50%, calc(-50% + 16px));
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}

@keyframes welcome-orb-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

@media (max-width: 900px) {
  .welcome-tag {
    left: 50%;
    transform: translateX(-50%);
  }

  .welcome-copy {
    left: 50%;
    top: 54%;
    bottom: auto;
    width: min(92%, 520px);
  }

  .welcome-stats {
    display: none;
  }

  .welcome-wordmark {
    font-size: clamp(1.35rem, 6vw, 1.9rem);
    padding-bottom: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .welcome-tag,
  .welcome-wordmark,
  .welcome-underline,
  .welcome-copy,
  .welcome-stats,
  .welcome-orb {
    animation: none !important;
  }

  .welcome-copy {
    transform: translate(-50%, -50%);
  }

  .markdown-section a.welcome-cta:hover {
    transform: none !important;
  }
}

/* Language switcher */
.lang-switcher {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 10000;
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(16, 18, 24, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.lang-switcher__btn {
  min-width: 44px;
  padding: 8px 12px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: #b8b8b8;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.lang-switcher__btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.lang-switcher__btn.is-active,
.lang-switcher__btn[aria-pressed='true'] {
  background: #f0a500;
  color: #111;
}

body.welcome-page .lang-switcher {
  top: 18px;
  right: 18px;
}

@media (max-width: 900px) {
  .lang-switcher {
    top: 12px;
    right: 12px;
  }
}
