/* ============================================
   Yucox Design System - CSS Custom Properties
   ============================================ */

:root {
  /* Color Palette */
  --color-bg-primary: #0a0a0f;
  --color-bg-secondary: #111118;
  --color-bg-tertiary: #1a1a24;
  --color-bg-card: #14141e;
  --color-bg-card-hover: #1c1c2a;

  --color-text-primary: #f0f0f5;
  --color-text-secondary: #a0a0b8;
  --color-text-muted: #6b6b82;

  --color-accent: #00b4ff;
  --color-accent-light: #33c4ff;
  --color-accent-dark: #0090cc;
  --color-accent-glow: rgba(0, 180, 255, 0.15);
  --color-accent-glow-strong: rgba(0, 180, 255, 0.3);

  --color-border: #2a2a3a;
  --color-border-light: #3a3a4a;

  --color-success: #00d68f;
  --color-warning: #ffaa00;

  /* Gradients */
  --gradient-hero: linear-gradient(135deg, #0a0a0f 0%, #0d1117 40%, #111827 100%);
  --gradient-card: linear-gradient(180deg, rgba(20, 20, 30, 0.8) 0%, rgba(20, 20, 30, 0.4) 100%);
  --gradient-accent: linear-gradient(135deg, #00b4ff, #00d4ff);
  --gradient-accent-subtle: linear-gradient(135deg, rgba(0, 180, 255, 0.1), rgba(0, 212, 255, 0.05));
  --gradient-glow: radial-gradient(ellipse at center, rgba(0, 180, 255, 0.08) 0%, transparent 70%);

  /* Shadows */
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.3);
  --shadow-card-hover: 0 8px 40px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 60px rgba(0, 180, 255, 0.1);
  --shadow-button: 0 4px 16px rgba(0, 180, 255, 0.25);

  /* Spacing Scale */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --space-4xl: 6rem;
  --space-5xl: 8rem;

  /* Typography */
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Cascadia Code', 'JetBrains Mono', Menlo, Consolas, monospace;

  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 2rem;
  --text-4xl: 2.5rem;
  --text-5xl: 3.5rem;

  --leading-tight: 1.2;
  --leading-normal: 1.5;
  --leading-relaxed: 1.7;

  /* Border Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.5rem;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms ease;
  --transition-spring: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Layout */
  --max-width: 1200px;
  --nav-height: 72px;
}

/* ============================================
   Base Reset & Styles
   ============================================ */

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--color-text-primary);
  background-color: var(--color-bg-primary);
  overflow-x: hidden;
}

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

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

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

/* ============================================
   Layout Utilities
   ============================================ */

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

.section {
  padding: var(--space-5xl) 0;
}

/* ============================================
   Navigation
   ============================================ */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--color-border);
  z-index: 1000;
  transition: background var(--transition-base);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-xl);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  text-decoration: none;
  color: var(--color-text-primary);
}

.nav-brand img {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
}

.nav-brand-text {
  font-size: var(--text-xl);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
  list-style: none;
}

.nav-links a {
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
  font-weight: 500;
  transition: color var(--transition-fast);
  text-decoration: none;
}

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

.nav-github {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  color: var(--color-text-secondary) !important;
  font-size: var(--text-sm) !important;
}

.nav-github svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.nav-github:hover {
  color: var(--color-text-primary) !important;
}

/* Mobile menu */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-sm);
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-text-primary);
  border-radius: 1px;
  transition: all var(--transition-fast);
}

/* ============================================
   Hero Section
   ============================================ */

.hero {
  min-height: 80vh;
  display: flex;
  align-items: center;
  padding-top: var(--nav-height);
  background: var(--gradient-hero);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -20%;
  right: -10%;
  width: 600px;
  height: 600px;
  background: var(--gradient-glow);
  border-radius: 50%;
  pointer-events: none;
}

.hero-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-4xl) var(--space-xl);
  position: relative;
  z-index: 1;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero h1 {
  font-size: clamp(var(--text-3xl), 5vw, var(--text-5xl));
  font-weight: 800;
  line-height: var(--leading-tight);
  letter-spacing: -0.03em;
  margin-bottom: var(--space-lg);
}

.hero h1 .highlight {
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: var(--text-lg);
  color: var(--color-text-secondary);
  line-height: var(--leading-relaxed);
  max-width: 600px;
  margin-bottom: var(--space-2xl);
}

/* Hero download cards */
#heroDownloadCards .download-cards {
  margin-bottom: var(--space-lg);
}

#heroGithub {
  text-align: center;
}

/* ============================================
   Buttons
   ============================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 0 var(--space-xl);
  height: 48px;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 600;
  border-radius: var(--radius-lg);
  border: none;
  cursor: pointer;
  transition: all var(--transition-base);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--gradient-accent);
  color: #fff;
  box-shadow: var(--shadow-button);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(0, 180, 255, 0.35);
  color: #fff;
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--color-bg-tertiary);
  color: var(--color-text-primary);
  border: 1px solid var(--color-border);
}

.btn-secondary:hover {
  background: var(--color-bg-card-hover);
  border-color: var(--color-border-light);
  color: var(--color-text-primary);
}

.btn-download {
  background: var(--color-bg-tertiary);
  color: var(--color-text-primary);
  border: 1px solid var(--color-border);
  padding: 0 var(--space-lg);
  height: 56px;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.btn-download:hover {
  border-color: var(--color-accent);
  background: rgba(0, 180, 255, 0.05);
  color: var(--color-text-primary);
}

.btn-download-label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-weight: 400;
}

.btn-download-name {
  font-size: var(--text-sm);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.btn-recommended {
  border-color: var(--color-accent);
  background: rgba(0, 180, 255, 0.05);
}

.btn-recommended .btn-download-label {
  color: var(--color-accent);
}

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

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

/* ============================================
   Features Section
   ============================================ */

.features {
  background: var(--color-bg-secondary);
}

.features-product-name {
  font-size: var(--text-xl);
  font-weight: 700;
  margin-bottom: var(--space-xl);
  text-align: center;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
}

.feature-card {
  padding: var(--space-xl);
  background: var(--gradient-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  transition: all var(--transition-base);
}

.feature-card:hover {
  border-color: var(--color-accent);
  background: var(--gradient-accent-subtle);
  transform: translateY(-2px);
}

.feature-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient-accent-subtle);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-md);
  color: var(--color-accent);
  font-size: var(--text-xl);
}

.feature-card h3 {
  font-size: var(--text-base);
  font-weight: 600;
  margin-bottom: var(--space-sm);
}

.feature-card p {
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
}

/* ============================================
   Download Cards
   ============================================ */

.download-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
  max-width: 600px;
  margin: 0 auto var(--space-lg);
}

.download-card {
  padding: var(--space-xl);
  background: var(--gradient-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  text-align: center;
  transition: all var(--transition-base);
  display: flex;
  flex-direction: column;
  min-height: 220px;
}

.download-card:hover {
  border-color: var(--color-accent);
  transform: translateY(-2px);
}

.download-card.recommended {
  border-color: var(--color-accent);
  background: rgba(0, 180, 255, 0.03);
  box-shadow: var(--shadow-glow);
}

.download-card-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto var(--space-md);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient-accent-subtle);
  border-radius: var(--radius-lg);
  color: var(--color-accent);
}

.download-card-icon svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.download-card .recommended-badge {
  font-size: var(--text-xs);
  color: var(--color-accent);
  margin-bottom: var(--space-xs);
  min-height: 18px;
}

.download-card .recommended-badge.invisible {
  visibility: hidden;
}

.download-card h3 {
  font-size: var(--text-lg);
  font-weight: 600;
  margin-bottom: var(--space-xs);
}

.download-card .version {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-lg);
}

.download-card .btn {
  width: 100%;
  margin-top: auto;
}

.download-github {
  text-align: center;
}

.download-github a {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
  transition: color var(--transition-fast);
}

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

.download-github svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* ============================================
   Product Section - Dynamic Rendering
   ============================================ */

.download-github {
  text-align: center;
}

.download-github a {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
  transition: color var(--transition-fast);
}

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

.download-github svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* ============================================
   Version History Section
   ============================================ */

.versions {
  background: var(--color-bg-secondary);
}

.versions-header {
  text-align: center;
  margin-bottom: var(--space-3xl);
}

.versions-header h2 {
  font-size: clamp(var(--text-2xl), 4vw, var(--text-4xl));
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-md);
}

.versions-header p {
  color: var(--color-text-secondary);
  font-size: var(--text-lg);
}

.versions-product + .versions-product {
  margin-top: var(--space-4xl);
}

.versions-product-name {
  font-size: var(--text-xl);
  font-weight: 700;
  margin-bottom: var(--space-xl);
  color: var(--color-accent);
}

.versions-timeline {
  max-width: 720px;
  margin: 0 auto;
}

.version-item {
  display: flex;
  gap: var(--space-lg);
  position: relative;
}

.version-item + .version-item {
  margin-top: 0;
}

.version-marker {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  width: 20px;
  padding-top: 6px;
}

.version-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--color-border);
  border: 2px solid var(--color-border-light);
  flex-shrink: 0;
  transition: all var(--transition-base);
}

.version-dot.active {
  background: var(--color-accent);
  border-color: var(--color-accent-light);
  box-shadow: 0 0 12px rgba(0, 180, 255, 0.4);
}

.version-line {
  width: 2px;
  flex: 1;
  background: var(--color-border);
  margin-top: var(--space-sm);
  min-height: 40px;
}

.version-content {
  flex: 1;
  padding-bottom: var(--space-2xl);
}

.version-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
  flex-wrap: wrap;
}

.version-number {
  font-family: var(--font-mono);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-text-primary);
}

.version-badge-latest {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  background: var(--gradient-accent-subtle);
  border: 1px solid rgba(0, 180, 255, 0.3);
  border-radius: var(--radius-full);
  color: var(--color-accent);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.version-date {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

.version-changes {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--space-md) 0;
}

.version-changes li {
  position: relative;
  padding-left: var(--space-lg);
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-xs);
}

.version-changes li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-accent);
  opacity: 0.6;
}

.version-item.latest .version-changes li::before {
  opacity: 1;
}

.version-downloads {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.btn-version-download {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-md);
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text-secondary);
  font-size: var(--text-xs);
  font-weight: 500;
  text-decoration: none;
  transition: all var(--transition-fast);
}

.btn-version-download:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
  background: rgba(0, 180, 255, 0.05);
}

.btn-version-download svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

/* ============================================
   Footer
   ============================================ */

.footer {
  padding: var(--space-3xl) 0;
  border-top: 1px solid var(--color-border);
  background: var(--color-bg-secondary);
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-xl);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

.footer-brand img {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-sm);
}

.footer-links {
  display: flex;
  gap: var(--space-xl);
  list-style: none;
}

.footer-links a {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  transition: color var(--transition-fast);
}

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

/* ============================================
   Animations
   ============================================ */

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

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

.fade-in-up {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================
   Responsive Design
   ============================================ */

@media (max-width: 1024px) {
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  :root {
    --nav-height: 64px;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: rgba(10, 10, 15, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--color-border);
    flex-direction: column;
    padding: var(--space-lg) var(--space-xl);
    gap: var(--space-md);
  }

  .nav-links.active {
    display: flex;
  }

  .nav-toggle {
    display: flex;
  }

  .hero-inner {
    padding: var(--space-3xl) var(--space-lg);
  }

  .hero h1 {
    font-size: var(--text-3xl);
  }

  .hero-subtitle {
    font-size: var(--text-base);
  }

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

  .download-cards {
    grid-template-columns: 1fr;
  }

  .version-downloads {
    flex-direction: column;
  }

  .footer-inner {
    flex-direction: column;
    gap: var(--space-lg);
    text-align: center;
  }

  .section {
    padding: var(--space-3xl) 0;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 var(--space-md);
  }

  .hero-inner {
    padding: var(--space-2xl) var(--space-md);
  }
}
