:root {
  --bg-primary: #0a0e14;
  --bg-secondary: #131923;
  --bg-card: #18202c;
  --bg-card-hover: #222d3e;
  --brand-gradient: linear-gradient(135deg, #007aff 0%, #af52de 100%);
  --brand-gradient-hover: linear-gradient(135deg, #1a88ff 0%, #bd67e8 100%);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border-color: #273449;
  --border-subtle: #1e293b;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 24px;
  --radius-pill: 9999px;
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
}

/* Bilingual Display Rules */
html[lang="en"] [data-lang="uk"] {
  display: none !important;
}

html[lang="uk"] [data-lang="en"] {
  display: none !important;
}

/* Header */
header.site-header {
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(10, 14, 20, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.brand-text {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

.brand-extra {
  display: inline;
  margin-left: 0.32em;
}

.brand img.app-logo {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

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

/* Language Switcher */
.lang-switcher {
  display: inline-flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-pill);
  padding: 2px;
  gap: 2px;
}

.lang-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.15s ease;
}

.lang-btn:hover {
  color: var(--text-primary);
}

.lang-btn.active {
  background: #ffffff;
  color: #000000;
}

/* Community Telegram Button with Brand Gradient */
.btn-community {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--brand-gradient);
  color: #ffffff;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  box-shadow: 0 4px 14px rgba(175, 82, 222, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.btn-community:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(175, 82, 222, 0.5);
  opacity: 0.95;
}

.btn-community svg {
  width: 17px;
  height: 17px;
  fill: currentColor;
}

/* Install / Hero Section */
.install-section {
  padding: 56px 0 40px;
  text-align: center;
}

.app-big-icon {
  width: 96px;
  height: 96px;
  border-radius: 22px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.08);
  margin-bottom: 24px;
}

h1.app-title {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

p.app-subtitle {
  font-size: 1.15rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 16px;
}

p.app-desc {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 32px;
  line-height: 1.6;
}

.store-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.store-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  height: 60px;
  width: 216px;
  box-sizing: border-box;
  position: relative;
  cursor: pointer;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  text-align: left;
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.2;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  transition: all 0.2s ease;
}

.store-btn:hover {
  border-color: #3b82f6;
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.store-btn svg {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  fill: currentColor;
}

.store-btn .subtext {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.store-btn .maintext {
  display: block;
  font-size: 1.1rem;
  font-weight: 700;
  white-space: nowrap;
}

/* Modal Dialog */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 1000;
  overscroll-behavior: contain;
}

.modal-backdrop.is-open {
  display: flex;
  animation: modalFadeIn 0.15s ease-out;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  max-width: 460px;
  width: 100%;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 28px 24px;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.85);
  animation: modalPopIn 0.18s ease-out;
}

@keyframes modalPopIn {
  from {
    transform: scale(0.96);
    opacity: 0.8;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 6px;
  transition: color 0.15s ease;
}

.modal-close:hover {
  color: var(--text-primary);
}

.modal-badge {
  display: inline-block;
  background: #f59e0b;
  color: #1a1001;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  margin-bottom: 12px;
}

.modal-badge.badge-blue {
  background: rgba(0, 122, 255, 0.18);
  color: #60a5fa;
  border: 1px solid rgba(0, 122, 255, 0.35);
}

.modal-title {
  font-size: 1.35rem;
  font-weight: 800;
  margin-bottom: 12px;
  letter-spacing: -0.01em;
}

.modal-desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 16px;
}

.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-modal-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--brand-gradient);
  color: #ffffff;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  transition: opacity 0.15s ease;
}

.btn-modal-primary:hover {
  opacity: 0.92;
}

.btn-modal-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 11px 18px;
  border-radius: var(--radius-md);
  transition: all 0.15s ease;
}

.btn-modal-secondary:hover {
  border-color: #3b82f6;
  background: var(--bg-card-hover);
}

/* Screenshots Gallery Section */
.screenshots-section {
  padding: 30px 0 60px;
}

.screenshots-scroll {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  padding: 20px 4px 32px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--border-color) transparent;
}

.screenshot-item {
  flex: 0 0 auto;
  width: 240px;
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.08);
  scroll-snap-align: center;
  background: #000;
  transition: transform 0.2s ease;
}

.screenshot-item:hover {
  transform: translateY(-4px);
}

.screenshot-item img {
  display: block;
  width: 100%;
  height: auto;
}

/* Content Pages (Legal, Support) */
.content-wrapper {
  max-width: 800px;
  margin: 40px auto 80px;
  padding: 40px 32px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
}

.content-wrapper h1 {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.content-wrapper .last-updated {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 14px;
}

.content-wrapper h2, 
.content-wrapper h3 {
  margin-top: 28px;
  margin-bottom: 12px;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.content-wrapper p {
  color: var(--text-secondary);
  margin-bottom: 14px;
  font-size: 0.98rem;
}

.content-wrapper ul,
.content-wrapper ol {
  color: var(--text-secondary);
  padding-left: 24px;
  margin-bottom: 18px;
}

.content-wrapper li {
  margin-bottom: 8px;
}

.content-wrapper hr {
  border: none;
  border-top: 1px solid var(--border-subtle);
  margin: 28px 0;
}

.notice-box {
  background: var(--bg-card);
  border-left: 4px solid #3b82f6;
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin: 20px 0;
}

.notice-box p {
  margin: 0;
  color: var(--text-primary);
  font-size: 0.95rem;
}

/* Minimal Footer */
footer.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border-subtle);
  padding: 36px 0 28px;
  background: var(--bg-primary);
  font-size: 0.9rem;
  color: var(--text-muted);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
}

.footer-links a,
.footer-links button {
  color: var(--text-secondary);
  transition: color 0.15s ease;
  background: none;
  border: none;
  font: inherit;
  cursor: pointer;
  padding: 0;
  text-decoration: none;
}

.footer-links a:hover,
.footer-links button:hover {
  color: var(--text-primary);
}

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

/* Responsive */
@media (max-width: 640px) {
  .brand-extra {
    display: none !important;
  }

  .nav-wrap {
    height: 60px;
  }

  .header-actions {
    gap: 8px;
  }

  .btn-community {
    padding: 6px 12px;
    font-size: 0.82rem;
    gap: 6px;
  }

  .btn-community svg {
    width: 14px;
    height: 14px;
  }

  .lang-btn {
    padding: 4px 8px;
    font-size: 0.74rem;
  }

  h1.app-title {
    font-size: 2rem;
  }
  
  .footer-inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 16px;
  }
  
  .footer-links {
    justify-content: center;
    gap: 14px;
  }
  
  .screenshot-item {
    width: 200px;
  }
}
