:root {
  /* ANSI color palette */
  --bg: #0a0a0a;
  --bg-panel: #111111;
  --bg-hover: #1a1a1a;
  --fg: #c0c0c0;
  --fg-bright: #ffffff;
  --fg-dim: #666666;
  --accent: #00aa00;
  --accent-bright: #00ff00;
  --accent-cyan: #00aaaa;
  --accent-yellow: #aaaa00;
  --accent-red: #aa0000;
  --accent-blue: #0000aa;
  --accent-magenta: #aa00aa;
  --border: #333333;
  --border-bright: #555555;

  /* 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);
  overflow-x: hidden;
}

/* 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, 0, 0, 0.03) 2px,
    rgba(0, 0, 0, 0.03) 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;
}

a:hover {
  color: var(--accent-bright);
  text-decoration: underline;
}

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

/* Header */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg-panel);
  position: sticky;
  top: 0;
  z-index: 100;
}

.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;
  color: var(--accent-bright);
  text-shadow: 0 0 5px rgba(0, 255, 0, 0.3);
}

.site-title a {
  color: var(--accent-bright);
  text-decoration: none;
}

.site-title a:hover {
  color: var(--accent-bright);
  text-decoration: none;
}

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

.site-nav a {
  color: var(--fg);
  font-size: 0.9rem;
}

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

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

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

h1 {
  font-size: 2rem;
  color: var(--accent-bright);
  text-shadow: 0 0 10px rgba(0, 255, 0, 0.2);
}

h2 {
  font-size: 1.5rem;
  color: var(--accent-cyan);
  margin-top: 2rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

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

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: 2px;
  font-size: 0.9em;
}

pre {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1rem;
  overflow-x: auto;
  margin-bottom: 1.5rem;
  line-height: 1.4;
}

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

/* Terminal window */
.terminal {
  background: var(--bg-panel);
  border: 1px solid var(--border-bright);
  border-radius: 6px;
  margin: 2rem 0;
  overflow: hidden;
}

.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 8px rgba(0, 255, 0, 0.2);
    font-family: var(--font-mono);
    overflow-x: auto;
}

/* 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);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1.5rem;
  transition: border-color 0.2s, transform 0.2s;
}

.feature-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.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);
  border: 1px solid var(--accent);
  border-radius: 6px;
  padding: 1.5rem 2rem;
  margin: 2rem 0;
  text-align: center;
}

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

.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;
}

.connect-command:hover {
  background: var(--bg-hover);
}

/* 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);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1rem;
  text-align: center;
}

.stat-value {
  font-size: 1.8rem;
  color: var(--accent-bright);
  font-weight: bold;
}

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

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

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

.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;
}

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

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

.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;
}

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

th {
  color: var(--accent-cyan);
  font-weight: bold;
}

/* Blockquote */
blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 1rem;
  margin: 1.5rem 0;
  color: var(--fg-dim);
}

/* 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);
}