@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@300;400;700&family=IBM+Plex+Mono:wght@300;500&display=swap');

:root {
  --bg: #1a1a1a;
  --surface: #252525;
  --primary: #4af626;
  --secondary: #00d9ff;
  --accent: #ff6b9d;
  --text: #e0e0e0;
  --dim: #666666;
}

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

body {
  font-family: 'JetBrains Mono', monospace;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

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

/* Navigation styling */
nav {
  background: var(--surface);
  border-bottom: 1px solid var(--primary);
  padding: 0.5rem 1.5rem;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.terminal-dots {
  display: flex;
  gap: 0.5rem;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.dot:nth-child(1) { background: #ff5f56; }
.dot:nth-child(2) { background: #ffbd2e; }
.dot:nth-child(3) { background: #27c93f; }

.terminal-title {
  color: var(--dim);
  font-weight: 300;
}

nav h1 {
  margin: 0;
  color: var(--text);
  font-size: 1rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

nav a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
  margin-left: auto;
}

nav a:hover {
  color: var(--secondary);
}

/* Main container */
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 2rem;
  animation: fadeIn 0.8s ease-out;
  padding-bottom: 5rem; /* Space for stats bar */
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Prompt section */
.prompt {
  margin-bottom: 3rem;
  animation: slideUp 0.6s ease-out;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.prompt-line {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.prompt-symbol {
  color: var(--primary);
  font-weight: 700;
}

.prompt-command {
  color: var(--secondary);
}

.prompt-output {
  color: var(--dim);
  font-size: 0.9rem;
  margin-left: 1.5rem;
  margin-top: 0.5rem;
}

.cursor {
  display: inline-block;
  width: 8px;
  height: 16px;
  background: var(--primary);
  animation: blink 1s step-end infinite;
  margin-left: 2px;
}

@keyframes blink {
  50% { opacity: 0; }
}

/* Article styling */
article {
  margin-bottom: 3rem;
  background: rgba(37, 37, 37, 0.4);
  border-left: 2px solid var(--primary);
  padding: 2rem;
  position: relative;
  overflow: hidden;
}

article::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 2px;
  height: 100%;
  background: var(--primary);
  animation: lineGlow 2s ease-in-out infinite alternate;
}

@keyframes lineGlow {
  from { box-shadow: 0 0 5px var(--primary); }
  to { box-shadow: 0 0 15px var(--primary); }
}

article header {
  margin-bottom: 2rem;
  border-bottom: 1px solid rgba(74, 246, 38, 0.2);
  padding-bottom: 1rem;
}

article header h1 {
  color: var(--text);
  margin-bottom: 0.5rem;
  font-size: 1.5rem;
  font-weight: 700;
}

article header time {
  color: var(--dim);
  font-size: 0.9rem;
  font-family: 'IBM Plex Mono', monospace;
}

.content {
  margin-top: 1.5rem;
}

.content h2, .content h3, .content h4 {
  color: var(--secondary);
  margin-top: 2rem;
  margin-bottom: 1rem;
  position: relative;
}

.content h2::before {
  content: '## ';
  color: var(--dim);
}

.content h3::before {
  content: '### ';
  color: var(--dim);
}

.content p {
  margin-bottom: 1rem;
  line-height: 1.7;
}

.content code {
  background: var(--surface);
  padding: 0.2em 0.4em;
  border-radius: 3px;
  font-size: 0.9em;
  color: var(--accent);
  border: 1px solid rgba(255, 107, 157, 0.2);
}

.content pre {
  background: var(--surface);
  padding: 1.5rem;
  border-radius: 5px;
  overflow-x: auto;
  margin: 1.5rem 0;
  border-left: 3px solid var(--primary);
  position: relative;
}

.content pre::before {
  content: '$ ';
  color: var(--primary);
  position: absolute;
  top: 0.5rem;
  left: 1rem;
  font-size: 0.8rem;
}

.content pre code {
  background: none;
  padding: 0;
  border: none;
  color: var(--text);
  margin-left: 1rem;
}

.content blockquote {
  border-left: 4px solid var(--secondary);
  padding: 1rem 1.5rem;
  margin: 1.5rem 0;
  background: rgba(0, 217, 255, 0.05);
  color: var(--text);
  font-style: italic;
  position: relative;
}

.content blockquote::before {
  content: '> ';
  color: var(--secondary);
  font-weight: bold;
  position: absolute;
  left: 0.5rem;
  top: 1rem;
}

.content ul, .content ol {
  margin: 1rem 0;
  padding-left: 2rem;
}

.content li {
  margin-bottom: 0.5rem;
  position: relative;
}

.content ul li::before {
  content: '→ ';
  color: var(--primary);
  position: absolute;
  left: -1.5rem;
}

.content a {
  color: var(--secondary);
  text-decoration: none;
  position: relative;
  transition: color 0.3s ease;
}

.content a:hover {
  color: var(--primary);
}

.content a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--primary);
  transition: width 0.3s ease;
}

.content a:hover::after {
  width: 100%;
}

/* Links section */
.links-section {
  margin-bottom: 3rem;
  animation: slideUp 0.6s ease-out backwards;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(74, 246, 38, 0.2);
}

.section-number {
  font-family: 'IBM Plex Mono', monospace;
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 500;
}

.section-title {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.section-count {
  margin-left: auto;
  color: var(--dim);
  font-size: 0.85rem;
}

/* Post list styling */
ul {
  list-style: none;
  padding: 0;
}

ul li {
  margin-bottom: 0.5rem;
  animation: slideUp 0.6s ease-out backwards;
}

ul li:nth-child(1) { animation-delay: 0.1s; }
ul li:nth-child(2) { animation-delay: 0.2s; }
ul li:nth-child(3) { animation-delay: 0.3s; }
ul li:nth-child(4) { animation-delay: 0.4s; }
ul li:nth-child(5) { animation-delay: 0.5s; }

ul li a {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1rem 1.5rem;
  background: rgba(37, 37, 37, 0.4);
  border-left: 2px solid transparent;
  text-decoration: none;
  color: var(--text);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

ul li a::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 100%;
  background: rgba(74, 246, 38, 0.05);
  transition: width 0.3s ease;
}

ul li a:hover {
  border-left-color: var(--primary);
  background: rgba(37, 37, 37, 0.8);
  transform: translateX(5px);
}

ul li a:hover::before {
  width: 100%;
}

ul li:nth-child(4n+2) a:hover { border-left-color: var(--secondary); }
ul li:nth-child(4n+3) a:hover { border-left-color: var(--accent); }
ul li:nth-child(4n+4) a:hover { border-left-color: #ffd700; }

ul li a::after {
  content: '→';
  color: var(--primary);
  font-size: 1.2rem;
  opacity: 0;
  transform: translateX(-10px);
  transition: all 0.3s ease;
  position: relative;
  z-index: 1;
  margin-left: auto;
}

ul li a:hover::after {
  opacity: 1;
  transform: translateX(0);
}

/* Link components */
.link-index {
  font-family: 'IBM Plex Mono', monospace;
  color: var(--dim);
  font-size: 0.85rem;
  min-width: 2.5rem;
  position: relative;
  z-index: 1;
}

.link-title {
  flex: 1;
  font-size: 0.95rem;
  letter-spacing: -0.02em;
  position: relative;
  z-index: 1;
  word-break: break-word;
}

.link-date {
  color: var(--secondary);
  font-size: 0.85rem;
  font-family: 'IBM Plex Mono', monospace;
  position: relative;
  z-index: 1;
}

/* Stats bar */
.stats-bar {
  background: var(--surface);
  border-top: 1px solid rgba(74, 246, 38, 0.2);
  padding: 1rem 1.5rem;
  font-size: 0.85rem;
  color: var(--dim);
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  gap: 2rem;
  z-index: 100;
}

.stat {
  display: flex;
  gap: 0.5rem;
}

.stat-label {
  color: var(--dim);
}

.stat-value {
  color: var(--primary);
  font-weight: 500;
}

/* Responsive */
@media (max-width: 768px) {
  main {
    padding: 2rem 1rem 5rem 1rem;
  }

  article {
    padding: 1.5rem;
  }

  ul li a {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
  }

  .link-title {
    font-size: 0.9rem;
  }

  .stats-bar {
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1rem;
    padding-bottom: env(safe-area-inset-bottom, 1rem);
  }

  nav {
    padding: 0.5rem 1rem;
    flex-wrap: wrap;
  }

  .terminal-title {
    font-size: 0.8rem;
  }
}