:root {
  --color-bg: #000000;
  --color-text: #f5f5f7;
  --color-text-secondary: #a1a1a6;
  --color-border: rgba(255, 255, 255, 0.1);
  --color-nav-bg: rgba(0, 0, 0, 0.72);
  --color-card-bg: #0a0a0a;
  --color-light: #f5f5f7;
  --color-dark-gray: #0a0a0a;

  --font-primary: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Helvetica Neue', 'Segoe UI', sans-serif;

  --transition-fast: 0.2s cubic-bezier(0.25, 0.1, 0.25, 1);
  --transition-medium: 0.4s cubic-bezier(0.25, 0.1, 0.25, 1);
  --transition-slow: 0.8s cubic-bezier(0.25, 0.1, 0.25, 1);

  --shadow-sm: 0 1px 3px rgba(255, 255, 255, 0.04);
  --shadow-md: 0 4px 16px rgba(255, 255, 255, 0.06);
  --shadow-lg: 0 8px 32px rgba(255, 255, 255, 0.08);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --max-width: 1200px;
  --nav-height: 64px;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-primary);
  background: var(--color-bg);
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
  overflow-x: hidden;
}

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

ul {
  list-style: none;
}

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

/* --- Navigation --- */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-bottom: 1px solid var(--color-border);
  transition: background var(--transition-medium);
}

.nav-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-height);
}

.nav-logo {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--color-text);
  transition: opacity var(--transition-fast);
}

.nav-logo:hover {
  opacity: 0.7;
}

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

.nav-links a {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-secondary);
  transition: color var(--transition-fast);
  position: relative;
  padding: 4px 0;
  letter-spacing: 0.3px;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-text);
  transition: width var(--transition-fast);
  border-radius: 1px;
}

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

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

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

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 4px;
  z-index: 1001;
}

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

.nav-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle.active span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* --- Hero --- */

.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(var(--nav-height) + 40px) 24px 80px;
  position: relative;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(ellipse 600px 400px at 70% 20%, rgba(255, 255, 255, 0.03) 0%, transparent 100%),
    radial-gradient(ellipse 500px 500px at 30% 80%, rgba(255, 255, 255, 0.02) 0%, transparent 100%);
  pointer-events: none;
}

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

.hero-title {
  font-size: clamp(56px, 10vw, 96px);
  font-weight: 700;
  letter-spacing: -4px;
  line-height: 1;
  margin-bottom: 20px;
  color: var(--color-text);
}

.hero-subtitle {
  font-size: clamp(20px, 3vw, 28px);
  font-weight: 400;
  color: var(--color-text-secondary);
  margin-bottom: 16px;
  letter-spacing: -0.3px;
}

.hero-description {
  font-size: clamp(16px, 2vw, 20px);
  color: var(--color-text-secondary);
  line-height: 1.6;
  margin-bottom: 48px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.hero-404 {
  min-height: 80vh;
}

.title-404 {
  font-size: clamp(80px, 15vw, 160px) !important;
}

/* --- Buttons --- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 36px;
  font-size: 16px;
  font-weight: 500;
  font-family: var(--font-primary);
  border-radius: 980px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.btn-primary {
  background: var(--color-light);
  color: #000000;
  border-color: var(--color-light);
}

.btn-primary:hover {
  background: #ffffff;
  transform: scale(1.02);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: transparent;
  color: var(--color-text);
  border-color: var(--color-border);
}

.btn-secondary:hover {
  background: var(--color-dark-gray);
  border-color: var(--color-text-secondary);
  transform: scale(1.02);
}

/* --- Features --- */

.features {
  padding: 120px 24px;
  background: var(--color-dark-gray);
}

.section-container {
  max-width: var(--max-width);
  margin: 0 auto;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.feature-card {
  background: var(--color-card-bg);
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
  transition: all var(--transition-medium);
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.feature-number {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
  letter-spacing: 2px;
  margin-bottom: 16px;
}

.feature-card h3 {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 12px;
  letter-spacing: -0.3px;
}

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

/* --- Page Header --- */

.page-header {
  padding: calc(var(--nav-height) + 80px) 24px 60px;
  text-align: center;
}

.page-header h1 {
  font-size: clamp(40px, 6vw, 64px);
  font-weight: 700;
  letter-spacing: -2px;
  margin-bottom: 12px;
}

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

/* --- Downloads --- */

.downloads {
  padding: 0 24px 120px;
}

.downloads-grid {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
}

.download-card {
  background: var(--color-card-bg);
  border-radius: var(--radius-xl);
  padding: 48px 40px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
  transition: all var(--transition-medium);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.download-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.download-card .badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 16px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.08);
  color: var(--color-text-secondary);
  border-radius: 980px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 24px;
}

.download-card .icon {
  font-size: 48px;
  margin-bottom: 16px;
  color: var(--color-text);
}

.download-card h2 {
  font-size: 28px;
  font-weight: 600;
  margin-bottom: 12px;
  letter-spacing: -0.5px;
}

.download-card p {
  font-size: 16px;
  color: var(--color-text-secondary);
  line-height: 1.7;
  margin-bottom: 32px;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

.download-card .badge-available {
  background: rgba(52, 199, 89, 0.15);
  color: #34c759;
}

.card-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.04) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: 980px;
}

.skeleton-btn {
  width: 140px;
  height: 48px;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* --- Documentation --- */

.docs {
  padding: 0 24px 120px;
}

.docs-container {
  max-width: 800px;
  margin: 0 auto;
}

.docs-section {
  margin-bottom: 80px;
}

.docs-section:last-child {
  margin-bottom: 0;
}

.docs-section h2 {
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
}

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

.step {
  display: flex;
  gap: 24px;
  padding: 28px 0;
  border-bottom: 1px solid var(--color-border);
}

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

.step-number {
  font-size: 40px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.15);
  line-height: 1;
  min-width: 52px;
  font-feature-settings: "tnum";
}

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

.step-content p {
  font-size: 15px;
  color: var(--color-text-secondary);
  line-height: 1.7;
}

.docs-notice {
  margin-top: 48px;
  padding: 24px 32px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
}

.docs-notice p {
  font-size: 15px;
  color: var(--color-text-secondary);
  line-height: 1.7;
}

.docs-notice strong {
  color: var(--color-text);
}

/* --- Key System --- */

.keysystem {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
}

.keysystem-content {
  max-width: 520px;
}

.keysystem-icon {
  margin-bottom: 24px;
  display: flex;
  justify-content: center;
  color: var(--color-text-secondary);
}

.keysystem-content h1 {
  font-size: clamp(36px, 5vw, 48px);
  font-weight: 700;
  letter-spacing: -1.5px;
  margin-bottom: 16px;
}

.keysystem-content p {
  font-size: 18px;
  color: var(--color-text-secondary);
  line-height: 1.7;
  margin-bottom: 40px;
}

.keysystem-content .status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-secondary);
  background: rgba(255, 255, 255, 0.08);
  border-radius: 980px;
  border: 1px solid var(--color-border);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #34c759;
  animation: pulse 2s ease-in-out infinite;
}

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

/* --- Footer --- */

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

.footer p {
  font-size: 13px;
  color: var(--color-text-secondary);
  letter-spacing: 0.5px;
}

/* --- Animations --- */

.fade-in {
  opacity: 0;
  transform: translateY(24px);
  animation: fadeInUp 0.8s cubic-bezier(0.25, 0.1, 0.25, 1) forwards;
}

.fade-in:nth-child(1) { animation-delay: 0.1s; }
.fade-in:nth-child(2) { animation-delay: 0.3s; }
.fade-in:nth-child(3) { animation-delay: 0.5s; }
.fade-in:nth-child(4) { animation-delay: 0.7s; }

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

.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s cubic-bezier(0.25, 0.1, 0.25, 1),
              transform 0.8s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Responsive --- */

@media (max-width: 768px) {
  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: rgba(0, 0, 0, 0.98);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    flex-direction: column;
    padding: 80px 32px 32px;
    gap: 24px;
    transition: right var(--transition-medium);
    box-shadow: var(--shadow-lg);
    border-left: 1px solid var(--color-border);
  }

  .nav-links.open {
    right: 0;
  }

  .nav-links a {
    font-size: 18px;
    font-weight: 500;
  }

  .nav-toggle {
    display: flex;
  }

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

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

  .hero-title {
    letter-spacing: -2px;
  }

  .step {
    gap: 16px;
  }

  .step-number {
    font-size: 32px;
    min-width: 40px;
  }
}

@media (max-width: 480px) {
  .hero-actions {
    flex-direction: column;
    align-items: center;
  }

  .btn {
    width: 100%;
    max-width: 280px;
  }
}
