/* Paper landing pages. Loads after base.css; the :root values below are the
   paper pages' own and override base.css where they differ. */

:root {
  --bg: #F5EFE1;          /* warm cream */
  --ink: #1E2A1A;         /* soft near-black, green-tinted */
  --accent: #4B6F44;      /* Green Satin */
  --panel: #EDE5D2;       /* slightly deeper cream for blocks */
  --rule: #D8CEB6;        /* hairline */
  --muted: #4A5342;       /* secondary text */
  --rule-strong: #8E8468; /* 3.24:1 on --bg, for control boundaries */
}

*, *::before, *::after { box-sizing: border-box; }

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  padding: 2.5rem 1rem 3.5rem;
  background: var(--bg);
  color: var(--ink);
  font-family: "Avenir", "Afacad", -apple-system, "Segoe UI", sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
  overflow-wrap: break-word;
}

.sheet {
  max-width: 44rem;
  margin: 0 auto;
}

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

/* In-prose links need a non-colour cue: accent on muted body text is 1.40:1. */
p a {
  text-decoration: underline;
  text-underline-offset: 0.15em;
  text-decoration-thickness: from-font;
}

a:focus-visible,
button:focus-visible,
pre:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* The site nav sits where the old back link was: the name on the left,
   Home · CV · Blog on the right. Overrides the rail styling in base.css. */
.sheet > .site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.4rem 1.5rem;
  margin-bottom: 2.25rem;
  font-size: 0.9375rem;
  letter-spacing: 0.01em;
}
.sheet > .site-nav ul {
  margin: 0;
  padding: 0;
  border-top: 0;
  font-size: inherit;
}
.site-nav .brand { font-weight: 600; color: var(--ink); }

h1 {
  font-size: clamp(1.5rem, 1.1rem + 1.9vw, 2.125rem);
  font-weight: 500;
  line-height: 1.25;
  margin: 0 0 1rem;
  letter-spacing: -0.01em;
}

h2 {
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin: 2.75rem 0 0.75rem;
}

p { margin: 0 0 1rem; }

/* Keep sub/sup out of the line box so leading stays even. */
sub, sup {
  font-size: 0.72em;
  line-height: 0;
  position: relative;
  vertical-align: baseline;
}
sup { top: -0.45em; }
sub { bottom: -0.2em; }

.authors {
  margin: 0 0 0.5rem;
  line-height: 1.8;
}
.authors .me { font-weight: 600; }
.authors sup { font-size: 0.72em; }

.affil,
.venue,
.award,
.corr,
.doi {
  font-size: 0.9375rem;
  color: var(--muted);
  margin: 0 0 0.35rem;
}
.affil sup { font-size: 0.8em; }
.venue { margin-top: 0.75rem; }
.venue em { font-style: normal; color: var(--ink); }
.venue cite { font-style: italic; color: var(--ink); }
.doi { margin-bottom: 0; }
/* A won award is boxed in the accent green so it stands out from the grey
   metadata lines above it. */
.award {
  display: inline-block;
  margin: 0.9rem 0 0.35rem;
  padding: 0.6rem 1rem;
  border: 1px solid var(--accent);
  border-left-width: 4px;
  border-radius: 3px;
  background: rgba(75, 111, 68, 0.12);
  font-size: 1rem;
  color: var(--ink);
}
.award strong { font-weight: 600; color: #3A5735; }
/* A candidacy is not a win: it stays an ordinary grey metadata line. */
.award.candidate {
  display: block;
  margin: 0 0 0.35rem;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  font-size: 0.9375rem;
  color: var(--muted);
}
.award.candidate strong { color: var(--ink); }

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

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: center;
  margin: 1.75rem 0 0;
}

.btn {
  display: inline-block;
  background: var(--accent);
  color: var(--bg);
  padding: 0.7rem 1.35rem;
  border-radius: 3px;
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}
.btn:hover {
  background: #3E5C38;
  color: var(--bg);
  text-decoration: none;
}

.actions .note {
  font-size: 0.875rem;
  color: var(--muted);
}

/* Running prose is justified; hyphenation keeps the rivers out. */
main > p:not(.terms),
footer p {
  text-align: justify;
  -webkit-hyphens: auto;
  hyphens: auto;
}

.terms {
  font-size: 0.9375rem;
  color: var(--muted);
}

.bibwrap { position: relative; }

pre {
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 1.1rem 1.15rem;
  margin: 0;
  overflow-x: auto;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, "DejaVu Sans Mono", monospace;
  font-size: 0.8125rem;
  line-height: 1.6;
  tab-size: 2;
}

.copy {
  font: inherit;
  font-size: 0.8125rem;
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--rule-strong);
  border-radius: 3px;
  padding: 0.35rem 0.75rem;
  margin-bottom: 0.6rem;
  cursor: pointer;
}
.copy:hover { background: var(--panel); }

footer {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  font-size: 0.8125rem;
  line-height: 1.6;
  color: var(--muted);
}
footer p { margin: 0 0 0.75rem; }
footer p:last-child { margin-bottom: 0; }

/* The site footer under the sheet, same width as the sheet. */
.site-foot {
  max-width: 44rem;
  margin: 0 auto;
}

@media (max-width: 400px) {
  body { padding: 2rem 1rem 3rem; font-size: 1rem; }
  pre { font-size: 0.75rem; }
}
