/* ==========================================================================
   Site-Wide Fonts & Design Policy (shared across homepage, papers, and demos)
   --------------------------------------------------------------------------
   Fonts (single source of truth — loaded lazily by unicode-range & usage):
     --font-sans  Lato (400/700 normal & italic, v25 woff2)
     --font-mono  Source Code Pro (400–700 variable, v32 woff2)

   Colors:
     --bg            #ffffff  Page, button, and popover background.
     --bg-code       #f7f7f5  Code listing, inline code & control surface.
     --border        #e4e4e0  Hairline dividers & borders (~black!15).
     --text          #000000  All primary content & paper metadata (prose,
                              headings, authors, affiliations, venues, emails,
                              captions, tables, references, code body/keywords).
     --text-muted    #555555  Chrome ONLY: nav/link separators (/), footers,
                              sidebar TOC, eq numbers, hover # anchors, Copy
                              buttons, and code comments. Never use for main
                              content or paper metadata.
     --accent        #1772d0  Clickable links & active navigation ONLY. Never
                              use for non-clickable elements or code keywords.
     --accent-hover  #f09228  Hover/focus state for links & interactive chrome.
     --highlight-bg  #ffffd0  Highlighted paper rows & :target jump highlights.
     (Homepage-only accents: award badges #d40000 / #c64848, Miscellanea boxes.)

   Typography:
     Homepage (index.html): 32px title, 22px h2, 14px body (normal ~1.2 leading),
                            13px footer.
     Papers (paper.css):    32px title, 22px h2, 18px h3/abstract, 15px regular
                            text (prose, authors, emails, affiliations, venue,
                            top nav, TOC, eq numbers; 14px on mobile <= 640px),
                            13px ONLY for LaTeX-\small equivalents (fig/table
                            captions, tables, bibliography, code, algorithms,
                            footnotes) and small UI chrome (footer, popups,
                            Copy buttons). KaTeX math scaled to 1.14em.
   ========================================================================== */

/* Lato — latin-ext italic 400 */
@font-face {
  font-family: 'Lato';
  font-style: italic;
  font-weight: 400;
  font-display: block;
  src: url(https://fonts.gstatic.com/s/lato/v25/S6u8w4BMUTPHjxsAUi-qNiXg7eU0.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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* Lato — latin italic 400 */
@font-face {
  font-family: 'Lato';
  font-style: italic;
  font-weight: 400;
  font-display: block;
  src: url(https://fonts.gstatic.com/s/lato/v25/S6u8w4BMUTPHjxsAXC-qNiXg7Q.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;
}
/* Lato — latin-ext italic 700 */
@font-face {
  font-family: 'Lato';
  font-style: italic;
  font-weight: 700;
  font-display: block;
  src: url(https://fonts.gstatic.com/s/lato/v25/S6u_w4BMUTPHjxsI5wq_FQftx9897sxZ.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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* Lato — latin italic 700 */
@font-face {
  font-family: 'Lato';
  font-style: italic;
  font-weight: 700;
  font-display: block;
  src: url(https://fonts.gstatic.com/s/lato/v25/S6u_w4BMUTPHjxsI5wq_Gwftx9897g.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;
}
/* Lato — latin-ext normal 400 */
@font-face {
  font-family: 'Lato';
  font-style: normal;
  font-weight: 400;
  font-display: block;
  src: url(https://fonts.gstatic.com/s/lato/v25/S6uyw4BMUTPHjxAwXiWtFCfQ7A.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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* Lato — latin normal 400 */
@font-face {
  font-family: 'Lato';
  font-style: normal;
  font-weight: 400;
  font-display: block;
  src: url(https://fonts.gstatic.com/s/lato/v25/S6uyw4BMUTPHjx4wXiWtFCc.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;
}
/* Lato — latin-ext normal 700 */
@font-face {
  font-family: 'Lato';
  font-style: normal;
  font-weight: 700;
  font-display: block;
  src: url(https://fonts.gstatic.com/s/lato/v25/S6u9w4BMUTPHh6UVSwaPGQ3q5d0N7w.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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* Lato — latin normal 700 */
@font-face {
  font-family: 'Lato';
  font-style: normal;
  font-weight: 700;
  font-display: block;
  src: url(https://fonts.gstatic.com/s/lato/v25/S6u9w4BMUTPHh6UVSwiPGQ3q5d0.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;
}

/* Source Code Pro — greek 400–700 (variable) */
@font-face {
  font-family: 'Source Code Pro';
  font-style: normal;
  font-weight: 400 700;
  font-display: block;
  src: url(https://fonts.gstatic.com/s/sourcecodepro/v32/HI_SiYsKILxRpg3hIP6sJ7fM7PqlPuvWnsUnxlC9.woff2) format('woff2');
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}
/* Source Code Pro — latin-ext 400–700 (variable) */
@font-face {
  font-family: 'Source Code Pro';
  font-style: normal;
  font-weight: 400 700;
  font-display: block;
  src: url(https://fonts.gstatic.com/s/sourcecodepro/v32/HI_SiYsKILxRpg3hIP6sJ7fM7PqlM-vWnsUnxlC9.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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* Source Code Pro — latin 400–700 (variable) */
@font-face {
  font-family: 'Source Code Pro';
  font-style: normal;
  font-weight: 400 700;
  font-display: block;
  src: url(https://fonts.gstatic.com/s/sourcecodepro/v32/HI_SiYsKILxRpg3hIP6sJ7fM7PqlPevWnsUnxg.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;
}

:root {
  --bg: #ffffff;
  --bg-code: #f7f7f5;
  --border: #e4e4e0;
  --text: #000000;
  --text-muted: #555555;
  --accent: #1772d0;
  --accent-hover: #f09228;
  --highlight-bg: #ffffd0;
  --font-sans: 'Lato', Helvetica, Arial, sans-serif;
  --font-mono: 'Source Code Pro', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--accent);
  text-decoration: none;
}

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

h2 {
  margin: 0;
  font-weight: 400;
  font-size: 22px;
}

.page {
  width: 100%;
  max-width: 816px;
  margin: 0 auto;
  padding: 8px;
}

.bio {
  display: flex;
  align-items: center;
}

.bio-text {
  width: 63%;
  padding: 2.5%;
}

.bio-photo {
  width: 37%;
  padding: 2.5%;
}

.bio-photo img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  border-radius: 50%;
}

.name {
  padding-top: 20px;
  margin: 0;
  font-weight: 400;
  font-size: 32px;
  text-align: center;
}

.bio-links {
  text-align: center;
  color: var(--text-muted);
}

.section-header {
  padding: 16px;
}

.highlight {
  background-color: var(--highlight-bg);
}

.papers {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

.paper,
.misc-row {
  display: grid;
  grid-template-columns: 192px minmax(0, 1fr);
  align-items: center;
}

.paper.highlighted {
  background-color: var(--highlight-bg);
}

.paper-media,
.misc-badge {
  padding: 16px;
}

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

.paper-info,
.misc-links {
  padding: 8px;
}

.papertitle {
  font-size: inherit;
  font-weight: 700;
}

.paper-links {
  color: var(--text-muted);
}

.paper-authors {
  text-wrap: balance;
}

.paper-authors a,
.paper-authors strong,
.paper-authors .author {
  white-space: nowrap;
}

.award {
  color: #d40000;
}

.award-highlight {
  color: #c64848;
}

.paper-desc {
  margin: 14px 0 0;
}

.one {
  width: 160px;
  height: 160px;
  position: relative;
}

.one-short,
.one-short .two {
  height: 120px;
}

.two {
  width: 160px;
  height: 160px;
  position: absolute;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease-in-out;
}

.one img,
.paper-media > img {
  width: 100%;
  height: auto;
  display: block;
}

.one video {
  width: 100%;
  height: 100%;
  display: block;
}

@media (hover: hover) {
  .paper:hover > .paper-media > .one > .two {
    opacity: 1;
    pointer-events: auto;
  }
}

.paper.hover-active > .paper-media > .one > .two {
  opacity: 1;
  pointer-events: auto;
}

.colored-box {
  color: var(--text);
  padding: 20px;
  display: inline-block;
  border-radius: 10px;
}

.site-footer {
  text-align: right;
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 18px;
}

@media (max-width: 640px) {
  .page {
    padding: 0;
  }

  .bio {
    flex-direction: column-reverse;
  }

  .bio-text {
    width: 100%;
    padding: 8px 16px;
  }

  .bio-photo {
    width: 100%;
    padding: 20px 16px 0;
    text-align: center;
  }

  .bio-photo img {
    width: 148px;
    margin: 0 auto;
  }

  .name {
    padding-top: 8px;
    font-size: 28px;
  }

  .paper,
  .misc-row {
    grid-template-columns: 124px minmax(0, 1fr);
  }

  .paper-media,
  .misc-badge {
    padding: 12px 8px 12px 12px;
  }

  .paper-info,
  .misc-links {
    padding: 10px 12px 10px 6px;
  }

  .one,
  .two {
    width: 104px;
    height: 104px;
  }

  .one-short,
  .one-short .two {
    height: 78px;
  }

  .colored-box {
    padding: 12px 8px;
    width: 104px;
  }

  .colored-box h2 {
    font-size: 15px;
  }

  .site-footer {
    padding: 0 16px;
  }
}

/* ==========================================================================
   Additions for this site (not in the original template)
   ========================================================================== */

.news-scroll {
  max-height: 140px;
  margin-top: 10px;
  padding: 8px 12px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
  /* Scroll shadows: a soft edge appears only where more news is hidden. */
  background:
    linear-gradient(var(--bg) 30%, rgba(255, 255, 255, 0)) center top / 100% 24px no-repeat local,
    linear-gradient(rgba(255, 255, 255, 0), var(--bg) 70%) center bottom / 100% 24px no-repeat local,
    radial-gradient(farthest-side at 50% 0, rgba(0, 0, 0, 0.14), rgba(0, 0, 0, 0)) center top / 100% 10px no-repeat scroll,
    radial-gradient(farthest-side at 50% 100%, rgba(0, 0, 0, 0.14), rgba(0, 0, 0, 0)) center bottom / 100% 10px no-repeat scroll;
}

.news-scroll:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.news ul {
  margin: 0;
  padding-left: 18px;
}

.news li {
  margin: 0 0 6px;
}

.news li:last-child {
  margin-bottom: 0;
}

.news-date {
  font-weight: 700;
}

/* Education & experience logo tiles */

.logos {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 0 16px 4px;
}

.logo-label {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.logo-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 12px 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.logo-row a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 84px;
  color: var(--text);
  text-align: center;
}

.logo-row .logo-wide a {
  width: 124px;
}

.logo-row a:hover .logo-caption,
.logo-row a:focus-visible .logo-caption {
  color: var(--accent-hover);
}

.logo-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 46px;
}

.logo-row img {
  width: auto;
  height: auto;
  max-width: 80px;
  max-height: 28px;
}

.logo-row .logo-wide img {
  max-width: 120px;
  max-height: 24px;
}

.logo-row img.logo-seal {
  max-width: 44px;
  max-height: 44px;
}

.logo-caption {
  font-size: 11px;
  font-weight: 700;
  line-height: 1.3;
}

.logo-caption .degree {
  display: block;
  font-weight: 400;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Publication venue labels and equal-contribution note */

.venue {
  color: #a51c30;
  font-weight: 700;
}

.pub-note {
  margin: 6px 0 0;
  color: var(--text-muted);
}

/* Paper thumbnails: fit any figure (square or wide) inside the 160x160 box */

.one .zoom {
  display: block;
  width: 100%;
  height: 100%;
  cursor: zoom-in;
}

.one .zoom img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.one .zoom::after {
  content: "";
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6'/%3E%3Cpath d='M15 15l5 5M10.5 8v5M8 10.5h5'/%3E%3C/svg%3E") center / 14px no-repeat;
  opacity: 0;
  transition: opacity 0.15s ease-in-out;
  pointer-events: none;
}

.one .zoom:hover::after,
.one .zoom:focus-visible::after {
  opacity: 1;
}

@media (hover: none) {
  .one .zoom::after {
    opacity: 0.8;
  }
}

/* Quick-view overlay */

.lightbox {
  max-width: 70vw;
  max-height: 66vh;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: visible;
  cursor: zoom-out;
}

.lightbox::backdrop {
  background: rgba(0, 0, 0, 0.82);
}

.lightbox img {
  display: block;
  max-width: 67vw;
  max-height: 63vh;
  width: auto;
  height: auto;
  background: #fff;
  border-radius: 4px;
}

.lightbox-close {
  position: fixed;
  top: 10px;
  right: 14px;
  padding: 0 8px;
  border: 0;
  background: none;
  color: #fff;
  font: 32px/1 var(--font-sans);
  cursor: pointer;
}

.lightbox-close:hover,
.lightbox-close:focus-visible {
  color: var(--accent-hover);
}

/* On phones, keep the quick view full width so wide figures stay readable */
@media (max-width: 640px) {
  .lightbox {
    max-width: 96vw;
    max-height: 94vh;
  }

  .lightbox img {
    max-width: 96vw;
    max-height: 90vh;
  }
}
