/* =====================================================================
   site.css — the look of every page.
   Change the values in :root to restyle the whole site at once.
   ===================================================================== */

:root {
  --accent: #2252a0;        /* links, buttons, small highlights */
  --accent-dark: #173d7a;   /* buttons while hovered, tagline */
  --accent-soft: #e8effa;   /* pale accent backgrounds */
  --glow: 34, 82, 160;      /* the accent as R, G, B: soft glow at the top of the page */
  --ink: #18202b;           /* main text */
  --muted: #566273;         /* secondary text */
  --line: #dfe5ee;          /* thin borders */
  --tint: #f5f8fc;          /* soft backgrounds */
  --max: 1080px;            /* width of the page content */

  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --heading: var(--sans);   /* typeface of your name and the section headings */
  --shadow: 0 1px 2px rgba(16, 32, 64, 0.05), 0 14px 32px -20px rgba(16, 32, 64, 0.3);
  --shadow-raised: 0 2px 4px rgba(16, 32, 64, 0.05), 0 24px 44px -24px rgba(16, 32, 64, 0.38);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* ---------- basics ---------- */

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
  background-color: #fff;
  /* two soft glows and a fade at the top of every page */
  background-image:
    radial-gradient(820px 420px at 90% -80px, rgba(var(--glow), 0.15), transparent 70%),
    radial-gradient(640px 360px at 0% -140px, rgba(var(--glow), 0.08), transparent 70%),
    linear-gradient(180deg, var(--tint), #fff 620px);
  background-repeat: no-repeat;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
p { margin: 0 0 1rem; }
::selection { background: var(--accent-soft); }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

/* keeps the footer at the bottom of the window on short pages */
#site { display: flex; flex-direction: column; min-height: 100vh; }
#site > main { flex: 1 0 auto; width: 100%; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 28px; }
.wrap.narrow { max-width: 870px; }

.icon { flex: none; width: 16px; height: 16px; }

.skip { position: absolute; top: -80px; left: 20px; z-index: 30; padding: 12px; background: #fff; }
.skip:focus { top: 10px; }

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid transparent;
  transition: background-color 0.3s, border-color 0.3s;
}
/* once the page is scrolled, the header turns into frosted glass */
.site-header.is-scrolled {
  border-bottom-color: var(--line);
  background-color: rgba(255, 255, 255, 0.78);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
}
.nav { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 72px; }
.brand { color: var(--ink); font-family: var(--heading); font-size: 18px; font-weight: 700; letter-spacing: -0.015em; line-height: 1; transition: color 0.2s; }
.brand:hover { color: var(--accent); text-decoration: none; }
.nav-links { display: flex; gap: 4px; font-size: 15px; }
.nav-links a { padding: 7px 15px; border-radius: 999px; color: var(--muted); transition: color 0.2s, background-color 0.2s; }
.nav-links a:hover { background-color: rgba(var(--glow), 0.08); color: var(--ink); text-decoration: none; }
.nav-links a[aria-current="page"] { background-color: var(--accent-soft); color: var(--accent-dark); font-weight: 500; }

/* ---------- About page: introduction ---------- */

.hero { display: grid; grid-template-columns: minmax(0, 1fr) 260px; align-items: center; gap: 76px; padding: 72px 14px 80px 0; }
.hero.no-photo { grid-template-columns: minmax(0, 1fr); }
.hero h1 { margin-bottom: 14px; font-family: var(--heading); font-size: clamp(40px, 6.2vw, 66px); font-weight: 700; line-height: 1.05; letter-spacing: -0.035em; }
.tagline { margin-bottom: 26px; color: var(--accent); font-size: clamp(17px, 2vw, 20px); font-weight: 500; line-height: 1.4; }
.bio p { max-width: 660px; color: var(--ink); font-size: 17px; line-height: 1.75; }
.bio p:first-child { font-size: 19px; line-height: 1.7; }
.bio a { text-decoration: underline; text-decoration-color: rgba(var(--glow), 0.35); text-underline-offset: 3px; }
.bio a:hover { text-decoration-color: currentColor; }
.hero .buttons { gap: 10px; margin-top: 28px; }

.portrait-frame { position: relative; width: 260px; height: 260px; }
.portrait { width: 100%; height: 100%; border: 6px solid #fff; border-radius: 50%; object-fit: cover; box-shadow: 0 26px 48px -22px rgba(16, 32, 64, 0.5), 0 2px 6px rgba(16, 32, 64, 0.08); }
/* a thin ring around the portrait, with an accent-coloured arc on top of it */
.portrait-frame::before, .portrait-frame::after { content: ""; position: absolute; inset: -14px; border-radius: 50%; }
.portrait-frame::before { border: 1px solid rgba(var(--glow), 0.14); }
.portrait-frame::after {
  background: conic-gradient(from 150deg, transparent 0turn, var(--accent) 0.3turn, transparent 0.62turn);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2.5px), #000 calc(100% - 2px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 2.5px), #000 calc(100% - 2px));
}

/* ---------- sections: heading on the left, content on the right ---------- */

.section { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 20px 56px; padding: 60px 0; border-top: 1px solid var(--line); }
.section-label h2 { font-family: var(--heading); font-size: 26px; font-weight: 700; line-height: 1.15; letter-spacing: -0.02em; }
.more-link { display: inline-flex; align-items: center; gap: 6px; margin-top: 14px; font-size: 14px; font-weight: 500; }
.more-link .icon { width: 15px; height: 15px; transition: transform 0.25s var(--ease); }
.more-link:hover { text-decoration: none; }
.more-link:hover .icon { transform: translateX(4px); }

/* ---------- research interests ---------- */

.interest-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin: 0; padding: 0; list-style: none; }
.interest-grid li { padding: 22px 22px 24px; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: var(--shadow); font-size: 17px; font-weight: 600; line-height: 1.4; }
.interest-grid li::before { content: ""; display: block; width: 28px; height: 3px; margin-bottom: 16px; border-radius: 3px; background: linear-gradient(90deg, var(--accent), rgba(var(--glow), 0.45)); }

/* ---------- highlighted announcement ---------- */

.notice { margin-bottom: 60px; padding: 30px 34px; border: 1px solid rgba(var(--glow), 0.16); border-radius: 18px; background: linear-gradient(135deg, var(--accent-soft), var(--tint)); }
.notice h2 { margin-bottom: 14px; font-family: var(--heading); font-size: 22px; font-weight: 700; line-height: 1.25; letter-spacing: -0.015em; }
.notice p { max-width: 820px; }
.notice p:last-child { margin-bottom: 0; }

/* ---------- publication cards ---------- */

.publication { display: grid; grid-template-columns: 220px minmax(0, 1fr); align-items: center; gap: 28px; padding: 22px; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: var(--shadow); transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), border-color 0.35s; }
.publication.no-image { grid-template-columns: minmax(0, 1fr); }
.publication + .publication { margin-top: 18px; }
.publication:hover { border-color: rgba(var(--glow), 0.28); box-shadow: var(--shadow-raised); transform: translateY(-2px); }
.publication-image { display: block; aspect-ratio: 16 / 10; overflow: hidden; padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.publication-image img { width: 100%; height: 100%; object-fit: contain; transition: transform 0.5s var(--ease); }
.publication:hover .publication-image img { transform: scale(1.04); }
.venue { display: inline-block; margin: 0 0 10px; padding: 3px 10px; border-radius: 6px; background: var(--accent-soft); color: var(--accent-dark); font-size: 12.5px; font-weight: 600; letter-spacing: 0.02em; line-height: 1.5; }
.publication h3 { margin-bottom: 8px; font-size: 19px; font-weight: 600; line-height: 1.4; }
.publication h3 a { color: var(--ink); transition: color 0.2s; }
.publication h3 a:hover { color: var(--accent); text-decoration: none; }
.authors { margin: 0; color: var(--muted); font-size: 15px; }
.authors strong { color: var(--ink); font-weight: 600; }

/* ---------- pill buttons (Email, PDF, Code, …) ---------- */

.buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.button { display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 7px 16px; border: 1px solid #cfd8e6; border-radius: 999px; background: #fff; color: var(--ink); font-size: 14px; font-weight: 500; transition: transform 0.2s var(--ease), background-color 0.2s, border-color 0.2s, color 0.2s; }
.button .icon { color: var(--accent); }
.button:hover { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-dark); text-decoration: none; transform: translateY(-1px); }
.button.is-primary { border-color: var(--accent); background: var(--accent); color: #fff; }
.button.is-primary .icon { color: #fff; }
.button.is-primary:hover { border-color: var(--accent-dark); background: var(--accent-dark); color: #fff; }
.button.is-pending { border-color: var(--line); background: var(--tint); color: var(--muted); }
.button.is-pending:hover { transform: none; }

/* ---------- talks ---------- */

.talk-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.talk { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 16px 20px; border: 1px solid var(--line); border-radius: 14px; background: #fff; color: var(--ink); font-size: 16px; font-weight: 500; line-height: 1.5; transition: border-color 0.25s, color 0.25s, background-color 0.25s; }
.talk .icon { width: 18px; height: 18px; color: var(--accent); transition: transform 0.25s var(--ease); }
a.talk:hover { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-dark); text-decoration: none; }
a.talk:hover .icon { transform: translate(2px, -2px); }

/* ---------- Publications page ---------- */

.page-head { padding: 72px 0 48px; }
.page-head h1 { margin-bottom: 14px; font-family: var(--heading); font-size: clamp(36px, 5.6vw, 56px); font-weight: 700; line-height: 1.05; letter-spacing: -0.035em; }
.page-head p { margin: 0; color: var(--muted); font-size: 18px; }
.year { color: var(--muted); }

/* ---------- project pages ---------- */

.project-hero { padding: 56px 0 40px; text-align: center; }
.project-hero h1 { margin-bottom: 14px; font-family: var(--heading); font-size: clamp(38px, 6vw, 60px); font-weight: 700; line-height: 1.05; letter-spacing: -0.035em; }
.project-subtitle { max-width: 820px; margin: 0 auto 18px; font-size: 24px; line-height: 1.4; }
.project-hero .venue { margin-bottom: 20px; font-size: 13.5px; }
.project-authors { margin-bottom: 6px; font-size: 18px; }
.project-affiliation { margin: 0; color: var(--muted); font-size: 15px; }
.project-hero .buttons { justify-content: center; margin: 26px 0 34px; }
.project-hero .button { min-height: 42px; padding: 9px 20px; font-size: 15px; }
.figure-link { display: block; }
.figure-link img { margin: 0 auto; }
.teaser { max-width: 100%; border-radius: 14px; }

.project-section { padding: 52px 0; border-top: 1px solid var(--line); }
.project-section h2 { margin-bottom: 20px; font-family: var(--heading); font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
.project-section p { max-width: 860px; font-size: 17px; line-height: 1.8; }
.project-section figure { margin: 28px 0 0; }
.project-section figure img { border-radius: 12px; }
.project-section h2 + figure { margin-top: 0; }
.project-section video { display: block; width: 100%; height: auto; aspect-ratio: auto 16 / 9; border: 1px solid var(--line); border-radius: 12px; background: var(--tint); box-shadow: var(--shadow); }
.project-section .caption { max-width: none; margin: 16px 0 0; color: var(--muted); font-size: 14.5px; line-height: 1.7; }
.project-section .caption + .caption { margin-top: 8px; }

/* ---------- results tables on project pages ---------- */

.table-scroll { margin-top: 26px; overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
th, td { padding: 10px 12px; text-align: right; white-space: nowrap; }
th.text, td.text { text-align: left; }
thead th { background: var(--tint); color: var(--muted); font-size: 13px; font-weight: 600; }
thead tr:last-child th { border-bottom: 1px solid var(--line); }
thead .group-row th { padding-bottom: 0; color: var(--ink); text-align: center; }
tbody th { font-weight: 600; vertical-align: top; white-space: normal; min-width: 150px; }
tbody tr.group-start > * { border-top: 1px solid var(--line); }
tbody tr:first-child > * { border-top: 0; }
tbody tr.ours { background: var(--accent-soft); }
tbody tr.ours th { color: var(--accent-dark); }
td b { font-weight: 700; }
td u { text-decoration-thickness: 1px; text-underline-offset: 3px; }
th:first-child { padding-left: 18px; }
th:last-child, td:last-child { padding-right: 18px; }

.bibtex-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.bibtex-head h2 { margin: 0; }
.copy { cursor: pointer; font-family: inherit; }
pre { margin: 0; padding: 22px; overflow: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--tint); font-size: 13px; line-height: 1.7; }
.status { min-height: 20px; margin: 10px 0 0; color: var(--accent); font-size: 13px; }

/* ---------- footer ---------- */

.site-footer { margin-top: 48px; padding: 32px 0 38px; border-top: 1px solid var(--line); background: var(--tint); color: var(--muted); font-size: 14px; }
.footer-inner { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 10px 24px; }
.footer-name { margin-right: 10px; color: var(--ink); font-family: var(--heading); font-size: 16px; font-weight: 700; letter-spacing: -0.01em; }

/* ---------- phones and narrow windows ---------- */

@media (max-width: 820px) {
  .wrap { padding: 0 20px; }
  .nav { min-height: 64px; gap: 12px; }
  .brand { font-size: 17px; }
  .nav-links { font-size: 14px; }
  .nav-links a { padding: 6px 11px; }

  .hero { grid-template-columns: minmax(0, 1fr); gap: 34px; padding: 44px 0 52px; }
  .portrait-frame { grid-row: 1; width: 176px; height: 176px; margin: 10px 0 0 12px; }
  .portrait-frame::before, .portrait-frame::after { inset: -11px; }
  .bio p { font-size: 16px; }
  .bio p:first-child { font-size: 17.5px; }

  .section { grid-template-columns: minmax(0, 1fr); gap: 22px; padding: 44px 0; }
  .section-label h2 { font-size: 23px; }
  .more-link { margin-top: 8px; }
  .notice { margin-bottom: 44px; padding: 24px 22px; }
  .notice h2 { font-size: 20px; }

  .publication { grid-template-columns: minmax(0, 1fr); gap: 18px; padding: 16px; }
  .publication-image { max-width: 440px; }

  .page-head { padding: 48px 0 36px; }
  .project-hero { padding: 40px 0 30px; }
  .project-subtitle { font-size: 20px; }
  .project-authors { font-size: 16px; }
  .project-section { padding: 40px 0; }
  .project-section h2 { font-size: 23px; }
  .project-section p { font-size: 16px; }
  .project-section .caption { font-size: 14px; }
  table { font-size: 13px; }
  th, td { padding: 9px 10px; }
  pre { padding: 16px; font-size: 12px; }
}

/* ---------- motion (skipped for visitors who ask for reduced motion) ---------- */

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }

  /* the introduction eases in when the page opens */
  .hero-text > *, .page-head > *, .project-hero > * { animation: rise 0.8s var(--ease) both; }
  .hero-text > :nth-child(2), .page-head > :nth-child(2), .project-hero > :nth-child(2) { animation-delay: 0.07s; }
  .hero-text > :nth-child(3), .project-hero > :nth-child(3) { animation-delay: 0.14s; }
  .hero-text > :nth-child(n + 4), .project-hero > :nth-child(n + 4) { animation-delay: 0.21s; }
  .portrait-frame { animation: pop 0.9s var(--ease) 0.1s both; }

  /* sections fade in as they scroll into view (site.js adds these classes) */
  .reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
  .reveal.is-visible { opacity: 1; transform: none; }
}

@keyframes rise { from { opacity: 0; transform: translateY(16px); } }
@keyframes pop { from { opacity: 0; transform: scale(0.94); } }

/* ---------- printing: show everything, without the sticky header ---------- */

@media print {
  .site-header { position: static; }
  .reveal { opacity: 1 !important; transform: none !important; }
}
