:root {
  --bg: #0d1117;
  --bg-elevated: #161b22;
  --bg-elevated-hover: #1c2129;
  --border: #30363d;
  --text: #e6edf3;
  --text-secondary: #8b949e;
  --accent: #8fa3ff;
  --accent-strong: #aebbff;
  --accent-ink: #0b1020;
  --danger: #f87171;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --content-width: 760px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif;
  --glow: 143, 163, 255;
  --shadow-elevated: 0 20px 44px -22px rgba(0, 0, 0, 0.65);
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover,
a:focus-visible {
  text-decoration: underline;
}

img,
svg {
  max-width: 100%;
  display: block;
}

.container {
  width: 100%;
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* Шапка */

.site-header {
  border-bottom: 1px solid var(--border);
}

.site-header__inner {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text);
}

.logo:hover {
  text-decoration: none;
}

.logo__mark {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  display: block;
  filter: drop-shadow(0 0 5px rgba(var(--glow), 0.55));
}

.main-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px 20px;
}

.main-nav a:not(.button) {
  color: var(--text-secondary);
  text-shadow: 0 0 0 transparent;
  transition: color 0.2s ease, text-shadow 0.2s ease;
}

.main-nav a:not(.button):hover,
.main-nav a:not(.button):focus-visible {
  color: var(--text);
  text-shadow: 0 0 14px rgba(var(--glow), 0.55);
}

/* Кнопки */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 18px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease,
    color 0.15s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

.button:hover,
.button:focus-visible {
  text-decoration: none;
  transform: translateY(-1px);
}

.button--primary {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 0 0 0 rgba(var(--glow), 0);
}

.button--primary:hover,
.button--primary:focus-visible {
  background: var(--accent-strong);
  box-shadow: 0 0 22px 2px rgba(var(--glow), 0.55),
    0 12px 24px -14px rgba(0, 0, 0, 0.6);
}

.button--secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

.button--secondary:hover,
.button--secondary:focus-visible {
  background: var(--bg-elevated-hover);
  border-color: var(--accent);
  box-shadow: 0 0 18px 1px rgba(var(--glow), 0.35);
}

.button--block {
  width: 100%;
}

/* Главная */

.hero {
  position: relative;
  padding: 72px 0 48px;
  overflow: clip;
}

.hero::before {
  content: "";
  position: absolute;
  top: -120px;
  left: 50%;
  width: 900px;
  height: 480px;
  transform: translateX(-50%);
  background: radial-gradient(
    ellipse 50% 50% at 50% 50%,
    rgba(var(--glow), 0.16),
    rgba(var(--glow), 0.05) 45%,
    transparent 72%
  );
  pointer-events: none;
  z-index: 0;
}

.hero .container {
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-size: clamp(2rem, 4vw, 2.6rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0 0 16px;
  text-shadow: 0 0 32px rgba(var(--glow), 0.25);
}

.hero p.lede {
  color: var(--text-secondary);
  font-size: 1.1rem;
  max-width: 56ch;
  margin: 0 0 28px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero h1,
.hero p.lede,
.hero-actions {
  animation: fade-in-up 0.5s ease both;
}

.hero p.lede {
  animation-delay: 0.08s;
}

.hero-actions {
  animation-delay: 0.16s;
}

.section {
  padding: 40px 0;
}

.section h2 {
  font-size: 1.5rem;
  margin: 0 0 24px;
}

.section-intro {
  color: var(--text-secondary);
  max-width: 62ch;
  margin: -12px 0 24px;
}

/* Дорожка с точками-маячками — интерактивная замена сетки карточек */

.feature-trail {
  position: relative;
  border-top: 1px solid var(--border);
}

.feature-trail::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--border);
  pointer-events: none;
}

.feature-trail__item {
  border-bottom: 1px solid var(--border);
}

.feature-trail__item summary {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 4px 20px 6px;
  cursor: pointer;
  list-style: none;
  color: var(--text-secondary);
  transition: color 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.feature-trail__item summary::-webkit-details-marker {
  display: none;
}

.feature-trail__item summary:hover,
.feature-trail__item summary:focus-visible {
  color: var(--text);
}

.feature-trail__item summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  border-radius: var(--radius-sm);
}

.feature-trail__dot {
  position: relative;
  z-index: 1;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  flex-shrink: 0;
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.feature-trail__item:not([open]) summary:hover .feature-trail__dot {
  background: var(--text-secondary);
  box-shadow: 0 0 8px 1px rgba(var(--glow), 0.35);
}

.feature-trail__icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  color: var(--text-secondary);
  transition: color 0.25s ease, filter 0.25s ease;
}

.feature-trail__item:not([open]) summary:hover .feature-trail__icon {
  color: var(--accent);
}

.feature-trail__label {
  flex: 1;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
}

.feature-trail__chevron {
  width: 18px;
  height: 18px;
  color: var(--text-secondary);
  transition: transform 0.25s ease;
  flex-shrink: 0;
}

.feature-trail__item[open] .feature-trail__chevron {
  transform: rotate(90deg);
}

.feature-trail__item[open] .feature-trail__dot {
  background: var(--accent);
  box-shadow: 0 0 14px 3px rgba(var(--glow), 0.75);
}

.feature-trail__item[open] .feature-trail__icon {
  color: var(--accent-strong);
  filter: drop-shadow(0 0 8px rgba(var(--glow), 0.6));
}

.feature-trail__body {
  margin: 0 4px 24px 40px;
  color: var(--text-secondary);
  max-width: 60ch;
}

.feature-trail__body p {
  margin: 0;
}

.audience {
  /* border-top: 1px solid var(--border); */
  border-bottom: 1px solid var(--border);
  padding: 28px 0;
  color: var(--text-secondary);
}

.audience strong {
  color: var(--text);
}

.invite-note {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.illustration {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-elevated);
  margin: 8px 0 0;
}

.illustration--bleed {
  border: none;
  background: transparent;
}

.sync-scene {
  width: 100%;
  height: auto;
  display: block;
}

.sync-scene__bg {
  fill: var(--bg);
}

@keyframes sync-flow {
  to {
    stroke-dashoffset: -24;
  }
}

.sync-scene__flow {
  animation: sync-flow 1.4s linear infinite;
}

@keyframes sync-pulse {
  0%, 100% {
    opacity: 0.15;
    transform: scale(0.94);
  }
  50% {
    opacity: 0.5;
    transform: scale(1.04);
  }
}

.sync-scene__pulse {
  transform-origin: 380px 160px;
  animation: sync-pulse 2.6s ease-in-out infinite;
}

@keyframes sync-file-fade {
  0%, 100% {
    opacity: 0.35;
  }
  50% {
    opacity: 1;
  }
}

.sync-scene__files path {
  animation: sync-file-fade 1.4s ease-in-out infinite;
}

.sync-scene__files path:nth-child(3),
.sync-scene__files path:nth-child(4) {
  animation-delay: 0.7s;
}

@keyframes orbit-spin {
  to {
    transform: rotate(360deg);
  }
}

.sync-scene__orbit {
  fill: none;
  transform-origin: 380px 160px;
}

.sync-scene__orbit--a {
  animation: orbit-spin 18s linear infinite;
}

.sync-scene__orbit--b {
  animation: orbit-spin 26s linear infinite reverse;
}

@keyframes particle-flow-left {
  0% {
    transform: translateX(0);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translateX(98px);
    opacity: 0;
  }
}

@keyframes particle-flow-right {
  0% {
    transform: translateX(0);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translateX(128px);
    opacity: 0;
  }
}

.sync-scene__particle--l1,
.sync-scene__particle--l2 {
  animation: particle-flow-left 2.6s ease-in-out infinite;
}

.sync-scene__particle--r1,
.sync-scene__particle--r2 {
  animation: particle-flow-right 2.6s ease-in-out infinite;
}

.sync-scene__particle--l2,
.sync-scene__particle--r2 {
  animation-delay: 1.3s;
}

@keyframes terminal-cursor-blink {
  0%, 45% {
    opacity: 1;
  }
  50%, 95% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

.sync-scene__cursor {
  animation: terminal-cursor-blink 1.1s steps(1) infinite;
}

/* Форма входа */

.auth-shell {
  min-height: calc(100vh - 66px);
  display: flex;
  align-items: center;
  padding: 40px 0;
}

.auth-card {
  width: 100%;
  max-width: 380px;
  margin: 0 auto;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
}

.auth-card h1 {
  font-size: 1.4rem;
  margin: 0 0 6px;
}

.auth-card__subtitle {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin: 0 0 24px;
}

.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.field input[type="email"],
.field input[type="password"] {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
}

.field input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
  box-shadow: 0 0 16px 1px rgba(var(--glow), 0.3);
}

.field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
}

.checkbox input {
  width: 15px;
  height: 15px;
}

.form-message {
  min-height: 20px;
  font-size: 0.88rem;
  color: var(--danger);
  margin-bottom: 14px;
}

.form-message:empty {
  display: none;
}

.auth-foot {
  margin-top: 20px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-align: center;
}

/* О проекте */

.prose {
  max-width: 68ch;
}

.prose p {
  color: var(--text-secondary);
}

.changelog {
  list-style: none;
  padding: 0;
  margin: 0;
  border-top: 1px solid var(--border);
}

.changelog li {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.changelog__version {
  flex-shrink: 0;
  width: 100px;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

.changelog__desc {
  color: var(--text);
}

/* 404 */

.error-shell {
  min-height: calc(100vh - 66px);
  display: flex;
  align-items: center;
  text-align: center;
  padding: 40px 0;
}

.error-shell .container {
  max-width: 480px;
}

.error-code {
  font-size: 4rem;
  font-weight: 700;
  color: var(--accent);
  margin: 0;
}

.error-shell h1 {
  margin: 8px 0 12px;
  font-size: 1.4rem;
}

.error-shell p {
  color: var(--text-secondary);
  margin: 0 0 24px;
}

/* Заглушка "забыли пароль" */

.notice-card {
  max-width: 420px;
  margin: 0 auto;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  text-align: center;
}

/* Футер */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 24px 0 40px;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.site-footer .container {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 24px;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
}

/* Заголовок раздела с подзаголовком (для длинных страниц) */

.page-lede {
  color: var(--text-secondary);
  max-width: 62ch;
  margin: -8px 0 32px;
  font-size: 1.05rem;
}

/* Подробный разбор одной возможности (features, architecture) */

.detail {
  padding: 28px 0;
  border-top: 1px solid var(--border);
}

.detail:first-child {
  border-top: none;
  padding-top: 0;
}

.detail h3 {
  margin: 0 0 10px;
  font-size: 1.15rem;
}

.detail .prose {
  max-width: 68ch;
}

.detail-note {
  display: flex;
  gap: 10px;
  margin-top: 56px;
  padding: 12px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.88rem;
  color: var(--text-secondary);
}

/* Статус-бейджи (roadmap) */

.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  flex-shrink: 0;
}

.tag--active {
  color: var(--accent-strong);
  border-color: var(--accent);
}

/* Статус-страница */

.stat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  padding: 24px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin: 28px 0;
}

.stat-row dt {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin: 0 0 4px;
}

.stat-row dd {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 600;
}

/* Графики (SVG) */

.chart-svg {
  width: 100%;
  height: auto;
  display: block;
}

.chart-svg text {
  font-family: var(--font);
  fill: var(--text-secondary);
}

.chart-svg .chart-svg__axis {
  stroke: var(--border);
}

.chart-svg .chart-svg__value {
  fill: var(--text);
  font-weight: 600;
}

.chart-caption {
  padding: 14px 20px 4px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* Проявление при скролле — класс добавляется только через JS,
   без него всё остаётся видимым (см. js/reveal.js) */

.js-reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s ease, transform 0.7s ease, filter 0.7s ease;
  filter: blur(2px);
}

.js-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}

/* Утилиты */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

@media (max-width: 640px) {
  .site-footer .container {
    flex-direction: column;
  }

  .auth-card {
    padding: 24px;
  }

  .site-header__inner {
    align-items: flex-start;
  }

  .main-nav {
    gap: 6px 14px;
    font-size: 0.92rem;
    padding-top: 2px;
  }

  .stat-row {
    gap: 20px 28px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
