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

:root {
  --bg: #030003;
  --bg-elevated: #141414;
  --bg-card: #141414;
  --text: #e4e4e4;
  --text-muted: #888;
  --accent: #4dd864;
  --accent-hover: #6ee787;
  --accent-dim: rgba(77, 216, 100, 0.15);
  --accent-glow: rgba(77, 216, 100, 0.08);
  --border: #2a2a2a;
  --nav-bg: rgba(10, 10, 10, 0.85);
  --scanline-color: rgba(77, 216, 100, 0.008);
  --hero-glow: rgba(77, 216, 100, 0.04);
  --card-shadow: rgba(77, 216, 100, 0.05);
  --cta-shadow: rgba(77, 216, 100, 0.3);
  --cta-bg: #4dd864;
  --cta-text: #030003;
  --pulse-shadow: rgba(77, 216, 100, 0.4);
  --dot-shadow: rgba(77, 216, 100, 0.4);
  --dot-bg: #030003;
  --error: #ff6b6b;
  --font-sans:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif;
  --font-mono:
    "SF Mono", "Fira Code", "Fira Mono", "Roboto Mono", Consolas, monospace;
  --max-width: 1080px;
  --gap: 2rem;
  --nav-height: 56px;
}

[data-theme="light"] {
  --bg: #f8f9fa;
  --bg-elevated: #ffffff;
  --bg-card: #ffffff;
  --text: #1a1a1a;
  --text-muted: #555;
  --accent: #2d9a4e;
  --accent-hover: #38b860;
  --accent-dim: rgba(45, 154, 78, 0.18);
  --accent-glow: rgba(45, 154, 78, 0.06);
  --border: #e0e0e0;
  --nav-bg: rgba(255, 255, 255, 0.85);
  --scanline-color: rgba(0, 0, 0, 0.01);
  --hero-glow: rgba(45, 154, 78, 0.06);
  --card-shadow: rgba(45, 154, 78, 0.08);
  --dot-bg: #f8f9fa;
  --cta-shadow: rgba(45, 154, 78, 0.25);
  --cta-bg: #237a3d;
  --cta-text: #ffffff;
  --pulse-shadow: rgba(45, 154, 78, 0.3);
  --dot-shadow: rgba(45, 154, 78, 0.3);
  --error: #d64545;
}

html {
  scroll-behavior: smooth;
  /* Якорные переходы останавливаются под фиксированным nav, а не под ним */
  scroll-padding-top: calc(var(--nav-height) + 1rem);
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Сканлайны — только на карточках и заголовках секций, не на весь вьюпорт */
.feature,
.price-card,
.stat {
  background-image: repeating-linear-gradient(
    to bottom,
    transparent,
    transparent 2px,
    var(--scanline-color) 2px,
    var(--scanline-color) 4px
  );
}

section h2 {
  background-image: repeating-linear-gradient(
    to bottom,
    transparent,
    transparent 2px,
    var(--scanline-color) 2px,
    var(--scanline-color) 4px
  );
  display: inline-block;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gap);
}

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

a:hover {
  color: var(--accent-hover);
}

/* ── Nav ── */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: var(--nav-bg);
  border-bottom: 1px solid var(--border);
  z-index: 100;
}

/* Blur — только на desktop: на мобильных backdrop-filter на fixed-элементе
   ест кадры во время скролла и даёт артефакты отрисовки в WebKit */
@media (pointer: fine) {
  .nav {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }
}

@media (pointer: coarse) {
  .nav {
    background: var(--bg);
  }
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
}

.nav-links a {
  font-size: 0.85rem;
  color: var(--text-muted) !important;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--accent) !important;
}

.nav-links a.active {
  color: var(--accent) !important;
}

/* На узких экранах все 6 ссылок должны помещаться в один ряд,
   иначе nav (fixed, 56px) переполняется и режется краем экрана */
@media (max-width: 480px) {
  .nav-links {
    gap: 0.6rem;
  }

  .nav-links a {
    font-size: 0.75rem;
    white-space: nowrap;
  }
}

/* ── Hero ── */

.hero {
  padding: calc(var(--nav-height) + 6rem) 0 6rem;
  position: relative;
}

.hero::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(600px, 100%);
  height: 400px;
  background: radial-gradient(ellipse, var(--hero-glow) 0%, transparent 70%);
  pointer-events: none;
}

.hero-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2rem;
}

.hero-icon {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 28%;
  border: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--bg-elevated);
}

.hero-text {
  flex: 1;
  min-width: 0;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
    box-shadow: 0 0 0 0 var(--pulse-shadow);
  }
  50% {
    opacity: 0.7;
    box-shadow: 0 0 0 6px rgba(77, 216, 100, 0);
  }
}

.role {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--accent);
  margin-bottom: 1rem;
}

.cursor {
  display: inline-block;
  color: var(--accent);
  animation: blink 1s step-end infinite;
  margin-left: 2px;
}

@keyframes blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}

.hero h1 {
  font-size: 2.8rem;
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 0.5rem;
}

.tagline {
  font-size: 1.15rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  max-width: 520px;
}

.about {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  max-width: 560px;
  line-height: 1.7;
}

.cta {
  display: inline-block;
  padding: 0.6rem 1.5rem;
  border: 1px solid var(--accent);
  background: var(--cta-bg);
  color: var(--cta-text);
  border-radius: 4px;
  font-size: 0.9rem;
  cursor: pointer;
  transition:
    background 0.2s,
    color 0.2s,
    box-shadow 0.2s,
    transform 0.2s;
}

.cta:hover {
  box-shadow: 0 0 20px var(--cta-shadow);
  transform: translateY(-1px);
}

.cta:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ── Section headings ── */

section {
  padding: 4rem 0;
  position: relative;
}

section:not(:first-of-type)::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80%;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--border),
    var(--accent-dim),
    var(--border),
    transparent
  );
}

.terminal-prompt {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
  opacity: 0.5;
  margin-bottom: 0.25rem;
}

section h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 2rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

/* ── Stats ── */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.stat {
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 6px;
  position: relative;
  overflow: hidden;
}

.stat::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}

.stat:hover::before {
  opacity: 1;
}

.stat:hover {
  border-color: var(--accent-dim);
  box-shadow: 0 0 20px var(--card-shadow);
}

.stat-number {
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 0.5rem;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ── Features ── */

.features-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

.feature {
  padding: 1.5rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 6px;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
  position: relative;
  overflow: hidden;
}

.feature::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}

.feature:hover::before {
  opacity: 1;
}

.feature:hover {
  border-color: var(--accent-dim);
  box-shadow: 0 0 25px var(--card-shadow);
}

.feature-icon {
  width: 32px;
  height: 32px;
  color: var(--accent);
  margin-bottom: 1rem;
}

.feature h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.feature p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.feature code {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
}

/* ── Download ── */

.download-note {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  max-width: 560px;
  line-height: 1.7;
}

.download-buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ── Pricing ── */

.pricing-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

.price-card {
  padding: 2rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 6px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.price-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.5;
}

.price-card.featured {
  border-color: var(--accent-dim);
  box-shadow: 0 0 25px var(--card-shadow);
}

.price-card.featured::before {
  opacity: 1;
}

.price-badge {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.5rem;
}

.price-amount {
  font-family: var(--font-mono);
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 0.25rem;
}

.price-period {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.price-list {
  list-style: none;
  margin-bottom: 2rem;
  flex: 1;
}

.price-list li {
  font-size: 0.9rem;
  color: var(--text-muted);
  padding: 0.35rem 0;
  padding-left: 1.4rem;
  position: relative;
}

.price-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-family: var(--font-mono);
}

/* ── Payment form ── */

.pay-form {
  max-width: 480px;
  display: grid;
  gap: 1.1rem;
}

.pay-form label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.pay-form input[type="email"],
.pay-form select {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.6rem 0.8rem;
  border-radius: 4px;
  font: inherit;
  font-size: 0.9rem;
  width: 100%;
}

.pay-form input:focus,
.pay-form select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.pay-form .check-row {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.check-row input {
  margin-top: 0.25rem;
  accent-color: var(--accent);
}

.form-status {
  font-size: 0.85rem;
  color: var(--error);
}

.form-status.info {
  color: var(--text-muted);
}

.pay-note {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 1rem;
}

/* ── Page head (subpages) ── */

.page-head {
  padding: calc(var(--nav-height) + 4rem) 0 2.5rem;
}

.back-link {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  margin-bottom: 1rem;
}

.page-head h1 {
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1.25;
}

/* ── Prose (license / opensource) ── */

.prose {
  max-width: 760px;
  padding-bottom: 4rem;
}

.prose h2 {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 2.25rem 0 0.75rem;
}

.prose h2:first-child {
  margin-top: 0;
}

.prose p {
  margin-bottom: 1rem;
}

.prose ol,
.prose ul {
  padding-left: 1.4rem;
  margin-bottom: 1rem;
}

.prose li {
  margin-bottom: 0.4rem;
}

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

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0 1.75rem;
  font-size: 0.9rem;
}

.prose th,
.prose td {
  border: 1px solid var(--border);
  padding: 0.5rem 0.75rem;
  text-align: left;
}

.prose th {
  background: var(--bg-elevated);
  font-weight: 600;
}

.prose a {
  overflow-wrap: anywhere;
}

.oss-notes {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ── Footer ── */

footer {
  padding: 3rem 0;
  border-top: 1px solid var(--border);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.footer-links a {
  font-size: 0.8rem;
  color: var(--text-muted) !important;
}

.footer-links a:hover {
  color: var(--accent) !important;
}

footer .copy {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ── Pixel Canvas ── */

#pixels {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

/* ── Responsive ── */
@media (min-width: 900px) {
  .hero-content {
    flex-direction: row;
    align-items: center;
    gap: 3rem;
  }

  .hero-terminal {
    display: block;
    width: 380px;
    flex-shrink: 0;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 6px;
    box-shadow: 0 0 30px var(--card-shadow);
    overflow: hidden;
    font-family: var(--font-mono);
    font-size: 0.8rem;
  }

  .hero-terminal-bar {
    display: flex;
    gap: 6px;
    padding: 0.6rem 0.9rem;
    border-bottom: 1px solid var(--border);
  }

  .hero-terminal-bar span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--border);
  }

  .hero-terminal-body {
    margin: 0;
    padding: 1rem 1.2rem;
    line-height: 1.7;
    color: var(--text-muted);
    white-space: pre;
    overflow-x: auto;
  }

  .t-prompt {
    color: var(--accent);
  }
}

.hero-terminal {
  display: none;
}

@media (min-width: 600px) {
  .hero h1 {
    font-size: 3rem;
  }

  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .features-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .pricing-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .footer-inner {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

@media (max-width: 400px) {
  .hero {
    padding: calc(var(--nav-height) + 3rem) 0 2rem;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .hero-icon {
    width: 88px;
    height: 88px;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }

  .stat {
    padding: 1rem;
  }

  section {
    padding: 3rem 0;
  }

  .prose table {
    display: block;
    overflow-x: auto;
  }
}

/* ── Focus Visible ── */
a:focus-visible,
.cta:focus-visible,
.pay-form input:focus-visible,
.pay-form select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ── 404 page ── */

.error404 {
  padding: calc(var(--nav-height) + 6rem) 0 6rem;
  text-align: center;
}

.error404 .container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.error404 .terminal-prompt {
  text-align: center;
}

.error-code {
  font-family: var(--font-mono);
  font-size: 5rem;
  font-weight: 700;
  line-height: 1;
  color: var(--accent);
  text-shadow: 0 0 30px var(--cta-shadow);
}

.error-msg {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 480px;
  line-height: 1.6;
}

/* ── Reduced Motion ── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }
}

/* ── Совместимость ── */

.compat-list {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.6rem;
  margin: 1.5rem 0;
}

.compat-list li {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  padding: 0.6rem 1rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 4px;
  background-image: repeating-linear-gradient(
    to bottom,
    transparent,
    transparent 2px,
    var(--scanline-color) 2px,
    var(--scanline-color) 4px
  );
}

.compat-list li::before {
  content: "> ";
  color: var(--accent);
}

@media (min-width: 600px) {
  .compat-list {
    grid-template-columns: 1fr 1fr;
  }
}

/* ── Скриншоты ── */

.screens-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  max-width: 720px;
}

.screen img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
  border: 1px solid var(--border);
  box-shadow: 0 4px 24px var(--card-shadow);
}

@media (max-width: 600px) {
  .screens-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
  }
}

/* ── FAQ ── */

.faq details {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 4px;
  margin-bottom: 0.75rem;
  transition: border-color 0.2s;
}

.faq details[open] {
  border-color: var(--accent-dim);
}

.faq summary {
  cursor: pointer;
  padding: 1rem 1.25rem;
  font-size: 0.95rem;
  font-weight: 600;
  list-style: none;
  position: relative;
}

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

.faq summary::after {
  content: "+";
  position: absolute;
  right: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  color: var(--accent);
  transition: transform 0.2s;
}

.faq details[open] summary::after {
  content: "-";
}

.faq details p {
  padding: 0 1.25rem 1rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.7;
}

/* ── SHA-256 в блоке скачивания ── */

.sha {
  margin: 0.5rem 0 1rem;
  overflow-x: auto;
}

.sha code {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  user-select: all;
  word-break: break-all;
}
