:root {
  --text: #1a1a1a;
  --text-muted: #6b6b6b;
  --bg: #fefefe;
  --accent: #0f4c81;
  --border: #e5e5e5;
  --code-bg: #f5f5f5;
  --max-width: 720px;
}

* { box-sizing: border-box; }

html { font-size: 18px; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", sans-serif;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  margin: 0;
  padding: 0;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

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

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

.site-title {
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--text);
  text-decoration: none;
}

.site-nav a {
  color: var(--text-muted);
  text-decoration: none;
  margin-left: 1.5rem;
  font-size: 0.95rem;
}

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

/* Main content */
.site-main { min-height: 60vh; padding-bottom: 4rem; }

h1 {
  font-size: 2.2rem;
  line-height: 1.2;
  font-weight: 700;
  margin: 0 0 1rem;
  letter-spacing: -0.02em;
}

h2 {
  font-size: 1.5rem;
  line-height: 1.3;
  font-weight: 600;
  margin: 2.5rem 0 1rem;
  letter-spacing: -0.01em;
}

h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 1.8rem 0 0.6rem;
}

p { margin: 0 0 1.2rem; }

a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
a:hover { text-decoration: none; }

strong { font-weight: 600; }

ul, ol { padding-left: 1.3rem; margin: 0 0 1.2rem; }
li { margin-bottom: 0.4rem; }

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

code {
  background: var(--code-bg);
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  font-family: "SF Mono", Monaco, Consolas, monospace;
  font-size: 0.9em;
}

pre {
  background: var(--code-bg);
  padding: 1rem;
  overflow-x: auto;
  border-radius: 4px;
}
pre code { background: none; padding: 0; }

blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 1.2rem;
  color: var(--text-muted);
  margin: 1.5rem 0;
  font-style: italic;
}

/* Article / paper cover image — breakout 20% wider than text column */
article img:first-of-type {
  display: block;
  width: 120%;
  max-width: calc(100vw - 2rem);
  height: auto;
  margin-top: 0;
  margin-bottom: 2rem;
  margin-left: -10%;
  margin-right: -10%;
  border-radius: 4px;
}

@media (max-width: 860px) {
  article img:first-of-type {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
  }
}

/* Any paragraph containing only an image (the markdown `![...](...)` pattern)
   shouldn't add default paragraph margins around the image */
.paper-content p:has(> img:only-child) {
  margin: 0 0 2rem;
}

/* Paper */
.paper-series {
  color: var(--text-muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.5rem;
}

.paper-subtitle {
  font-size: 1.3rem;
  color: var(--text-muted);
  margin: 0 0 1rem;
  font-weight: 400;
}

.paper-meta {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 3rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1.5rem;
}

.paper-footer {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Paper list */
.paper-list {
  list-style: none;
  padding: 0;
  margin: 2rem 0;
}

.paper-list li {
  border-bottom: 1px solid var(--border);
  padding: 1.5rem 0;
}

.paper-list a {
  text-decoration: none;
  color: var(--text);
  display: block;
}

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

.paper-list h3 { margin: 0 0 0.5rem; }

.paper-list .subtitle { color: var(--text-muted); margin: 0 0 0.3rem; }
.paper-list .date { font-size: 0.85rem; color: var(--text-muted); margin: 0; }

/* Home */
.home h1 { font-size: 2.5rem; }

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

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

/* Responsive */
@media (max-width: 640px) {
  html { font-size: 17px; }
  h1 { font-size: 1.8rem; }
  h2 { font-size: 1.3rem; }
  .site-header .container { flex-direction: column; align-items: flex-start; }
  .site-nav a { margin-left: 0; margin-right: 1.2rem; }
}
