:root {
  --project-description-spacing: 6px;
  --award-highlight-color: #E43F37;
  --cv-divider: #e7edf5;
  --link-color: #305b81;
  --link-hover: #c58b5c;
}

body {
  margin-top: 50px;
  margin-bottom: 60px;
  font-family: "Source Sans Pro", "Lato", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 155%;
  font-size: 15.4px;
  color: #1d2731;
}

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

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

heading {
  display: block;
  font-size: 22px;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--cv-divider);
}

papertitle {
  font-size: 17px;
  font-weight: 700;
}

name {
  font-size: 32px;
  line-height: 130%;
  font-weight: 600;
}

.profile-name {
  padding-top: 18px;
  margin-bottom: 18px;
}

/* Page-load float-in for hero elements (staggered) */
.profile-name,
.intro-col > p {
  animation: subtleFloatIn 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: var(--float-delay, 0ms);
  will-change: transform, opacity;
}

.profile-name                 { --float-delay: 40ms; }
.intro-col > p:nth-of-type(1) { --float-delay: 80ms; }
.profile-links                { --float-delay: 200ms; }

@keyframes subtleFloatIn {
  from { opacity: 0; transform: translate3d(0, 18px, 0) scale(0.992); }
  to   { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}

/* Slower, "develop from black" entrance for the profile photo */
.profile-photo {
  animation: profileFadeIn 2.2s cubic-bezier(0.22, 1, 0.36, 1) 200ms both;
  will-change: transform, filter;
  background: #000;
}

@keyframes profileFadeIn {
  from {
    filter: brightness(0) blur(6px);
    transform: scale(0.97);
  }
  to {
    filter: brightness(1) blur(0);
    transform: scale(1);
  }
}

/* Scroll-triggered reveal for sections below the fold */
.scroll-reveal {
  opacity: 0;
  transform: translate3d(0, 18px, 0) scale(0.992);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: var(--scroll-reveal-delay, 0ms);
  will-change: transform, opacity;
}

.scroll-reveal.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
}

@media (prefers-reduced-motion: reduce) {
  .profile-name,
  .intro-col > p,
  .profile-photo {
    animation: none;
    opacity: 1;
    transform: none;
    filter: none;
    background: transparent;
  }
  .scroll-reveal,
  .scroll-reveal.is-visible {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

note {
  color: #080808a6;
  font-size: 13px;
}

u {
  text-underline-offset: 3px;
}

.mobile-photo-wrap {
  display: none;
}

.profile-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px 8px;
  margin-top: 12px;
}

.profile-links a,
.profile-links .link-separator {
  white-space: nowrap;
}

.link-separator {
  color: #8b97a3;
  user-select: none;
}

.profile-photo {
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(28, 40, 54, 0.12);
  aspect-ratio: 1 / 1;
  object-fit: cover;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 0.35s ease;
}

.profile-photo:hover {
  transform: translateY(-2px) scale(1.015);
  box-shadow: 0 14px 32px rgba(28, 40, 54, 0.18);
}

/* Research highlights */
.research-intro {
  margin-bottom: 6px;
}

.research-areas {
  margin-top: 0;
  margin-bottom: 0;
  padding-left: 22px;
}

.research-area-title {
  font-weight: 700;
}

.award-highlight {
  color: var(--award-highlight-color);
}

a.award-highlight,
a.award-highlight:hover,
a.award-highlight:visited,
a.award-highlight:active,
a.award-highlight:focus {
  color: var(--award-highlight-color);
}

/* News list */
.news-list {
  margin-bottom: 0;
  padding-left: 0;
  list-style: none;
}

.news-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 1px 0;
}

.news-date {
  position: relative;
  display: inline-block;
  width: 78px;
  flex-shrink: 0;
  font-size: 1em;
  font-weight: 700;
  color: #4f5a66;
  line-height: 1.55;
  white-space: nowrap;
  padding-left: 14px;
  font-variant-numeric: tabular-nums;
}

.news-date::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 5px;
  height: 5px;
  background: #8e98a3;
  border-radius: 50%;
  transform: translateY(-50%);
}

.news-item-body {
  flex: 1;
}

.news-list.collapsed .news-item--extra {
  display: none;
}

.news-toggle {
  background: none;
  border: none;
  color: var(--link-color);
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
  padding: 0;
  margin-top: 6px;
}

.news-toggle:hover {
  color: var(--link-hover);
}

/* Project / research card list */
.project-heading-row {
  display: flex;
  align-items: baseline;
  justify-content: flex-start;
  gap: 12px;
  flex-wrap: wrap;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--cv-divider);
}

.project-heading-row heading {
  margin: 0;
  padding: 0;
  border-bottom: 0;
}

.paper-media {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  box-shadow: 0 6px 14px rgba(28, 40, 54, 0.10);
  background: #000;
}

video.paper-media {
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.project-description {
  margin-top: 10px;
}

.project-meta {
  margin-top: 5px;
  font-size: 14.5px;
  line-height: 1.55;
}

.project-meta:first-of-type {
  margin-top: 9px;
}

.project-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.project-meta-row .project-status,
.project-meta-row .project-date {
  margin-left: 0;
}

.project-date {
  color: #5a6673;
  font-size: 13.5px;
  white-space: nowrap;
}

.project-status {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 9px 2px;
  border-radius: 999px;
  background: rgba(48, 91, 129, 0.10);
  color: #305b81;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  vertical-align: 1px;
  white-space: nowrap;
}

.project-status.dot::before {
  content: "●";
  display: inline-block;
  margin-right: 5px;
  color: #2f9e6b;
  vertical-align: 0;
  font-size: 9px;
}

table.project-table td:first-of-type {
  vertical-align: top !important;
}

.projects-list {
  border-spacing: 0 2px !important;
}

.projects-list tbody tr {
  transition: transform 0.22s ease;
}

.projects-list tbody tr td {
  background: transparent;
  transition: background 0.22s ease, box-shadow 0.22s ease;
}

.projects-list tbody tr td:first-child {
  border-radius: 14px 0 0 14px;
}

.projects-list tbody tr td:last-child {
  border-radius: 0 14px 14px 0;
}

@media (min-width: 701px) {
  .projects-list tbody > tr > td:first-child {
    width: 26% !important;
  }
  .projects-list tbody > tr > td:last-child {
    width: 74% !important;
  }
}

.projects-list tbody tr:hover {
  transform: translateY(-2px);
}

.projects-list tbody tr:hover td {
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(20, 24, 28, 0.10), 0 2px 8px rgba(20, 24, 28, 0.05);
}

/* CV-style entries (Honors / Education) */
.cv-list {
  margin-top: 8px;
}

.cv-entry {
  display: grid;
  grid-template-columns: 110px 1fr;
  column-gap: 10px;
  align-items: flex-start;
  margin: 0;
  padding: 4px 0;
}

.cv-year {
  text-align: left;
  font-weight: 700;
  font-size: 1em;
  line-height: 1.55;
  color: #2d4e6b;
  padding: 0 2px 0 6px;
  border-left: 3px solid #9fb9d3;
  white-space: nowrap;
}

.cv-detail {
  color: #4f5a66;
  font-size: 0.95em;
}

.honors-list .cv-entry {
  grid-template-columns: 80px 1fr;
  column-gap: 6px;
}

/* Experience — flat list using subgrid so all dates align in one column */
.experience-list {
  margin-top: 8px;
  display: grid;
  grid-template-columns: 90px 1fr auto;
  column-gap: 18px;
  border-top: 1px solid var(--cv-divider);
}

.experience-entry {
  display: grid;
  grid-template-columns: subgrid;
  grid-column: 1 / -1;
  align-items: start;
  padding: 14px 4px;
  border-top: 1px solid var(--cv-divider);
}

.experience-entry:first-child {
  border-top: 0;
  padding-top: 6px;
}

.experience-entry.nested {
  border-top-style: dashed;
  padding: 12px 4px;
}

.experience-logo-wrap {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 36px;
}

.experience-logo {
  display: block;
  max-width: 100%;
  max-height: 36px;
  width: auto;
  height: auto;
  object-fit: contain;
}

.experience-main {
  min-width: 0;
}

.experience-org {
  font-size: 15.5px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--link-color);
}

.experience-entry.nested .experience-org {
  font-size: 14.5px;
}

.experience-org a {
  color: inherit;
}

.experience-org a:hover {
  color: var(--link-hover);
}

.experience-role {
  margin-top: 2px;
  font-size: 14.5px;
}

.experience-entry.nested .experience-role {
  font-size: 13.5px;
}

.experience-note {
  margin-top: 2px;
  color: #5a6673;
  font-size: 13.5px;
}

.experience-date {
  color: #5a6673;
  font-size: 13.5px;
  white-space: nowrap;
  text-align: right;
  padding-top: 2px;
}

/* Collapsible "Project: ..." toggle inside each lab row */
.experience-project {
  margin-top: 8px;
  font-size: 14px;
}

.experience-project summary {
  cursor: pointer;
  list-style: none;
  color: var(--link-color);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  user-select: none;
  font-weight: 600;
  transition: color 0.2s ease;
}

.experience-project summary::-webkit-details-marker {
  display: none;
}

.experience-project summary::before {
  content: "▸";
  font-size: 11px;
  transition: transform 0.22s ease;
}

.experience-project[open] summary::before {
  transform: rotate(90deg);
}

.experience-project summary:hover {
  color: var(--link-hover);
}

.experience-project-body {
  margin-top: 10px;
  padding: 10px 14px;
  border-left: 3px solid #c9d6e5;
  border-radius: 0 8px 8px 0;
  background: linear-gradient(180deg, #fafcfe 0%, #f4f7fb 100%);
}

.experience-project-body p {
  margin: 0;
}

.experience-project-images {
  display: flex;
  gap: 10px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.experience-project-images img {
  width: 100%;
  max-width: 220px;
  height: auto;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 4px 12px rgba(28, 40, 54, 0.10);
  object-fit: cover;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 0.3s ease;
}

.experience-project-images img:hover {
  transform: translateY(-2px) scale(1.025);
  box-shadow: 0 10px 22px rgba(28, 40, 54, 0.18);
}

/* Skills groups */
.service-group {
  margin-top: 4px;
  padding-top: 4px;
}

.service-group p {
  margin: 4px 0;
}

/* Mobile tweaks */
@media (max-width: 760px) {
  body {
    margin-top: 18px;
    margin-bottom: 32px;
    font-size: 15px;
    line-height: 155%;
  }

  heading {
    font-size: 20px;
  }

  name {
    font-size: 28px;
  }

  .hero-table,
  .hero-table tbody,
  .hero-row {
    display: block;
    width: 100%;
  }

  .hero-row > td {
    display: block;
    box-sizing: border-box;
  }

  .intro-col,
  .photo-col {
    width: 100% !important;
    max-width: none !important;
    padding: 0 14px 16px 14px !important;
  }

  .intro-col {
    padding-top: 6px !important;
  }

  .photo-col {
    display: none !important;
  }

  .profile-photo {
    width: min(64vw, 260px) !important;
    max-width: 260px !important;
  }

  .mobile-photo-wrap {
    display: block;
    margin: 4px 0 14px 0;
    text-align: left;
  }

  .profile-photo-mobile {
    display: block;
    margin: 0;
  }

  .profile-name {
    text-align: left !important;
    margin-bottom: 10px;
  }

  .profile-links {
    justify-content: flex-start;
    gap: 6px 10px;
    text-align: left !important;
  }

  .projects-list,
  .projects-list tbody {
    display: block;
    width: 100%;
  }

  .projects-list tbody > tr {
    display: block;
    margin-bottom: 12px;
  }

  .projects-list tbody > tr > td {
    display: block;
    width: 100% !important;
    box-sizing: border-box;
  }

  .projects-list tbody > tr > td:first-child {
    padding: 14px 14px 8px 14px !important;
    border-radius: 14px 14px 0 0;
  }

  .projects-list tbody > tr > td:last-child {
    padding: 0 14px 14px 14px !important;
    border-radius: 0 0 14px 14px;
  }

  .paper-media {
    width: 100%;
    max-width: 460px;
    margin: 0 auto;
  }

  .projects-list tbody tr:hover {
    transform: none;
  }

  .projects-list tbody tr:hover td {
    box-shadow: none;
  }

  .cv-entry {
    grid-template-columns: 102px 1fr;
    column-gap: 8px;
  }

  .honors-list .cv-entry {
    grid-template-columns: 72px 1fr;
  }

  .experience-entry {
    grid-template-columns: 64px 1fr;
    grid-template-areas:
      "logo  main"
      "logo  date";
    column-gap: 12px;
    row-gap: 4px;
  }

  .experience-logo-wrap { grid-area: logo; }
  .experience-main { grid-area: main; }
  .experience-date {
    grid-area: date;
    text-align: left;
    margin-top: 4px;
  }

  .experience-suborg {
    grid-template-columns: 1fr;
    row-gap: 4px;
  }
  .experience-suborg-date {
    text-align: left;
  }
}

@media (max-width: 560px) {
  .news-date {
    width: 72px;
    padding-left: 10px;
  }
}

/* ====================================================================
   Dark mode — auto-applied when the OS prefers a dark color scheme.
   Logo cards keep a light background so brand artwork stays legible.
   ==================================================================== */
@media (prefers-color-scheme: dark) {
  :root {
    --cv-divider: #232c39;
    --link-color: #7fb1de;
    --link-hover: #e6a86b;
  }

  body {
    background: #11151b;
    color: #dde4ec;
  }

  note {
    color: #d0d8df99;
  }

  .link-separator {
    color: #5b6673;
  }

  .news-date {
    color: #aab4be;
  }
  .news-date::before {
    background: #5b6673;
  }

  .cv-year {
    color: #93b3d2;
    border-left-color: #4d6885;
  }
  .cv-detail {
    color: #93a0ac;
  }

  .experience-date,
  .experience-note,
  .experience-suborg-note,
  .experience-suborg-date {
    color: #93a0ac;
  }

  .project-status {
    background: rgba(127, 177, 222, 0.15);
    color: #7fb1de;
  }
  .project-status.dot::before {
    color: #57c896;
  }
  .project-date {
    color: #93a0ac;
  }

  .experience-project-body {
    border-left-color: #3a4d63;
    background: linear-gradient(180deg, #1b232f 0%, #161d28 100%);
  }

  .projects-list tbody tr:hover td {
    background: #1c2533;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45),
                0 2px 8px rgba(0, 0, 0, 0.3);
  }

  .profile-photo {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  }
  .profile-photo:hover {
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.55);
  }

  .experience-project-images img {
    background: #1c2533;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
  }
  .experience-project-images img:hover {
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.55);
  }

  .paper-media {
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.45);
  }
}
