:root {
  --bg: #0b0d12;
  --bg-soft: #12151d;
  --bg-card: #171b26;
  --border: #232a3a;
  --text: #e7ecf5;
  --text-dim: #9aa6bd;
  --accent: #6c8cff;
  --accent-2: #9a5cff;
  --accent-green: #34d399;
  --radius: 14px;
  --max: 1120px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 20px; }

/* Nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11, 13, 18, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.nav-logo { font-weight: 800; font-size: 1.2rem; letter-spacing: -0.02em; color: var(--text); }
.nav-logo span { color: var(--accent); }
.nav-links { display: flex; gap: 26px; align-items: center; }
.nav-links a { color: var(--text-dim); font-weight: 500; font-size: 0.95rem; transition: color 0.15s; }
.nav-links a:hover { color: var(--text); text-decoration: none; }
.nav-links a.active { color: var(--accent); }
.nav-toggle { display: none; background: none; border: none; color: var(--text); font-size: 1.5rem; cursor: pointer; }

/* Hero */
.hero { padding: 96px 0 64px; text-align: center; }
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1.15; margin-bottom: 16px; }
.hero .grad {
  background: linear-gradient(100deg, var(--accent), var(--accent-2) 60%, var(--accent-green));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero p { color: var(--text-dim); font-size: clamp(1rem, 2vw, 1.2rem); max-width: 640px; margin: 0 auto 32px; }
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.btn {
  display: inline-block; padding: 12px 24px; border-radius: 999px; font-weight: 600; font-size: 0.95rem;
  transition: transform 0.15s, box-shadow 0.15s;
}
.btn-primary { background: linear-gradient(100deg, var(--accent), var(--accent-2)); color: #fff; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(108, 140, 255, 0.35); text-decoration: none; }
.btn-ghost { border: 1px solid var(--border); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent); transform: translateY(-2px); text-decoration: none; }

/* Sections */
.section { padding: 56px 0; }
.section-head { margin-bottom: 32px; }
.section-head h2 { font-size: 1.8rem; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 8px; }
.section-head p { color: var(--text-dim); max-width: 560px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; transition: transform 0.15s, border-color 0.15s; display: flex; flex-direction: column; gap: 10px;
}
.card:hover { transform: translateY(-3px); border-color: var(--accent); }
.card h3 { font-size: 1.1rem; font-weight: 650; }
.card p { color: var(--text-dim); font-size: 0.92rem; flex: 1; }
.card .tag { align-self: flex-start; background: rgba(108, 140, 255, 0.12); color: var(--accent); font-size: 0.74rem; font-weight: 650; padding: 4px 10px; border-radius: 999px; }
.card a.link { font-size: 0.9rem; font-weight: 600; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin-top: 40px; }
.stat { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; text-align: center; }
.stat .num { font-size: 1.8rem; font-weight: 800; color: var(--accent); }
.stat .lbl { color: var(--text-dim); font-size: 0.88rem; }

/* Tools page */
.toolbar { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 28px; align-items: center; }
.search { flex: 1 1 260px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 999px; padding: 11px 18px; color: var(--text); font-size: 0.95rem; outline: none; transition: border-color 0.15s; }
.search:focus { border-color: var(--accent); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  padding: 8px 16px; border-radius: 999px; border: 1px solid var(--border); background: var(--bg-card);
  color: var(--text-dim); font-size: 0.85rem; font-weight: 600; cursor: pointer; transition: all 0.15s;
}
.chip:hover { border-color: var(--accent); color: var(--text); }
.chip.active { background: linear-gradient(100deg, var(--accent), var(--accent-2)); color: #fff; border-color: transparent; }
.empty { text-align: center; color: var(--text-dim); padding: 40px 0; }

/* Blog */
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.post { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; transition: transform 0.15s, border-color 0.15s; }
.post:hover { transform: translateY(-3px); border-color: var(--accent); }
.post-body { padding: 20px 24px; display: flex; flex-direction: column; gap: 10px; }
.post .meta { color: var(--text-dim); font-size: 0.8rem; }
.post h3 { font-size: 1.15rem; }
.post p { color: var(--text-dim); font-size: 0.92rem; }

/* Article */
.article { max-width: 760px; margin: 0 auto; padding: 48px 20px 80px; }
.article h1 { font-size: 2rem; letter-spacing: -0.02em; margin-bottom: 8px; }
.article .meta { color: var(--text-dim); font-size: 0.9rem; margin-bottom: 24px; }
.article h2 { font-size: 1.4rem; margin: 32px 0 12px; }
.article p { margin-bottom: 16px; color: #c9d2e3; }
.article ul, .article ol { margin: 0 0 16px 24px; color: #c9d2e3; }
.article li { margin-bottom: 6px; }
.article pre { background: #0d1017; border: 1px solid var(--border); border-radius: 10px; padding: 16px; overflow-x: auto; margin-bottom: 16px; }
.article code { font-family: "Cascadia Code", Consolas, monospace; font-size: 0.9rem; }

/* Resources */
.res-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.res-row { display: flex; flex-direction: column; gap: 14px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.res-row:last-child { border-bottom: none; }
.res-row h4 { font-size: 1rem; }
.res-row p { color: var(--text-dim); font-size: 0.9rem; }
.res-list { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.res-list li a { display: inline-flex; align-items: center; gap: 8px; color: var(--text); font-size: 0.92rem; }
.res-list li a::before { content: "→"; color: var(--accent); }

/* Footer */
.footer { margin-top: auto; border-top: 1px solid var(--border); padding: 32px 0; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; color: var(--text-dim); font-size: 0.88rem; }

@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .nav-links {
    display: none; position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; gap: 0;
    background: var(--bg-soft); border-bottom: 1px solid var(--border); padding: 8px 0;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px 20px; width: 100%; }
  .hero { padding: 64px 0 40px; }
}