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

html {
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scrollbar-gutter: stable;
}

body {
  font-family: "Instrument Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #1a1a1a;
  background-color: #FAFAF5;
}

a {
  color: #c0392b;
  text-decoration: none;
  transition: color 0.15s ease;
}
a:hover {
  color: #a93226;
}

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

h1, h2, h3, h4 {
  font-weight: 600;
  line-height: 1.3;
}

hr {
  border: none;
  border-top: 1px solid #e5e5e0;
}

body.theme-transition,
body.theme-transition *,
body.theme-transition *::before,
body.theme-transition *::after {
  transition: color 0.3s ease, background-color 0.3s ease, border-color 0.3s ease !important;
}

.site-wrapper {
  display: flex;
  min-height: 100vh;
  max-width: 1200px;
  margin: 0 auto;
}

.main-content {
  flex: 1;
  max-width: 820px;
  padding: 40px;
}

@media (max-width: 768px) {
  .site-wrapper {
    flex-direction: column;
    max-width: 100%;
  }
  .main-content {
    padding: 24px;
  }
}
.sidebar {
  flex-shrink: 0;
  width: max-content;
  max-width: 300px;
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid #e5e5e0;
  background: #FAFAF5;
  overflow-y: auto;
}

.sidebar-inner {
  padding: 40px;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.sidebar-profile {
  margin-bottom: 40px;
  text-align: right;
}

.sidebar-links {
  align-items: flex-end;
}

.profile-photo-wrapper {
  position: relative;
  width: 140px;
  height: 140px;
  margin-left: auto;
  margin-bottom: 12px;
  cursor: pointer;
  border-radius: 50%;
  overflow: hidden;
}

.profile-photo {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  object-fit: cover;
}

.profile-photo-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.profile-photo-wrapper:hover .profile-photo-video {
  opacity: 1;
}

.profile-name {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 2px;
  color: #1a1a1a;
}

.profile-role {
  color: #555;
  font-size: 16px;
}

.profile-tags {
  color: #555;
  font-size: 11px;
  margin-top: 6px;
  line-height: 1.4;
}

.sidebar-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #1a1a1a;
  font-size: 14px;
}
.sidebar-link:hover {
  color: #c0392b;
}
.sidebar-link svg {
  flex-shrink: 0;
  opacity: 0.6;
}

.dark-mode-toggle {
  background: none;
  border: 1px solid #e5e5e0;
  border-radius: 6px;
  padding: 6px 10px;
  cursor: pointer;
  color: #1a1a1a;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin-top: auto;
  align-self: flex-end;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.dark-mode-toggle:hover {
  border-color: #c0392b;
  color: #c0392b;
}
.dark-mode-toggle .moon-icon {
  display: none;
}

body.dark-mode .dark-mode-toggle .sun-icon {
  display: none;
}
body.dark-mode .dark-mode-toggle .moon-icon {
  display: block;
}

@media (max-width: 768px) {
  .sidebar {
    position: static;
    width: 100%;
    max-width: 100%;
    height: auto;
    border-right: none;
    border-bottom: 1px solid #e5e5e0;
  }
  .sidebar-inner {
    padding: 12px 24px;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    min-height: auto;
  }
  .sidebar-profile {
    margin-bottom: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: left;
  }
  .profile-photo-wrapper {
    width: 40px;
    height: 40px;
    min-width: 40px;
    margin: 0;
  }
  .profile-photo,
  .profile-photo-video {
    width: 40px;
    height: 40px;
    min-width: 40px;
  }
  .profile-name {
    font-size: 16px;
    margin-bottom: 0;
  }
  .profile-role,
  .profile-tags {
    display: none;
  }
  .sidebar-links {
    flex-direction: row;
    align-items: center;
    gap: 12px;
    margin-left: auto;
  }
}
@media (max-width: 768px) and (max-width: 380px) {
  .profile-photo-wrapper {
    display: none;
  }
}
@media (max-width: 768px) {
  .sidebar-link {
    gap: 0;
    font-size: 0;
  }
  .sidebar-link svg {
    width: 18px;
    height: 18px;
  }
  .dark-mode-toggle {
    margin-top: 0;
    align-self: auto;
    width: 32px;
    height: 32px;
    border: none;
  }
}
.content-header {
  margin-bottom: 24px;
}

.content-bio {
  font-size: 16px;
  line-height: 1.6;
}
.content-bio p {
  margin-bottom: 12px;
}
.content-bio a {
  color: #1a1a1a;
  text-decoration: underline;
  text-decoration-color: #ccc;
  text-underline-offset: 2px;
}
.content-bio a:hover {
  text-decoration-color: #c0392b;
  color: #c0392b;
}

.section-divider {
  margin: 24px 0;
}

.content-toggle {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  border-bottom: 1px solid #e5e5e0;
}

.toggle-btn {
  background: none;
  border: none;
  padding: 8px 16px;
  font-size: 16px;
  font-family: "Instrument Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #555;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.toggle-btn:hover {
  color: #1a1a1a;
}
.toggle-btn.active {
  color: #1a1a1a;
  border-bottom-color: #c0392b;
  font-weight: 600;
}

.content-section {
  display: none;
}
.content-section.active {
  display: block;
}

.year-group {
  margin-bottom: 24px;
}

.year-heading {
  font-size: 20px;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 4px;
}

.year-divider {
  margin-bottom: 12px;
}

.pub-card {
  display: flex;
  gap: 24px;
  padding: 12px 0;
  border-bottom: 1px solid #e5e5e0;
  align-items: flex-start;
}
.pub-card:last-child {
  border-bottom: none;
}

.pub-info {
  flex: 1;
  min-width: 0;
}

.pub-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
  line-height: 1.4;
}
.pub-title a {
  color: #1a1a1a;
}
.pub-title a:hover {
  color: #c0392b;
}
.pub-title .arrow {
  font-size: 14px;
  opacity: 0;
  transition: opacity 0.15s ease, transform 0.15s ease;
  display: inline-block;
}
.pub-title a:hover .arrow {
  opacity: 1;
  transform: translateX(2px);
}

.pub-authors {
  font-size: 14px;
  color: #555;
  margin-bottom: 2px;
  line-height: 1.4;
}
.pub-authors b {
  color: #1a1a1a;
  font-weight: 600;
}

.pub-venue {
  font-size: 14px;
  color: #555;
  margin-bottom: 4px;
}

.pub-award {
  color: #c0392b;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 4px;
}

.pub-links {
  margin-top: 8px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: center;
}
.pub-links a {
  color: #555;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  transition: color 0.15s ease;
}
.pub-links a:hover {
  color: #c0392b;
}
.pub-links a svg {
  display: block;
  flex-shrink: 0;
}

.pub-thumb {
  flex-shrink: 0;
  width: 160px;
}
.pub-thumb img {
  width: 100%;
  border-radius: 10px;
  object-fit: cover;
}

.blog-card {
  padding: 12px 0;
}

.blog-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
}
.blog-title a {
  color: #1a1a1a;
}
.blog-title a:hover {
  color: #c0392b;
}
.blog-title .arrow {
  font-size: 14px;
  opacity: 0;
  transition: opacity 0.15s ease;
  display: inline-block;
}
.blog-title a:hover .arrow {
  opacity: 1;
}

.blog-date {
  font-size: 14px;
  color: #555;
  display: block;
  margin-bottom: 4px;
}

.blog-excerpt {
  font-size: 14px;
  color: #555;
}

.card-divider {
  margin: 0;
}

@media (max-width: 768px) {
  .content-name {
    font-size: 22px;
  }
  .pub-card {
    flex-direction: column-reverse;
    gap: 12px;
  }
  .pub-thumb {
    width: 100%;
  }
  .pub-thumb img {
    max-height: 200px;
    width: auto;
    max-width: 100%;
  }
}
.blog-post {
  max-width: 680px;
}

.post-header {
  margin-bottom: 40px;
}

.back-link {
  font-size: 14px;
  color: #555;
  display: inline-block;
  margin-bottom: 24px;
}
.back-link:hover {
  color: #c0392b;
}

.post-title {
  font-size: 30px;
  font-weight: 700;
  margin-bottom: 6px;
  color: #1a1a1a;
}

.post-date {
  font-size: 14px;
  color: #555;
}

.post-content {
  font-size: 16px;
  line-height: 1.75;
}
.post-content p {
  margin-bottom: 24px;
}
.post-content h2 {
  font-size: 20px;
  margin-top: 40px;
  margin-bottom: 12px;
}
.post-content h3 {
  font-size: 16px;
  margin-top: 24px;
  margin-bottom: 12px;
}
.post-content ul, .post-content ol {
  margin-bottom: 24px;
  padding-left: 24px;
}
.post-content li {
  margin-bottom: 4px;
}
.post-content code {
  background: rgba(0, 0, 0, 0.05);
  padding: 2px 5px;
  border-radius: 3px;
  font-size: 14px;
}
.post-content pre {
  background: #f5f5f0;
  padding: 24px;
  border-radius: 6px;
  overflow-x: auto;
  margin-bottom: 24px;
}
.post-content pre code {
  background: none;
  padding: 0;
}
.post-content img {
  border-radius: 4px;
  margin: 24px 0;
}
.post-content blockquote {
  border-left: 3px solid #c0392b;
  padding-left: 24px;
  color: #555;
  margin-bottom: 24px;
}
.post-content a {
  color: #1a1a1a;
  text-decoration: underline;
  text-decoration-color: #ccc;
  text-underline-offset: 2px;
}
.post-content a:hover {
  text-decoration-color: #c0392b;
  color: #c0392b;
}

body.dark-mode {
  background-color: #121212;
  color: #e0e0e0;
}
body.dark-mode a {
  color: #e74c3c;
}
body.dark-mode a:hover {
  color: rgb(236.5890410959, 117.6849315068, 105.4109589041);
}
body.dark-mode hr {
  border-top-color: #2a2a2a;
}
body.dark-mode .sidebar {
  background: #121212;
  border-right-color: #2a2a2a;
  border-bottom-color: #2a2a2a;
}
body.dark-mode .profile-name {
  color: #e0e0e0;
}
body.dark-mode .profile-role,
body.dark-mode .profile-tags {
  color: #aaa;
}
body.dark-mode .sidebar-link {
  color: #e0e0e0;
}
body.dark-mode .sidebar-link:hover {
  color: #e74c3c;
}
body.dark-mode .dark-mode-toggle {
  color: #e0e0e0;
  border-color: #2a2a2a;
}
body.dark-mode .dark-mode-toggle:hover {
  border-color: #e74c3c;
  color: #e74c3c;
}
body.dark-mode .content-tags {
  color: #aaa;
}
body.dark-mode .content-bio a {
  color: #e0e0e0;
  text-decoration-color: #444;
}
body.dark-mode .content-bio a:hover {
  color: #e74c3c;
  text-decoration-color: #e74c3c;
}
body.dark-mode .toggle-btn {
  color: #aaa;
}
body.dark-mode .toggle-btn:hover {
  color: #e0e0e0;
}
body.dark-mode .toggle-btn.active {
  color: #e0e0e0;
  border-bottom-color: #e74c3c;
}
body.dark-mode .content-toggle {
  border-bottom-color: #2a2a2a;
}
body.dark-mode .pub-card {
  border-bottom-color: #2a2a2a;
}
body.dark-mode .pub-title a {
  color: #e0e0e0;
}
body.dark-mode .pub-title a:hover {
  color: #e74c3c;
}
body.dark-mode .pub-authors {
  color: #aaa;
}
body.dark-mode .pub-authors b {
  color: #e0e0e0;
}
body.dark-mode .pub-venue {
  color: #aaa;
}
body.dark-mode .pub-award {
  color: #e74c3c;
}
body.dark-mode .pub-links a {
  color: #aaa;
}
body.dark-mode .pub-links a:hover {
  color: #e74c3c;
}
body.dark-mode .year-heading {
  color: #e0e0e0;
}
body.dark-mode .year-divider,
body.dark-mode .card-divider,
body.dark-mode .section-divider {
  border-top-color: #2a2a2a;
}
body.dark-mode .blog-title a {
  color: #e0e0e0;
}
body.dark-mode .blog-title a:hover {
  color: #e74c3c;
}
body.dark-mode .blog-date,
body.dark-mode .blog-excerpt {
  color: #aaa;
}
body.dark-mode .post-title {
  color: #e0e0e0;
}
body.dark-mode .post-date,
body.dark-mode .back-link {
  color: #aaa;
}
body.dark-mode .back-link:hover {
  color: #e74c3c;
}
body.dark-mode .post-content a {
  color: #e0e0e0;
  text-decoration-color: #444;
}
body.dark-mode .post-content a:hover {
  color: #e74c3c;
  text-decoration-color: #e74c3c;
}
body.dark-mode .post-content code {
  background: rgba(255, 255, 255, 0.1);
}
body.dark-mode .post-content pre {
  background: #1e1e1e;
}
body.dark-mode .post-content blockquote {
  border-left-color: #e74c3c;
  color: #aaa;
}