:root {
  color-scheme: light dark;
  --bg:           #0d1117;
  --panel:        #13191f;
  --surface:      #161b22;
  --surface-2:    #1f252d;
  --surface-3:    #2a3038;
  --border:       #21262d;
  --border-bright:#30363d;
  --text:         #f0ede6;
  --text-muted:   #9ca3af;
  --text-dim:     #7a7468;
  --accent:       #f0b429;
  --accent-dim:   #78460d;
  --accent-glow:  rgba(240,180,41,0.2);
  --danger:       #f87171;
  --success:      #34d399;
  --cyan:         #22d3ee;
  --radius:       12px;
  --font:         ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
}

[data-theme="light"] {
  --bg:           #f8f7f4;
  --panel:        #f0ede8;
  --surface:      #ffffff;
  --surface-2:    #f0ede8;
  --surface-3:    #e8e5e0;
  --border:       #d6cfc8;
  --border-bright:#bfb8b0;
  --text:         #1c1917;
  --text-muted:   #57534e;
  --text-dim:     #78716c;
  --accent:       #d97706;
  --accent-dim:   #fef3c7;
  --accent-glow:  rgba(217,119,6,0.15);
  --danger:       #dc2626;
  --success:      #16a34a;
  --cyan:         #0891b2;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg:           #f8f7f4;
    --panel:        #f0ede8;
    --surface:      #ffffff;
    --surface-2:    #f0ede8;
    --surface-3:    #e8e5e0;
    --border:       #d6cfc8;
    --border-bright:#bfb8b0;
    --text:         #1c1917;
    --text-muted:   #57534e;
    --text-dim:     #78716c;
    --accent:       #d97706;
    --accent-dim:   #fef3c7;
    --accent-glow:  rgba(217,119,6,0.15);
    --danger:       #dc2626;
    --success:      #16a34a;
    --cyan:         #0891b2;
  }
}

* { box-sizing: border-box; }
html, body { min-height: 100vh; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.6;
  display: flex;
  flex-direction: column;
}
.container { max-width: 1900px; margin: 0 auto; padding: 80px 20px 0; width: 100%; flex: 1; }

/* Hero */
.hero {
  text-align: center;
  margin-bottom: 56px;
}
.hero h1 {
  font-size: 2.4rem;
  margin: 0 0 12px;
  background: linear-gradient(90deg, var(--accent), #f59e0b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero p {
  color: var(--text-muted);
  font-size: 1.15rem;
  max-width: 620px;
  margin: 0 auto;
}

/* Cards */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin-bottom: 48px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: transform .15s ease, border-color .2s ease;
}
.card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
}
.card h3 {
  margin: 0 0 10px;
  font-size: 1.15rem;
  color: var(--accent);
}
.card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin: 0 0 20px;
}
.card .cta {
  display: inline-block;
  padding: 10px 18px;
  background: var(--accent);
  color: var(--bg);
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
}
.card .cta:hover { opacity: 0.92; }
.card .cta-secondary {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}
.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 10px;
}

/* Why section */
.why {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  margin-bottom: 48px;
}
.why h2 {
  margin: 0 0 16px;
  font-size: 1.3rem;
  color: var(--accent);
}
.why ul {
  margin: 0;
  padding-left: 20px;
  color: var(--text-muted);
}
.why li { margin-bottom: 8px; }

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

/* Topbar */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  height: 56px;
  background: rgba(13,17,23,0.92);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 20px; gap: 12px;
}
[data-theme="light"] .topbar { background: rgba(248,247,244,0.92); }
.topbar-logo {
  font-size: 0.875rem; font-weight: 700;
  color: var(--accent); white-space: nowrap;
  display: flex; align-items: center; gap: 8px;
  text-decoration: none;
}
.topbar-nav {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-right: auto;
}
.topbar-nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  transition: color 0.2s;
}
.topbar-nav a:hover { color: var(--accent); }
.topbar-nav a.active { color: var(--accent); font-weight: 600; }
.topbar-logo:hover { opacity: 0.85; }
.topbar-logo svg { color: var(--accent); }
#theme-toggle {
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); cursor: pointer;
  transition: all 0.2s; flex-shrink: 0;
  padding: 0;
  position: static;
}
#theme-toggle:hover { border-color: var(--accent); background: var(--accent-dim); }
#theme-toggle .icon-sun { display: none; }
#theme-toggle .icon-moon { display: block; }
[data-theme="light"] #theme-toggle .icon-sun { display: block; }
[data-theme="light"] #theme-toggle .icon-moon { display: none; }

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.topbar-github {
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text);
  transition: all 0.2s; flex-shrink: 0;
  text-decoration: none;
}
.topbar-github:hover { border-color: var(--accent); background: var(--accent-dim); }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 16px 20px;
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.footer-brand {
  font-size: 0.85rem; font-weight: 600;
  color: var(--text-dim);
  display: flex; align-items: center; gap: 6px;
}
.footer-brand svg { color: var(--accent); }
.footer-links { display: flex; align-items: center; gap: 6px; }
.footer-links a { color: var(--accent); text-decoration: none; font-size: 0.8rem; }
.footer-links a:hover { text-decoration: underline; }
.footer-sep { color: var(--text-dim); }

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