@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:ital,wght@0,300;0,400;0,600;1,400&display=swap');

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

:root {
  --bg: #0a0a0a;
  --bg-raised: #111111;
  --text: #e0e0e0;
  --text-dim: #888888;
  --accent: #4ec9b0;
  --accent-dim: #2a7a66;
  --red: #c94e4e;
  --border: #222222;
  --mono: 'JetBrains Mono', monospace;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

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

/* Header */
header {
  padding: 3rem 0 2rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 3rem;
}

header .container {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

header h1 {
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

header h1 a {
  color: var(--text);
}

header h1 a:hover {
  text-decoration: none;
  color: var(--accent);
}

header nav {
  display: flex;
  gap: 1.5rem;
  font-size: 0.85rem;
}

header nav a {
  color: var(--text-dim);
}

header nav a:hover {
  color: var(--accent);
  text-decoration: none;
}

/* Article list */
.article-list {
  list-style: none;
}

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

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

.article-meta {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.article-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

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

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

.article-excerpt {
  font-size: 0.85rem;
  color: var(--text-dim);
  line-height: 1.6;
}

/* Vote widget */
.vote-widget {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
}

.vote-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 0.75rem;
  cursor: pointer;
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  transition: all 0.15s;
  line-height: 1;
}

.vote-btn:hover {
  border-color: var(--text-dim);
  color: var(--text);
}

.vote-btn.active-up {
  border-color: var(--accent);
  color: var(--accent);
}

.vote-btn.active-down {
  border-color: var(--red);
  color: var(--red);
}

.vote-score {
  min-width: 1.5rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-dim);
  font-weight: 600;
}

/* Article page */
.article-header {
  margin-bottom: 2.5rem;
}

.article-header h1 {
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 1rem;
}

.article-body {
  font-size: 0.9rem;
  line-height: 1.8;
}

.article-body p {
  margin-bottom: 1.5rem;
}

.article-body h2 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 2.5rem 0 1rem;
}

.article-body h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 2rem 0 0.75rem;
}

.article-body code {
  background: var(--bg-raised);
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  font-size: 0.85em;
}

.article-body pre {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1.25rem;
  overflow-x: auto;
  margin-bottom: 1.5rem;
}

.article-body pre code {
  background: none;
  padding: 0;
  font-size: 0.8rem;
  line-height: 1.6;
}

.article-body blockquote {
  border-left: 2px solid var(--accent-dim);
  padding-left: 1rem;
  color: var(--text-dim);
  margin-bottom: 1.5rem;
}

.article-body ul, .article-body ol {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
}

.article-body li {
  margin-bottom: 0.5rem;
}

.article-body a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.article-body img {
  max-width: 100%;
  border-radius: 4px;
  margin: 1rem 0;
}

.article-body hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.5rem 0;
}

/* Subscribe form */
.subscribe-section {
  margin-top: 4rem;
  padding: 2rem;
  border: 1px solid var(--border);
  border-radius: 4px;
}

.subscribe-section h2 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.subscribe-section p {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-bottom: 1rem;
}

.subscribe-form {
  display: flex;
  gap: 0.5rem;
}

.subscribe-form input[type="email"] {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.8rem;
  padding: 0.5rem 0.75rem;
  border-radius: 3px;
  outline: none;
}

.subscribe-form input[type="email"]:focus {
  border-color: var(--accent-dim);
}

.subscribe-form button {
  background: var(--accent-dim);
  border: none;
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.8rem;
  padding: 0.5rem 1rem;
  border-radius: 3px;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}

.subscribe-form button:hover {
  background: var(--accent);
  color: var(--bg);
}

.subscribe-msg {
  font-size: 0.75rem;
  margin-top: 0.5rem;
  min-height: 1.2em;
}

.subscribe-msg.ok { color: var(--accent); }
.subscribe-msg.err { color: var(--red); }

/* Linktree */
.linktree {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.linktree-intro {
  margin-bottom: 2.5rem;
}

.linktree-intro h2 {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
}

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

.linktree-links {
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 3rem;
}

.link-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  transition: border-color 0.15s, color 0.15s;
  font-size: 0.9rem;
}

.link-card:hover {
  border-color: var(--accent-dim);
  color: var(--accent);
  text-decoration: none;
}

.link-arrow {
  color: var(--text-dim);
  font-size: 0.8rem;
}

.link-card:hover .link-arrow {
  color: var(--accent);
}

.linktree .subscribe-section {
  width: 100%;
  max-width: 400px;
  text-align: left;
}

/* Page title */
.page-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 2rem;
}

/* Project list */
.project-list {
  list-style: none;
}

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

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

.project-title {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

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

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

.project-arrow {
  color: var(--text-dim);
  font-size: 0.8rem;
  margin-left: 0.3rem;
}

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

/* Footer */
footer {
  margin-top: 4rem;
  padding: 2rem 0;
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--text-dim);
  text-align: center;
}

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

  .subscribe-form {
    flex-direction: column;
  }

  .article-header h1 {
    font-size: 1.25rem;
  }
}
