/* ===== Theme ===== */
:root{
  --bg:#0b1020;
  --panel:rgba(255,255,255,.06);
  --panel2:rgba(255,255,255,.10);
  --text:#e8eefc;
  --muted:rgba(232,238,252,.72);
  --border:rgba(255,255,255,.14);
  --shadow:rgba(0,0,0,.30);
  --accent:#7c5cff;
  --codebg:rgba(0,0,0,.35);
}

:root[data-theme="light"]{
  --bg:#f7f7fb;
  --panel:rgba(0,0,0,.04);
  --panel2:rgba(0,0,0,.06);
  --text:#0d1220;
  --muted:rgba(13,18,32,.70);
  --border:rgba(0,0,0,.12);
  --shadow:rgba(0,0,0,.10);
  --accent:#5a44ff;
  --codebg:rgba(0,0,0,.06);
}

/* ===== Base ===== */
*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}
a{ color:inherit; }
.muted{ color:var(--muted); }
.small{ font-size:.92rem; }

.container{
  width: min(980px, calc(100% - 28px));
  margin: 0 auto;
  padding: 18px 0 36px;
}

/* ===== Topbar ===== */
.topbar{
  position: sticky;
  top:0;
  z-index:50;
  display:flex;
  align-items:center;
  gap:10px;
  padding: 12px 14px;
  border-bottom:1px solid var(--border);
  background: rgba(10,14,28,.70);
  backdrop-filter: blur(10px);
}
:root[data-theme="light"] .topbar{
  background: rgba(247,247,251,.85);
}

.brand{
  text-decoration:none;
  font-weight:800;
  letter-spacing:.2px;
  margin-right:auto;
}
.brand span{ color:var(--accent); }

.nav{
  display:flex;
  gap:8px;
  align-items:center;
}
.nav a{
  text-decoration:none;
  color:var(--muted);
  padding:8px 10px;
  border-radius:10px;
  border:1px solid transparent;
}
.nav a:hover{
  color:var(--text);
  border-color:var(--border);
  background: var(--panel);
}
.nav a.active{
  color:var(--text);
  border-color:var(--border);
  background: var(--panel2);
}

.menuBtn{ display:none; }

/* Mobile nav */
@media (max-width: 760px){
  .menuBtn{ display:inline-flex; }
  .nav{
    display:none;
    position:absolute;
    left:14px;
    right:14px;
    top:56px;
    padding:10px;
    border:1px solid var(--border);
    background: rgba(10,14,28,.92);
    border-radius:14px;
    flex-direction:column;
    align-items:stretch;
    gap:6px;
  }
  :root[data-theme="light"] .nav{ background: rgba(247,247,251,.95); }
  .nav.open{ display:flex; }
  .nav a{ padding:10px 12px; }
}

/* ===== Layout helpers ===== */
.row{ display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.between{ justify-content:space-between; }
.stack{ display:flex; flex-direction:column; gap:14px; }

.hero{
  padding: 16px 0 8px;
  margin-bottom: 10px;
}
.hero h1{
  margin: 0 0 8px;
  font-size: clamp(1.6rem, 2.5vw, 2.2rem);
  letter-spacing: -0.02em;
}
.hero p{ margin: 0 0 12px; max-width: 60ch; }

.pageHead{ margin: 8px 0 16px; }
.pageHead h1{
  margin:0 0 6px;
  font-size: clamp(1.4rem, 2vw, 1.9rem);
}

.grid{
  display:grid;
  gap:14px;
  grid-template-columns: repeat(3, 1fr);
}
@media (max-width: 980px){
  .grid{ grid-template-columns: 1fr; }
}

/* ===== Cards & text ===== */
.card{
  background: var(--panel);
  border:1px solid var(--border);
  border-radius:16px;
  box-shadow: 0 12px 28px var(--shadow);
  padding:16px;
}
.kicker{
  font-size:.78rem;
  letter-spacing:.12em;
  text-transform:uppercase;
  color:var(--muted);
  margin-bottom:10px;
}
.h2{
  margin: 0 0 10px;
  font-size: 1.25rem;
}
p{ line-height:1.6; }
p:last-child{ margin-bottom:0; }

/* ===== Buttons ===== */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding:10px 14px;
  border-radius:12px;
  border:1px solid var(--border);
  background: rgba(124,92,255,.18);
  color: var(--text);
  text-decoration:none;
  cursor:pointer;
  user-select:none;
}
.btn:hover{ border-color: rgba(124,92,255,.45); }
.btn.ghost{
  background: var(--panel);
}
.btn.ghost:hover{
  background: var(--panel2);
}

/* ===== Search ===== */
.search{
  width: min(520px, 100%);
  padding: 11px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  outline: none;
}
.search:focus{
  border-color: rgba(124,92,255,.50);
}

/* ===== Code ===== */
.code{
  margin: 12px 0 0;
  background: var(--codebg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  overflow:auto;
}
code{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.95rem;
  line-height: 1.45;
}
p code{
  padding: 2px 6px;
  border-radius: 8px;
  background: var(--codebg);
  border: 1px solid var(--border);
}

/* ===== Lists ===== */
.bullets{
  margin:0;
  padding-left:18px;
  color:var(--muted);
}
.bullets li{ margin:6px 0; }

/* ===== Footer ===== */
.footer{
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

