/* fromthematrix.dev — Custom theme */

:root {
  --bg: #0a0a0a;
  --bg-code: #1a1a1a;
  --text: #e0e0e0;
  --text-muted: #888;
  --accent: #00ff41;
  --accent-dim: #00cc33;
  --red: #ff0000;
  --border: #333;
  --font-mono: "JetBrains Mono", "Fira Code", "Cascadia Code", monospace;
  --font-body: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --max-width: 720px;
}

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

html {
  font-size: 18px;
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Links */
a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s, text-shadow 0.2s;
}

a:hover {
  color: #33ff66;
  text-shadow: 0 0 8px rgba(0, 255, 65, 0.3);
}

/* Layout */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  width: 100%;
}

main {
  flex: 1;
  padding: 2rem 0;
}

/* Header */
.site-header {
  border-bottom: 1px solid var(--border);
  padding: 1.5rem 0;
}

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

.site-title {
  font-family: var(--font-mono);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
}

.site-title:hover {
  text-shadow: 0 0 12px rgba(0, 255, 65, 0.5);
  color: var(--accent);
}

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

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

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

.site-nav a {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: lowercase;
}

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

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 0;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.site-footer a {
  color: var(--text-muted);
}

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

/* Homepage */
.hero {
  margin-bottom: 3rem;
  padding: 2rem 0;
}

.hero h1 {
  font-family: var(--font-mono);
  font-size: 2rem;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.hero .tagline {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.95rem;
}

/* Post list */
.post-list {
  list-style: none;
}

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

.post-item:last-child {
  border-bottom: none;
}

.post-date {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.post-title {
  font-family: var(--font-mono);
  font-size: 1.2rem;
  margin: 0.3rem 0;
}

.post-title a {
  color: var(--text);
}

.post-title a:hover {
  color: var(--accent);
}

.post-description {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: 0.3rem;
}

/* Single post */
.post-header {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.post-header h1 {
  font-family: var(--font-mono);
  font-size: 1.8rem;
  line-height: 1.3;
  margin-bottom: 0.5rem;
}

.post-meta {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.post-content {
  margin-bottom: 2rem;
}

.post-content h2 {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  color: var(--accent);
  margin: 2rem 0 1rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--border);
}

.post-content h3 {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  color: var(--text);
  margin: 1.5rem 0 0.8rem;
}

.post-content p {
  margin-bottom: 1.2rem;
}

.post-content ul, .post-content ol {
  margin: 0 0 1.2rem 1.5rem;
}

.post-content li {
  margin-bottom: 0.4rem;
}

.post-content blockquote {
  border-left: 3px solid var(--accent);
  padding: 0.5rem 1rem;
  margin: 1.5rem 0;
  color: var(--text-muted);
  background: var(--bg-code);
}

.post-content code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--bg-code);
  padding: 0.15em 0.4em;
  border-radius: 3px;
  color: var(--accent);
}

.post-content pre {
  background: var(--bg-code);
  padding: 1rem;
  border-radius: 4px;
  overflow-x: auto;
  margin: 1.5rem 0;
  border: 1px solid var(--border);
}

.post-content pre code {
  background: none;
  padding: 0;
  color: var(--text);
}

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

.post-content strong {
  color: #fff;
}

.post-content em {
  color: var(--text-muted);
}

/* Tags */
.post-tags {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
  border: 1px solid var(--border);
  padding: 0.2em 0.6em;
  border-radius: 3px;
  margin: 0.2rem;
  transition: border-color 0.2s;
}

.tag:hover {
  border-color: var(--accent);
  text-shadow: 0 0 6px rgba(0, 255, 65, 0.3);
}

/* Archive page */
.archive-year {
  font-family: var(--font-mono);
  font-size: 1.3rem;
  color: var(--accent);
  margin: 2rem 0 1rem;
}

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

.archive-list li {
  display: flex;
  gap: 1rem;
  padding: 0.5rem 0;
  align-items: baseline;
}

.archive-list .date {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  flex-shrink: 0;
  width: 6rem;
}

/* Topics/tags page */
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0;
}

.tag-cloud .tag {
  font-size: 0.85rem;
  padding: 0.3em 0.8em;
}

/* 404 */
.error-page {
  text-align: center;
  padding: 4rem 0;
  font-family: var(--font-mono);
}

.error-page h1 {
  font-size: 3rem;
  color: var(--red);
  margin-bottom: 1rem;
}

.error-page p {
  color: var(--text-muted);
}

/* Responsive */
@media (max-width: 600px) {
  html { font-size: 16px; }
  
  .site-header .container {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .hero h1 { font-size: 1.5rem; }
  .post-header h1 { font-size: 1.4rem; }
  .post-meta { flex-direction: column; gap: 0.3rem; }
}

/* Reading progress (optional, pure CSS) */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(to right, var(--accent) var(--progress, 0%), transparent 0);
  z-index: 1000;
}
