:root {
  --bg: #fbfaf7;
  --fg: #1c1b19;
  --muted: #5f5c55;
  --rule: #e4e1da;
  --accent: #1f4e79;
  --accent-fg: #ffffff;
  --card: #ffffff;
  --max: 42rem;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131313;
    --fg: #ebe8e1;
    --muted: #a39f95;
    --rule: #2a2a2a;
    --accent: #7fb0e0;
    --accent-fg: #0d1a26;
    --card: #1b1b1b;
  }
}

* { box-sizing: border-box; }

html { font-size: 17px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: Georgia, "Iowan Old Style", "Palatino Linotype", "Book Antiqua", serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

/* Header */
.site-header {
  max-width: calc(var(--max) + 4rem);
  margin: 0 auto;
  padding: 1.5rem 2rem;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--rule);
}

.wordmark {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-weight: 600;
  font-size: 1.1rem;
  letter-spacing: 0.02em;
  color: var(--fg);
  text-decoration: none;
}

.site-nav {
  display: flex;
  gap: 1.25rem;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 0.9rem;
}
.site-nav a { color: var(--muted); text-decoration: none; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--fg); }

/* Layout */
main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 2rem 4rem;
}

.section {
  padding: 2.5rem 0;
  border-top: 1px solid var(--rule);
}

h1, h2, h3 {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0 0 1rem;
}
h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); font-weight: 650; }
h2 { font-size: 1.3rem; font-weight: 600; }
h3 { font-size: 1.1rem; font-weight: 600; }

p { margin: 0 0 1rem; }

.eyebrow {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.meta, .authors { color: var(--muted); font-size: 0.95rem; }

/* Hero */
.hero { padding: 4rem 0 3rem; }
.lede { font-size: 1.15rem; color: var(--muted); max-width: 36rem; }

.actions { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: 1.5rem; }

.button {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 0.95rem;
  padding: 0.6rem 1.1rem;
  border: 1px solid var(--rule);
  border-radius: 4px;
  color: var(--fg);
  text-decoration: none;
  background: var(--card);
}
.button:hover { border-color: var(--fg); }
.button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.button.primary:hover { filter: brightness(1.08); }

/* Cards */
.card-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
.card {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 1.25rem 1.5rem;
}
.card-kicker {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 0.5rem;
}
.card h3 a { color: var(--fg); text-decoration: none; }
.card h3 a:hover { text-decoration: underline; }
.card p:last-child { margin-bottom: 0; }

/* Whitepaper */
.paper-header { padding: 3rem 0 1rem; }

.pdf-frame {
  border: 1px solid var(--rule);
  border-radius: 6px;
  overflow: hidden;
  background: var(--card);
}
.pdf-frame object { display: block; width: 100%; height: 80vh; min-height: 32rem; }
.pdf-frame object p { padding: 2rem; text-align: center; }

.citation {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85rem;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 1rem 1.25rem;
  overflow-x: auto;
  margin: 0;
}

/* Footer */
.site-footer {
  max-width: calc(var(--max) + 4rem);
  margin: 0 auto;
  padding: 1.5rem 2rem 3rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.85rem;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}
.site-footer p { margin: 0; }

@media (max-width: 600px) {
  html { font-size: 16px; }
  .site-header, main, .site-footer { padding-left: 1.25rem; padding-right: 1.25rem; }
  .hero { padding-top: 2.5rem; }
}
