/* ===== Fonts (self-hosted, see assets/fonts/README.md) ===== */
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("../fonts/inter-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("../fonts/inter-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "JetBrains Mono"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("../fonts/jetbrains-mono-latin-400-normal.woff2") format("woff2");
}

/* ===== Theme tokens ===== */
:root {
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --maxw: 760px;

  /* light */
  --bg: #ffffff;
  --bg-image: none;
  --surface: #f6f7f9;
  --text: #1d2129;
  --muted: #5c6370;
  --line: #e3e5ea;
  --acc: #b45a69;
  --acc-tint: #f8ecee;
  --on-acc: #ffffff;
  --shadow: 0 10px 40px rgba(20, 24, 40, .18);

  /* domains: bar / text / tint */
  --gw-bar: #AA4499;  --gw-text: #a34193;  --gw-tint: #f3e5f1;
  --pp-bar: #332288;  --pp-text: #332288;  --pp-tint: #e2e0ee;
  --sp-bar: #DDCC77;  --sp-text: #7c7243;  --sp-tint: #faf8ec;
  --bio-bar: #117733; --bio-text: #117733; --bio-tint: #deece2;
  --exo-bar: #88CCEE; --exo-text: #4f768a; --exo-tint: #eef8fd;
  --rs-bar: #999933;  --rs-text: #717126;  --rs-tint: #f1f1e2;
}

:root[data-theme="dark"] {
  --bg: #0b0e18;
  --bg-image: radial-gradient(ellipse 120% 70% at 50% 0%, #141a2e 0%, #0f1322 45%, #0b0e18 100%);
  --surface: rgba(255, 255, 255, .04);
  --text: #e6e8ec;
  --muted: #9aa1ad;
  --line: rgba(255, 255, 255, .10);
  --acc: #CC6677;
  --acc-tint: rgba(204, 102, 119, .14);
  --on-acc: #111318;
  --shadow: 0 10px 50px rgba(0, 0, 0, .6);

  --gw-bar: #AA4499;  --gw-text: #c075b4;  --gw-tint: #331e34;
  --pp-bar: #6457a5;  --pp-text: #857ab8;  --pp-tint: #181631;
  --sp-bar: #DDCC77;  --sp-text: #DDCC77;  --sp-tint: #3e3c2d;
  --bio-bar: #117733; --bio-text: #4f9a68; --bio-tint: #11291e;
  --exo-bar: #88CCEE; --exo-text: #88CCEE; --exo-tint: #2b3c47;
  --rs-bar: #999933;  --rs-text: #9b9b37;  --rs-tint: #2f301e;
}

/* ===== Base ===== */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg);
  background-image: var(--bg-image);
  background-attachment: fixed;
  transition: background-color .25s ease, color .25s ease;
}
a { color: var(--acc); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ===== Header ===== */
.site-header { border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.site-title { font-weight: 650; font-size: 17px; color: var(--text); text-decoration: none; letter-spacing: -0.01em; }
.site-nav { display: flex; align-items: center; gap: 22px; }
.site-nav a { color: var(--text); text-decoration: none; font-size: 15px; padding: 20px 0 19px; border-bottom: 2px solid transparent; transition: color .15s, border-color .15s; }
.site-nav a:hover { color: var(--acc); }
.site-nav a[aria-current="page"] { color: var(--acc); border-bottom-color: var(--acc); }
.theme-toggle {
  background: none; border: 1px solid var(--line); color: var(--text); border-radius: 999px;
  width: 34px; height: 34px; display: grid; place-items: center; cursor: pointer; font-size: 15px;
  transition: border-color .15s, color .15s, transform .15s;
}
.theme-toggle:hover { border-color: var(--acc); color: var(--acc); transform: translateY(-1px); }

/* ===== Main ===== */
main { padding: 48px 0 64px; }
h1 { font-size: 34px; line-height: 1.15; letter-spacing: -0.025em; margin: 0 0 4px; font-weight: 700; }
h2 { font-size: 20px; letter-spacing: -0.015em; margin: 48px 0 16px; padding-bottom: 8px; border-bottom: 1px solid var(--line); font-weight: 650;
     display: flex; justify-content: space-between; align-items: baseline; }
h2 .more { font-size: 14px; font-weight: 500; text-decoration: none; }
h2 .more:hover { text-decoration: underline; }
.page-title { margin-bottom: 8px; }
.page-intro { color: var(--muted); margin: 0 0 28px; }

/* ===== Hero ===== */
.hero { display: grid; grid-template-columns: 170px 1fr; gap: 36px; align-items: center; margin-bottom: 22px; }
.hero .intro { margin: 0; }
.hero h1 { margin-bottom: 10px; }
.hero img.portrait { width: 170px; height: 170px; border-radius: 50%; object-fit: cover; display: block; }
.role { color: var(--muted); margin: 0 0 12px; font-size: 16px; }
.bio p { margin: 0 0 12px; }
.bio .open { color: var(--text); font-weight: 500; }
.links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.links a {
  display: inline-flex; align-items: center; gap: 7px; font-size: 14px; color: var(--text); text-decoration: none;
  border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px 5px 10px; background: var(--surface);
  transition: border-color .15s, color .15s, transform .15s, background .15s;
}
.links a:hover { border-color: var(--acc); color: var(--acc); background: var(--acc-tint); transform: translateY(-1px); }
.links svg { width: 15px; height: 15px; flex: none; }

/* ===== News ===== */
.news { list-style: none; margin: 0; padding: 0; }
.news li { display: grid; grid-template-columns: 82px 1fr; gap: 14px; padding: 7px 0; }
.news .date { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; padding-top: 2px; white-space: nowrap; }
details.older { margin-top: 6px; }
details.older summary {
  cursor: pointer; list-style: none; color: var(--acc); font-size: 14.5px; font-weight: 500; padding: 6px 0; display: inline-flex; align-items: center; gap: 6px;
}
details.older summary::-webkit-details-marker { display: none; }
details.older summary::before { content: "▸"; transition: transform .2s; display: inline-block; }
details.older[open] summary::before { transform: rotate(90deg); }
details.older[open] summary .when-closed, details.older:not([open]) summary .when-open { display: none; }

/* ===== Papers ===== */
.paper {
  --bar: var(--line); --ptext: var(--muted); --ptint: var(--surface);
  position: relative; padding: 2px 0 2px 18px; margin: 0 0 28px;
  transition: transform .18s ease;
}
.paper::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; border-radius: 3px; background: var(--bar);
  transition: width .18s ease;
}
.paper:hover { transform: translateX(3px); }
.paper:hover::before { width: 5px; }
.paper[data-domain="gw"]  { --bar: var(--gw-bar);  --ptext: var(--gw-text);  --ptint: var(--gw-tint); }
.paper[data-domain="pp"]  { --bar: var(--pp-bar);  --ptext: var(--pp-text);  --ptint: var(--pp-tint); }
.paper[data-domain="sp"]  { --bar: var(--sp-bar);  --ptext: var(--sp-text);  --ptint: var(--sp-tint); }
.paper[data-domain="bio"] { --bar: var(--bio-bar); --ptext: var(--bio-text); --ptint: var(--bio-tint); }
.paper[data-domain="exo"] { --bar: var(--exo-bar); --ptext: var(--exo-text); --ptint: var(--exo-tint); }
.paper[data-domain="rs"]  { --bar: var(--rs-bar);  --ptext: var(--rs-text);  --ptint: var(--rs-tint); }
.domain { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 999px; color: var(--ptext); background: var(--ptint); margin-bottom: 6px; letter-spacing: .01em; }
.paper .title { font-weight: 650; font-size: 16.5px; line-height: 1.35; letter-spacing: -0.01em; margin: 0 0 3px; color: var(--text); }
.paper .authors { font-size: 14.5px; color: var(--muted); line-height: 1.5; }
.paper .authors b { color: var(--text); font-weight: 600; }
.paper .venue { font-size: 14.5px; color: var(--muted); line-height: 1.5; }
.paper .award { font-size: 14.5px; color: var(--text); margin-top: 2px; }
.btns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.btn {
  font: inherit; font-size: 13px; line-height: 1.2; color: var(--text); text-decoration: none; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); border-radius: 7px; padding: 5px 11px;
  transition: border-color .15s, color .15s, background .15s, transform .15s;
}
.btn:hover { border-color: var(--acc); color: var(--acc); background: var(--acc-tint); transform: translateY(-1px); text-decoration: none; }

/* ===== Filters ===== */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 32px; }
.filter {
  font: inherit; font-size: 14px; padding: 6px 14px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: transparent; color: var(--text);
  transition: border-color .15s, color .15s, background .15s, transform .15s;
}
.filter:hover { border-color: var(--acc); color: var(--acc); transform: translateY(-1px); }
.filter[aria-pressed="true"] { background: var(--acc); border-color: var(--acc); color: var(--on-acc); font-weight: 600; }
.year { font-size: 15px; font-weight: 650; color: var(--muted); letter-spacing: .04em; margin: 8px 0 14px; }
.collab { margin-top: 40px; border-top: 1px solid var(--line); padding-top: 18px; }
.collab summary { cursor: pointer; font-weight: 600; list-style: none; display: inline-flex; gap: 8px; align-items: center; }
.collab summary::-webkit-details-marker { display: none; }
.collab summary::before { content: "▸"; transition: transform .2s; display: inline-block; color: var(--muted); }
.collab[open] summary::before { transform: rotate(90deg); }
.collab .note { color: var(--muted); font-size: 14.5px; margin: 10px 0 20px; }

/* ===== Talks ===== */
.talk .ttype { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--acc); margin-bottom: 1px; }
.talk .ttitle { font-weight: 650; font-size: 16px; line-height: 1.35; color: var(--text); text-decoration: none; letter-spacing: -0.01em; }
.talk a.ttitle:hover { color: var(--acc); text-decoration: underline; }
.talk .where { color: var(--muted); font-size: 14.5px; margin-top: 2px; }
.talk .where a, .talk .tnote a { color: inherit; }
.talk .where a:hover, .talk .tnote a:hover { color: var(--acc); }
.talk .tnote { font-size: 14.5px; margin-top: 4px; }
.list.talks li { border-bottom: 0; padding: 12px 14px; margin: 0 -14px 4px; border-radius: 12px; border: 1px solid transparent; transition: background .18s, border-color .18s, transform .18s; }
.list.talks li:hover { transform: translateX(3px); }
.list.talks li.highlight { background: var(--surface); border-color: var(--line); }
.list.talks + .year { margin-top: 26px; }
.year.upcoming { color: var(--acc); }
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.card { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
        color: var(--text); text-decoration: none; transition: border-color .15s, transform .15s, background .15s; }
.card:hover { border-color: var(--acc); transform: translateY(-2px); background: var(--acc-tint); text-decoration: none; }
.card .cicon { font-size: 22px; line-height: 1.2; }
.card .ctitle { display: block; font-weight: 600; font-size: 15px; line-height: 1.35; }
.card .cdesc { display: block; color: var(--muted); font-size: 13.5px; line-height: 1.45; margin-top: 3px; }

/* ===== Lists & CV ===== */
.list { list-style: none; padding: 0; margin: 0; }
.list li { display: grid; grid-template-columns: 82px 1fr; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.list .date { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; padding-top: 2px; }
.list .what { font-weight: 600; }
.list .where { color: var(--muted); font-size: 14.5px; }
.list .btns { margin-top: 6px; }
.cv-entry { padding: 8px 0; }
.cv-entry .head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.cv-entry .head b { font-weight: 600; }
.cv-entry .when { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cv-entry .detail { color: var(--muted); font-size: 14.5px; }
.cv-text { margin: 0; }
.list.cv li { grid-template-columns: 150px 1fr; }
.cv-entry .detail.note { color: var(--text); }
.mentoring { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; }

/* ===== Dialog ===== */
dialog {
  border: 1px solid var(--line); border-radius: 14px; padding: 0; width: min(760px, calc(100vw - 32px));
  background: var(--bg); background-image: var(--bg-image); color: var(--text); box-shadow: var(--shadow);
}
dialog::backdrop { background: rgba(10, 12, 20, .55); backdrop-filter: blur(3px); }
dialog .dhead { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
dialog .dhead h3 { margin: 0; font-size: 15px; font-weight: 600; line-height: 1.35; }
dialog .close { background: none; border: 0; color: var(--muted); font-size: 22px; line-height: 1; cursor: pointer; padding: 2px 6px; border-radius: 6px; }
dialog .close:hover { color: var(--acc); }
dialog .dbody { padding: 16px 18px 18px; }
dialog pre {
  margin: 0; font-family: var(--mono); font-size: 12.5px; line-height: 1.55; background: var(--surface);
  border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; overflow: auto; max-height: 55vh; white-space: pre;
}
dialog .dfoot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
dialog .primary { background: var(--acc); border-color: var(--acc); color: var(--on-acc); font-weight: 600; }
dialog .primary:hover { background: var(--acc); color: var(--on-acc); }
dialog img.poster { display: block; width: 100%; max-height: 70vh; object-fit: contain; border-radius: 6px; background: #fff; }

/* ===== Footer ===== */
.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.site-footer .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding-top: 22px; padding-bottom: 28px; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--acc); }

/* ===== Small screens ===== */
@media (max-width: 640px) {
  main { padding-top: 32px; }
  .site-header .wrap { height: auto; padding-top: 12px; padding-bottom: 0; flex-wrap: wrap; }
  .site-nav { gap: 18px; width: 100%; justify-content: space-between; }
  .site-nav a { padding: 12px 0 11px; }
  .hero img.portrait { width: 96px; height: 96px; }
  h1 { font-size: 28px; }
  .news li, .list li, .list.cv li { grid-template-columns: 1fr; gap: 0; }
  .cards { grid-template-columns: 1fr; }
  .hero { grid-template-columns: 96px 1fr; gap: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before { transition: none !important; }
}

/* ===== Extras for the real site ===== */
.skip { position: absolute; left: -9999px; top: 8px; background: var(--acc); color: var(--on-acc); padding: 8px 14px; border-radius: 8px; z-index: 100; text-decoration: none; }
.skip:focus { left: 12px; }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; border-radius: 4px; }
.prose h2 { display: block; }
.prose p, .prose ul { margin: 0 0 14px; }
.notfound { text-align: center; padding: 40px 0; }
.notfound h1 { font-size: 72px; margin-bottom: 8px; }
@media print {
  .site-header nav, .theme-toggle, .btns, .filters, details.older summary { display: none !important; }
  body { background: #fff !important; color: #000; }
}
