/* style.css — personal website. Created 2026-09-28.
   Matches the CV: Palatino body, bold uppercase section headings over a rule,
   blue links. System fonts only; the site makes no third-party requests. */

:root {
  --text: #1a1a1a;
  --muted: #5f5f5f;
  --rule: #cfcfcf;
  --link: #0000c8;
  --bg: #ffffff;
  --panel: #f5f5f3;
  --serif: "Palatino Linotype", Palatino, "Book Antiqua", "TeX Gyre Pagella", "URW Palladio L", Georgia, serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --text: #e8e6e3;
    --muted: #a8a49e;
    --rule: #3a3a3a;
    --link: #8fb4ff;
    --bg: #161616;
    --panel: #202020;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.55;
}
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 20px; }

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

/* header */
.site-header { border-bottom: 1px solid var(--rule); }
.header-inner {
  display: flex; flex-wrap: wrap; align-items: baseline;
  justify-content: space-between; gap: 6px 24px; padding-top: 18px; padding-bottom: 14px;
}
.site-name { color: var(--text); font-weight: bold; font-size: 1.2rem; letter-spacing: 0.02em; }
.site-name:hover { text-decoration: none; }
.site-nav { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.site-nav a { color: var(--muted); font-size: 0.95rem; }
.site-nav a[aria-current="page"] { color: var(--text); font-weight: bold; }

/* headings */
h1 { font-size: 1.9em; font-weight: normal; margin: 1.4em 0 0.4em; }
h2 {
  font-size: 0.85em; font-weight: bold; text-transform: uppercase; letter-spacing: 0.06em;
  border-bottom: 1px solid var(--rule); padding-bottom: 4px; margin: 2.4em 0 1em;
}
h3 { font-size: 1em; margin: 0; }

/* home */
.intro { display: flex; gap: 36px; align-items: flex-start; margin-top: 2.2em; }
.portrait { width: 220px; height: auto; border-radius: 50%; flex: 0 0 auto; }
.intro-text h1 { margin-top: 0.1em; }
.intro-text { min-width: 0; }
.contact-links .sep { color: var(--muted); margin: 0 0.45em; }

/* papers */
.paper { margin: 0 0 1.6em; }
.paper-title { font-weight: bold; }
.paper-title a { color: var(--text); }
.paper-title a:hover { color: var(--link); }
.paper-authors, .paper-status, .paper-note, .paper-links { margin: 0.1em 0; }
.paper-note { font-size: 0.9em; color: var(--muted); }
.paper-authors { color: var(--muted); }
.tag {
  font-size: 0.66em; font-weight: normal; text-transform: uppercase; letter-spacing: 0.05em;
  border: 1px solid var(--rule); border-radius: 3px; padding: 1px 5px; vertical-align: 2px; color: var(--muted);
}
/* the action row: [> Abstract]  SSRN  PDF */
.paper-links, details.abstract summary { font-size: 0.88em; margin-top: 0.15em; }
.plink { margin-right: 1em; }
details.abstract summary { list-style: none; cursor: pointer; width: fit-content; }
details.abstract summary::-webkit-details-marker { display: none; }
.abs-label { color: var(--link); margin-right: 1em; }
.abs-label::before { content: "\25B8\00A0"; display: inline-block; width: 1em; }
details.abstract[open] .abs-label::before { content: "\25BE\00A0"; }
details.abstract summary:hover .abs-label { text-decoration: underline; }
details.abstract p {
  background: var(--panel); border-left: 3px solid var(--rule);
  padding: 10px 14px; margin: 0.5em 0 0; font-size: 0.92em; line-height: 1.5;
}

/* paper figures */
.paper-fig { margin: 0; }
/* Figures are fitted inside a fixed box: full column width, capped height, so a tall
   figure cannot make its entry taller than the text beside it. */
.paper-fig img {
  display: block; width: 100%; height: auto; max-height: 190px; object-fit: contain;
  background: #fff; border: 1px solid var(--rule); border-radius: 4px;
}
.fig-gallery .paper-fig img { max-height: 220px; }
details.abstract > .paper-fig img { max-height: 320px; }
.paper-fig figcaption { font-size: 0.8em; color: var(--muted); margin-top: 0.35em; line-height: 1.35; }
.paper.has-fig { display: grid; gap: 28px; align-items: start; }
.paper.fig-thumb_left { grid-template-columns: 150px 1fr; }
.paper.fig-right { grid-template-columns: 1fr 280px; }
.paper.fig-right .paper-fig { order: 2; }
.paper.fig-right .paper-body { order: 1; }
details.abstract > .paper-fig { max-width: 520px; margin: 0.7em 0 0.2em; }
.fig-gallery {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px; margin-top: 0.9em;
}
.paper-body { min-width: 0; }

/* home cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 22px; }
.card { border: 1px solid var(--rule); border-radius: 6px; overflow: hidden; background: var(--bg); }
.card-fig { display: block; aspect-ratio: 4 / 3; background: #fff; border-bottom: 1px solid var(--rule); }
.card-fig img { width: 100%; height: 100%; object-fit: contain; }
.card-fig-empty { background: var(--panel); }
.card-body { padding: 12px 14px 14px; font-size: 0.92em; }
.card-body .paper-title { font-size: 1em; }
.card details.abstract p { font-size: 0.95em; }

/* lists and entries */
ul.compact { padding-left: 1.1em; margin: 0.4em 0; }
ul.compact li { margin: 0.35em 0; }
.muted { color: var(--muted); }
.entry { margin-bottom: 1.3em; }
.entry p { margin: 0.1em 0; }
.entry-head { display: flex; justify-content: space-between; gap: 12px; }
.when { font-style: italic; color: var(--muted); white-space: nowrap; }

/* talks */
dl.by-year { display: grid; grid-template-columns: 4em 1fr; gap: 0.7em 0.5em; margin-top: 1.2em; }
dl.by-year dt { font-weight: bold; }
dl.by-year dd { margin: 0; }

/* cv */
.button {
  display: inline-block; border: 1px solid var(--link); border-radius: 4px;
  padding: 5px 14px; margin-right: 10px;
}
.button:hover { background: var(--link); color: var(--bg); text-decoration: none; }
.cv-embed { width: 100%; height: 85vh; border: 1px solid var(--rule); margin-top: 1em; }

/* footer */
.site-footer { border-top: 1px solid var(--rule); margin-top: 4em; }
.site-footer .wrap { padding-top: 14px; padding-bottom: 28px; color: var(--muted); font-size: 0.85rem; }

/* tablets: a narrower figure column keeps the text column readable */
@media (max-width: 900px) {
  .paper.fig-right { grid-template-columns: 1fr 210px; gap: 20px; }
}

/* phones */
@media (max-width: 640px) {
  body { font-size: 17px; }
  .intro { flex-direction: column; align-items: center; text-align: center; gap: 16px; }
  .portrait { width: 170px; }
  .contact-links .sep { margin: 0 0.3em; }
  .cv-embed { height: 70vh; }
  .paper.fig-thumb_left { grid-template-columns: 96px 1fr; gap: 14px; }
  .paper.fig-right { grid-template-columns: 1fr; }
  .paper.fig-right .paper-fig { order: 0; }
  .paper-fig img { max-height: 200px; }
}
