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

:root {
  --bg: #ffffff;
  --bg-alt: #f8fafc;
  --surface: #ffffff;
  --border: #e2e8f0;
  --text: #1e293b;
  --text-muted: #64748b;
  --accent: #6366f1;
  --accent-dim: #4f46e5;
  --accent-light: #a5b4fc;
  --accent-glow: rgba(99, 102, 241, 0.1);
  --green: #059669;
  --orange: #d97706;
  --red: #dc2626;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', 'Fira Code', monospace;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

h2 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

h3 {
  font-size: 1.15rem;
  font-weight: 600;
}

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

a:hover {
  text-decoration: underline;
}

/* === Skip Link === */
.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  background: var(--accent);
  color: #fff;
  padding: 8px 16px;
  border-radius: 0 0 8px 8px;
  z-index: 1001;
  font-size: 0.85rem;
}

.skip-link:focus {
  top: 0;
  text-decoration: none;
}

/* === Nav === */
.nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
}

.nav-inner {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-brand {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
  white-space: nowrap;
  flex-shrink: 0;
}

.nav-brand:hover {
  color: var(--accent);
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.nav-links::-webkit-scrollbar {
  display: none;
}

.nav-links a {
  font-size: 0.82rem;
  color: var(--text-muted);
  white-space: nowrap;
  transition: color 0.2s;
}

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

/* === Hero === */
.hero {
  padding: 100px 0 80px;
  text-align: center;
  background: linear-gradient(180deg, var(--bg-alt) 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--border);
}

.hero-badge {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--accent);
  background: var(--accent-glow);
  border: 1px solid var(--accent-light);
  border-radius: 20px;
  padding: 4px 16px;
  margin-bottom: 24px;
}

.hero h1 {
  font-size: 3.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
  color: var(--text);
}

.hero-tagline {
  font-size: 1.25rem;
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto 36px;
  line-height: 1.7;
}

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

.btn {
  display: inline-block;
  padding: 12px 28px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.2s;
}

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

.btn-primary:hover {
  background: var(--accent-dim);
  text-decoration: none;
}

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

.btn-secondary:hover {
  border-color: var(--accent-light);
  text-decoration: none;
}

.btn-tertiary {
  background: var(--accent-glow);
  color: var(--accent-dim);
  border: 1px solid var(--accent-light);
}

.btn-tertiary:hover {
  background: var(--accent-light);
  color: #fff;
  text-decoration: none;
}

/* === Sections === */
.section {
  padding: 80px 0;
}

.section-alt {
  background: var(--bg-alt);
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-bottom: 40px;
}

/* === Pipeline (How It Works) === */
.phase-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 32px 0 12px;
}

.phase-title:first-of-type {
  margin-top: 0;
}

.pipeline {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 12px;
}

.pipeline-step {
  flex: 1;
  min-width: 180px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px 20px;
}

.pipeline-step h3 {
  margin: 12px 0 8px;
}

.pipeline-step p {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-glow);
  color: var(--accent);
  font-weight: 700;
  font-family: var(--mono);
  font-size: 0.85rem;
  border: 1px solid var(--accent-light);
}

.pipeline-arrow {
  display: flex;
  align-items: center;
  color: var(--text-muted);
  font-size: 1.4rem;
  padding-top: 40px;
  flex-shrink: 0;
}

/* === Dimensions Grid === */
.dimensions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.dimension-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px 20px;
}

.dimension-icon {
  font-size: 1.2rem;
  color: var(--accent);
  margin-bottom: 4px;
  font-family: var(--mono);
  font-weight: 700;
}

.dimension-card h3 {
  margin-bottom: 8px;
}

.dimension-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.dimension-values {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.dimension-values span {
  display: inline-block;
  font-size: 0.75rem;
  font-family: var(--mono);
  color: var(--accent);
  background: var(--accent-glow);
  border-radius: 4px;
  padding: 2px 8px;
}

/* === Skills Grid === */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.skill-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px 24px;
}

.skill-card h3 {
  margin-bottom: 12px;
  color: var(--accent);
}

.skill-card p {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin-bottom: 16px;
  line-height: 1.65;
}

.skill-card cite {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: normal;
  font-family: var(--mono);
  opacity: 0.7;
}

.skill-command {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--green);
  background: rgba(5, 150, 105, 0.08);
  border-radius: 4px;
  padding: 2px 8px;
  margin-bottom: 12px;
}

/* === Gap Analysis === */
.gap-table-wrapper {
  overflow-x: auto;
}

.gap-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

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

.gap-table th {
  background: var(--bg-alt);
  font-weight: 600;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.gap-table td {
  color: var(--text-muted);
}

.gap-level {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 4px;
}

.gap-level-high {
  color: var(--red);
  background: rgba(220, 38, 38, 0.08);
}

.gap-level-medium-high {
  color: var(--orange);
  background: rgba(217, 119, 6, 0.08);
}

.gap-level-medium {
  color: #ca8a04;
  background: rgba(202, 138, 4, 0.08);
}

.gap-level-low {
  color: var(--green);
  background: rgba(5, 150, 105, 0.08);
}

.gap-level-none {
  color: var(--text-muted);
  background: var(--bg-alt);
}

/* === Papers === */
.papers-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.paper-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  transition: border-color 0.2s;
  color: var(--text);
}

.paper-card:hover {
  border-color: var(--accent-light);
  text-decoration: none;
}

.paper-tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  background: var(--accent-glow);
  border-radius: 4px;
  padding: 2px 8px;
  margin-bottom: 8px;
}

.paper-card h3 {
  margin-bottom: 6px;
  font-size: 1.1rem;
}

.paper-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.paper-link {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--accent);
}

/* === Installation === */
.install-methods {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.install-method {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
}

.install-method h3 {
  margin-bottom: 16px;
}

.install-method p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

pre {
  background: #1e293b;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  overflow-x: auto;
}

code {
  font-family: var(--mono);
  font-size: 0.88rem;
  color: #a5b4fc;
}

.compat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
}

.compat h3 {
  margin-bottom: 16px;
}

.compat-list {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.compat-badge {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.85rem;
  padding: 6px 16px;
  border-radius: 6px;
  background: var(--accent-glow);
  color: var(--accent);
  border: 1px solid var(--accent-light);
}

.compat-note {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.compat-note code {
  color: var(--orange);
  font-size: 0.85rem;
}

/* === Usage === */
.usage-examples {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 10px;
}

.usage-examples pre {
  margin: 0;
}

/* === Footer === */
.footer {
  border-top: 1px solid var(--border);
  padding: 40px 0;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 16px;
}

.footer-brand {
  font-size: 0.95rem;
}

.footer-brand a {
  color: var(--accent);
}

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

.footer-links a {
  font-size: 0.9rem;
  color: var(--text-muted);
}

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

.footer-license {
  font-size: 0.82rem;
  color: var(--text-muted);
  opacity: 0.7;
}

/* === Responsive === */
@media (max-width: 768px) {
  .nav-brand {
    font-size: 0.85rem;
  }

  .nav-links {
    gap: 14px;
  }

  .nav-links a {
    font-size: 0.78rem;
  }

  .hero {
    padding: 60px 0 50px;
  }

  .hero h1 {
    font-size: 2.2rem;
  }

  .hero-tagline {
    font-size: 1.05rem;
  }

  .section {
    padding: 50px 0;
  }

  h2 {
    font-size: 1.6rem;
  }

  .pipeline {
    flex-direction: column;
    align-items: stretch;
  }

  .pipeline-arrow {
    transform: rotate(90deg);
    padding: 0;
    justify-content: center;
  }

  .footer-content {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: 1.8rem;
  }

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

  .skills-grid,
  .install-methods {
    grid-template-columns: 1fr;
  }

  .usage-examples {
    grid-template-columns: 1fr;
  }
}
