:root {
  --ink: #171716;
  --muted: #6f6c67;
  --paper: #fff;
  --line: #d8d5d0;
  --warm: #f2f0ec;
  --red: #b5232e;
  --link: #1e49b6;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.45;
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

.site-header {
  height: 82px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #1c1b19;
  border-bottom: 1px solid #37342f;
}

.wordmark {
  display: inline-block;
  color: #bbb5ac;
  font: 700 35px/1 Arial, Helvetica, sans-serif;
  letter-spacing: -2px;
  text-decoration: none;
}

.wordmark::first-letter { color: var(--red); }
.wordmark:hover { color: #fff; text-decoration: none; }

nav { display: flex; align-items: center; gap: 35px; }
nav a { color: #bdb9b4; font-weight: 600; }

.category-bar {
  padding: 8px 24px;
  font-size: 20px;
  font-weight: 700;
  background: #efefef;
  border-bottom: 1px solid var(--line);
}

.category-bar span { padding: 0 8px; color: var(--muted); }

.archive { max-width: 1100px; margin: 0 auto; padding: 32px 24px 60px; }
.archive-intro { margin: 0 0 30px; color: var(--muted); }
.paper-list { list-style: none; margin: 0; padding: 0; }
.paper-entry { padding: 24px 0; border-top: 1px solid var(--line); }
.paper-entry h2 { margin: 0 0 10px; font-size: clamp(23px, 2vw, 28px); line-height: 1.25; }
.paper-entry p { margin: 0 0 12px; }
.paper-entry .paper-id { color: var(--muted); font-size: 14px; }
.entry-meta, .entry-subjects { color: var(--muted); }
.entry-subjects { font-size: 14px; }
a:focus-visible { outline: 2px solid var(--link); outline-offset: 4px; }

.page-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 355px;
  min-height: calc(100vh - 122px);
}

.paper { padding: 12px 42px 60px 24px; }
.submission { margin: 0 0 6px; font-style: italic; color: #3e3c39; }

h1 {
  max-width: 1250px;
  margin: 0 0 12px;
  font-size: clamp(30px, 2.2vw, 40px);
  line-height: 1.15;
  letter-spacing: .01em;
}

.authors { margin: 0 0 40px; font-size: 23px; }

.abstract { max-width: 1370px; }
.abstract h2 {
  display: inline;
  margin: 0 15px 0 0;
  font: bold 18px Georgia, serif;
}

.abstract p {
  display: inline;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 20px;
  line-height: 1.65;
}

.metadata {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 6px 12px;
  margin: 42px 0 0;
  max-width: 1000px;
}

.metadata dt { font-weight: 700; }
.metadata dd { margin: 0; }

.sidebar {
  display: flex;
  flex-direction: column;
  border-left: 6px solid #e2e2e2;
  background: #fafafa;
}

.access-card, .side-section { padding: 22px 26px; border-bottom: 4px solid #ddd; }
.access-card h2 { margin: 0 0 18px; font-size: 32px; line-height: 1; }

.primary-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  margin-bottom: 14px;
  padding: 12px 18px;
  color: #fff;
  background: var(--red);
  border-radius: 3px;
  font-size: 20px;
  font-weight: 700;
}

.primary-button:hover { background: #951b25; text-decoration: none; }
.primary-button svg { width: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.secondary-link { display: block; margin: 7px 3px; font-size: 18px; }
.side-section h3 { margin: 0 0 8px; font-size: 22px; }
.side-section p { margin: 6px 0; color: #4d4a46; }
.side-section a { display: block; margin: 3px 0; }
.support-section { margin-top: auto; padding: 22px 26px; text-align: right; }
.support-section a { font-size: 18px; font-weight: 700; }

@media (max-width: 800px) {
  .site-header { height: 68px; padding: 0 18px; }
  .wordmark { font-size: 38px; }
  nav { gap: 18px; }
  .category-bar { padding: 8px 18px; font-size: 16px; }
  .page-shell { display: flex; flex-direction: column; }
  .paper { padding: 14px 20px 38px; }
  h1 { font-size: 30px; }
  .authors { margin-bottom: 28px; font-size: 20px; }
  .abstract p { font-size: 18px; line-height: 1.55; }
  .metadata { grid-template-columns: 92px minmax(0, 1fr); font-size: 14px; }
  .sidebar { order: -1; border-left: 0; border-bottom: 5px solid #ddd; }
  .access-card { padding: 19px 20px; }
  .access-card h2 { font-size: 26px; }
  .side-section { display: none; }
  .support-section { padding: 10px 20px 16px; }
}
