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

:root {
  --bg: #0a0a0a;
  --bg-card: #111;
  --bg-code: #161616;
  --text: #e0e0e0;
  --text-dim: #888;
  --accent: #4ade80;
  --accent-dim: #22763a;
  --border: #222;
  --mono: "SF Mono", "Fira Code", "JetBrains Mono", Menlo, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

a:hover {
  text-decoration: underline;
}

/* Layout */
.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Hero */
.hero {
  padding: 96px 0 64px;
  text-align: center;
}

.hero .logo {
  margin-bottom: 16px;
}

.hero h1 {
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.hero .tagline {
  font-size: 1.15rem;
  color: var(--accent);
  margin-bottom: 8px;
  font-weight: 500;
}

.hero .subtitle {
  font-size: 1rem;
  color: var(--text-dim);
  margin-bottom: 28px;
}

.icon-links {
  display: flex;
  gap: 20px;
  justify-content: center;
}

.icon-links a {
  color: var(--text-dim);
  transition: color 0.15s;
}

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

/* Sections */
section {
  padding: 56px 0;
  border-top: 1px solid var(--border);
}

section h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 24px;
  letter-spacing: -0.01em;
}

/* Card Grid */
.card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.card {
  display: block;
  padding: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  transition: border-color 0.15s;
}

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

.card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.card p {
  font-size: 0.9rem;
  color: var(--text-dim);
  line-height: 1.5;
  margin-bottom: 12px;
}

.card .install {
  display: block;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--accent);
  background: var(--bg-code);
  padding: 6px 10px;
  border-radius: 4px;
  margin-bottom: 12px;
}

.card .card-link {
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 500;
}

/* Research */
.research-meta {
  color: var(--text-dim);
  font-size: 0.95rem;
  margin-bottom: 20px;
}

.research-meta em {
  color: var(--text);
}

/* Paper list (index) */
.paper-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.paper-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.paper-title {
  font-size: 0.9rem;
  font-weight: 500;
}

.paper-venue {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--accent);
  white-space: nowrap;
}

.view-all {
  font-size: 0.9rem;
  font-weight: 500;
}

/* Project list */
.project-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.project-list li {
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.project-list li a {
  color: var(--text);
  font-size: 0.95rem;
}

.project-list li a:hover {
  text-decoration: none;
}

.project-list li a:hover strong {
  color: var(--accent);
}

.lang {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-dim);
  background: var(--bg-code);
  padding: 2px 8px;
  border-radius: 4px;
  margin-left: 8px;
}

.project-desc {
  display: block;
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-top: 4px;
}

/* Post list */
.post-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.post-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

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

.post-list a {
  font-size: 0.95rem;
  color: var(--text);
}

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

.post-date {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text-dim);
  white-space: nowrap;
}

/* Blog article */
article {
  padding: 40px 0 56px;
}

article h2 {
  font-size: 1.4rem;
  font-weight: 600;
  margin: 32px 0 12px;
}

article h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 24px 0 8px;
}

article p {
  margin-bottom: 16px;
  line-height: 1.8;
}

article ul, article ol {
  margin: 0 0 16px 24px;
  line-height: 1.8;
}

article code {
  font-family: var(--mono);
  font-size: 0.85em;
  background: var(--bg-code);
  padding: 2px 6px;
  border-radius: 3px;
}

article pre {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 20px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.7;
  margin-bottom: 16px;
}

article pre code {
  background: none;
  padding: 0;
}

article blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 16px;
  color: var(--text-dim);
  margin: 0 0 16px;
}

article a {
  color: var(--accent);
}

article img {
  max-width: 100%;
  border-radius: 8px;
}

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

footer .links {
  display: flex;
  gap: 24px;
  justify-content: center;
  margin-bottom: 12px;
}

/* Papers page */
.papers-header {
  padding: 64px 0 32px;
  text-align: center;
}

.papers-header h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.papers-header .back {
  font-size: 0.9rem;
}

.paper-group {
  padding: 40px 0;
  border-top: 1px solid var(--border);
}

.paper-group h2 {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 24px;
  color: var(--accent);
}

.paper-entry {
  padding: 20px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 16px;
}

.paper-entry h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 6px;
  line-height: 1.4;
}

.paper-entry .authors {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 4px;
}

.paper-entry .venue {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--accent);
  margin-bottom: 10px;
}

.paper-entry .abstract {
  font-size: 0.85rem;
  color: var(--text-dim);
  line-height: 1.6;
  margin-bottom: 12px;
}

.paper-entry .paper-links {
  display: flex;
  gap: 16px;
}

.paper-entry .paper-links a {
  font-size: 0.8rem;
  font-family: var(--mono);
  font-weight: 500;
}

/* Responsive */
@media (max-width: 600px) {
  .hero {
    padding: 64px 0 48px;
  }

  .hero h1 {
    font-size: 1.75rem;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

  .paper-list li {
    flex-direction: column;
    gap: 4px;
  }
}
