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

:root {
  --bg-primary: #0a0a0a;
  --bg-secondary: #111111;
  --bg-tertiary: #1a1a1a;
  --text-primary: #ffffff;
  --text-secondary: #a0a0a0;
  --accent: #d4a853;
  --border: #333333;
  
  --v0-color: #4ade80;
  --v1-color: #60a5fa;
  --v2-color: #fbbf24;
  --v3-color: #f87171;
  --v4-color: #a78bfa;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

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

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

::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

/* Selection */
::selection {
  background-color: rgba(212, 168, 83, 0.3);
}

/* Hero Section */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 2rem;
  background-image: 
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 50px 50px;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent, var(--bg-primary));
  pointer-events: none;
}

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

.hero-title {
  font-size: clamp(2.5rem, 8vw, 4rem);
  font-weight: 700;
  margin-bottom: 0.5rem;
  line-height: 1.1;
}

.hero-subtitle {
  display: block;
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  font-weight: 400;
  color: var(--text-secondary);
  margin-top: 0.5rem;
}

.hero-description {
  font-size: 1.125rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.hero-subdescription {
  display: block;
  font-size: 0.875rem;
  color: #666;
  margin-top: 0.5rem;
}

/* Version Timeline */
.version-timeline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin: 3rem 0;
  flex-wrap: wrap;
}

.version-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.icon-box {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  border: 2px solid;
}

.icon-box.v0 { background: rgba(74, 222, 128, 0.15); border-color: var(--v0-color); }
.icon-box.v1 { background: rgba(96, 165, 250, 0.15); border-color: var(--v1-color); }
.icon-box.v2 { background: rgba(251, 191, 36, 0.15); border-color: var(--v2-color); }
.icon-box.v3 { background: rgba(248, 113, 113, 0.15); border-color: var(--v3-color); }
.icon-box.v4 { background: rgba(167, 139, 250, 0.15); border-color: var(--v4-color); }

.version-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.875rem;
  font-weight: 600;
}

.version-arrow {
  font-size: 1.5rem;
  color: #444;
}

/* Core Pattern */
.core-pattern {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  max-width: 500px;
  margin: 0 auto;
}

.pattern-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.pattern-code {
  text-align: left;
  overflow-x: auto;
}

.pattern-code code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: #ccc;
  line-height: 1.6;
}

/* Scroll Indicator */
.scroll-indicator {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  transition: color 0.2s;
}

.scroll-indicator:hover {
  color: var(--text-primary);
}

.scroll-arrow {
  font-size: 1.5rem;
  animation: bounce 1.5s infinite;
}

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

/* Main Content */
main {
  padding: 4rem 0;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Section Header */
.section-header {
  text-align: center;
  margin-bottom: 3rem;
}

.section-header h2 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

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

/* Version Switcher */
.version-switcher {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 3rem;
}

.version-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: transparent;
  border: 2px solid var(--border);
  border-radius: 8px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.version-btn:hover {
  border-color: #555;
  color: var(--text-primary);
}

.version-btn.active {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--version-color);
  color: var(--text-primary);
  box-shadow: 0 0 20px color-mix(in srgb, var(--version-color) 30%, transparent);
}

.version-id {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  color: var(--version-color);
}

.version-name {
  font-size: 0.875rem;
}

/* Version Detail */
.version-detail {
  margin-bottom: 4rem;
}

.version-content {
  display: none;
  animation: fadeIn 0.3s ease;
}

.version-content.active {
  display: block;
}

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

.detail-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.version-badge {
  padding: 0.375rem 0.75rem;
  border-radius: 9999px;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 0.875rem;
  border: 1px solid;
}

.detail-title {
  font-size: 1.75rem;
  font-weight: 700;
}

/* Philosophy Box */
.philosophy-box {
  padding: 1rem 1.5rem;
  border-left: 4px solid;
  border-radius: 0 8px 8px 0;
  margin-bottom: 1.5rem;
}

.philosophy-label {
  font-size: 0.875rem;
  font-weight: 600;
  display: block;
  margin-bottom: 0.5rem;
}

.philosophy-text {
  font-size: 1.125rem;
  font-style: italic;
  color: var(--text-primary);
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

@media (min-width: 640px) {
  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.stat-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
}

.stat-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}

.stat-value {
  font-size: 1.5rem;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  color: var(--text-primary);
}

.stat-value.highlight {
  font-size: 1rem;
}

/* Features */
.features {
  margin-bottom: 1.5rem;
}

.features h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.feature-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.feature-tag {
  padding: 0.375rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  border: 1px solid;
}

/* Code Section */
.code-section {
  margin-bottom: 2rem;
}

.code-section h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.code-block {
  position: relative;
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 8px;
  overflow: hidden;
}

.code-block pre {
  padding: 1.5rem;
  overflow-x: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  line-height: 1.6;
}

.code-block code {
  color: #c9d1d9;
}

.copy-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  padding: 0.375rem 0.75rem;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 4px;
  color: var(--text-secondary);
  font-size: 0.75rem;
  cursor: pointer;
  opacity: 0;
  transition: all 0.2s;
}

.code-block:hover .copy-btn {
  opacity: 1;
}

.copy-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: var(--text-primary);
}

/* Q&A Section */
.qa-section {
  margin-bottom: 2rem;
}

.qa-section h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.qa-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.qa-item {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.qa-question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 0.9rem;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s;
}

.qa-question:hover {
  background: rgba(255, 255, 255, 0.05);
}

.qa-toggle {
  color: var(--text-secondary);
  transition: transform 0.2s;
}

.qa-item.active .qa-toggle {
  transform: rotate(180deg);
}

.qa-answer {
  display: none;
  padding: 0 1rem 1rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.7;
  border-left: 2px solid var(--accent);
  margin-left: 1rem;
}

.qa-item.active .qa-answer {
  display: block;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.qa-answer p {
  margin-bottom: 0.75rem;
}

.qa-answer ul, .qa-answer ol {
  margin-left: 1.5rem;
  margin-bottom: 0.75rem;
}

.qa-answer li {
  margin-bottom: 0.25rem;
}

.qa-answer blockquote {
  border-left: 2px solid var(--accent);
  padding-left: 1rem;
  margin: 0.75rem 0;
  font-style: italic;
  color: #888;
}

.qa-answer pre {
  background: #0d1117;
  padding: 0.75rem;
  border-radius: 4px;
  overflow-x: auto;
  margin: 0.75rem 0;
}

.qa-answer table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.75rem 0;
  font-size: 0.8rem;
}

.qa-answer th, .qa-answer td {
  padding: 0.5rem;
  border: 1px solid var(--border);
  text-align: left;
}

.qa-answer th {
  background: rgba(255, 255, 255, 0.05);
}

/* Comparison Section */
.comparison-section {
  margin-bottom: 4rem;
}

.comparison-table-wrapper {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow-x: auto;
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.comparison-table th,
.comparison-table td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.comparison-table th {
  color: var(--text-secondary);
  font-weight: 500;
}

.comparison-table tr:last-child td {
  border-bottom: none;
}

.comparison-table tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

/* Learning Path Section */
.learning-path-section {
  margin-bottom: 4rem;
}

.learning-cards {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 1rem;
}

@media (min-width: 640px) {
  .learning-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .learning-cards {
    grid-template-columns: repeat(3, 1fr);
  }
}

.learning-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  transition: transform 0.2s, border-color 0.2s;
}

.learning-card:hover {
  transform: translateY(-2px);
  border-color: #444;
}

.card-number {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  margin-bottom: 1rem;
}

.learning-card h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.learning-card p {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

/* Footer */
footer {
  border-top: 1px solid var(--border);
  padding: 3rem 0;
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

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

.footer-info {
  text-align: center;
}

@media (min-width: 640px) {
  .footer-info {
    text-align: left;
  }
}

.footer-title {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.footer-desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.github-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  transition: all 0.2s;
}

.github-link:hover {
  border-color: #555;
  color: var(--text-primary);
}

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

.footer-bottom p {
  color: #666;
  font-size: 0.875rem;
}

/* Back to top */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 48px;
  height: 48px;
  background: rgba(212, 168, 83, 0.2);
  border: 1px solid rgba(212, 168, 83, 0.4);
  border-radius: 50%;
  color: var(--accent);
  font-size: 1.25rem;
  cursor: pointer;
  transition: all 0.2s;
  z-index: 100;
}

.back-to-top:hover {
  background: rgba(212, 168, 83, 0.3);
  transform: translateY(-2px);
}

/* Syntax Highlighting */
.language-python .keyword { color: #ff7b72; }
.language-python .string { color: #a5d6ff; }
.language-python .comment { color: #8b949e; }
.language-python .function { color: #d2a8ff; }
.language-python .number { color: #79c0ff; }

/* Responsive */
@media (max-width: 640px) {
  .hero {
    padding: 1.5rem;
  }
  
  .version-timeline {
    gap: 0.25rem;
  }
  
  .icon-box {
    width: 48px;
    height: 48px;
    font-size: 1.25rem;
  }
  
  .version-arrow {
    display: none;
  }
  
  .container {
    padding: 0 1rem;
  }
  
  .code-block pre {
    padding: 1rem;
    font-size: 0.7rem;
  }
}
