:root {
  --background: #fbfbfa;
  --surface: #ffffff;
  --text: #1f2328;
  --muted: #626a73;
  --border: #d9dee3;
  --accent: #1f5e91;
  --accent-soft: #edf4fa;
  --content-width: 840px;
  --site-width: 1080px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: #0e1116;
    --surface: #151a21;
    --text: #e7ecf1;
    --muted: #a4adb8;
    --border: #303844;
    --accent: #8dc5f0;
    --accent-soft: #172839;
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--background);
  color: var(--text);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

a:hover {
  text-decoration-thickness: 2px;
}

.site-header {
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--background) 94%, transparent);
}

.navbar {
  max-width: var(--site-width);
  min-height: 68px;
  margin: 0 auto;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.site-name {
  color: var(--text);
  font-family: Georgia, Cambria, "Times New Roman", serif;
  font-size: 1.15rem;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: -0.01em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-links a {
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--text);
}

.page {
  max-width: var(--site-width);
  margin: 0 auto;
  padding: 76px 28px 96px;
}

.home-hero {
  max-width: 760px;
  min-height: calc(100vh - 250px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-bottom: 80px;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.home-hero h1,
.page-heading {
  margin: 0;
  font-family: Georgia, Cambria, "Times New Roman", serif;
  font-size: clamp(2.75rem, 8vw, 5.25rem);
  line-height: 1.03;
  letter-spacing: -0.045em;
}

.home-hero p {
  max-width: 690px;
  margin: 28px 0 0;
  color: var(--muted);
  font-family: Georgia, Cambria, "Times New Roman", serif;
  font-size: clamp(1.25rem, 2.5vw, 1.65rem);
  line-height: 1.55;
}

.primary-link {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin-top: 34px;
  padding: 11px 17px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-weight: 650;
  text-decoration: none;
}

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

.page-heading {
  font-size: clamp(2.5rem, 7vw, 4.6rem);
}

.page-intro {
  max-width: 650px;
  margin: 20px 0 56px;
  color: var(--muted);
  font-family: Georgia, Cambria, "Times New Roman", serif;
  font-size: 1.15rem;
}

.section-heading {
  margin: 0 0 20px;
  font-family: Georgia, Cambria, "Times New Roman", serif;
  font-size: 1.65rem;
  letter-spacing: -0.02em;
}

.paper-list {
  max-width: 820px;
  border-top: 1px solid var(--border);
}

.paper-entry {
  padding: 28px 0 31px;
  border-bottom: 1px solid var(--border);
}

.paper-entry h2 {
  margin: 0 0 8px;
  font-family: Georgia, Cambria, "Times New Roman", serif;
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  line-height: 1.3;
}

.paper-entry h2 a {
  color: var(--text);
  text-decoration: none;
}

.paper-entry h2 a:hover {
  color: var(--accent);
}

.paper-meta {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.91rem;
}

.paper-description {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
}

.article-page {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 54px 24px 90px;
}

.article-header {
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border);
}

.article-type {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.article-header h1 {
  margin: 0;
  font-family: Georgia, Cambria, "Times New Roman", serif;
  font-size: clamp(2.15rem, 6.5vw, 3.75rem);
  line-height: 1.08;
  letter-spacing: -0.04em;
}

.article-subtitle {
  margin: 18px 0 0;
  color: var(--muted);
  font-family: Georgia, Cambria, "Times New Roman", serif;
  font-size: 1.18rem;
}

.byline {
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.article-body {
  padding-top: 18px;
  font-family: Georgia, Cambria, "Times New Roman", serif;
  font-size: 1.05rem;
}

.article-body h2 {
  margin: 2.3em 0 0.75em;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  font-size: 1.42rem;
  line-height: 1.28;
  letter-spacing: -0.02em;
}

.article-body p {
  margin: 1em 0;
}

.article-body code {
  padding: 0.08em 0.28em;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.87em;
}

.article-body .refs {
  padding-left: 1.35em;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  font-size: 0.92rem;
}

.article-body .refs li {
  margin-bottom: 0.85em;
}

mjx-container[jax="SVG"][display="true"] {
  margin: 1.35em 0 !important;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0.1em 0;
}

.article-footer,
.site-footer {
  color: var(--muted);
  font-size: 0.88rem;
}

.article-footer {
  margin-top: 52px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
}

.site-footer {
  max-width: var(--site-width);
  margin: 0 auto;
  padding: 28px;
  border-top: 1px solid var(--border);
}

.visitor-map-small {
  width: 180px;
  height: 110px;
  margin: 24px auto 0;
  overflow: hidden;
  border-radius: 6px;
}

.visitor-map-small iframe,
.visitor-map-small img,
.visitor-map-small canvas,
.visitor-map-small svg {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  display: block;
}

@media (max-width: 620px) {
  .navbar {
    min-height: 62px;
    padding: 0 20px;
  }

  .nav-links {
    gap: 17px;
  }

  .page {
    padding: 58px 20px 78px;
  }

  .article-page {
    padding: 40px 20px 72px;
  }

  .home-hero {
    min-height: calc(100vh - 210px);
  }
}
