/*vars*/
:root {
  --bg: #fafaf7;
  --ink: #111111;
  --muted: #6b6b66;
  --rule: #d9d6cd;
  --accent: #8a6d2c;
  --measure: 38rem;          /* ~608px reading column */
  --space: 1.5rem;
}

/*reset (minimal)*/
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
img { max-width: 100%; display: block; }

/*base type*/
html {
  font-size: 17px;
  -webkit-text-size-adjust: 100%;
}
body {
  font-family: "Source Serif 4", "Source Serif Pro", Georgia, "Times New Roman", serif;
  font-weight: 400;
  font-feature-settings: "onum" 1, "kern" 1;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-weight: 600;
  line-height: 1.2;
  margin: 0 0 0.6em;
  letter-spacing: -0.005em;
}
h1 { font-size: 1.75rem; }
h2 { font-size: 1.2rem; margin-top: 2.4rem; }
h3 { font-size: 1rem; margin-top: 1.6rem; }

p { margin: 0 0 1em; text-wrap: pretty; }

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  text-decoration-color: var(--rule);
  transition: color 120ms ease, text-decoration-color 120ms ease;
}
a:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

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

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

::selection { background: #111; color: var(--bg); }

/*layout*/
.page {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 3rem 1.5rem 2rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

/*masthead / nav*/
.masthead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
}
.brand {
  font-weight: 600;
  text-decoration: none;
  letter-spacing: -0.01em;
  display: inline-flex;
  align-items: baseline;
  gap: 0.5rem;
}
.brand .mark {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  background: var(--accent);
  transform: translateY(-0.05rem);
}
.brand:hover { color: var(--ink); text-decoration: none; }

nav.primary ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 1.1rem;
}
nav.primary a {
  text-decoration: none;
  color: var(--muted);
}
nav.primary a:hover { color: var(--accent); }
nav.primary a[aria-current="page"] {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--ink);
  text-underline-offset: 0.25em;
}

/*inrto block*/
.lede {
  font-size: 1.05rem;
  color: var(--ink);
}
.role {
  color: var(--muted);
  margin-top: -0.3rem;
  margin-bottom: 2rem;
}

/*publication list*/
.pubs {
  list-style: none;
  margin: 0;
  padding: 0;
}
.pubs > li {
  padding: 1.1rem 0;
  border-top: 1px solid var(--rule);
  display: grid;
  grid-template-columns: 3.5rem 1fr;
  gap: 0.9rem;
  align-items: baseline;
}
.pubs > li:last-child { border-bottom: 1px solid var(--rule); }
.pubs .year {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-size: 0.9rem;
}
.pubs .title { font-weight: 600; }
.pubs .subtitle {font-weight: 400; display:block; font-style: italic;}
.pubs .subtitle::before {content: "  "}
.pubs .venue { color: var(--muted); font-style: italic; }
.pubs .venue::before { content: " - "; color: var(--rule); font-style: normal; }
.pubs .note {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 0.25rem;
}

/*branch cards (publications stuff) */
.branches {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin: 1.5rem 0 0;
}
.branch {
  display: block;
  text-decoration: none;
  border: 1px solid var(--rule);
  padding: 1.4rem 1.3rem;
  background: transparent;
  transition: border-color 150ms ease, background 150ms ease;
}
.branch:hover {
  border-color: var(--ink);
  color: var(--ink);
  background: rgba(17, 17, 17, 0.02);
}
.branch h2 {
  margin: 0 0 0.4rem;
  font-size: 1.05rem;
}
.branch p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}
.branch .arrow {
  color: var(--accent);
  margin-left: 0.25rem;
}

/*contact list*/
.contact {
  list-style: none;
  margin: 0;
  padding: 0;
}
.contact > li {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  gap: 0.9rem;
  padding: 0.9rem 0;
  border-top: 1px solid var(--rule);
  align-items: baseline;
}
.contact > li:last-child { border-bottom: 1px solid var(--rule); }
.contact .label {
  color: var(--muted);
  font-size: 0.86rem;
  text-transform: lowercase;
  letter-spacing: 0.02em;
}

/*pgp block*/
details.pgp {
  margin-top: 2rem;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 0.9rem 0;
}
details.pgp summary {
  cursor: pointer;
  list-style: none;
  color: var(--muted);
  font-size: 0.92rem;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
details.pgp summary::-webkit-details-marker { display: none; }
details.pgp summary::after {
  content: "+";
  color: var(--accent);
  font-size: 1.1rem;
  line-height: 1;
}
details.pgp[open] summary::after { content: "−"; }

details.pgp pre {
  font-family: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--ink);
  background: #f3f1ea;
  border: 1px solid var(--rule);
  padding: 1rem;
  margin: 1rem 0 0;
  overflow-x: auto;
  white-space: pre;
  -webkit-user-select: all;
  user-select: all;
}
details.pgp .fingerprint {
  margin-top: 0.8rem;
  font-family: ui-monospace, monospace;
  font-size: 0.8rem;
  color: var(--muted);
  letter-spacing: 0.04em;
}

/*article template*/
.article-subtitle {
  font-size: 1.05rem;
  color: var(--muted);
  margin-top: -0.7rem;
}
.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.9rem;
  color: var(--muted);
  font-size: 0.86rem;
  margin: -0.2rem 0 1.4rem;
}
.article-meta .dot { color: var(--rule); }
.article-meta a { color: var(--muted); text-decoration-color: var(--rule); }
.article-meta a:hover { color: var(--accent); }

.article-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 0.4rem 0 2rem;
}
.btn {
  display: inline-block;
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--ink);
  text-decoration: none;
  font-size: 0.9rem;
  color: var(--ink);
  background: transparent;
  transition: background 120ms ease, color 120ms ease;
}
.btn:hover {
  background: var(--ink);
  color: var(--bg);
}
.btn.ghost {
  border-color: var(--rule);
  color: var(--muted);
}
.btn.ghost:hover {
  border-color: var(--ink);
  color: var(--ink);
  background: transparent;
}

.pdf-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 8.5 / 11;
  border: 1px solid var(--rule);
  background: #ffffff;
  overflow: hidden;
}
.pdf-frame iframe,
.pdf-frame embed,
.pdf-frame object {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}
.pdf-frame .fallback {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  color: var(--muted);
  font-size: 0.9rem;
  padding: 1.5rem;
  text-align: center;
}
.pdf-caption {
  margin-top: 0.7rem;
  color: var(--muted);
  font-size: 0.82rem;
}

@media (max-width: 36rem) {
  .pdf-frame { aspect-ratio: 3 / 4; }
}

/*footer*/
footer.colophon {
  margin-top: 4rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.82rem;
}
footer.colophon a { color: var(--muted); text-decoration: none; }
footer.colophon a:hover { color: var(--accent); }

/*responsive*/
@media (max-width: 36rem) {
  html { font-size: 16px; }
  .page { padding: 2rem 1.25rem 1.5rem; }
  .masthead {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.6rem;
  }
  nav.primary ul { gap: 0.9rem; }
  .branches { grid-template-columns: 1fr; }
  .pubs > li {
    grid-template-columns: 1fr;
    gap: 0.15rem;
  }
  .contact > li {
    grid-template-columns: 1fr;
    gap: 0.1rem;
  }
}

@media print {
  :root { --bg: #ffffff; }
  body { font-size: 11pt; }
  nav.primary, footer.colophon { display: none; }
  a { color: var(--ink); text-decoration: none; }
}
