/* Dark theme matching credencelabs.ai brand tokens:
 * warm near-black bg, warm white ink, crimson accent, Cormorant + Inter. */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@500;600;700&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --bg: #151013;
  --panel: #211a1e;
  --text: #f7f1f3;
  --soft: #ded4d8;
  --muted: #a99ba1;
  --accent: #f7f1f3;
  --accent-hover: #ffffff;
  --rule: #3d2f35;
  --nav-bg: rgba(21, 16, 19, 0.88);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  /* Soft white corner glows + the credencelabs.ai dot lattice, in white. */
  background:
    radial-gradient(920px circle at 88% -6%, rgba(255, 255, 255, 0.07), transparent 64%),
    radial-gradient(880px circle at -10% 104%, rgba(255, 255, 255, 0.05), transparent 62%),
    radial-gradient(rgba(255, 255, 255, 0.16) 1px, transparent 1.5px),
    var(--bg);
  background-size:
    100% 100%,
    100% 100%,
    26px 26px,
    auto;
  background-attachment: fixed;
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
  text-decoration-color: var(--accent-hover);
  text-underline-offset: 3px;
}
nav a, .header-links a {
  text-decoration: none;
}

.wrap {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---- Nav ---- */
nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--nav-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}
.nav-inner {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  height: 52px;
  overflow-x: auto;
  white-space: nowrap;
}
.nav-name {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 700;
  font-size: 20px;
  color: var(--text);
  margin-right: auto;
}
.nav-name:hover { text-decoration: none; color: var(--text); }
nav a.nav-link {
  font-size: 13.5px;
  color: var(--muted);
}
nav a.nav-link:hover { color: var(--accent-hover); text-decoration: none; }
nav a.nav-link.active { color: var(--text); font-weight: 600; }

/* ---- Header ---- */
header {
  padding: 56px 0 8px;
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 40px;
}
.header-text { flex: 1; min-width: 0; }
.portrait {
  width: 190px;
  height: 232px;
  object-fit: cover;
  border-radius: 16px;
  flex-shrink: 0;
  border: 1px solid var(--rule);
}
.erc-logo {
  display: block;
  max-width: 380px;
  width: 100%;
  height: auto;
  background: #fff;
  padding: 14px 18px;
  border-radius: 10px;
  border: 1px solid var(--rule);
  margin: 8px 0 20px;
}
header .erc-logo {
  max-width: 320px;
  margin: 0 0 32px;
}

/* ---- Coauthors ---- */
ul.coauthor-list {
  list-style: none;
  padding: 0;
  margin: 24px 0 0;
  columns: 3;
  column-gap: 32px;
}
ul.coauthor-list li {
  margin: 9px 0;
  break-inside: avoid;
  font-size: 15.5px;
}
@media (max-width: 760px) {
  ul.coauthor-list { columns: 2; }
}
@media (max-width: 480px) {
  ul.coauthor-list { columns: 1; }
}
h1 {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 52px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.05;
  margin: 0 0 14px;
}
.tagline {
  margin: 0 0 4px;
  font-size: 17px;
  color: var(--soft);
}
.fields {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 15px;
}
.bio {
  margin: 18px 0 0;
  color: var(--soft);
  font-size: 15.5px;
  line-height: 1.65;
}
.header-links {
  margin: 22px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.header-links a {
  font-size: 13.5px;
  font-weight: 600;
  padding: 6px 14px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--panel);
  color: var(--text);
}
.header-links a:hover {
  text-decoration: none;
  border-color: var(--accent);
  color: var(--accent-hover);
}

/* ---- Sections ---- */
section { padding-top: 8px; }
h2 {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--rule);
  padding-bottom: 8px;
  margin: 44px 0 6px;
}

.pub {
  margin: 20px 0;
}
.pub .pt {
  font-weight: 600;
}
.pub .co { color: var(--soft); }
.pub .jn {
  font-style: italic;
  color: var(--muted);
}
.pub .extras {
  font-size: 14px;
}

.note {
  color: var(--muted);
  font-size: 15px;
  margin: 14px 0;
}

/* ---- Papers by Topic (collapsible sections) ---- */
details.topic {
  border-bottom: 1px solid var(--rule);
}
details.topic summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}
details.topic summary::-webkit-details-marker { display: none; }
details.topic summary::before {
  content: "\25B8";
  color: var(--accent);
  font-size: 15px;
  transition: transform 0.15s ease;
}
details.topic[open] summary::before {
  transform: rotate(90deg);
}
details.topic .topic-body {
  padding: 0 0 14px 27px;
}
details.topic .topic-intro {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
  max-width: 640px;
  margin: 2px 0 18px;
}
details.topic .pub { margin: 14px 0; }

ul.plain {
  padding-left: 1.2em;
  margin: 14px 0;
  color: var(--soft);
}
ul.plain li { margin: 10px 0; }

/* ---- Art gallery ---- */
.art-grid {
  columns: 2;
  column-gap: 20px;
  margin-top: 24px;
}
.art-item {
  break-inside: avoid;
  margin: 0 0 22px;
}
.art-item img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
  border: 1px solid var(--rule);
}
.art-item figcaption {
  font-size: 13.5px;
  color: var(--muted);
  margin-top: 8px;
}
@media (max-width: 600px) {
  .art-grid { columns: 1; }
}

footer {
  margin-top: 64px;
  padding: 24px 0 40px;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 13.5px;
}

@media (max-width: 600px) {
  body { font-size: 15.5px; }
  h1 { font-size: 40px; }
  header { padding-top: 36px; }
  .header-inner { flex-direction: column-reverse; align-items: flex-start; gap: 24px; }
  .portrait { width: 140px; height: 170px; }
}
