/* ===== Reset & Base ===== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #1E1E2E;
  --bg-alt: #181825;
  --bg-card: #2A2A3E;
  --border: #3A3A4E;
  --accent: #4CAF50;
  --accent-hover: #66BB6A;
  --primary: #673AB7;
  --primary-hover: #7E57C2;
  --text: #FFFFFF;
  --text-muted: #B0B0C0;
  --radius: 12px;
  --radius-sm: 8px;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
}

/* ===== Scroll Animations ===== */
.anim {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.anim.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children */
.features-grid .anim:nth-child(2),
.usp-grid .anim:nth-child(2),
.features-detail .anim:nth-child(2) { transition-delay: 0.1s; }
.features-grid .anim:nth-child(3),
.usp-grid .anim:nth-child(3),
.features-detail .anim:nth-child(3) { transition-delay: 0.2s; }
.features-grid .anim:nth-child(4) { transition-delay: 0.3s; }
.features-grid .anim:nth-child(5) { transition-delay: 0.35s; }
.features-grid .anim:nth-child(6) { transition-delay: 0.4s; }

/* ===== Navigation ===== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(30, 30, 46, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.25rem;
  font-weight: 700;
}

.nav-brand img {
  border-radius: 6px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.2s;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary);
  transition: width 0.25s ease;
}

.nav-links a:hover {
  color: var(--text);
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

.nav-links a.active {
  color: var(--text);
}

.lang-toggle {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  transition: border-color 0.2s, background 0.2s;
}

.lang-toggle:hover {
  border-color: var(--primary);
  background: var(--primary);
}

.nav-hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem;
}

/* ===== Hero ===== */
.hero {
  text-align: center;
  padding: 6rem 2rem 4rem;
  max-width: 800px;
  margin: 0 auto;
  position: relative;
}

.hero-glow {
  position: absolute;
  top: -60px;
  left: 50%;
  transform: translateX(-50%);
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(103, 58, 183, 0.15) 0%, transparent 70%);
  pointer-events: none;
  z-index: -1;
}

.hero-icon {
  border-radius: 20px;
  margin-bottom: 1.5rem;
  box-shadow: 0 8px 32px rgba(103, 58, 183, 0.3);
  animation: hero-float 4s ease-in-out infinite;
}

@keyframes hero-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.hero h1 {
  font-size: 3.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
  background: linear-gradient(135deg, var(--text) 0%, var(--text-muted) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-tagline {
  font-size: 1.35rem;
  color: var(--text-muted);
  margin-bottom: 2.5rem;
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn-download {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--accent);
  color: #fff;
  padding: 0.9rem 2rem;
  border-radius: var(--radius);
  font-size: 1.1rem;
  font-weight: 600;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(76, 175, 80, 0.3);
}

.btn-download:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(76, 175, 80, 0.4);
}

.btn-download svg {
  width: 20px;
  height: 20px;
}

.hero-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.version-badge {
  background: var(--primary);
  color: #fff;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}

/* ===== Sections ===== */
.section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 5rem 2rem;
}

.section-alt {
  background: var(--bg-alt);
  max-width: 100%;
  padding-left: 0;
  padding-right: 0;
}

.section-alt > .section-title,
.section-alt > .features-detail,
.section-alt > .changelog-list {
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 2rem;
  padding-right: 2rem;
}

.section-title {
  font-size: 2rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 3rem;
}

/* ===== Why / USP ===== */
.usp-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.usp-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  transition: border-color 0.25s, transform 0.2s;
}

.usp-card:hover {
  border-color: var(--primary);
  transform: translateY(-3px);
}

.usp-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.usp-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
}

.usp-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.55;
}

/* ===== Features Grid ===== */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  transition: border-color 0.25s, transform 0.2s;
}

.feature-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

.feature-icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
  display: block;
}

.feature-card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.feature-card p {
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

/* ===== All Features Detail ===== */
.features-detail {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.feature-category {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
}

.feature-category h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--primary-hover);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.9rem;
}

.feature-category ul {
  list-style: none;
}

.feature-category li {
  padding: 0.4rem 0;
  padding-left: 1.2rem;
  position: relative;
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.feature-category li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.75rem;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

/* ===== Screenshots ===== */
.screenshots-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
}

.screenshot-item {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: border-color 0.25s, transform 0.2s, box-shadow 0.25s;
}

.screenshot-item:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.screenshot-item img {
  width: 100%;
  display: block;
}

.screenshots-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 3rem;
  background: var(--bg-card);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

/* ===== Changelog ===== */
.changelog-list {
  max-width: 700px;
}

.changelog-entry {
  border-left: 3px solid var(--primary);
  padding: 0 0 2rem 1.5rem;
  position: relative;
}

.changelog-entry:last-child {
  padding-bottom: 0;
}

.changelog-entry::before {
  content: '';
  position: absolute;
  left: -7px;
  top: 4px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid var(--bg-alt);
}

.changelog-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.6rem;
}

.changelog-version {
  font-weight: 700;
  font-size: 1.05rem;
}

.changelog-date {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.changelog-entry ul {
  list-style: none;
}

.changelog-entry li {
  padding: 0.2rem 0;
  padding-left: 1rem;
  position: relative;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.changelog-entry li::before {
  content: '+';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}

/* ===== Lightbox ===== */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.92);
  align-items: center;
  justify-content: center;
  padding: 2rem;
  cursor: pointer;
}

.lightbox.active {
  display: flex;
}

.lightbox img {
  max-width: 95vw;
  max-height: 90vh;
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 48px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: none;
  border: none;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.lightbox-close:hover {
  opacity: 1;
}

/* ===== Downloads Table ===== */
.downloads-table-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.downloads-table {
  width: 100%;
  border-collapse: collapse;
}

.downloads-table th {
  text-align: left;
  padding: 1rem 1.25rem;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.15);
}

.downloads-table td {
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}

.downloads-table tr:last-child td {
  border-bottom: none;
}

.downloads-table tr.latest-row {
  background: rgba(76, 175, 80, 0.08);
}

.latest-tag {
  background: var(--accent);
  color: #fff;
  padding: 0.15rem 0.5rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-left: 0.5rem;
  vertical-align: middle;
}

.btn-dl {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--accent);
  color: #fff;
  padding: 0.4rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  transition: background 0.2s;
}

.btn-dl:hover {
  background: var(--accent-hover);
}

.btn-dl svg {
  width: 14px;
  height: 14px;
}

.downloads-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 3rem;
}

/* ===== Footer ===== */
.footer {
  border-top: 1px solid var(--border);
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.footer-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  list-style: none;
}

.footer-links a {
  color: var(--text-muted);
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--text);
}

/* ===== Legal Pages ===== */
.legal-page {
  max-width: 760px;
  margin: 0 auto;
  padding: 3rem 2rem 5rem;
}

.legal-page h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.legal-page h2 {
  font-size: 1.15rem;
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  color: var(--text);
}

.legal-page p {
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  line-height: 1.7;
}

.legal-page ul {
  color: var(--text-muted);
  margin-left: 1.25rem;
  margin-bottom: 0.75rem;
}

.legal-page li {
  padding: 0.25rem 0;
  line-height: 1.6;
}

.legal-page a {
  color: var(--primary-hover);
  text-decoration: underline;
  text-decoration-color: rgba(126, 87, 194, 0.4);
  transition: text-decoration-color 0.2s;
}

.legal-page a:hover {
  text-decoration-color: var(--primary-hover);
}

.legal-date {
  margin-top: 2rem;
  font-size: 0.85rem;
  font-style: italic;
}

/* ===== 404 ===== */
.error-code {
  font-size: 8rem;
  font-weight: 800;
  line-height: 1;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1rem;
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .features-grid,
  .usp-grid,
  .features-detail {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: rgba(30, 30, 46, 0.98);
    backdrop-filter: blur(16px);
    flex-direction: column;
    padding: 1rem 2rem;
    gap: 1rem;
    border-bottom: 1px solid var(--border);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-hamburger {
    display: block;
  }

  .hero h1 {
    font-size: 2.5rem;
  }

  .hero-tagline {
    font-size: 1.1rem;
  }

  .hero-glow {
    width: 300px;
    height: 300px;
  }

  .features-grid,
  .usp-grid,
  .features-detail {
    grid-template-columns: 1fr;
  }

  .screenshots-gallery {
    grid-template-columns: 1fr;
  }

  .downloads-table th:nth-child(2),
  .downloads-table td:nth-child(2) {
    display: none;
  }

  .error-code {
    font-size: 5rem;
  }
}
