:root{
  --bg: #101113;
  --bg-elevated: #17181c;
  --bg-elevated-hover: #1e2024;
  --border: #26282d;
  --border-bright: #34363c;
  --text: #e7e8ea;
  --text-dim: #8b8d93;
  --accent: #5b53f5;
  --accent-strong: #766fff;
  --accent-soft: rgba(91,83,245,0.14);
  --sans: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'Geist Mono', ui-monospace, monospace;
  --sidebar-w: 232px;
}

*{ box-sizing: border-box; }

html, body{
  margin:0; padding:0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

a{ color: inherit; }

.layout{ display:flex; min-height: 100vh; }

/* ---------- sidebar ---------- */
.sidebar{
  width: var(--sidebar-w);
  flex-shrink:0;
  border-right: 1px solid var(--border);
  padding: 24px 14px;
  display:flex;
  flex-direction:column;
  justify-content: space-between;
  position: sticky;
  top:0;
  height: 100vh;
}

.brand{
  display:flex;
  align-items:center;
  gap:10px;
  padding: 4px 10px 22px;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.01em;
  text-decoration:none;
}

.brand .dot{
  width:9px; height:9px; border-radius:50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.nav-list{ list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap: 2px; }

.nav-link{
  display:flex; align-items:center; gap: 12px;
  padding: 9px 10px; border-radius: 8px;
  text-decoration:none; color: var(--text-dim);
  font-size: 13.5px; font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-link svg{ flex-shrink:0; opacity: 0.85; }

.nav-link:hover, .nav-link:focus-visible{ background: var(--bg-elevated); color: var(--text); }
.nav-link:focus-visible{ outline: 2px solid var(--accent); outline-offset: -2px; }

.nav-link.is-active{ background: var(--accent-soft); color: var(--accent-strong); }
.nav-link.is-active svg{ opacity: 1; }

.sidebar-footer{ display:flex; flex-direction:column; gap: 12px; padding: 0 10px; }
.sidebar-social{ display:flex; gap: 8px; }

.sidebar-social a{
  width: 30px; height:30px;
  display:flex; align-items:center; justify-content:center;
  border-radius: 7px; color: var(--text-dim);
  transition: background 0.15s ease, color 0.15s ease;
}

.sidebar-social a:hover{ background: var(--bg-elevated); color: var(--text); }

.sidebar-copyright{ font-size: 11.5px; color: var(--text-dim); }

/* ---------- main ---------- */
.main{ flex:1; min-width:0; padding: 64px 56px 48px; max-width: 900px; }

.eyebrow{
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--accent-strong);
  display:flex; align-items:center; gap:8px; margin-bottom: 18px;
}

.pulse{
  width:7px; height:7px; border-radius:50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 var(--accent-soft);
  animation: pulse 2.4s infinite;
}

@keyframes pulse{
  0%{ box-shadow: 0 0 0 0 rgba(91,83,245,0.45); }
  70%{ box-shadow: 0 0 0 8px rgba(91,83,245,0); }
  100%{ box-shadow: 0 0 0 0 rgba(91,83,245,0); }
}

h1{ font-size: 42px; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 10px; }
h2{ font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-dim); font-weight: 600; margin:0; }

.tagline{ font-size: 16px; color: var(--text-dim); margin: 0 0 24px; max-width: 52ch; line-height: 1.6; }
.about{ font-size: 15.5px; line-height: 1.75; color: var(--text); margin: 0 0 36px; max-width: 58ch; }
.about b{ color: var(--accent-strong); font-weight: 600; }

section{ margin-bottom: 44px; }

.section-head{ display:flex; align-items:baseline; justify-content: space-between; margin-bottom: 16px; }

.card-grid{ display:grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }

.card{
  background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 14px;
  padding: 18px 18px 16px; text-decoration:none; display:flex; flex-direction:column; gap: 14px;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.card:hover, .card:focus-visible{ border-color: var(--border-bright); background: var(--bg-elevated-hover); transform: translateY(-2px); }
.card:focus-visible{ outline: 2px solid var(--accent); outline-offset: 2px; }

.card-icon{
  width: 38px; height:38px; border-radius: 10px;
  display:flex; align-items:center; justify-content:center;
  background: var(--accent-soft); color: var(--accent-strong);
}

.card-title{ font-size: 15px; font-weight: 600; margin:0; }
.card-sub{ font-family: var(--mono); font-size: 12px; color: var(--text-dim); margin-top: 2px; }

footer{
  margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--border);
  display:flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  font-size: 12.5px; color: var(--text-dim);
}

footer a{ color: var(--text-dim); text-decoration: none; border-bottom: 1px dotted var(--border-bright); }
footer a:hover{ color: var(--accent-strong); border-color: var(--accent-strong); }

/* ---------- blog list ---------- */
.post-list{ list-style:none; margin:0; padding:0; display:flex; flex-direction:column; }

.post-list li{ border-bottom: 1px solid var(--border); padding: 20px 0; }
.post-list li:first-child{ padding-top: 0; }

.post-list a{ text-decoration:none; }
.post-list h3{ margin: 0 0 6px; font-size: 18px; font-weight: 600; }
.post-list h3:hover{ color: var(--accent-strong); }

.post-date{ font-family: var(--mono); font-size: 12px; color: var(--text-dim); }
.post-excerpt{ margin: 8px 0 0; color: var(--text-dim); font-size: 14.5px; line-height: 1.6; }

/* ---------- single post / prose pages ---------- */
.prose{ font-size: 15.5px; line-height: 1.8; max-width: 62ch; }
.prose h2{ text-transform:none; letter-spacing:0; color: var(--text); font-size: 22px; margin: 32px 0 12px; }
.prose h3{ color: var(--text); font-size: 18px; margin: 24px 0 10px; }
.prose p{ margin: 0 0 16px; color: var(--text); }
.prose a{ color: var(--accent-strong); }
.prose code{
  font-family: var(--mono); font-size: 0.9em; background: var(--bg-elevated);
  border: 1px solid var(--border); padding: 2px 6px; border-radius: 5px;
}
.prose pre{
  background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 10px;
  padding: 16px; overflow-x:auto;
}
.prose pre code{ border:none; padding:0; background:none; }
.prose ul, .prose ol{ margin: 0 0 16px; padding-left: 22px; color: var(--text); }
.prose blockquote{
  margin: 0 0 16px; padding: 4px 16px; border-left: 3px solid var(--accent);
  color: var(--text-dim);
}

.prose img{ max-width: 100%; height: auto; border-radius: 10px; }

.back-link{
  display:inline-flex; align-items:center; gap:6px;
  font-size: 13px; color: var(--text-dim); text-decoration:none; margin-bottom: 24px;
}
.back-link:hover{ color: var(--accent-strong); }

/* ---------- mobile ---------- */
@media (max-width: 860px){
  .sidebar{
    position: static; height:auto; width: 100%;
    flex-direction: row; align-items:center; padding: 12px 16px; overflow-x:auto;
  }
  .sidebar-footer{ display:none; }
  .brand{ padding: 4px 12px 4px 0; flex-shrink:0; }
  .nav-list{ flex-direction:row; gap:4px; }
  .nav-link span{ display:none; }
  .nav-link{ padding: 8px; }
  .layout{ flex-direction: column; }
  .main{ padding: 32px 22px 40px; }
  h1{ font-size: 32px; }
}

@media (max-width: 520px){
  .card-grid{ grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce){
  .pulse{ animation:none; }
}
