:root {
  --bg:        #0a0e18;
  --bg-2:      #0d1422;
  --ink:       #e6e9f2;
  --muted:     #8b94ad;
  --accent:    #5bb8ff;  /* matches logo blue glow */
  --accent-2:  #c9d4ff;
  --glow:      #5b7cff;
  --hairline:  rgba(230, 233, 242, 0.12);
  --code-bg:   #0c1220;
  --font-body: "Adwaita Sans", "Noto Sans", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Adwaita Sans", "Noto Sans", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "DejaVu Sans Mono", "Cascadia Mono", "SFMono-Regular", "Liberation Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* starfield */
.stars {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    radial-gradient(1px 1px at 23% 17%, rgba(255,255,255,0.8), transparent 60%),
    radial-gradient(1px 1px at 71% 42%, rgba(255,255,255,0.6), transparent 60%),
    radial-gradient(1.5px 1.5px at 44% 81%, rgba(255,255,255,0.7), transparent 60%),
    radial-gradient(1px 1px at 88% 12%, rgba(255,255,255,0.5), transparent 60%),
    radial-gradient(1px 1px at 12% 64%, rgba(255,255,255,0.6), transparent 60%),
    radial-gradient(1.5px 1.5px at 63% 28%, rgba(255,255,255,0.8), transparent 60%),
    radial-gradient(1px 1px at 31% 53%, rgba(255,255,255,0.4), transparent 60%),
    radial-gradient(1px 1px at 82% 78%, rgba(255,255,255,0.7), transparent 60%),
    radial-gradient(1px 1px at 5% 34%, rgba(255,255,255,0.5), transparent 60%),
    radial-gradient(1px 1px at 96% 58%, rgba(255,255,255,0.6), transparent 60%);
}

.glow {
  position: fixed;
  top: -10%;
  left: 50%;
  transform: translateX(-50%);
  width: 820px;
  height: 820px;
  max-width: 120vw;
  background: radial-gradient(circle, rgba(91,184,255,0.18) 0%, rgba(91,124,255,0.06) 35%, transparent 65%);
  filter: blur(20px);
  pointer-events: none;
  z-index: 0;
}

/* ----- NAV ----- */
nav {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.75rem 3rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

nav .brand {
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
}
nav .brand::before {
  content: "";
  display: inline-block;
  width: 8px; height: 8px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--accent);
}

nav .actions {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

nav .stack-label { color: var(--muted); }

.btn-home {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--hairline);
  background: rgba(230, 233, 242, 0.02);
  padding: 0.5rem 1.1rem;
  border-radius: 2px;
  text-decoration: none;
  transition: all 0.25s cubic-bezier(.2,.8,.2,1);
}
.btn-home:hover {
  border-color: var(--accent);
  box-shadow: 0 0 24px rgba(91,184,255,0.25);
  transform: translateY(-1px);
}

/* ----- MAIN ----- */
main {
  position: relative;
  z-index: 2;
  flex: 1;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

/* ----- HOME / POST LIST ----- */
.home-header {
  margin-bottom: 2.75rem;
  padding-bottom: 1.75rem;
  border-bottom: 1px solid var(--hairline);
}

.home-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  letter-spacing: -0.01em;
  line-height: 1.1;
}

.home-tagline {
  margin-top: 0.75rem;
  color: var(--muted);
  font-size: 1.05rem;
}

.post-list { list-style: none; }

.post-list-item {
  padding: 1.6rem 0;
  border-bottom: 1px solid var(--hairline);
}

.post-list-link {
  display: flex;
  align-items: baseline;
  gap: 1.1rem;
  text-decoration: none;
  color: var(--ink);
}

.post-list-date {
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: 0.2rem;
  min-width: 5.5rem;
}

.post-list-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 500;
  line-height: 1.3;
  transition: color 0.2s;
}
.post-list-link:hover .post-list-title { color: var(--accent); }

.post-list-excerpt {
  margin-top: 0.55rem;
  margin-left: 6.6rem;
  color: var(--muted);
  font-size: 0.96rem;
}

/* ----- POST ----- */
.post-header {
  margin-bottom: 2.5rem;
  padding-bottom: 1.75rem;
  border-bottom: 1px solid var(--hairline);
}

.post-back {
  display: inline-block;
  margin-bottom: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}
.post-back:hover { color: var(--accent); }

.post-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.9rem, 4.2vw, 2.7rem);
  line-height: 1.12;
  letter-spacing: -0.01em;
}

.post-meta {
  margin-top: 0.9rem;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ----- ARTICLE TYPOGRAPHY ----- */
.post-content { font-size: 1.05rem; }

.post-content > * + * { margin-top: 1.25rem; }

.post-content h2,
.post-content h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.25;
  margin-top: 2.5rem;
}
.post-content h2 { font-size: 1.5rem; }
.post-content h3 { font-size: 1.2rem; }

.post-content a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(91,184,255,0.35);
  transition: border-color 0.2s;
}
.post-content a:hover { border-color: var(--accent); }

.post-content strong { color: var(--accent-2); font-weight: 600; }
.post-content em { color: var(--accent-2); }

.post-content ul,
.post-content ol { padding-left: 1.4rem; }
.post-content li + li { margin-top: 0.4rem; }
.post-content li::marker { color: var(--accent); }

.post-content blockquote {
  border-left: 2px solid var(--accent);
  padding: 0.4rem 0 0.4rem 1.25rem;
  color: var(--accent-2);
  font-style: italic;
}

.post-content hr {
  border: 0;
  border-top: 1px solid var(--hairline);
  margin: 2.5rem 0;
}

.post-content img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}

/* ----- CODE ----- */
.post-content code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--code-bg);
  border: 1px solid var(--hairline);
  border-radius: 3px;
  padding: 0.12em 0.4em;
}

.post-content pre {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.6;
  background: var(--code-bg);
  border: 1px solid var(--hairline);
  border-radius: 6px;
  padding: 1.1rem 1.25rem;
  overflow-x: auto;
}
.post-content pre code {
  background: none;
  border: 0;
  padding: 0;
  font-size: inherit;
}

/* Rouge syntax highlighting (lunar dark) */
.highlight .c, .highlight .c1, .highlight .cm, .highlight .cs,
.highlight .cd { color: #6b7693; font-style: italic; }
.highlight .cp { color: #6b7693; }
.highlight .k, .highlight .kd, .highlight .kn, .highlight .kp,
.highlight .kr, .highlight .kv { color: #b79bff; }
.highlight .kt { color: #5bb8ff; }
.highlight .o, .highlight .ow { color: #9fb0d6; }
.highlight .s, .highlight .s1, .highlight .s2, .highlight .sb,
.highlight .sc, .highlight .sd, .highlight .se, .highlight .sh,
.highlight .si, .highlight .sx, .highlight .sr, .highlight .dl { color: #7fd6a3; }
.highlight .m, .highlight .mi, .highlight .mf, .highlight .mh,
.highlight .mo, .highlight .il { color: #ffb487; }
.highlight .nf, .highlight .fm { color: #5bb8ff; }
.highlight .nc, .highlight .nn { color: #ffd479; }
.highlight .no, .highlight .nb, .highlight .bp { color: #c9d4ff; }
.highlight .na { color: #7fd6a3; }
.highlight .nt { color: #b79bff; }
.highlight .nv, .highlight .vi, .highlight .vg, .highlight .vc { color: #e6e9f2; }
.highlight .p, .highlight .pi { color: #9fb0d6; }
.highlight .err { color: #ff9aa2; }
.highlight .gd { color: #ff9aa2; }
.highlight .gi { color: #7fd6a3; }

/* ----- FOOTER ----- */
footer {
  position: relative;
  z-index: 2;
  padding: 2rem 3rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--hairline);
  gap: 1rem;
  flex-wrap: wrap;
}

footer .status::before {
  content: "\25CF";
  color: #5bd48f;
  margin-right: 0.5rem;
  animation: pulse 2s ease-in-out infinite;
}

footer .license a {
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px dotted var(--hairline);
  transition: color 0.2s;
}
footer .license a:hover { color: var(--accent); }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.4; }
}

/* ----- RESPONSIVE ----- */
@media (max-width: 720px) {
  nav { padding: 1.25rem 1.25rem; font-size: 0.7rem; }
  nav .actions { gap: 0.8rem; }
  nav .stack-label { display: none; }
  .btn-home { padding: 0.45rem 0.9rem; font-size: 0.7rem; }
  main { padding: 1.75rem 1.25rem 3rem; }

  .post-list-link { flex-direction: column; gap: 0.3rem; }
  .post-list-date { padding-top: 0; min-width: 0; }
  .post-list-excerpt { margin-left: 0; }

  footer {
    justify-content: center;
    text-align: center;
    padding: 1.5rem;
    font-size: 0.68rem;
  }
}
