/* Design tokens — aligned with gdebenz.ru */
html[data-theme='light'],
html:not([data-theme]) {
  --bg: #f4f6fa;
  --bg2: #eaeef4;
  --panel: #ffffff;
  --card: #ffffff;
  --border: rgba(18, 28, 46, 0.12);
  --text: #121a28;
  --dim: #5a6678;
  --dim2: #46505f;
  --green: #16a34a;
  --green-t: #15803d;
  --orange: #ea580c;
  --red: #dc2626;
  --brand-green: #16a34a;
  --header-bg: rgba(255, 255, 255, 0.92);
  --btn-primary-fg: #052310;
  --shadow-soft: 0 14px 40px rgba(18, 28, 46, 0.08);
  --hero-glow: rgba(22, 163, 74, 0.12);
}

html[data-theme='dark'] {
  --bg: #05070c;
  --bg2: #070b12;
  --panel: #0f1520;
  --card: #0f1520;
  --border: rgba(255, 255, 255, 0.06);
  --text: #f2f4f8;
  --dim: #8b96a8;
  --dim2: #a7b0bf;
  --green: #22c55e;
  --green-t: #4ade80;
  --orange: #f97316;
  --red: #ef4444;
  --brand-green: #30d56b;
  --header-bg: rgba(15, 21, 32, 0.92);
  --btn-primary-fg: #052310;
  --shadow-soft: 0 14px 40px rgba(0, 0, 0, 0.4);
  --hero-glow: rgba(48, 213, 107, 0.15);
}

html {
  --background-color: var(--bg);
  --surface-color: var(--card);
  --surface-hover: var(--bg2);
  --text-primary: var(--text);
  --text-secondary: var(--dim);
  --border-color: var(--border);
  --primary-color: var(--brand-green);
  --secondary-color: var(--green-t);
  --border-radius: 12px;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow: var(--shadow-soft);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  transition: background-color 0.25s ease, color 0.25s ease;
  -webkit-font-smoothing: antialiased;
}

#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Buttons — green CTA like gdebenz.ru */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition);
  gap: 8px;
}

.btn-primary {
  background: var(--green);
  color: var(--btn-primary-fg);
}

.btn-primary:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(34, 197, 94, 0.25);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  border: 1px solid var(--border);
}

html[data-theme='light'] .btn-secondary,
html:not([data-theme]) .btn-secondary {
  background: #ffffff;
  border-color: rgba(18, 28, 46, 0.12);
  color: #2b3648;
}

.btn-secondary:hover {
  border-color: rgba(48, 213, 107, 0.45);
  color: var(--brand-green);
}

.section {
  padding: 64px 0;
}

.section-title {
  font-size: 24px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 32px;
  color: var(--text);
  letter-spacing: -0.01em;
}

/* Header */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: var(--header-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  gap: 12px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  color: var(--text);
  min-width: 0;
}

.brand-badge,
.logo img {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  flex-shrink: 0;
  object-fit: cover;
  display: block;
}

.logo-wordmark,
.wm {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
  white-space: nowrap;
}

.logo-accent,
.wm .g {
  color: var(--brand-green);
}

.nav {
  display: flex;
  gap: 24px;
}

.nav-link {
  text-decoration: none;
  color: var(--dim);
  font-weight: 600;
  font-size: 14px;
  transition: var(--transition);
}

.nav-link:hover,
.nav-link.active {
  color: var(--brand-green);
}

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

.lang-selector {
  position: relative;
}

.lang-button,
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 40px;
  height: 40px;
  padding: 0 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--dim);
  cursor: pointer;
  border-radius: 999px;
  transition: var(--transition);
}

html[data-theme='light'] .lang-button,
html:not([data-theme]) .lang-button,
html[data-theme='light'] .theme-toggle,
html:not([data-theme]) .theme-toggle {
  background: #ffffff;
  color: #2b3648;
}

.lang-button {
  width: auto;
  min-width: 40px;
}

.lang-button:hover,
.theme-toggle:hover {
  border-color: rgba(48, 213, 107, 0.45);
  color: var(--brand-green);
}

.chevron {
  transition: var(--transition);
}

.lang-selector.active .chevron {
  transform: rotate(180deg);
}

.lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  min-width: 150px;
  z-index: 1001;
  overflow: hidden;
}

.lang-option {
  display: block;
  width: 100%;
  padding: 12px 16px;
  border: none;
  background: none;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  font-size: 14px;
}

.lang-option:hover {
  background: var(--bg2);
}

.lang-option.active {
  color: var(--brand-green);
  font-weight: 700;
}

html[data-theme='light'] .icon-moon,
html:not([data-theme]) .icon-moon,
html[data-theme='dark'] .icon-sun {
  display: none;
}

.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
}

html[data-theme='light'] .menu-toggle,
html:not([data-theme]) .menu-toggle {
  background: #ffffff;
}

.menu-toggle span {
  width: 18px;
  height: 2px;
  background-color: var(--text);
  transition: var(--transition);
}

/* Footer */
.footer {
  background: var(--bg2);
  border-top: 1px solid var(--border);
  padding: 48px 0 20px;
}

.footer-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  margin-bottom: 32px;
}

.footer-brand .logo {
  margin-bottom: 12px;
}

.footer-brand .logo img {
  width: 40px;
  height: 40px;
}

.footer-brand .logo-wordmark {
  font-size: 20px;
}

.description {
  color: var(--dim);
  max-width: 420px;
  line-height: 1.6;
  font-size: 14px;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 12px;
  justify-self: end;
}

.footer-links a {
  color: var(--dim);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
}

.footer-links a:hover {
  color: var(--brand-green);
}

.footer-bottom {
  text-align: center;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  color: var(--dim);
  font-size: 13px;
}

/* Home / About */
.home {
  padding-top: 72px;
}

.hero {
  background: var(--bg);
  padding: 48px 0 56px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: -20% -10% auto;
  height: 320px;
  background: radial-gradient(ellipse at 30% 40%, var(--hero-glow), transparent 70%);
  pointer-events: none;
}

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

.hero-content {
  max-width: 720px;
}

.animate-in {
  opacity: 0;
  transform: translateY(16px);
  animation: fadeInUp 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.delay-1 { animation-delay: 0.08s; }
.delay-2 { animation-delay: 0.16s; }
.delay-3 { animation-delay: 0.24s; }
.delay-4 { animation-delay: 0.32s; }
.delay-5 { animation-delay: 0.4s; }

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-title {
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 800;
  line-height: 1.08;
  margin-bottom: 12px;
  color: var(--text);
  letter-spacing: -0.02em;
}

.hero-title .logo-accent {
  color: var(--brand-green);
}

.hero-subtitle {
  font-size: clamp(18px, 3vw, 22px);
  font-weight: 700;
  color: var(--dim2);
  margin-bottom: 16px;
  letter-spacing: -0.01em;
}

.hero-description {
  font-size: 16px;
  color: var(--dim);
  line-height: 1.6;
  margin-bottom: 28px;
  max-width: 640px;
}

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

.platform-badges {
  display: flex;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.platform-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  transition: var(--transition);
  min-width: 76px;
  text-decoration: none;
}

.platform-badge:hover {
  border-color: rgba(48, 213, 107, 0.45);
  transform: translateY(-2px);
}

.platform-badge img {
  height: 24px;
  width: 24px;
  object-fit: contain;
}

html[data-theme='dark'] .platform-badge img {
  filter: brightness(0) invert(1);
}

.platform-badge span {
  font-size: 11px;
  font-weight: 600;
  color: var(--dim);
}

/* Feature cards — safe-card / scard style */
.features {
  background: var(--bg2);
  border-top: 1px solid var(--border);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.feature-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px 18px 20px;
  transition: var(--transition);
}

.feature-card:hover {
  border-color: rgba(48, 213, 107, 0.35);
}

.feature-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.feature-description {
  font-size: 14px;
  color: var(--dim);
  line-height: 1.55;
}

/* Download page */
.download-page {
  padding-top: 72px;
}

.download-hero {
  background: var(--bg);
  padding: 40px 0 32px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.download-title {
  font-size: clamp(28px, 4vw, 36px);
  font-weight: 800;
  margin-bottom: 8px;
  color: var(--text);
  letter-spacing: -0.02em;
}

.download-subtitle {
  font-size: 16px;
  color: var(--dim);
}

.pricing-info-card {
  display: inline-flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 24px;
  padding: 14px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  max-width: 640px;
  text-align: left;
}

.info-icon-wrapper {
  color: var(--brand-green);
  display: flex;
  margin-top: 2px;
}

.info-text {
  font-size: 13px;
  color: var(--dim);
  font-weight: 500;
  margin: 0;
  line-height: 1.5;
}

.download-content {
  padding: 32px 0 56px;
  background: var(--bg2);
}

.platforms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 14px;
}

.platform-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px;
  transition: var(--transition);
}

.platform-card:hover {
  border-color: rgba(48, 213, 107, 0.35);
}

.platform-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.platform-icon img {
  width: 26px;
  height: 26px;
}

html[data-theme='dark'] .platform-icon img {
  filter: brightness(0) invert(1);
}

.platform-header h3 {
  font-size: 17px;
  font-weight: 700;
  margin: 0;
  color: var(--text);
}

.platform-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.download-item-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 14px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  transition: var(--transition);
}

html[data-theme='light'] .download-item-button,
html:not([data-theme]) .download-item-button {
  background: #f4f6fa;
}

.download-item-button:hover {
  border-color: rgba(48, 213, 107, 0.45);
  color: var(--brand-green);
}

.download-item-button.is-primary {
  background: var(--green);
  color: var(--btn-primary-fg);
  border-color: transparent;
}

.download-item-button.is-primary:hover {
  filter: brightness(1.05);
  color: var(--btn-primary-fg);
}

.badge-row {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--brand-green);
  margin-top: 2px;
}

.download-item-button.is-primary .badge-row {
  color: rgba(5, 35, 16, 0.75);
}

.download-version {
  margin: 12px 0 0;
  font-size: 13px;
  color: var(--dim);
}

.download-item-button.is-unavailable {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

.download-item-button.is-unavailable .unavailable-hint {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: var(--dim);
}

.download-item-button.is-primary.is-unavailable {
  background: var(--card);
  color: var(--dim);
  border-color: var(--border);
}

/* Policy pages */
.policy-page {
  padding-top: 96px;
  padding-bottom: 56px;
  min-height: 100vh;
  background: var(--bg2);
}

.policy-container {
  max-width: 760px;
  margin: 0 auto;
}

.policy-content {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 28px 24px 32px;
  line-height: 1.55;
}

.policy-content h1 {
  font-size: clamp(26px, 4vw, 32px);
  font-weight: 800;
  color: var(--text);
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.policy-content h2 {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  margin-top: 28px;
  margin-bottom: 10px;
  letter-spacing: -0.01em;
}

.policy-content p,
.policy-content li {
  font-size: 14px;
  color: var(--dim);
  margin-bottom: 12px;
}

.policy-content ul {
  margin: 8px 0 12px;
  padding-left: 20px;
}

.policy-content a {
  color: var(--brand-green);
  text-decoration: none;
  font-weight: 600;
}

.policy-content a:hover {
  text-decoration: underline;
}

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

@media (max-width: 1024px) {
  .hero-description {
    max-width: none;
  }
}

@media (max-width: 768px) {
  .section {
    padding: 48px 0;
  }

  .nav {
    position: fixed;
    top: 63px;
    left: 0;
    right: 0;
    background: var(--panel);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 16px;
    gap: 12px;
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    box-shadow: var(--shadow);
  }

  .nav.nav-open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .menu-toggle {
    display: flex;
  }

  .download-title {
    font-size: 28px;
  }

  .platforms-grid {
    grid-template-columns: 1fr;
  }

  .footer-content {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .footer-links {
    justify-self: center;
    align-items: center;
  }

  .description {
    margin: 0 auto;
  }

  .policy-content {
    padding: 22px 16px 26px;
  }
}
