/* ===== CSS VARIABLES ===== */
:root {
  --tg-blue: #2AABEE;
  --tg-dark-blue: #229ED9;
  --surface: #0F1923;
  --surface-2: #17212B;
  --surface-3: #1E2C3A;
  --surface-4: #242F3D;
  --text-primary: #F5F5F5;
  --text-secondary: #8B9BAA;
  --border: #2B3945;
  --bg: #0A1118;
}

/* ===== RESET & BASE ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

img {
  max-width: 100%;
  height: auto;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

/* ===== UTILITIES ===== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.container-sm {
  max-width: 800px;
}

.text-blue {
  color: var(--tg-blue);
}

.hidden {
  display: none !important;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

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

@keyframes gradient-shift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.animate-fade-in {
  animation: fadeInUp 0.8s ease-out forwards;
  opacity: 0;
}

.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }

/* ===== NAVBAR ===== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  transition: all 0.3s ease;
}

.navbar.scrolled {
  background: rgba(15, 25, 35, 0.8);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

.navbar-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 18px;
  transition: transform 0.3s ease;
}

.logo:hover {
  transform: scale(1.02);
}

.logo-icon {
  width: 28px;
  height: 28px;
  color: var(--tg-blue);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-links a {
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s ease;
}

.nav-links a:hover {
  color: var(--text-primary);
}

.nav-links .github-link {
  display: flex;
}

.nav-links .github-link svg {
  width: 20px;
  height: 20px;
}

.mobile-menu-btn {
  display: none;
  padding: 8px;
  color: var(--text-secondary);
}

.mobile-menu-btn svg {
  width: 24px;
  height: 24px;
}

.mobile-menu {
  background: var(--surface-2);
  border-top: 1px solid var(--border);
  padding: 16px 24px;
}

.mobile-menu a {
  display: block;
  padding: 12px 0;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s ease;
}

.mobile-menu a:hover {
  color: var(--text-primary);
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
  }

  .mobile-menu-btn {
    display: block;
  }
}

/* ===== HERO ===== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 64px 24px;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hero-glow-1 {
  position: absolute;
  top: 25%;
  left: 25%;
  width: 500px;
  height: 500px;
  background: rgba(42, 171, 238, 0.08);
  border-radius: 50%;
  filter: blur(150px);
}

.hero-glow-2 {
  position: absolute;
  bottom: 25%;
  right: 25%;
  width: 400px;
  height: 400px;
  background: rgba(34, 158, 217, 0.06);
  border-radius: 50%;
  filter: blur(120px);
}

.hero-grid {
  position: absolute;
  inset: 0;
  opacity: 0.03;
  background-image: 
    linear-gradient(rgba(255,255,255,0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.1) 1px, transparent 1px);
  background-size: 60px 60px;
}

.hero-content {
  position: relative;
  z-index: 10;
  text-align: center;
  max-width: 800px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(42, 171, 238, 0.1);
  border: 1px solid rgba(42, 171, 238, 0.2);
  border-radius: 50px;
  color: var(--tg-blue);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 32px;
}

.badge svg {
  width: 16px;
  height: 16px;
}

.hero-title {
  font-size: clamp(48px, 8vw, 96px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-bottom: 24px;
}

.gradient-text {
  background: linear-gradient(135deg, var(--tg-blue), #67D4FF);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  background-size: 200% 200%;
  animation: gradient-shift 5s ease infinite;
}

.hero-description {
  font-size: clamp(18px, 3vw, 24px);
  color: var(--text-secondary);
  max-width: 640px;
  margin: 0 auto 40px;
  line-height: 1.6;
}

.hero-buttons {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 56px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 32px;
  font-size: 18px;
  font-weight: 600;
  border-radius: 12px;
  transition: all 0.3s ease;
}

.btn svg {
  width: 20px;
  height: 20px;
}

.btn-primary {
  background: var(--tg-blue);
  color: white;
  box-shadow: 0 8px 30px rgba(42, 171, 238, 0.25);
}

.btn-primary:hover {
  background: var(--tg-dark-blue);
  box-shadow: 0 8px 40px rgba(42, 171, 238, 0.4);
  transform: scale(1.02);
}

.btn-secondary {
  background: var(--surface-3);
  color: white;
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--surface-4);
  border-color: rgba(42, 171, 238, 0.3);
}

.btn-lg {
  padding: 18px 40px;
  font-size: 18px;
}

.tech-badges {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  color: var(--text-secondary);
  font-size: 14px;
}

.tech-badges span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.dot.orange { background: #F97316; }
.dot.blue { background: #3B82F6; }
.dot.yellow { background: #EAB308; }
.dot.cyan { background: #06B6D4; }

.scroll-indicator {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  animation: bounce 2s ease-in-out infinite;
}

.scroll-indicator svg {
  width: 24px;
  height: 24px;
  color: var(--text-secondary);
}

/* ===== SECTIONS ===== */
.section {
  padding: 96px 24px;
}

.section-alt {
  background: rgba(15, 25, 35, 0.5);
}

.section-header {
  text-align: center;
  margin-bottom: 64px;
}

.section-header h2 {
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 700;
  margin-bottom: 16px;
}

.section-header p {
  color: var(--text-secondary);
  font-size: 18px;
  max-width: 600px;
  margin: 0 auto;
}

/* ===== FEATURES ===== */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}

.feature-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  transition: all 0.3s ease;
}

.feature-card:hover {
  border-color: rgba(42, 171, 238, 0.3);
  box-shadow: 0 8px 40px rgba(42, 171, 238, 0.05);
}

.feature-icon {
  width: 48px;
  height: 48px;
  background: rgba(42, 171, 238, 0.1);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  transition: background 0.3s ease;
}

.feature-card:hover .feature-icon {
  background: rgba(42, 171, 238, 0.2);
}

.feature-icon svg {
  width: 24px;
  height: 24px;
  color: var(--tg-blue);
}

.feature-card h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
}

.feature-card p {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
}

/* ===== SCREENSHOTS ===== */
.screenshots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 24px;
}

@media (max-width: 480px) {
  .screenshots-grid {
    grid-template-columns: 1fr;
  }
}

.screenshot-card {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  transition: all 0.3s ease;
}

.screenshot-card:hover {
  border-color: rgba(42, 171, 238, 0.3);
  box-shadow: 0 20px 60px rgba(42, 171, 238, 0.05);
}

.screenshot-image {
  aspect-ratio: 16/9;
  overflow: hidden;
}

.screenshot-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.screenshot-card:hover .screenshot-image img {
  transform: scale(1.05);
}

.screenshot-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 20px;
  background: linear-gradient(to top, rgba(0,0,0,0.8), rgba(0,0,0,0.4), transparent);
  font-weight: 500;
}

/* ===== STEPS ===== */
.steps {
  display: flex;
  flex-direction: column;
  gap: 32px;
  margin-bottom: 48px;
}

.step {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

@media (min-width: 768px) {
  .step {
    gap: 32px;
  }
}

.step-number {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  background: rgba(42, 171, 238, 0.1);
  border: 1px solid rgba(42, 171, 238, 0.2);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--tg-blue);
  font-weight: 700;
  font-size: 18px;
  transition: background 0.3s ease;
}

.step:hover .step-number {
  background: rgba(42, 171, 238, 0.2);
}

.step-content {
  flex: 1;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border);
}

.step:last-child .step-content {
  border-bottom: none;
}

.step-content h3 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 8px;
}

.step-content p {
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 12px;
}

.step-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--tg-blue);
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s ease;
}

.step-link:hover {
  color: var(--tg-dark-blue);
}

.step-link svg {
  width: 14px;
  height: 14px;
}

/* ===== PREREQUISITES ===== */
.prerequisites {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
}

.prerequisites h4 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
}

.prerequisites h4 svg {
  width: 20px;
  height: 20px;
  color: var(--tg-blue);
}

.prerequisites ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.prerequisites li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  color: var(--text-secondary);
  font-size: 14px;
}

.prerequisites li strong {
  color: var(--text-primary);
}

.prerequisites li a {
  color: var(--tg-blue);
}

.prerequisites li a:hover {
  text-decoration: underline;
}

.bullet {
  flex-shrink: 0;
  width: 6px;
  height: 6px;
  background: var(--tg-blue);
  border-radius: 50%;
  margin-top: 8px;
}

.prerequisites-note {
  margin-top: 16px;
  font-size: 12px;
  color: var(--text-secondary);
  font-style: italic;
}

/* ===== DOWNLOAD ===== */
.download-section {
  position: relative;
}

.download-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 600px;
  height: 600px;
  background: rgba(42, 171, 238, 0.05);
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
}

.version-text {
  color: var(--tg-blue);
  font-size: 14px;
  font-weight: 500;
  margin-top: 8px;
}

.platform-tabs {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.platform-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: var(--surface-3);
  color: var(--text-secondary);
  border-radius: 12px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.platform-tab svg {
  width: 20px;
  height: 20px;
}

.platform-tab:hover {
  color: var(--text-primary);
  background: var(--surface-4);
}

.platform-tab.active {
  background: var(--tg-blue);
  color: white;
  box-shadow: 0 8px 30px rgba(42, 171, 238, 0.25);
}

.download-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px;
  text-align: center;
}

.download-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 32px 0;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 2px solid rgba(42, 171, 238, 0.3);
  border-top-color: var(--tg-blue);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.download-content {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.download-info {
  color: var(--text-secondary);
  font-size: 14px;
  margin-top: 12px;
}

.secondary-downloads {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  width: 100%;
}

.secondary-downloads > p {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 16px;
}

.secondary-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.secondary-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: 8px;
  font-size: 14px;
  transition: all 0.2s ease;
}

.secondary-btn:hover {
  background: var(--surface-4);
  color: var(--text-primary);
  border-color: rgba(42, 171, 238, 0.3);
}

.secondary-btn svg {
  width: 16px;
  height: 16px;
}

.secondary-btn .size {
  opacity: 0.6;
  font-size: 12px;
}

.github-releases-link {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.github-releases-link a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 14px;
  transition: color 0.2s ease;
}

.github-releases-link a:hover {
  color: var(--text-primary);
}

.github-releases-link svg {
  width: 16px;
  height: 16px;
}

/* ===== BUILD FROM SOURCE ===== */
.build-source-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px 40px;
}

.build-source-card h3 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
}

.build-source-card > p {
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.code-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 14px;
  overflow-x: auto;
}

.code-block p {
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.code-block p:last-child {
  margin-bottom: 0;
}

.prompt {
  color: var(--tg-blue);
}

.code-note {
  margin-top: 16px;
  font-size: 12px;
  color: var(--text-secondary);
}

/* ===== FAQ ===== */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.faq-item {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
}

.faq-item h3 {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 12px;
}

.faq-icon {
  width: 32px;
  height: 32px;
  background: rgba(42, 171, 238, 0.1);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.faq-item p {
  color: var(--text-secondary);
  line-height: 1.7;
}

.faq-item p strong {
  color: var(--text-primary);
}

.faq-item p a {
  color: var(--tg-blue);
}

.faq-item p a:hover {
  text-decoration: underline;
}

/* ===== FOOTER ===== */
.footer {
  border-top: 1px solid var(--border);
  padding: 48px 24px;
}

.footer-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  margin-bottom: 32px;
}

@media (min-width: 768px) {
  .footer-top {
    flex-direction: row;
    justify-content: space-between;
  }
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}

.footer-logo svg {
  width: 24px;
  height: 24px;
  color: var(--tg-blue);
}

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

.footer-links a {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  font-size: 14px;
  transition: color 0.2s ease;
}

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

.footer-links svg {
  width: 16px;
  height: 16px;
}

.footer-bottom {
  padding-top: 24px;
  border-top: 1px solid var(--border);
  text-align: center;
}

.footer-bottom p {
  color: var(--text-secondary);
  font-size: 12px;
  margin-bottom: 8px;
}

.footer-credit {
  opacity: 0.5;
}

.footer-credit a {
  color: var(--text-secondary);
  transition: color 0.2s ease;
}

.footer-credit a:hover {
  color: var(--tg-blue);
}

.footer-developer {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(43, 57, 69, 0.5);
  text-align: center;
}

.footer-developer p {
  color: var(--text-secondary);
  font-size: 12px;
  opacity: 0.6;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #3B4955;
}
