:root {
  --bg:        #0b0e14;
  --bg-soft:   #11151f;
  --fg:        #c8d3e0;
  --fg-dim:    #7d8a9c;
  --accent:    #4ade80;
  --accent-2:  #38bdf8;
  --border:    #1e2530;
  --radius:    7px;
  --maxw:      720px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.7;
  letter-spacing: 0.1px;
  -webkit-font-smoothing: antialiased;
  background-image:
    radial-gradient(900px 500px at 85% -5%, rgba(56,189,248,0.06), transparent 70%),
    radial-gradient(700px 500px at 0% 0%, rgba(74,222,128,0.05), transparent 60%);
  background-attachment: fixed;
}

/* very subtle CRT scanlines — cosmetic, non-intrusive */
.scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255,255,255,0.012) 0px,
    rgba(255,255,255,0.012) 1px,
    transparent 1px,
    transparent 3px
  );
  mix-blend-mode: overlay;
}

/* ---------- layout ---------- */
.site-header, .content, .site-footer {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding-left: 1.4rem;
  padding-right: 1.4rem;
}

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.6rem 1.2rem;
  padding-top: 2.2rem;
  padding-bottom: 1.4rem;
  border-bottom: 1px solid var(--border);
}

.prompt {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--fg);
  white-space: nowrap;
}
.prompt .user   { color: var(--accent); }
.prompt .path   { color: var(--fg-dim); }
.prompt .cmd    { color: var(--fg); margin-left: 0.4ch; }
.prompt .cursor {
  color: var(--accent);
  animation: blink 1.1s steps(1) infinite;
  margin-left: 1px;
}
@keyframes blink { 50% { opacity: 0; } }

.site-nav {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.9rem;
  display: flex;
  gap: 1.1rem;
  flex-wrap: wrap;
}
.site-nav a {
  color: var(--fg-dim);
  text-decoration: none;
  position: relative;
  transition: color 0.15s ease;
}
.site-nav a:hover { color: var(--accent); }
.site-nav a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -3px;
  width: 0; height: 1px;
  background: var(--accent);
  transition: width 0.18s ease;
}
.site-nav a:hover::after { width: 100%; }

/* ---------- content ---------- */
.content {
  padding-top: 2.6rem;
  padding-bottom: 3rem;
  min-height: 60vh;
}

h1, h2, h3 {
  font-family: "IBM Plex Mono", monospace;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.2px;
}
h1 { font-size: 1.9rem; margin: 0 0 1.2rem; }
h2 {
  font-size: 1.25rem;
  margin: 2.6rem 0 0.9rem;
  color: var(--fg);
}
h2::before {
  content: "## ";
  color: var(--accent);
  opacity: 0.7;
}
h3 { font-size: 1.05rem; margin: 2rem 0 0.7rem; }
h3::before { content: "### "; color: var(--accent-2); opacity: 0.7; }

p { margin: 0 0 1.1rem; }

a {
  color: var(--accent-2);
  text-decoration: none;
  border-bottom: 1px solid rgba(56,189,248,0.3);
  transition: border-color 0.15s ease, color 0.15s ease;
}
a:hover { color: var(--accent); border-color: var(--accent); }

ul { padding-left: 1.3rem; margin: 0 0 1.2rem; }
li { margin: 0.35rem 0; }
li::marker { color: var(--accent); }

code {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.86em;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.1em 0.4em;
}

blockquote {
  margin: 1.4rem 0;
  padding: 0.4rem 1.1rem;
  border-left: 3px solid var(--accent);
  background: var(--bg-soft);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--fg);
  font-style: italic;
}

img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
a:has(img) { border: none; }

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.4rem 0;
}

.muted { color: var(--fg-dim); font-weight: 400; }

/* ---------- post / page bits ---------- */
.post-meta {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.85rem;
  color: var(--fg-dim);
  margin: -0.6rem 0 1.8rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  align-items: center;
}

.post-list { list-style: none; padding: 0; }
.post-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 0.7rem;
  padding: 0.45rem 0;
  border-bottom: 1px dashed var(--border);
}
.post-list li > a:first-child { font-weight: 500; }
.post-date {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.8rem;
  color: var(--fg-dim);
}

.tag, .tag-cloud a {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.78rem;
  color: var(--accent);
  background: rgba(74,222,128,0.08);
  border: 1px solid rgba(74,222,128,0.25);
  border-radius: 999px;
  padding: 0.05rem 0.55rem;
  text-decoration: none;
}
.tag:hover, .tag-cloud a:hover {
  background: rgba(74,222,128,0.16);
  border-color: var(--accent);
  color: var(--accent);
}
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.back {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.9rem;
  border: none;
}

.linktree { list-style: none; padding: 0; }
.linktree li { margin: 0.3rem 0; }

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding-top: 1.4rem;
  padding-bottom: 2.4rem;
  margin-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.6rem 1.2rem;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.82rem;
  color: var(--fg-dim);
}
.site-footer a { color: var(--fg-dim); border: none; }
.site-footer a:hover { color: var(--accent); }
.footer-links { display: flex; gap: 1rem; }

/* ---------- entrance animation ---------- */
.content > * {
  animation: rise 0.5s ease both;
}
.content > *:nth-child(2) { animation-delay: 0.04s; }
.content > *:nth-child(3) { animation-delay: 0.08s; }
.content > *:nth-child(4) { animation-delay: 0.12s; }
@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .content > *, .prompt .cursor { animation: none; }
}

@media (max-width: 540px) {
  body { font-size: 16px; }
  h1 { font-size: 1.55rem; }
  .site-header { padding-top: 1.6rem; }
}
