:root {
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="dark"] {
  --bg-page: #0a0b10;
  --bg-surface: #12141d;
  --bg-subtle: #191b26;
  --bg-card: #151722;
  --bg-code: #06070a;
  --border: #232636;
  --border-focus: #3e4460;
  --text-main: #f3f4f8;
  --text-muted: #9299b0;
  --accent-primary: #8b5cf6;
  --accent-secondary: #06b6d4;
  --accent-hover: #7c3aed;
  --accent-gradient: linear-gradient(135deg, #a78bfa 0%, #38bdf8 100%);
  --glow-1: rgba(139, 92, 246, 0.15);
  --glow-2: rgba(6, 182, 212, 0.12);
  --shadow-card: 0 4px 20px -2px rgba(0, 0, 0, 0.4);
}

[data-theme="light"] {
  --bg-page: #fbfbfd;
  --bg-surface: #ffffff;
  --bg-subtle: #f2f4f8;
  --bg-card: #ffffff;
  --bg-code: #f6f8fb;
  --border: #e2e6f0;
  --border-focus: #cbd3e2;
  --text-main: #0f172a;
  --text-muted: #566176;
  --accent-primary: #7c3aed;
  --accent-secondary: #0284c7;
  --accent-hover: #6d28d9;
  --accent-gradient: linear-gradient(135deg, #7c3aed 0%, #0284c7 100%);
  --glow-1: rgba(124, 58, 237, 0.08);
  --glow-2: rgba(2, 132, 199, 0.06);
  --shadow-card: 0 4px 20px -2px rgba(15, 23, 42, 0.06);
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.65;
  overflow-x: hidden;
  transition: background-color 0.25s ease, color 0.25s ease;
}

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

a:hover {
  text-decoration: underline;
}

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

/* Ambient Background Glows */
.ambient-glow {
  position: absolute;
  top: 0;
  width: 50vw;
  height: 450px;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.8;
  animation: floatAmbient 12s ease-in-out infinite alternate;
}

.glow-1 {
  left: 5%;
  background: var(--glow-1);
}

.glow-2 {
  right: 5%;
  background: var(--glow-2);
  animation-delay: -6s;
}

@keyframes floatAmbient {
  0% { transform: translateY(0) scale(1); }
  100% { transform: translateY(40px) scale(1.08); }
}

/* Navbar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(var(--bg-page), 0.8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
}

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

.brand-link {
  display: flex;
  align-items: center;
}

.brand-name {
  font-weight: 700;
  font-size: 1.12rem;
  letter-spacing: -0.02em;
  color: var(--text-main);
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

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

.nav-links a {
  font-size: 0.92rem;
  color: var(--text-muted);
  font-weight: 500;
  position: relative;
  transition: color var(--transition);
}

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

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Theme Toggle Button */
.theme-toggle {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-main);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.theme-toggle:hover {
  border-color: var(--border-focus);
  transform: rotate(15deg);
}

[data-theme="dark"] .sun-icon { display: block; }
[data-theme="dark"] .moon-icon { display: none; }
[data-theme="light"] .sun-icon { display: none; }
[data-theme="light"] .moon-icon { display: block; }

/* GitHub Button */
.github-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-surface);
  color: var(--text-main) !important;
  border: 1px solid var(--border);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  transition: var(--transition);
}

.github-btn:hover {
  background: var(--bg-subtle);
  border-color: var(--border-focus);
  transform: translateY(-1px);
  text-decoration: none;
}

/* Hero */
.hero {
  position: relative;
  z-index: 1;
  padding: 72px 0 56px;
  text-align: center;
}

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

.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: 30px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  margin-bottom: 22px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.pulse-dot {
  width: 7px;
  height: 7px;
  background: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6);
  animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6); }
  70% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.gradient-title {
  font-size: 2.85rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: 18px;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-desc {
  font-size: 1.15rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 32px;
}

.hero-cta {
  display: flex;
  justify-content: center;
  gap: 14px;
}

.btn {
  display: inline-block;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 11px 22px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.btn-gradient {
  background: var(--accent-gradient);
  color: #ffffff !important;
  box-shadow: 0 4px 16px rgba(139, 92, 246, 0.3);
}

.btn-gradient:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(139, 92, 246, 0.45);
  text-decoration: none;
}

.btn-outline {
  background: var(--bg-surface);
  color: var(--text-main) !important;
  border: 1px solid var(--border);
}

.btn-outline:hover {
  background: var(--bg-subtle);
  border-color: var(--border-focus);
  transform: translateY(-2px);
  text-decoration: none;
}

/* Layout */
.main-layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 48px;
  padding-top: 48px;
  padding-bottom: 96px;
}

/* Sidebar */
.sidebar {
  position: sticky;
  top: 88px;
  height: calc(100vh - 120px);
  overflow-y: auto;
}

.sidebar-group {
  margin-bottom: 28px;
}

.sidebar-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.sidebar ul {
  list-style: none;
}

.sidebar li {
  margin-bottom: 8px;
}

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

.sidebar a:hover {
  color: var(--text-main);
  text-decoration: none;
}

/* Content Area */
.content {
  min-width: 0;
}

.section {
  margin-bottom: 64px;
  scroll-margin-top: 100px;
}

.section h2 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
  margin-bottom: 18px;
}

.section h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 28px 0 12px;
}

.section p {
  color: var(--text-muted);
  font-size: 1.02rem;
  margin-bottom: 16px;
}

/* Feature Cards with Colored Top Borders */
.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin: 26px 0;
}

.card-interactive {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: var(--transition);
}

.card-interactive:hover {
  transform: translateY(-4px);
  border-color: var(--border-focus);
}

.card-accent {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}

.accent-purple { background: linear-gradient(90deg, #8b5cf6, #c084fc); }
.accent-blue { background: linear-gradient(90deg, #0284c7, #38bdf8); }
.accent-emerald { background: linear-gradient(90deg, #059669, #34d399); }
.accent-amber { background: linear-gradient(90deg, #d97706, #fbbf24); }

.card-interactive h3 {
  font-size: 1.08rem;
  margin: 4px 0 8px;
  color: var(--text-main);
}

.card-interactive p {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin: 0;
}

/* Steps */
.step-card {
  display: flex;
  gap: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-card);
}

.step-badge {
  width: 32px;
  height: 32px;
  background: var(--accent-gradient);
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.88rem;
  flex-shrink: 0;
}

.step-body {
  flex: 1;
}

.step-body h3 {
  margin: 0 0 8px;
  font-size: 1.15rem;
  color: var(--text-main);
}

.step-body ul {
  padding-left: 20px;
  color: var(--text-muted);
  margin-top: 8px;
}

/* Code Boxes */
.code-box {
  position: relative;
  margin: 16px 0;
}

pre {
  background-color: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.86rem;
  line-height: 1.55;
  color: var(--text-main);
}

code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  background: var(--bg-subtle);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
}

pre code {
  background: none;
  border: none;
  padding: 0;
}

/* Tables */
.table-wrap {
  overflow-x: auto;
  margin: 20px 0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

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

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

th {
  background-color: var(--bg-subtle);
  color: var(--text-main);
  font-weight: 600;
}

td {
  background-color: var(--bg-card);
  color: var(--text-muted);
}

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

/* Callout Box */
.callout {
  border-left: 3px solid var(--accent-primary);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent-primary);
  padding: 16px 20px;
  border-radius: var(--radius-sm);
  margin: 20px 0;
}

.callout ul {
  padding-left: 20px;
  margin-top: 8px;
  color: var(--text-muted);
}

/* Footer */
.footer {
  border-top: 1px solid var(--border);
  padding: 36px 0;
  background-color: var(--bg-surface);
  font-size: 0.88rem;
  color: var(--text-muted);
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

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

/* Responsive */
@media (max-width: 880px) {
  .main-layout {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .sidebar {
    display: none;
  }
  .nav-links {
    display: none;
  }
  .gradient-title {
    font-size: 2.1rem;
  }
}
