/* Reset */
*, *::before, *::after {
  box-sizing: border-box;
}

/* Variables */
:root {
  --text: #111;
  --text-secondary: #555;
  --text-tertiary: #888;
  --background: #fff;
  --background-alt: #f8f9fa;
  --accent: #1a5f7a;
  --accent-hover: #134b61;
  --border: #e5e5e5;
  --max-width: 640px;
}

/* Base */
html {
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Charter', 'Bitstream Charter', 'Sitka Text', Cambria, Georgia, serif;
  line-height: 1.7;
  color: var(--text);
  background: var(--background);
  margin: 0;
  padding: 0;
}

/* Layout */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3rem 1.5rem;
}

/* Header */
header {
  padding: 2rem 0;
  margin-bottom: 1rem;
}

header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 0;
  padding-bottom: 0;
}

.site-title {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
  color: var(--text);
}

.site-title:hover {
  color: var(--accent);
}

nav {
  display: flex;
  gap: 2rem;
}

nav a {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.15s ease;
}

nav a:hover {
  color: var(--accent);
}

/* Typography */
h1 {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 2.25rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin: 0 0 1.5rem 0;
  color: var(--text);
}

h2 {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 2.5rem 0 1rem 0;
  color: var(--text);
}

h3 {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  margin: 2rem 0 0.75rem 0;
}

p {
  margin: 0 0 1.5rem 0;
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--accent-hover);
}

strong {
  font-weight: 600;
}

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 3rem 0;
}

/* Home page */
.intro {
  font-size: 1.15rem;
  color: var(--text-secondary);
  margin-bottom: 3.5rem;
  line-height: 1.6;
}

.section-title {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-tertiary);
  margin: 0 0 1.25rem 0;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

/* Paper/Post list */
.paper-list, .post-list {
  list-style: none;
  padding: 0;
  margin: 0 0 2rem 0;
}

.paper-list li, .post-list li {
  margin-bottom: 2rem;
}

.paper-title, .post-title {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 0.35rem 0;
  line-height: 1.35;
}

.paper-title a, .post-title a {
  color: var(--text);
  text-decoration: none;
}

.paper-title a:hover, .post-title a:hover {
  color: var(--accent);
}

.paper-meta, .post-meta {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 0.85rem;
  color: var(--text-tertiary);
}

.paper-description {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-top: 0.5rem;
  line-height: 1.55;
}

/* Article */
article {
  margin-bottom: 3rem;
}

article .meta {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 0.9rem;
  color: var(--text-tertiary);
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

article .meta a {
  color: var(--text-secondary);
}

/* Lists in articles */
article ul, article ol {
  padding-left: 1.5rem;
  margin: 0 0 1.5rem 0;
}

article li {
  margin-bottom: 0.5rem;
}

/* Blockquote */
blockquote {
  border-left: 3px solid var(--accent);
  margin: 2rem 0;
  padding: 0.5rem 0 0.5rem 1.5rem;
  font-style: italic;
  color: var(--text-secondary);
}

blockquote p:last-child {
  margin-bottom: 0;
}

/* Code */
code {
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 0.85em;
  background: var(--background-alt);
  padding: 0.2em 0.4em;
  border-radius: 3px;
  border: 1px solid var(--border);
}

pre {
  background: var(--background-alt);
  padding: 1.25rem;
  overflow-x: auto;
  border-radius: 6px;
  border: 1px solid var(--border);
  margin: 1.5rem 0;
}

pre code {
  background: none;
  padding: 0;
  border: none;
  font-size: 0.85rem;
  line-height: 1.5;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.95rem;
}

th, td {
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
}

th {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

/* Footer */
footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  margin-top: 4rem;
}

footer .container {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 0.85rem;
  color: var(--text-tertiary);
  padding-top: 0;
  padding-bottom: 0;
}

/* Links section */
.links {
  margin-top: 0.5rem;
}

.links a {
  margin-right: 1.25rem;
  font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 600px) {
  html {
    font-size: 16px;
  }

  .container {
    padding: 2rem 1.25rem;
  }

  header .container {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  nav {
    gap: 1.25rem;
  }

  h1 {
    font-size: 1.85rem;
  }
}
