/* ==================== CSS Variables ==================== */
:root {
  /* Light theme */
  --bg: #ffffff;
  --bg-secondary: #f7faf7;
  --bg-tertiary: #edf2ed;
  --text: #1a1a1a;
  --text-secondary: #4a4a4a;
  --text-muted: #6b7280;
  --border: #e0e0e0;
  --accent: #16a34a;
  --accent-hover: #15803d;
  --accent-light: #dcfce7;
  --card-bg: #ffffff;
  --card-border: #e5e5e5;
  --shadow: rgba(0, 0, 0, 0.06);
  --hero-bg: linear-gradient(135deg, #f0fdf4 0%, #ffffff 50%, #ecfdf5 100%);
  --btn-outline-bg: transparent;
  --btn-outline-border: #16a34a;
  --btn-outline-text: #16a34a;
  --btn-outline-hover-bg: #16a34a;
  --btn-outline-hover-text: #ffffff;
  --btn-primary-bg: #16a34a;
  --btn-primary-text: #ffffff;
  --btn-primary-hover: #15803d;
  --feature-bg: #ffffff;
  --feature-border: #e5e5e5;
  --link-color: #16a34a;
  --link-hover: #15803d;
  --theme-icon-sun: block;
  --theme-icon-moon: none;
}

[data-theme="dark"] {
  --bg: #0f1117;
  --bg-secondary: #161922;
  --bg-tertiary: #1e2130;
  --text: #e4e4e7;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --border: #27272a;
  --accent: #22c55e;
  --accent-hover: #16a34a;
  --accent-light: #052e16;
  --card-bg: #1e2130;
  --card-border: #3f3f46;
  --shadow: rgba(0, 0, 0, 0.3);
  --hero-bg: linear-gradient(135deg, #0f1117 0%, #161922 50%, #052e16 100%);
  --btn-outline-bg: transparent;
  --btn-outline-border: #22c55e;
  --btn-outline-text: #22c55e;
  --btn-outline-hover-bg: #22c55e;
  --btn-outline-hover-text: #0f1117;
  --btn-primary-bg: #22c55e;
  --btn-primary-text: #0f1117;
  --btn-primary-hover: #16a34a;
  --feature-bg: #1e2130;
  --feature-border: #3f3f46;
  --link-color: #22c55e;
  --link-hover: #16a34a;
  --theme-icon-sun: none;
  --theme-icon-moon: block;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* ==================== Top bar ==================== */
.top-bar {
  width: 100%;
  height: 6px;
  background: linear-gradient(90deg, #16a34a, #22c55e, #16a34a);
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
}

/* ==================== Header ==================== */
header {
  position: fixed;
  top: 6px;
  left: 0;
  right: 0;
  z-index: 99;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.header-content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}

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

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s;
}

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

/* ==================== Theme toggle ==================== */
.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px;
  cursor: pointer;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.theme-toggle .icon-sun {
  display: var(--theme-icon-sun);
}

.theme-toggle .icon-moon {
  display: var(--theme-icon-moon);
}

/* ==================== Hero ==================== */
.hero {
  padding: 160px 24px 100px;
  text-align: center;
  background: var(--hero-bg);
}

.hero h1 {
  font-size: 3.2rem;
  font-weight: 700;
  margin-bottom: 20px;
  line-height: 1.2;
  color: var(--text);
}

.hero h1 span {
  color: var(--accent);
}

.hero .subtitle {
  font-size: 1.2rem;
  color: var(--text-secondary);
  margin-bottom: 48px;
  max-width: 650px;
  margin-left: auto;
  margin-right: auto;
}

/* ==================== Buttons ==================== */
.btn {
  display: inline-block;
  padding: 14px 36px;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.25s;
  border: 2px solid transparent;
}

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

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

.btn-outline {
  background: var(--btn-outline-bg);
  color: var(--btn-outline-text);
  border-color: var(--btn-outline-border);
}

.btn-outline:hover {
  background: var(--btn-outline-hover-bg);
  color: var(--btn-outline-hover-text);
}

/* ==================== Stats ==================== */
.stats {
  display: flex;
  justify-content: center;
  gap: 64px;
  padding: 60px 24px;
  max-width: 900px;
  margin: 0 auto;
}

.stat-item {
  text-align: center;
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--accent);
}

.stat-label {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ==================== Features ==================== */
.features {
  padding: 80px 24px;
  max-width: 1100px;
  margin: 0 auto;
}

.features h2 {
  text-align: center;
  font-size: 2rem;
  margin-bottom: 48px;
  color: var(--text);
}

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

.feature-card {
  background: var(--feature-bg);
  border: 1px solid var(--feature-border);
  border-radius: 16px;
  padding: 32px;
  transition: transform 0.2s, box-shadow 0.2s;
}

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

.feature-icon {
  font-size: 2.4rem;
  margin-bottom: 16px;
}

.feature-card h3 {
  font-size: 1.1rem;
  margin-bottom: 10px;
  color: var(--text);
}

.feature-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ==================== CTA ==================== */
.cta {
  text-align: center;
  padding: 80px 24px;
  background: var(--hero-bg);
}

.cta h2 {
  font-size: 2rem;
  margin-bottom: 16px;
  color: var(--text);
}

.cta p {
  color: var(--text-secondary);
  margin-bottom: 32px;
  font-size: 1.1rem;
}

/* ==================== Footer ==================== */
footer {
  text-align: center;
  padding: 32px 24px;
  color: var(--text-muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--border);
}

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

footer a:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

/* ==================== Responsive ==================== */
@media (max-width: 768px) {
  .hero h1 {
    font-size: 2.2rem;
  }

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

  .stats {
    flex-direction: column;
    gap: 32px;
  }

  .header-content {
    flex-wrap: wrap;
    gap: 12px;
  }
}
