/* Personal site: navy throughout, mustard used sparingly.
   Fonts are self-hosted: Josefin Sans (headings), Source Sans 3 (text), JetBrains Mono (labels). */
@font-face { font-family: "Josefin Sans"; font-weight: 600; font-style: normal; font-display: swap; src: url("/assets/fonts/josefin-sans-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Josefin Sans"; font-weight: 700; font-style: normal; font-display: swap; src: url("/assets/fonts/josefin-sans-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-weight: 400; font-style: normal; font-display: swap; src: url("/assets/fonts/source-sans-3-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-weight: 400; font-style: italic; font-display: swap; src: url("/assets/fonts/source-sans-3-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-weight: 600; font-style: normal; font-display: swap; src: url("/assets/fonts/source-sans-3-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-weight: 700; font-style: normal; font-display: swap; src: url("/assets/fonts/source-sans-3-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 400; font-style: normal; font-display: swap; src: url("/assets/fonts/jetbrains-mono-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 500; font-style: normal; font-display: swap; src: url("/assets/fonts/jetbrains-mono-latin-500-normal.woff2") format("woff2"); }

:root {
  --bg: #f7f9fa;          /* near-white, faint cool tint */
  --paper: #ffffff;
  --sky: #e8eff5;
  --sky-strong: #d5e2ec;
  --sky-line: #bfd0de;
  --heading: #0b2447;     /* navy: headings, header rule, footer */
  --fill: #12305c;        /* navy: buttons and active items */
  --fill-hover: #1d4a86;
  --green: #12305c;       /* navy: links and small labels */
  --green-hover: #1d4a86;
  --mint: #e8eff5;
  --amber: #d9a520;       /* mustard: thin lines and one highlight only */
  --peach: #f7ebc2;
  --peach-ink: #5b4308;
  --ink: #14202e;
  --muted: #4c5b6b;
  --line: #dde6ec;
  --link: #12305c;
  --chip: #ebf1f5;
  --display: "Josefin Sans", "Avenir Next", "Century Gothic", "Trebuchet MS", sans-serif;
  --serif: var(--display);
  --sans: "Source Sans 3", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 18px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--green-hover); text-decoration-thickness: 2px; }
h1, h2, h3, h4, h5 { font-family: var(--serif); line-height: 1.2; margin: 0; color: var(--ink); font-weight: 600; letter-spacing: 0.005em; }
h1, h2 { font-weight: 700; }
h1, h2, h3 { color: var(--heading); }
p { margin: 0 0 1em; }
ul, ol { margin: 0; padding: 0; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 22px; }
.muted { color: var(--muted); }

/* header */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: rgba(247, 249, 250, 0.95);
  backdrop-filter: blur(6px);
  border-top: 4px solid var(--fill);
  border-bottom: 1px solid var(--line);
}
.bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 62px; flex-wrap: wrap; }
.brand { font-family: var(--serif); font-size: 1.25rem; font-weight: 700; color: var(--heading); text-decoration: none; letter-spacing: 0.01em; }
.brand:hover { color: var(--fill); }
.nav { display: flex; gap: 6px; flex-wrap: wrap; }
.nav a {
  color: var(--muted); text-decoration: none; padding: 6px 12px; border-radius: 999px;
  font-size: 0.95rem; font-weight: 500;
}
.nav a:hover { color: var(--heading); background: var(--sky); }
.nav a.active { color: #fff; background: var(--fill); }

/* hero */
.hero {
  display: grid; grid-template-columns: 1.35fr 0.85fr; gap: 64px; align-items: center;
  padding-top: 72px; padding-bottom: 72px;
}
.overline {
  font-family: var(--mono); font-size: 0.8rem; letter-spacing: 0.06em; text-transform: none; color: var(--green);
  font-weight: 500; margin-bottom: 14px;
}
.hero h1 { font-size: clamp(2.6rem, 6vw, 4.2rem); letter-spacing: -0.01em; margin-bottom: 18px; }
.lead { font-size: 1.25rem; line-height: 1.55; color: #2c3a4d; max-width: 34em; }
.cta { display: flex; gap: 12px; flex-wrap: wrap; margin: 28px 0 18px; }
.btn {
  display: inline-block; padding: 10px 22px; border-radius: 999px; text-decoration: none;
  background: var(--fill); color: #fff; font-weight: 600; font-size: 0.95rem;
  border: 1.5px solid var(--fill);
}
.btn:hover { background: var(--fill-hover); border-color: var(--fill-hover); color: #fff; }
.btn.ghost { background: transparent; color: var(--fill-hover); border-color: var(--sky-line); }
.btn.ghost:hover { background: var(--fill); border-color: var(--fill); color: #fff; }
.links { font-size: 0.95rem; color: var(--muted); }
.links a { margin-right: 14px; }
.portrait { margin: 0; position: relative; max-width: 340px; justify-self: end; width: 100%; }
.portrait::before {
  content: ""; position: absolute; inset: 16px -16px -16px 16px; border: 3px solid var(--amber);
  border-radius: 999px 999px 20px 20px;
}
.portrait img {
  position: relative; display: block; width: 100%; height: auto; aspect-ratio: 2 / 3; object-fit: cover; object-position: 50% 30%;
  border-radius: 999px 999px 20px 20px; background: var(--chip);
}

/* sections */
.section { padding-top: 56px; padding-bottom: 56px; border-top: 1px solid var(--line); }
.section h2, .cols h2 { font-size: 1.9rem; }
.cols { display: grid; grid-template-columns: 200px 1fr; gap: 32px; }
.prose { max-width: 40em; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.more { font-size: 0.95rem; }

.area-rows { border-bottom: 1px solid var(--line); }
.area-row {
  display: grid; grid-template-columns: 64px minmax(0, 1fr) minmax(0, 1.6fr); gap: 24px; align-items: baseline;
  padding: 20px 0; border-top: 1px solid var(--line); text-decoration: none; color: var(--ink);
}
.area-row:hover { background: rgba(15, 47, 92, 0.06); color: var(--ink); }
.area-row:hover .area-title { color: var(--fill); }
.num { font-family: var(--mono); font-size: 1.2rem; color: var(--green); }
.area-title { font-family: var(--serif); font-size: 1.2rem; font-weight: 600; color: var(--heading); }
.area-text { color: var(--muted); font-size: 0.98rem; }

/* page heads */
.page-head { padding-top: 56px; padding-bottom: 28px; }
.page-head h1 { font-size: clamp(2rem, 4.4vw, 3rem); margin-bottom: 14px; max-width: 20em; }
.page-head .lead { font-size: 1.12rem; max-width: 42em; }
.jump { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.jump a {
  font-size: 0.9rem; text-decoration: none; padding: 6px 14px; border: 1px solid var(--sky-line);
  border-radius: 999px; background: var(--paper); color: var(--heading);
}
.jump a:hover { border-color: var(--fill); background: var(--fill); color: #fff; }

/* papers */
.papers { list-style: none; }
.paper { padding: 16px 0; border-top: 1px solid var(--line); }
.paper:first-child { border-top: 0; }
.paper-title { font-family: var(--sans); font-size: 1.15rem; font-weight: 700; line-height: 1.35; color: var(--heading); }
.paper-authors { color: #3b485c; font-size: 0.95rem; margin-top: 4px; }
.paper-authors .me { color: var(--ink); font-weight: 700; }
.paper-venue { color: var(--muted); font-size: 0.93rem; margin-top: 6px; }
.plink { margin-left: 8px; font-weight: 600; }
.chip {
  display: inline-block; font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.04em; text-transform: uppercase; font-weight: 500;
  padding: 2px 9px; border-radius: 999px; background: var(--chip); color: var(--muted); margin-right: 8px; vertical-align: 1px;
}
.chip.published { background: var(--sky); color: var(--heading); }
.chip.review { background: var(--peach); color: var(--peach-ink); }
.chip.progress { background: transparent; border: 1px solid var(--sky-line); color: var(--muted); }
.chip.abstract { background: #e6ecf3; color: #3b4a5e; }
.abs { margin-top: 8px; font-size: 0.94rem; }
.abs summary { cursor: pointer; color: var(--link); font-weight: 600; }
.abs summary:hover { color: var(--green-hover); }
.abs p { margin: 8px 0 0; color: #2c3a4d; max-width: 46em; }

.area-block { padding: 44px 0 20px; border-top: 1px solid var(--line); }
.area-head { display: flex; align-items: baseline; gap: 18px; margin-bottom: 10px; }
.area-head h2 { font-size: 1.7rem; }
.area-desc { max-width: 44em; color: #2c3a4d; margin-bottom: 14px; }

/* publications filters */
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 26px; }
.pill {
  font: inherit; font-size: 0.92rem; cursor: pointer; padding: 7px 16px; border-radius: 999px;
  border: 1px solid var(--sky-line); background: var(--paper); color: var(--heading);
}
.pill span { color: var(--muted); margin-left: 4px; font-size: 0.85em; }
.pill:hover { border-color: var(--fill); }
.pill.active { background: var(--fill); color: #fff; border-color: var(--fill); }
.pill.active span { color: #c9dcf2; }
.search {
  font: inherit; font-size: 0.92rem; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--sky-line);
  background: var(--paper); min-width: 240px; margin-left: auto;
}
.search:focus, .pill:focus-visible { outline: 2px solid var(--fill); outline-offset: 2px; }
.empty { color: var(--muted); margin-top: 18px; }
.pubs { padding-bottom: 40px; }
.pub-group { padding: 26px 0 6px; border-top: 1px solid var(--line); display: grid; grid-template-columns: 120px 1fr; gap: 24px; }
.year { font-size: 1.6rem; color: var(--heading); align-self: start; padding-top: 10px; border-top: 3px solid var(--heading); margin-top: -27px; width: max-content; max-width: 100%; }

/* CV */
.cv-layout { display: grid; grid-template-columns: 210px 1fr; gap: 40px; padding-bottom: 60px; }
.cv-toc { position: sticky; top: 88px; align-self: start; display: flex; flex-direction: column; gap: 2px; font-size: 0.93rem; }
.cv-toc a { text-decoration: none; color: var(--muted); padding: 5px 10px; border-left: 3px solid var(--line); }
.cv-toc a:hover { color: var(--heading); border-left-color: var(--fill); }
.cv-section { padding: 6px 0 34px; }
.cv-section > h2 { font-size: 1.7rem; padding-bottom: 10px; border-bottom: 2px solid var(--sky-line); margin-bottom: 8px; }
.subhead { font-size: 1.15rem; color: var(--green); margin: 26px 0 6px; }
.entries { margin-bottom: 4px; }
.entry { display: grid; grid-template-columns: 170px 1fr; gap: 22px; padding: 16px 0; border-top: 1px solid var(--line); }
.entry:first-child { border-top: 0; }
.entry-date { font-family: var(--mono); color: var(--muted); font-size: 0.82rem; padding-top: 3px; }
.entry h4 { font-size: 1.08rem; color: var(--heading); }
.entry h5 { font-size: 1.02rem; margin-top: 12px; }
.meta { color: var(--muted); font-size: 0.93rem; margin: 2px 0 6px; }
.meta .deg { font-family: var(--sans); font-size: 1.05rem; font-weight: 700; color: var(--ink); }
.entry ul { padding-left: 1.2em; margin: 6px 0 0; font-size: 0.97rem; }
.entry li { margin-bottom: 4px; }
.entry li::marker { color: var(--green); }
.entry p { font-size: 0.97rem; margin-bottom: 4px; }
.note { color: var(--muted); font-size: 0.9rem; margin: 10px 0 0; }
.cv-list { padding-left: 2.2em; font-size: 0.96rem; margin-top: 6px; }
.cv-list li { padding: 5px 0 5px 6px; }
.cv-list li::marker { color: var(--green); font-size: 0.85em; }
.venues { list-style: none; margin: 4px 0 0; padding-left: 0; color: var(--muted); font-size: 0.9rem; }
.venues li { padding: 0 !important; }

/* contact call-out */
.callout {
  background: var(--mint); border: 1px solid var(--sky-line); border-left: 8px solid var(--amber);
  border-radius: 16px; padding: 26px 30px; max-width: 42em; color: var(--ink);
}
.callout h3 { font-size: 1.35rem; margin-bottom: 10px; }
.callout p { margin-bottom: 0.9em; }
.callout .btn { margin-top: 4px; }

/* footer */
.site-footer { background: var(--heading); color: #d5e4f5; margin-top: 24px; border-top: 4px solid var(--amber); }
.foot { display: flex; justify-content: space-between; gap: 24px; padding-top: 32px; padding-bottom: 36px; font-size: 0.93rem; flex-wrap: wrap; }
.foot-name { font-family: var(--serif); font-size: 1.1rem; color: #fff; font-weight: 600; }
.foot-right { text-align: right; }
.site-footer a { color: #fff; }
.site-footer a:hover { color: #f1d78a; }
.site-footer .muted { color: #a9c3e2; }

/* small screens */
@media (max-width: 820px) {
  body { font-size: 16.5px; }
  .hero { grid-template-columns: 1fr; gap: 40px; padding-top: 44px; padding-bottom: 48px; }
  .hero { text-align: center; }
  .portrait { justify-self: center; max-width: 240px; order: -1; margin: 0 auto; }
  .portrait::before { inset: -9px; border-radius: 999px 999px 28px 28px; }
  .lead { margin-left: auto; margin-right: auto; }
  .cta { justify-content: center; }
  .links a { margin: 0 8px; }
  .cols { grid-template-columns: 1fr; gap: 14px; }
  .area-row { grid-template-columns: 44px 1fr; gap: 6px 14px; }
  .area-text { grid-column: 2; }
  .pub-group { grid-template-columns: 1fr; gap: 4px; }
  .year { margin-top: 0; border-top: 0; padding-top: 0; border-bottom: 3px solid var(--heading); padding-bottom: 4px; margin-bottom: 8px; }
  .search { margin-left: 0; width: 100%; }
  .cv-layout { grid-template-columns: 1fr; gap: 12px; }
  .cv-toc { position: static; flex-direction: row; flex-wrap: wrap; gap: 6px; }
  .cv-toc a { border: 1px solid var(--sky-line); border-radius: 999px; padding: 4px 12px; background: var(--paper); }
  .entry { grid-template-columns: 1fr; gap: 2px; }
  .foot { flex-direction: column; align-items: center; text-align: center; }
  .foot-right { text-align: center; }
  .bar { flex-direction: column; align-items: center; gap: 6px; }
  .nav { justify-content: center; }
  .brand { font-size: 1.1rem; }
  body { font-size: 17px; }
}

@media print {
  .site-header, .cv-toc, .cta, .site-footer, .filters { display: none; }
  body { background: #fff; font-size: 11pt; }
}
