:root {
  /* ANSI color palette */
  --bg: #0a0a0a;
  --bg-panel: #111111;
  --bg-panel-hover: #161616;
  --bg-hover: #1a1a1a;
  --fg: #c0c0c0;
  --fg-bright: #ffffff;
  --fg-dim: #666666;
  --accent: #00aa00;
  --accent-bright: #00ff00;
  --accent-cyan: #00aaaa;
  --accent-cyan-bright: #00ffff;
  --accent-yellow: #aaaa00;
  --accent-yellow-bright: #ffff00;
  --accent-red: #aa0000;
  --accent-blue: #0000aa;
  --accent-blue-bright: #5555ff;
  --accent-magenta: #aa00aa;
  --accent-magenta-bright: #ff00ff;
  --border: #2a3a2a;
  --border-bright: #3a5a3a;
  --border-accent: #006600;

  /* Gradients */
  --grad-accent: linear-gradient(135deg, #00ff00, #00aaaa);
  --grad-accent-subtle: linear-gradient(135deg, rgba(0,255,0,0.12), rgba(0,170,170,0.12));
  --grad-hero-glow: radial-gradient(ellipse at center, rgba(0,255,0,0.12) 0%, rgba(0,170,170,0.06) 40%, transparent 70%);
  --grad-card: linear-gradient(180deg, rgba(0,170,0,0.04), transparent);
  --grad-card-hover: linear-gradient(180deg, rgba(0,170,0,0.10), rgba(0,170,170,0.05));
  --grad-divider: linear-gradient(90deg, transparent, rgba(0,255,0,0.5), rgba(0,170,170,0.5), transparent);

  /* Shadows / glows */
  --glow-green: 0 0 20px rgba(0, 255, 0, 0.2);
  --glow-cyan: 0 0 20px rgba(0, 170, 170, 0.2);
  --glow-green-strong: 0 0 30px rgba(0, 255, 0, 0.3);
  --shadow-card: 0 4px 12px rgba(0, 0, 0, 0.5);
  --shadow-card-hover: 0 6px 24px rgba(0, 0, 0, 0.6), 0 0 20px rgba(0, 170, 0, 0.2);

  /* Fonts */
  --font-mono: "JetBrains Mono", "Fira Code", "DejaVu Sans Mono", "Cascadia Code", monospace;
  --font-size: 15px;
  --line-height: 1.6;
}

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

html {
  font-size: var(--font-size);
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-mono);
  line-height: var(--line-height);
  max-width: 100%;
}

/* Scanline effect */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 255, 0, 0.025) 2px,
    rgba(0, 255, 0, 0.025) 4px
  );
  pointer-events: none;
  z-index: 9999;
}

/* CRT glow */
body::after {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(
    ellipse at center,
    transparent 60%,
    rgba(0, 0, 0, 0.15) 100%
  );
  pointer-events: none;
  z-index: 9998;
}

a {
  color: var(--accent-cyan);
  text-decoration: none;
  transition: color 0.15s, text-shadow 0.15s;
}

a:hover {
  color: var(--accent-cyan-bright);
  text-decoration: underline;
  text-shadow: 0 0 6px rgba(0, 170, 170, 0.3);
}

/* Layout */
.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Header */
.site-header {
  border-bottom: 1px solid var(--border-bright);
  border-bottom: 1px solid rgba(0, 170, 0, 0.3);
  background: var(--bg-panel);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 0 rgba(0, 255, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.4);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.site-title {
  font-size: 1.2rem;
  font-weight: bold;
  background: var(--grad-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 6px rgba(0, 255, 0, 0.2));
}

.site-title a {
  background: var(--grad-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-decoration: none;
}

.site-title a:hover {
  background: var(--grad-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-decoration: none;
  filter: drop-shadow(0 0 8px rgba(0, 255, 0, 0.3));
}

.site-nav {
  display: flex;
  gap: 1.5rem;
}

.site-nav a {
  color: var(--fg);
  font-size: 0.9rem;
  padding: 0.25rem 0.5rem;
  border-radius: 3px;
  transition: color 0.15s, background 0.15s;
}

.site-nav a:hover {
  color: var(--accent-bright);
  background: var(--bg-hover);
}

.site-nav a.active {
  color: var(--accent-bright);
  background: var(--bg-hover);
  box-shadow: inset 0 -2px 0 var(--accent);
}

/* Main content */
main {
  padding: 4rem 0;
  min-height: calc(100vh - 200px);
}

/* Headings */
h1, h2, h3, h4 {
  color: var(--fg-bright);
  margin-bottom: 1rem;
}

h1 {
  font-size: 2.2rem;
  background: var(--grad-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: none;
  filter: drop-shadow(0 0 20px rgba(0, 255, 0, 0.3));
}

h2 {
  font-size: 1.6rem;
  color: var(--accent-cyan);
  margin-top: 2.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(0, 170, 170, 0.25);
}

h3 {
  font-size: 1.2rem;
  color: var(--accent-yellow);
  margin-top: 1.5rem;
}

/* Hero section glow */
main > .container > .ansi-art:first-child,
main > .container > h1:first-child {
  position: relative;
}

main > .container {
  position: relative;
  overflow: hidden;
}

main > .container::before {
  content: "";
  position: absolute;
  top: -2rem;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 800px;
  height: 400px;
  background: var(--grad-hero-glow);
  pointer-events: none;
  z-index: -1;
}

/* Section divider */
h2::after {
  content: "";
  display: block;
  width: 100%;
  height: 2px;
  background: var(--grad-divider);
  margin-top: 0.5rem;
  opacity: 0.7;
}

p {
  margin-bottom: 1rem;
}

ul, ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

li {
  margin-bottom: 0.5rem;
}

/* Code blocks */
code {
  background: var(--bg-panel);
  color: var(--accent-bright);
  padding: 0.15rem 0.35rem;
  border-radius: 3px;
  font-size: 0.9em;
  border: 1px solid var(--border);
}

pre {
  background: var(--bg-panel);
  border: 1px solid var(--border-bright);
  border-left: 2px solid var(--accent);
  border-radius: 6px;
  padding: 1rem;
  overflow-x: auto;
  max-width: 100%;
  margin-bottom: 1.5rem;
  line-height: 1.4;
  box-shadow: inset 0 1px 0 rgba(0, 255, 0, 0.04);
}

pre code {
  background: none;
  color: var(--fg);
  padding: 0;
  font-size: 0.85rem;
  border: none;
}

/* Terminal window */
.terminal {
  background: var(--bg-panel);
  border: 1px solid var(--border-bright);
  border-top: 1px solid rgba(0, 170, 170, 0.2);
  border-radius: 6px;
  margin: 2rem 0;
  overflow: hidden;
  box-shadow: var(--shadow-card), 0 0 1px rgba(0, 255, 0, 0.1);
}

.terminal-header {
  background: #1a1a1a;
  padding: 0.5rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.terminal-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}

.terminal-dot.red { background: #ff5555; }
.terminal-dot.yellow { background: #ffaa00; }
.terminal-dot.green { background: #00ff00; }

.terminal-title {
  margin-left: 0.5rem;
  color: var(--fg-dim);
  font-size: 0.85rem;
}

.terminal-body {
    padding: 1.5rem;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    line-height: 1.5;
    white-space: pre;
    color: var(--fg);
    overflow-x: auto;
}

/* ANSI art blocks */
.ansi-art {
    color: var(--accent-bright);
    white-space: pre;
    text-align: center;
    margin: 2rem 0;
    font-size: 0.7rem;
    line-height: 1.1;
    text-shadow: 0 0 10px rgba(0, 255, 0, 0.3), 0 0 20px rgba(0, 170, 170, 0.15);
    font-family: var(--font-mono);
    overflow-x: auto;
    max-width: 100%;
}

/* Feature cards */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.feature-card {
  background: var(--bg-panel);
  background-image: var(--grad-card);
  border: 1px solid var(--border-bright);
  border-top: 1px solid rgba(0, 255, 0, 0.15);
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s, background-image 0.2s;
}

.feature-card:hover {
  border-color: var(--accent);
  border-top-color: var(--accent-bright);
  background-image: var(--grad-card-hover);
  transform: translateY(-4px);
  box-shadow: var(--shadow-card-hover);
}

.feature-card h3 {
  color: var(--accent-cyan);
  margin-top: 0;
  font-size: 1.1rem;
}

.feature-card p {
  color: var(--fg);
  font-size: 0.9rem;
  margin-bottom: 0;
}

.feature-card a {
  font-size: 0.85rem;
}

/* Connect bar */
.connect-bar {
  background: var(--bg-panel);
  background-image: var(--grad-accent-subtle);
  border: 1px solid var(--accent);
  border-radius: 6px;
  padding: 2rem;
  margin: 2rem 0;
  text-align: center;
  box-shadow: var(--glow-green-strong), inset 0 1px 0 rgba(0, 255, 0, 0.1);
}

.connect-bar h2 {
  color: var(--accent-bright);
  border: none;
  margin-top: 0;
}

.connect-bar h2::after {
  display: none;
}

.connect-command {
  display: inline-block;
  background: var(--bg);
  border: 1px solid var(--border-bright);
  border-radius: 3px;
  padding: 0.5rem 1rem;
  margin: 0.5rem 0.5rem;
  color: var(--accent-bright);
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.connect-command:hover {
  background: var(--bg-hover);
  border-color: var(--accent);
  box-shadow: 0 0 8px rgba(0, 255, 0, 0.12);
}

/* Live stats */
.stats-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin: 2rem 0;
}

.stat-box {
  background: var(--bg-panel);
  background-image: var(--grad-card);
  border: 1px solid var(--border-bright);
  border-top: 1px solid rgba(0, 170, 170, 0.2);
  border-radius: 6px;
  padding: 1.2rem 1rem;
  text-align: center;
  box-shadow: var(--shadow-card);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.stat-box:hover {
  border-color: var(--accent-cyan);
  border-top-color: var(--accent-cyan-bright);
  box-shadow: var(--glow-cyan);
}

.stat-value {
  font-size: 2rem;
  background: var(--grad-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: bold;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--fg-dim);
  text-transform: uppercase;
  margin-top: 0.25rem;
}

/* Blog list */
.post-list {
  list-style: none;
  padding: 0;
}

.post-list li {
  padding: 1.2rem 0;
  border-bottom: 1px solid var(--border-bright);
  transition: background 0.15s, padding-left 0.15s;
}

.post-list li:hover {
  background: var(--bg-panel-hover);
  padding-left: 0.5rem;
}

.post-list .post-date {
  color: var(--fg-dim);
  font-size: 0.85rem;
}

.post-list .post-title {
  color: var(--accent-cyan);
  font-size: 1.1rem;
  display: block;
  margin-top: 0.25rem;
  transition: color 0.15s;
}

.post-list .post-title:hover {
  color: var(--accent-cyan-bright);
}

.post-list .post-summary {
  color: var(--fg);
  font-size: 0.9rem;
  margin-top: 0.25rem;
}

/* Footer */
.site-footer {
  border-top: 1px solid rgba(0, 170, 170, 0.2);
  background: var(--bg-panel);
  padding: 2rem 0;
  margin-top: 3rem;
  box-shadow: 0 -1px 0 rgba(0, 170, 170, 0.06);
}

.site-footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-links {
  display: flex;
  gap: 1.5rem;
}

.footer-links a {
  color: var(--fg-dim);
  font-size: 0.85rem;
}

.footer-links a:hover {
  color: var(--accent-bright);
}

.footer-text {
  color: var(--fg-dim);
  font-size: 0.85rem;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

th, td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-bright);
}

th {
  color: var(--accent-cyan);
  font-weight: bold;
  background: var(--bg-panel);
  border-bottom: 2px solid var(--accent-cyan);
}

tr:hover td {
  background: var(--bg-panel-hover);
}

/* Blockquote */
blockquote {
  border-left: 3px solid var(--accent);
  padding: 0.5rem 0 0.5rem 1rem;
  margin: 1.5rem 0;
  color: var(--fg-dim);
  background: var(--bg-panel);
  background-image: var(--grad-accent-subtle);
  border-radius: 0 4px 4px 0;
}

/* Responsive */
@media (max-width: 640px) {
  .site-header .container {
    flex-direction: column;
    gap: 0.5rem;
  }

  .site-nav {
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
  }

  .feature-grid {
    grid-template-columns: 1fr;
  }

  .stats-panel {
    grid-template-columns: repeat(2, 1fr);
  }

  h1 {
    font-size: 1.5rem;
  }

  h2 {
    font-size: 1.2rem;
  }
}

/* Blink animation */
@keyframes blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

.cursor {
  animation: blink 1s step-end infinite;
  color: var(--accent-bright);
}