/**
 * Homepage layout — table-based grid preserved for pixel-stable rendering.
 * Typography complements stylesheet.css (Libre Franklin, link colors).
 */

:root {
  --color-page-bg: #ffffff;
  --color-text: #1a1a1a;
  --color-text-muted: #555;
  --color-border: #eaeaea;
  --color-link: #b509ac;
  --color-link-hover: #f09228;
  --color-representative: #f4faf1;
  --color-award: #b8860b;
  --shadow-card: 0 10px 24px rgba(20, 24, 28, 0.12), 0 2px 8px rgba(20, 24, 28, 0.06);
  --shadow-photo: 0 8px 20px rgba(20, 24, 28, 0.14), 0 2px 8px rgba(20, 24, 28, 0.08);
  --color-footer-bg: #555555;
  --color-footer-text: #f5f5f5;
  --layout-max-width: 875px;
}

:root[data-theme="dark"] {
  --color-page-bg: #1a1a1a;
  --color-text: #f2f2f2;
  --color-text-muted: #b0b0b0;
  --color-border: #3a3a3a;
  --color-link: #4db8ff;
  --color-link-hover: #ffcc66;
  --color-representative: #17301f;
  --color-award: #e0b84d;
  --shadow-card: 0 10px 26px rgba(0, 0, 0, 0.5), 0 2px 10px rgba(0, 0, 0, 0.35);
  --shadow-photo: 0 8px 22px rgba(0, 0, 0, 0.5), 0 2px 10px rgba(0, 0, 0, 0.35);
  --color-footer-bg: #b0b0b0;
  --color-footer-text: #1a1a1a;
}

*,
*::before,
*::after {
  transition: background-color 0.35s ease, color 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}

/* -------------------------------------------------------------------------- */
/* Accessibility */
/* -------------------------------------------------------------------------- */

.skip-link {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
  z-index: 10000;
  padding: 0.5rem 1rem;
  background: var(--color-page-bg);
  font-family: "Libre Franklin", Verdana, Helvetica, sans-serif;
  font-size: 14px;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
  width: auto;
  height: auto;
  overflow: visible;
  outline: 2px solid var(--color-link);
}

.site-main {
  display: block;
  padding-top: 28px;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--color-page-bg);
  border-bottom: 1px solid var(--color-border);
}

.site-header-inner {
  width: 100%;
  max-width: var(--layout-max-width);
  margin: 0 auto;
}

.site-header-content {
  padding: 12px 2.5%;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-icons {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-icons a {
  color: var(--color-text-muted);
  display: inline-flex;
}

.header-icons a:hover,
.header-icons a:focus {
  color: var(--color-link);
}

.header-icons svg {
  width: 21px;
  height: 21px;
  display: block;
}

.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text-muted);
  padding: 6px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle:hover,
.theme-toggle:focus {
  color: var(--color-link);
  background: var(--color-border);
}

.theme-toggle .icon {
  display: none;
  width: 18px;
  height: 18px;
}

.theme-toggle .icon svg {
  width: 18px;
  height: 18px;
  display: block;
}

.theme-toggle[data-active="auto"] .icon-auto,
.theme-toggle[data-active="light"] .icon-light,
.theme-toggle[data-active="dark"] .icon-dark {
  display: inline-flex;
}

/* -------------------------------------------------------------------------- */
/* Profile & section typography */
/* -------------------------------------------------------------------------- */

.profile-name {
  margin: 0;
  font-weight: 300;
  font-size: 34px;
  color: var(--color-text);
  font-family: "Libre Franklin", Verdana, Helvetica, sans-serif;
}

.section-heading {
  margin: 0;
  font-weight: 300;
  font-size: 23px;
  text-align: left;
  color: var(--color-text);
  font-family: "Libre Franklin", Verdana, Helvetica, sans-serif;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--color-border);
}

.section-heading-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  row-gap: 4px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--color-border);
}

.section-heading-row .section-heading {
  border-bottom: none;
  padding-bottom: 0;
}

.filter-nav {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--color-text-muted);
  font-size: 13.5px;
}

.filter-option {
  border: 0;
  background: none;
  color: var(--color-text-muted);
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
  font-weight: 400;
  line-height: inherit;
  padding: 0;
  position: relative;
  white-space: nowrap;
}

.filter-option:hover {
  color: var(--color-link);
}

.filter-option:focus-visible {
  outline: 2px solid var(--color-link);
  outline-offset: 2px;
}

.filter-option.is-active {
  color: var(--color-link);
}

.filter-option.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 1px;
  background: currentColor;
}

.filter-separator {
  color: var(--color-text-muted);
  user-select: none;
}

.paper-title {
  font-family: "Libre Franklin", Verdana, Helvetica, sans-serif;
  font-size: 14px;
  font-weight: 700;
}

.research-lede {
  font-size: 15px;
  color: var(--color-text-muted);
}

.venue-note {
  font-size: 12.5px;
  color: var(--color-text-muted);
  font-style: italic;
}

.award-star {
  color: var(--color-award);
  font-weight: 700;
  font-style: normal;
}

.text-center {
  text-align: center;
}

/* -------------------------------------------------------------------------- */
/* Page background */
/* -------------------------------------------------------------------------- */

body {
  background-color: var(--color-page-bg);
  color: var(--color-text);
}

/* -------------------------------------------------------------------------- */
/* Representative works (table rows + inline legend span) */
/* -------------------------------------------------------------------------- */

.representative {
  background-color: var(--color-representative);
}

/* -------------------------------------------------------------------------- */
/* Research list filtering (show selected / show all) */
/* -------------------------------------------------------------------------- */

#research-list.filter-selected > table:not(.is-selected) {
  display: none;
}

/* -------------------------------------------------------------------------- */
/* Entry hover "lift" effect (research, theses, patents) */
/* -------------------------------------------------------------------------- */

main table.tbl:has(> tbody > tr > td.cell-thumb),
main table.tbl:has(> tbody > tr > td.cell-logo) {
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-radius 0.22s ease, background-color 0.35s ease, color 0.35s ease, border-color 0.35s ease;
}

main table.tbl:has(> tbody > tr > td.cell-thumb):hover,
main table.tbl:has(> tbody > tr > td.cell-logo):hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-card);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

/* -------------------------------------------------------------------------- */
/* Conference / venue badges */
/* -------------------------------------------------------------------------- */

.conference-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12.5px;
  font-weight: 600;
  color: #333;
  background-color: #e3e3e3;
  border: 1px solid rgba(0, 0, 0, 0.06);
  margin-right: 6px;
  vertical-align: middle;
}

.badge-icra { background-color: #ffd6ba; }
.badge-corl { background-color: #cbdfbd; }
.badge-iclr { background-color: #fbe77d; }
.badge-rss  { background-color: #eac4d5; }
.badge-iros { background-color: #f4f0bb; }
.badge-ral  { background-color: #ffdac6; }
.badge-ar   { background-color: #d9d2e9; }
.badge-aeroconf { background-color: #bcd8e8; }
.badge-tiv  { background-color: #e2ece9; }
.badge-crv  { background-color: #f0ded1; }
.badge-emnlp { background-color: #cfe3f3; }
.badge-eccv { background-color: #d8cfe8; }
.badge-acl  { background-color: #f7d9c4; }
.badge-preprint { background-color: #e3e3e3; }
.badge-phd { background-color: #c9d8ef; }
.badge-bsc { background-color: #e6dcc8; }

/* -------------------------------------------------------------------------- */
/* Bio modal */
/* -------------------------------------------------------------------------- */

.link-button {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  color: var(--color-link);
  cursor: pointer;
}

.link-button:hover,
.link-button:focus {
  color: var(--color-link-hover);
}

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
}

.modal-overlay.open {
  display: flex;
}

.modal {
  position: relative;
  background: var(--color-page-bg);
  color: var(--color-text);
  max-width: 600px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  border-radius: 10px;
  padding: 32px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  font-size: 22px;
  line-height: 1;
  color: var(--color-text-muted);
  cursor: pointer;
}

.modal-close:hover,
.modal-close:focus {
  color: var(--color-link);
}

.modal h2 {
  margin-top: 0;
  font-size: 20px;
  font-weight: 400;
}

/* -------------------------------------------------------------------------- */
/* News */
/* -------------------------------------------------------------------------- */

.updates-card {
  padding: 0 2px;
}

.updates-scroll {
  max-height: 180px;
  overflow-y: auto;
  padding: 2px 0 6px 0;
  mask-image: linear-gradient(to bottom, black calc(100% - 28px), transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, black calc(100% - 28px), transparent 100%);
}

.news-list {
  display: flex;
  flex-direction: column;
}

.news-item {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 14px;
  padding: 9px 0;
}

.news-item + .news-item {
  border-top: 1px solid var(--color-border);
}

.news-date {
  color: var(--color-text-muted);
  font-size: 12px;
  white-space: nowrap;
  padding-top: 1px;
}

.news-text {
  font-size: 13.5px;
  color: var(--color-text);
  line-height: 1.45;
}

/* -------------------------------------------------------------------------- */
/* Layout tables — match legacy inline table/td rules */
/* -------------------------------------------------------------------------- */

.tbl {
  width: 100%;
  border: 0;
  border-spacing: 0;
  border-collapse: separate;
  margin-right: auto;
  margin-left: auto;
}

.tbl--page {
  max-width: var(--layout-max-width);
}

.tbl--page-spaced {
  max-width: var(--layout-max-width);
  margin-top: 26px;
}

.tbl--section-gap {
  margin-top: 18px;
}

.tbl--surface {
  background-color: var(--color-page-bg);
}

.tbl--pad-top {
  padding-top: 12.5px;
}

.cell-pad-0 {
  padding: 0;
}

.cell-profile-photo {
  padding: 2.5%;
  width: 32%;
  max-width: 32%;
}

.cell-profile-bio {
  padding: 2.5%;
  width: 64%;
  vertical-align: middle;
  background-color: var(--color-page-bg);
}

.profile-photo-frame {
  display: block;
  overflow: hidden;
  border-radius: 10px;
  box-shadow: var(--shadow-photo);
}

.profile-photo-img {
  display: block;
  width: 100%;
  max-width: 100%;
}

.section-label {
  text-align: left;
  padding: 14px 20px 0 20px;
}

.cell-thumb {
  padding: 20px;
  width: 25%;
  vertical-align: middle;
}

.cell-full {
  padding: 20px;
  width: 100%;
  vertical-align: middle;
}

.cell-lede {
  padding: 10px 20px 6px 20px;
  width: 100%;
  vertical-align: middle;
}

.cell-full-surface {
  padding: 20px;
  width: 100%;
  vertical-align: middle;
  background-color: var(--color-page-bg);
}

.cell-logo {
  padding: 20px;
  width: 25%;
  vertical-align: middle;
  text-align: center;
}

/* Logos keep a white plate in both themes; many are dark marks on transparency. */
.logo-frame {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 96px;
  height: 96px;
  padding: 12px;
  box-sizing: border-box;
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: 14px;
}

.logo-frame img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
}

.entry-role {
  font-family: "Libre Franklin", Verdana, Helvetica, sans-serif;
  font-size: 14px;
  font-weight: 700;
}

.entry-project {
  font-size: 13px;
  font-style: italic;
  color: var(--color-text-muted);
}

/* Wide diagram thumbnails fill the column rather than sitting at a fixed 140px. */
.cell-thumb img,
.cell-thumb video {
  max-width: 100%;
  height: auto;
}

.cell-thumb .thumb-fill {
  display: block;
  width: 100%;
  height: auto;
}

/* -------------------------------------------------------------------------- */
/* Narrow viewports — collapse the two-column layout tables into stacked rows  */
/* -------------------------------------------------------------------------- */

@media (max-width: 700px) {
  main .cell-profile-photo,
  main .cell-profile-bio,
  main .cell-thumb,
  main .cell-thumb + td,
  main .cell-logo,
  main .cell-logo + td {
    display: block;
    width: auto;
    max-width: none;
    box-sizing: border-box;
  }

  main .cell-profile-photo {
    max-width: 300px;
    margin: 0 auto;
    padding: 20px 20px 0 20px;
  }

  main .cell-profile-bio {
    padding: 16px 20px 4px 20px;
  }

  main .cell-thumb,
  main .cell-logo {
    padding: 18px 20px 0 20px;
    text-align: left;
  }

  main .cell-thumb + td,
  main .cell-logo + td {
    padding: 10px 20px 18px 20px;
  }

  .news-item {
    grid-template-columns: 64px 1fr;
    gap: 10px;
  }
}

/* -------------------------------------------------------------------------- */
/* Footer */
/* -------------------------------------------------------------------------- */

body {
  padding-bottom: 64px;
}

@media (max-width: 480px) {
  body {
    padding-bottom: 120px;
  }
}

.site-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  background: var(--color-footer-bg);
}

.site-footer-inner {
  max-width: var(--layout-max-width);
  margin: 0 auto;
  width: 100%;
}

.site-footer-content {
  padding: 10px 2.5%;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
}

.footer-note {
  font-size: 12px;
  color: var(--color-footer-text);
  text-align: center;
}

/* The footer bar inverts with the theme, so link colors are set against it. */
.footer-note a {
  color: inherit;
  text-decoration: underline;
}

.footer-note a:hover,
.footer-note a:focus {
  color: inherit;
  text-decoration: none;
}

/* -------------------------------------------------------------------------- */
/* Social icon strip (end of page content) */
/* -------------------------------------------------------------------------- */

.site-icons-divider {
  max-width: var(--layout-max-width);
  margin: 18px auto 0 auto;
  border-top: 1px solid var(--color-border);
}

.site-icons-row {
  max-width: var(--layout-max-width);
  margin: 0 auto;
  padding: 26px 2.5%;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
}

.site-icons-row a {
  color: var(--color-text-muted);
  display: inline-flex;
}

.site-icons-row a:hover,
.site-icons-row a:focus {
  color: var(--color-link);
}

.site-icons-row svg {
  width: 26px;
  height: 26px;
  display: block;
}
