/* ── reset + base ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #0d1117;
  --bg2:       #161b22;
  --bg3:       #21262d;
  --border:    #30363d;
  --text:      #e6edf3;
  --muted:     #8b949e;
  --blue:      #58a6ff;
  --blue-dim:  #1f6feb;
  --green:     #3fb950;
  --purple:    #d2a8ff;
  --orange:    #ffa657;
  --red:       #f78166;
  --radius:    8px;
  --radius-lg: 14px;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', ui-monospace, monospace;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --transition: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

html { scroll-behavior: smooth; font-size: 16px; }
body { font-family: var(--font-sans); background: var(--bg); color: var(--text); line-height: 1.6; overflow-x: hidden; }
::selection { background: #388bfd44; }
a { color: var(--blue); text-decoration: none; transition: color var(--transition); }
a:hover { color: #79c0ff; }
code { font-family: var(--font-mono); font-size: 0.88em; background: var(--bg3); padding: 0.1em 0.4em; border-radius: 4px; color: var(--blue); }
.container { max-width: 1100px; margin: 0 auto; padding: 0 2rem; }

/* ── nav ───────────────────────────────────────────────────── */
#nav {
  position: fixed; top: 0; left: 0; right: 0; height: 56px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 2rem; background: transparent; z-index: 100;
  transition: background var(--transition), box-shadow var(--transition);
}
#nav.scrolled { background: rgba(13,17,23,0.92); backdrop-filter: blur(12px); box-shadow: 0 1px 0 var(--border); }
.nav-logo { font-weight: 800; font-size: 1.1rem; color: var(--text); letter-spacing: -0.02em; }
.nav-links { display: flex; gap: 1.5rem; align-items: center; font-size: 0.9rem; }
.nav-links a { color: var(--muted); }
.nav-links a:hover { color: var(--text); }
.nav-gh { display: flex; align-items: center; gap: 0.35rem; }

/* ── hero ──────────────────────────────────────────────────── */
#hero {
  min-height: 90vh; display: flex; align-items: center; justify-content: center;
  padding: 6rem 2rem 4rem; text-align: center;
  background: radial-gradient(ellipse at 50% 30%, rgba(31,111,235,0.08) 0%, transparent 60%);
}
.hero-content { max-width: 720px; }
.hero-content h1 { font-size: 3.5rem; font-weight: 800; letter-spacing: -0.03em; margin-bottom: 1rem; }
.hero-tagline { font-size: 1.15rem; color: var(--muted); line-height: 1.7; margin-bottom: 2rem; }
.hero-actions { display: flex; gap: 1rem; justify-content: center; margin-bottom: 3rem; }
.btn { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.65rem 1.5rem;
       border-radius: var(--radius); font-weight: 600; font-size: 0.9rem; transition: all var(--transition); }
.btn-primary { background: var(--blue-dim); color: #fff; border: 1px solid var(--blue-dim); }
.btn-primary:hover { background: var(--blue); color: #fff; }
.btn-outline { background: transparent; color: var(--muted); border: 1px solid var(--border); }
.btn-outline:hover { color: var(--text); border-color: var(--muted); }

.hero-stats { display: flex; gap: 2rem; justify-content: center; flex-wrap: wrap; }
.stat { text-align: center; }
.stat-n { display: block; font-size: 1.8rem; font-weight: 800; color: var(--blue); font-family: var(--font-mono); }
.stat-l { font-size: 0.8rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.stat-sep { width: 1px; background: var(--border); align-self: stretch; }

/* ── sections ──────────────────────────────────────────────── */
.section { padding: 5rem 0; }
.section-dark { background: var(--bg2); }
.section-header { text-align: center; margin-bottom: 3rem; }
.section-header h2 { font-size: 2rem; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 0.5rem; }
.section-header p { color: var(--muted); font-size: 1.05rem; }

/* ── feature grid ──────────────────────────────────────────── */
.feature-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.25rem;
}
.feature-card {
  padding: 1.5rem; border-radius: var(--radius-lg); border: 1px solid var(--border);
  background: var(--bg2); transition: border-color var(--transition), transform var(--transition);
}
.feature-card:hover { border-color: var(--blue); transform: translateY(-2px); }
.feature-icon { font-size: 1.5rem; margin-bottom: 0.75rem; }
.feature-card h3 { font-size: 1.1rem; margin-bottom: 0.5rem; }
.feature-card p { color: var(--muted); font-size: 0.9rem; line-height: 1.6; }

/* ── screenshot tabs ───────────────────────────────────────── */
.screenshot-tabs { display: flex; gap: 0.5rem; justify-content: center; margin-bottom: 2rem; }
.tab-btn {
  padding: 0.5rem 1.2rem; border-radius: 99px; border: 1px solid var(--border);
  background: transparent; color: var(--muted); cursor: pointer; font-size: 0.85rem;
  transition: all var(--transition);
}
.tab-btn.active { background: var(--blue-dim); color: #fff; border-color: var(--blue-dim); }
.tab-btn:hover { color: var(--text); border-color: var(--muted); }
.tab-content { display: none; }
.tab-content.active { display: block; }

.screenshot-wrap { text-align: center; }
.screenshot-wrap img {
  max-width: 100%; border-radius: var(--radius-lg); border: 1px solid var(--border);
  box-shadow: 0 8px 40px rgba(0,0,0,0.4);
}
.screenshot-caption { margin-top: 1rem; color: var(--muted); font-size: 0.9rem; }

/* ── flow steps ────────────────────────────────────────────── */
.flow-steps { max-width: 700px; margin: 0 auto; }
.flow-step {
  display: flex; gap: 1.5rem; padding: 1.5rem 0;
  border-bottom: 1px solid var(--border);
}
.flow-step:last-child { border-bottom: none; }
.step-num {
  font-family: var(--font-mono); font-size: 1.5rem; font-weight: 800;
  color: var(--blue); opacity: 0.4; flex-shrink: 0; width: 2.5rem;
}
.step-body h3 { font-size: 1rem; margin-bottom: 0.4rem; }
.step-body p { color: var(--muted); font-size: 0.9rem; }

/* ── arch diagram ──────────────────────────────────────────── */
.arch-diagram {
  margin-top: 3rem; text-align: center;
}
.arch-diagram pre {
  display: inline-block; text-align: left; padding: 1.5rem 2rem;
  background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius-lg);
  font-family: var(--font-mono); font-size: 0.8rem; color: var(--muted);
  overflow-x: auto;
}

/* ── config sync ───────────────────────────────────────────── */
.sync-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: start; }
.sync-diagram pre {
  padding: 1.5rem 2rem; background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-lg); font-family: var(--font-mono); font-size: 0.85rem;
  color: var(--blue); text-align: center; margin-bottom: 1.5rem;
}
.sync-labels { display: flex; flex-direction: column; gap: 0.5rem; }
.sync-label { font-size: 0.85rem; color: var(--muted); }
.sync-label strong { color: var(--text); }
.sync-fact { margin-bottom: 1.5rem; }
.sync-fact h4 { font-size: 0.95rem; margin-bottom: 0.3rem; }
.sync-fact p { color: var(--muted); font-size: 0.9rem; }
.diff-add { color: var(--green); font-weight: 700; }
.diff-mod { color: var(--blue); font-weight: 700; }
.diff-del { color: var(--red); font-weight: 700; }

/* ── security grid ─────────────────────────────────────────── */
.security-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.25rem;
}
.sec-item {
  padding: 1.25rem; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg2);
}
.sec-item h4 { font-size: 0.95rem; margin-bottom: 0.4rem; }
.sec-item p { color: var(--muted); font-size: 0.85rem; }

/* ── code blocks ───────────────────────────────────────────── */
.doc-block { margin-bottom: 1.5rem; }
.doc-block pre {
  padding: 1.25rem 1.5rem; background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); font-family: var(--font-mono); font-size: 0.82rem;
  line-height: 1.7; overflow-x: auto; color: var(--text);
}
.doc-block pre code { background: none; padding: 0; }
.cm { color: var(--muted); }
.cv { color: var(--orange); }

/* ── footer ────────────────────────────────────────────────── */
footer { padding: 2.5rem 0; border-top: 1px solid var(--border); }
.footer-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; }
.footer-logo { font-weight: 800; }
.footer-links { display: flex; gap: 1.5rem; }
.footer-links a { color: var(--muted); font-size: 0.85rem; }
.footer-note { color: var(--muted); font-size: 0.75rem; width: 100%; text-align: center; margin-top: 0.5rem; }

/* ── reveal animation ──────────────────────────────────────── */
[data-reveal] { opacity: 0; transform: translateY(20px); transition: opacity 0.5s ease, transform 0.5s ease; }
[data-reveal].revealed { opacity: 1; transform: translateY(0); }

/* ── responsive ────────────────────────────────────────────── */
@media (max-width: 768px) {
  .hero-content h1 { font-size: 2.2rem; }
  .hero-tagline { font-size: 1rem; }
  .sync-layout { grid-template-columns: 1fr; }
  .hero-stats { gap: 1rem; }
  .stat-sep { display: none; }
  #nav { padding: 0 1rem; }
  .nav-links { gap: 0.8rem; font-size: 0.8rem; }
}
