@import url('https://fonts.googleapis.com/css2?family=Lato&family=Open+Sans:ital,wght@0,300;0,400;0,600;0,700;0,800;1,300;1,400;1,600;1,700;1,800&display=swap');

:root {
  color-scheme: light;
  --bg: #ffffff;
  --text: #222222;
  --heading: #404040;
  --link: #4D9A3A;
  --link-hover: #3A4D9A;
  --highlight: #DC143C;
  --toggle-bg: rgba(0, 0, 0, 0.06);
  --toggle-bg-hover: rgba(0, 0, 0, 0.12);
  --toggle-fg: #404040;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --bg: #121212;
    --text: #e6e6e6;
    --heading: #d4d4d4;
    --link: #7FC86B;
    --link-hover: #8FA3E8;
    --highlight: #FF6B82;
    --toggle-bg: rgba(255, 255, 255, 0.08);
    --toggle-bg-hover: rgba(255, 255, 255, 0.16);
    --toggle-fg: #d4d4d4;
  }
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #ffffff;
  --text: #222222;
  --heading: #404040;
  --link: #4D9A3A;
  --link-hover: #3A4D9A;
  --highlight: #DC143C;
  --toggle-bg: rgba(0, 0, 0, 0.06);
  --toggle-bg-hover: rgba(0, 0, 0, 0.12);
  --toggle-fg: #404040;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121212;
  --text: #e6e6e6;
  --heading: #d4d4d4;
  --link: #7FC86B;
  --link-hover: #8FA3E8;
  --highlight: #FF6B82;
  --toggle-bg: rgba(255, 255, 255, 0.08);
  --toggle-bg-hover: rgba(255, 255, 255, 0.16);
  --toggle-fg: #d4d4d4;
}

body {
  margin: 0;
  font-size: 1.1rem;
  font-family: 'Open Sans', sans-serif;
  font-weight: 300;
  background: var(--bg);
  color: var(--text);
}

.container {
  max-width: 920px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* Bio section */
.bio {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  padding: 2rem 0;
}

.bio-text {
  flex: 1;
}

.bio-text h1 {
  font-family: 'Lato', sans-serif;
  font-size: 32px;
  font-weight: 400;
  color: var(--heading);
  text-align: center;
  margin: 0 0 0.5rem;
}

.bio-photo {
  flex-shrink: 0;
  width: 30%;
  max-width: 240px;
  padding-top: 1.5rem;
}

.bio-photo img {
  width: 100%;
  border-radius: 20%;
}

/* Social links */
.social-links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 0.75rem;
}

.social-links a {
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.social-links .ai,
.social-links .bi-twitter-x,
.social-links .bi-linkedin {
  font-size: 20px;
}

/* Publications */
.publications h2 {
  font-family: 'Lato', sans-serif;
  font-size: 22px;
  font-weight: 400;
  margin: 1rem 0;
}

.pub {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  padding: 1rem 0;
}

.pub-thumb {
  flex-shrink: 0;
  width: 250px;
}

.pub-thumb img {
  width: 100%;
  height: auto;
}

.pub-details {
  flex: 1;
}

.pub-title {
  font-family: 'Lato', sans-serif;
  font-size: 18px;
  font-weight: 700;
}

.pub-authors {
  margin-top: 0.25rem;
}

.pub-venue {
  margin-top: 0.25rem;
}

.pub-venue .highlight-venue {
  color: var(--highlight);
}

.pub-links {
  margin-top: 0.25rem;
}

.pub-links a span {
  display: inline;
  text-decoration: none;
}

.pub-desc {
  margin-top: 0.5rem;
}

/* Hover video effect */
.one {
  width: 100%;
  position: relative;
}

.one > img {
  width: 100%;
  height: auto;
  display: block;
}

.two {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transition: opacity 0.2s ease-in-out;
}

.two video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

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

/* Footer */
footer {
  padding: 1rem 0;
}

footer p {
  text-align: right;
  font-size: small;
}

/* Mobile */
@media (max-width: 768px) {
  .container {
    padding: 0 1rem;
  }

  .bio {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .bio-photo {
    width: 150px;
    order: -1;
  }

  .bio-text p {
    text-align: left;
  }

  .social-links {
    justify-content: center;
  }

  .pub {
    flex-direction: column;
  }

  .pub-thumb {
    width: 100%;
  }

  .one {
    width: 100%;
    height: auto;
    aspect-ratio: 300 / 200;
  }

  .two {
    display: none;
  }

  .one img,
  .one video {
    width: 100%;
    height: auto;
  }
}

.theme-toggle {
  position: fixed;
  top: 1rem;
  right: 1rem;
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--toggle-bg);
  color: var(--toggle-fg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  line-height: 1;
  z-index: 100;
  transition: background 0.15s ease;
}

.theme-toggle:hover {
  background: var(--toggle-bg-hover);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
}

@media (max-width: 768px) {
  .theme-toggle {
    top: 0.5rem;
    right: 0.5rem;
    width: 36px;
    height: 36px;
    font-size: 16px;
  }
}
