:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #818cf8;
  --secondary: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --dark: #1e293b;
  --darker: #0f172a;
  --light: #f8fafc;
  --gray: #64748b;
  --gray-light: #e2e8f0;
  --radius: 12px;
  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  line-height: 1.6;
  color: var(--dark);
  background: var(--light);
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--primary-dark);
}

/* Navigation */
nav {
  background: white;
  border-bottom: 1px solid var(--gray-light);
  padding: 1rem 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

nav .container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

nav .logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--dark);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

nav .logo span {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

nav ul {
  display: flex;
  list-style: none;
  gap: 2rem;
  align-items: center;
}

nav ul a {
  color: var(--gray);
  font-weight: 500;
}

nav ul a:hover {
  color: var(--primary);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-dark);
  color: white;
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.btn-secondary {
  background: white;
  color: var(--primary);
  border: 2px solid var(--primary);
}

.btn-secondary:hover {
  background: var(--primary);
  color: white;
}

.btn-dark {
  background: var(--dark);
  color: white;
}

.btn-dark:hover {
  background: var(--darker);
  color: white;
}

/* Hero Section */
.hero {
  background: linear-gradient(135deg, var(--darker) 0%, var(--dark) 100%);
  color: white;
  padding: 6rem 2rem;
  text-align: center;
}

.hero h1 {
  font-size: 3.5rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
  line-height: 1.2;
}

.hero h1 span {
  background: linear-gradient(135deg, var(--primary-light), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 1.25rem;
  color: #94a3b8;
  max-width: 600px;
  margin: 0 auto 2rem;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* Sections */
section {
  padding: 5rem 2rem;
}

section h2 {
  font-size: 2.5rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 1rem;
}

section .subtitle {
  text-align: center;
  color: var(--gray);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto 3rem;
}

/* Features Grid */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.feature-card {
  background: white;
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--gray-light);
  transition: transform 0.2s, box-shadow 0.2s;
}

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

.feature-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.feature-card h3 {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
}

.feature-card p {
  color: var(--gray);
  font-size: 0.95rem;
}

/* Code Block */
.code-section {
  background: var(--darker);
  color: white;
}

.code-section h2 {
  color: white;
}

.code-section .subtitle {
  color: #94a3b8;
}

pre {
  background: #1a1a2e;
  border-radius: var(--radius);
  padding: 1.5rem;
  overflow-x: auto;
  font-family: 'SF Mono', Monaco, 'Courier New', monospace;
  font-size: 0.9rem;
  line-height: 1.6;
  border: 1px solid #2d2d44;
}

code {
  font-family: 'SF Mono', Monaco, 'Courier New', monospace;
}

.code-wrapper {
  max-width: 800px;
  margin: 0 auto;
}

/* How it Works */
.how-it-works {
  background: white;
}

.steps {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
  max-width: 1000px;
  margin: 0 auto;
}

.step {
  flex: 1;
  min-width: 200px;
  max-width: 280px;
  text-align: center;
}

.step-number {
  width: 48px;
  height: 48px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.25rem;
  margin: 0 auto 1rem;
}

.step h3 {
  margin-bottom: 0.5rem;
}

.step p {
  color: var(--gray);
  font-size: 0.95rem;
}

/* Rules Table */
.rules-table {
  max-width: 800px;
  margin: 0 auto;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

th, td {
  padding: 1rem 1.5rem;
  text-align: left;
  border-bottom: 1px solid var(--gray-light);
}

th {
  background: var(--dark);
  color: white;
  font-weight: 600;
}

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

tr:hover td {
  background: #f8fafc;
}

.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}

.badge-error {
  background: #fef2f2;
  color: var(--danger);
}

.badge-warning {
  background: #fffbeb;
  color: var(--warning);
}

/* Pricing */
.pricing-section {
  background: #f1f5f9;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  max-width: 1000px;
  margin: 0 auto;
}

.pricing-card {
  background: white;
  border-radius: var(--radius);
  padding: 2.5rem;
  box-shadow: var(--shadow);
  border: 2px solid transparent;
  transition: all 0.2s;
}

.pricing-card.featured {
  border-color: var(--primary);
  transform: scale(1.02);
}

.pricing-card h3 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.pricing-card .price {
  font-size: 3rem;
  font-weight: 800;
  color: var(--dark);
  margin: 1rem 0;
}

.pricing-card .price span {
  font-size: 1rem;
  font-weight: 400;
  color: var(--gray);
}

.pricing-card ul {
  list-style: none;
  margin: 1.5rem 0;
}

.pricing-card li {
  padding: 0.5rem 0;
  color: var(--gray);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pricing-card li::before {
  content: "✓";
  color: var(--secondary);
  font-weight: 700;
}

/* CTA */
.cta {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  text-align: center;
}

.cta h2 {
  color: white;
}

.cta p {
  color: rgba(255,255,255,0.8);
  max-width: 500px;
  margin: 0 auto 2rem;
}

/* Footer */
footer {
  background: var(--darker);
  color: #94a3b8;
  padding: 3rem 2rem;
}

footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

footer a {
  color: #94a3b8;
}

footer a:hover {
  color: white;
}

footer .links {
  display: flex;
  gap: 2rem;
}

/* Docs Page */
.docs-layout {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 3rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

.docs-sidebar {
  position: sticky;
  top: 100px;
  height: fit-content;
}

.docs-sidebar ul {
  list-style: none;
}

.docs-sidebar li {
  margin-bottom: 0.5rem;
}

.docs-sidebar a {
  display: block;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  color: var(--gray);
  transition: all 0.2s;
}

.docs-sidebar a:hover,
.docs-sidebar a.active {
  background: var(--primary);
  color: white;
}

.docs-content {
  min-width: 0;
}

.docs-content h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.docs-content h2 {
  font-size: 1.75rem;
  margin: 2rem 0 1rem;
  text-align: left;
  padding-top: 1rem;
  border-top: 1px solid var(--gray-light);
}

.docs-content h3 {
  font-size: 1.25rem;
  margin: 1.5rem 0 0.75rem;
}

.docs-content p {
  margin-bottom: 1rem;
  color: var(--gray);
}

.docs-content pre {
  margin: 1rem 0;
}

.docs-content table {
  margin: 1rem 0;
}

/* Responsive */
@media (max-width: 768px) {
  .hero h1 {
    font-size: 2.5rem;
  }
  
  nav .container {
    flex-direction: column;
    gap: 1rem;
  }
  
  nav ul {
    gap: 1rem;
  }
  
  .docs-layout {
    grid-template-columns: 1fr;
  }
  
  .docs-sidebar {
    position: static;
  }
  
  .steps {
    flex-direction: column;
    align-items: center;
  }
}
