:root {
  --bg: #0a0b0f;
  --surface: #12141c;
  --surface-2: #1a1d28;
  --border: #2a2e3a;
  --text: #e8eaef;
  --muted: #9ba3b5;
  --accent: #6ee7b7;
  --accent-dim: #34d399;
  --blue: #60a5fa;
  --purple: #a78bfa;
  --radius: 12px;
  --shadow: 0 8px 32px rgba(0,0,0,0.4);
}

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

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(110, 231, 183, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(110, 231, 183, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  z-index: 0;
}

.container {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 1.5rem;
  position: relative;
  z-index: 1;
}

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

.logo {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.logo span {
  color: var(--accent);
}

nav {
  margin-top: 1.25rem;
  display: flex;
  gap: 1.75rem;
  flex-wrap: wrap;
}

nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.2s;
}

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

/* Hero */
.hero {
  margin-bottom: 3.5rem;
}

.hero h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: 1rem;
}

.hero h1 .gradient {
  background: linear-gradient(135deg, var(--accent), var(--blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  color: var(--muted);
  font-size: 1.125rem;
  max-width: 540px;
}

/* Research project callout */
.research-callout {
  background: linear-gradient(135deg, rgba(110, 231, 183, 0.08), rgba(96, 165, 250, 0.08));
  border: 1px solid rgba(110, 231, 183, 0.25);
  border-radius: var(--radius);
  padding: 1.5rem 1.75rem;
  margin-bottom: 3.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.research-callout .label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.research-callout h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.35rem;
  font-weight: 600;
}

.research-callout p {
  color: var(--muted);
  font-size: 0.975rem;
}

.research-callout a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
  font-size: 0.975rem;
  transition: gap 0.2s, color 0.2s;
}

.research-callout a:hover {
  color: var(--accent-dim);
  gap: 0.75rem;
}

.research-callout a svg {
  width: 16px;
  height: 16px;
}

/* Posts */
.section-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  color: var(--text);
}

.posts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
  margin-bottom: 4rem;
}

article.card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  transition: border-color 0.2s, transform 0.2s;
  aspect-ratio: 1 / 1;
  min-height: auto;
}

.posts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: 1fr;
  gap: 1.5rem;
  margin-bottom: 4rem;
}

article.card:hover {
  border-color: rgba(110, 231, 183, 0.35);
  transform: translateY(-2px);
}

@media (max-width: 1024px) {
  .posts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .posts {
    grid-template-columns: 1fr;
  }
}

.meta {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-bottom: 0.75rem;
  font-size: 0.85rem;
  color: var(--muted);
  flex-wrap: wrap;
}

.tag {
  background: var(--surface-2);
  color: var(--accent);
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

article.card h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.6rem;
  letter-spacing: -0.01em;
}

article.card h3 a {
  color: inherit;
  text-decoration: none;
}

article.card h3 a:hover {
  color: var(--accent);
}

article.card p {
  color: var(--muted);
  font-size: 0.975rem;
}

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

.article-header h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(1.75rem, 4vw, 2.35rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.25;
  margin-bottom: 1rem;
}

.article-body {
  font-size: 1.05rem;
  color: var(--text);
}

.article-body p {
  margin-bottom: 1.35rem;
  color: #c8cdd8;
}

.article-body h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.4rem;
  font-weight: 600;
  margin: 2.25rem 0 1rem;
  letter-spacing: -0.02em;
}

.article-body h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.15rem;
  font-weight: 600;
  margin: 1.75rem 0 0.75rem;
}

.article-body ul,
.article-body ol {
  margin: 0 0 1.35rem 1.4rem;
  color: #c8cdd8;
}

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

.article-body a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.article-body a:hover {
  color: var(--accent-dim);
}

.article-body blockquote {
  border-left: 3px solid var(--accent);
  margin: 1.75rem 0;
  padding: 0.75rem 0 0.75rem 1.25rem;
  color: var(--muted);
  font-style: italic;
}

.article-body strong {
  color: var(--text);
  font-weight: 600;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
  transition: color 0.2s;
}

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

/* Related articles */
.related {
  margin: 3rem 0 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.related h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
}

.related-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.related-list a {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.2s, transform 0.2s;
}

.related-list a:hover {
  border-color: rgba(110, 231, 183, 0.35);
  transform: translateY(-1px);
}

.related-list .rel-tag {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.25rem;
}

.related-list .rel-title {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 0.975rem;
}

/* Updates */
#updates {
  margin-bottom: 3rem;
}

#updates .posts {
  grid-template-columns: repeat(1, minmax(0, 1fr));
  max-width: 460px;
}

/* Read more on cards */
.card .read-more {
  display: inline-block;
  margin-top: 0.85rem;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
}

.card .read-more:hover {
  color: var(--accent-dim);
}

/* Footer */
footer {
  border-top: 1px solid var(--border);
  padding: 2.5rem 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}

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

footer a:hover {
  text-decoration: underline;
}

@media (max-width: 600px) {
  .research-callout {
    padding: 1.25rem;
  }
  article.card {
    padding: 1.25rem;
  }
}
