/* ===== Reset & Base ===== */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #ffffff;
  --bg-secondary: #f8f9fa;
  --text: #212529;
  --text-secondary: #6c757d;
  --maroon: #861F41;
  --orange: #E5751F;
  --accent: #C84E00;
  --accent-hover: #861F41;
  --border: #dee2e6;
  --card-bg: #ffffff;
  --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  --nav-bg: #ffffff;
  --tag-bg: #f0f0f0;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: Georgia, "Times New Roman", serif;
  --max-width: 1060px;
}

[data-theme="dark"] {
  --bg: #1b1b1f;
  --bg-secondary: #24242a;
  --text: #e0e0e0;
  --text-secondary: #a0a0a0;
  --maroon: #c46b87;
  --orange: #f0944a;
  --accent: #f0944a;
  --accent-hover: #c46b87;
  --border: #3a3a44;
  --card-bg: #24242a;
  --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  --nav-bg: #1b1b1f;
  --tag-bg: #3a3a44;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 16px;
  transition: background 0.3s, color 0.3s;
}

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

a:hover {
  color: var(--accent-hover);
}

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

/* ===== Navigation ===== */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
  height: 56px;
}

.nav-bar-wrapper {
  background: var(--maroon);
}

.navbar .site-title {
  font-size: 1.1rem;
  font-weight: 500;
  color: #ffffff;
  text-decoration: none;
  letter-spacing: -0.01em;
}

.navbar .site-title:hover {
  color: var(--orange);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
}

.nav-links a {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.95rem;
  font-weight: 400;
  text-decoration: none;
  transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
  color: #ffffff;
  border-bottom: 2px solid var(--orange);
  padding-bottom: 2px;
}

.nav-divider {
  width: 100%;
  height: 3px;
  background: var(--orange);
}

.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  color: rgba(255, 255, 255, 0.85);
  padding: 0.2rem;
  transition: color 0.2s;
  line-height: 1;
}

.theme-toggle:hover {
  color: var(--orange);
}

/* Mobile menu button */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  color: #ffffff;
}

.menu-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: #ffffff;
  margin: 5px 0;
  transition: 0.3s;
}

/* ===== Main Content ===== */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem;
}

/* ===== About Page ===== */
.about-section {
  display: flex;
  gap: 3rem;
  align-items: flex-start;
  padding-top: 1rem;
}

.about-text {
  flex: 1;
}

.name-row {
  display: flex;
  align-items: baseline;
  gap: 2.5rem;
  flex-wrap: wrap;
}

.phd-motto {
  font-size: 1.5rem;
  font-style: italic;
  color: var(--text-secondary);
  font-weight: 300;
  letter-spacing: 0.03em;
}

.phd-letter {
  font-family: "Georgia", "Times New Roman", serif;
  font-weight: 700;
  font-size: 1.8rem;
  font-style: normal;
  color: var(--orange);
}

.about-text h1 {
  font-size: 2.8rem;
  font-weight: 400;
  margin-bottom: 1.5rem;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--maroon);
}

.about-text p {
  margin-bottom: 1rem;
  color: var(--text);
  line-height: 1.8;
}

.about-photo {
  flex-shrink: 0;
  width: 250px;
}

/* Carousel */
.carousel {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: 4px;
  border: 3px solid var(--maroon);
}

.carousel-slides {
  position: relative;
}

.carousel-slide {
  display: none;
}

.carousel-slide.active {
  display: block;
}

.carousel-slide img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  display: block;
  border: none;
  border-radius: 0;
}

.carousel-slide .photo-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 0.85rem;
  padding: 0.4rem 0.6rem;
  text-align: center;
  margin: 0;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 1.5rem;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  line-height: 1;
  z-index: 2;
}

.carousel-btn:hover {
  background: rgba(0, 0, 0, 0.6);
}

.carousel-prev {
  left: 6px;
}

.carousel-next {
  right: 6px;
}

.carousel-dots {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 2;
}

.carousel-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: background 0.2s;
}

.carousel-dot.active {
  background: #fff;
}

/* ===== Saxophone Video ===== */
.carousel-slide-video {
  position: relative;
}

.carousel-slide-video .sax-video-container {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: #000;
  cursor: pointer;
}

.carousel-slide-video .sax-video-container video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 75%;
  display: block;
}

.sax-poster {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--maroon), #2a0a15);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: opacity 0.3s;
}

.sax-poster.hidden {
  opacity: 0;
  pointer-events: none;
}

.sax-play-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  border: 2px solid rgba(255, 255, 255, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: #fff;
  transition: background 0.2s, transform 0.2s;
}

.sax-video-container:hover .sax-play-icon {
  background: var(--orange);
  border-color: var(--orange);
  transform: scale(1.1);
}

.sax-label {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.85rem;
  margin-top: 0.6rem;
  font-style: italic;
}

.sax-caption {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 0.4rem;
  text-align: left;
  font-style: italic;
}

.bold {
  font-weight: 700;
  color: var(--maroon);
}

/* ===== Blog Page ===== */
.blog-header {
  text-align: center;
  padding: 3rem 0 2rem;
}

.blog-header h1 {
  font-size: 3.5rem;
  font-weight: 400;
  font-style: italic;
  color: var(--maroon);
  margin-bottom: 0.5rem;
}

.blog-header p {
  font-size: 1.1rem;
  color: var(--text);
}

.blog-tags {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  padding: 1.5rem 0;
  flex-wrap: wrap;
  border-top: 2px solid var(--maroon);
  border-bottom: 2px solid var(--maroon);
  margin-bottom: 2rem;
}

.blog-tags a {
  color: var(--orange);
  font-size: 0.95rem;
  font-weight: 500;
}

.blog-tags a:hover {
  color: var(--maroon);
}

.blog-tags .separator {
  color: var(--text-secondary);
}

.blog-post {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border);
  gap: 2rem;
}

.blog-post:last-child {
  border-bottom: none;
}

.blog-post-info {
  flex: 1;
}

.blog-post-info h2 {
  font-size: 1.4rem;
  font-weight: 500;
  margin-bottom: 0.3rem;
  color: var(--text);
}

.blog-post-info h2 a {
  color: var(--text);
}

.blog-post-info h2 a:hover {
  color: var(--orange);
}

.blog-post-info .subtitle {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.blog-post-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  flex-wrap: wrap;
}

.blog-post-meta .tag {
  color: var(--orange);
  font-weight: 500;
}

.blog-post-thumbnail {
  width: 130px;
  height: 90px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}

/* ===== CV Page ===== */
.cv-layout {
  display: flex;
  gap: 3rem;
  align-items: flex-start;
}

.cv-sidebar {
  position: sticky;
  top: 2rem;
  width: 140px;
  flex-shrink: 0;
}

.cv-sidebar ul {
  list-style: none;
  border-left: 3px solid var(--maroon);
  padding-left: 1rem;
}

.cv-sidebar li {
  margin-bottom: 0.6rem;
}

.cv-sidebar a {
  color: var(--text);
  font-size: 0.9rem;
  text-decoration: none;
}

.cv-sidebar a:hover {
  color: var(--orange);
}

.cv-content {
  flex: 1;
}

.cv-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.cv-header h1 {
  font-size: 2rem;
  font-weight: 400;
  color: var(--maroon);
}

.cv-download {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #fff;
  background: var(--maroon);
  font-size: 0.9rem;
  padding: 0.4rem 1rem;
  border: none;
  border-radius: 4px;
  transition: background 0.2s;
}

.cv-download:hover {
  background: var(--orange);
  color: #fff;
}

.cv-section {
  margin-bottom: 2.5rem;
}

.cv-card {
  border: 1px solid var(--border);
  border-left: 4px solid var(--maroon);
  border-radius: 0 8px 8px 0;
  padding: 1.5rem 2rem;
  margin-bottom: 1.5rem;
  background: var(--card-bg);
}

.cv-card h2 {
  font-size: 1.4rem;
  font-weight: 500;
  margin-bottom: 1.2rem;
  color: var(--maroon);
}

.cv-info-table {
  width: 100%;
}

.cv-info-table tr {
  vertical-align: top;
}

.cv-info-table td {
  padding: 0.3rem 0;
}

.cv-info-table td:first-child {
  font-weight: 600;
  width: 100px;
  color: var(--maroon);
}

.cv-info-table td:last-child {
  color: var(--text);
}

.cv-info-table a {
  color: var(--orange);
}

/* Timeline */
.timeline {
  position: relative;
  padding-left: 2rem;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--maroon);
}

.timeline-item {
  position: relative;
  padding-bottom: 2rem;
  padding-left: 1.5rem;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -2.35rem;
  top: 0.4rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--orange);
  border: 2px solid var(--bg);
}

.timeline-date {
  display: inline-block;
  background: var(--orange);
  color: #fff;
  padding: 0.15rem 0.6rem;
  border-radius: 3px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.timeline-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--maroon);
  margin-bottom: 0.2rem;
}

.timeline-detail {
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.5;
}

.timeline-detail em {
  color: var(--text-secondary);
}

/* ===== Publications Section ===== */
.pub-item {
  padding: 1.2rem 0;
  border-bottom: 1px solid var(--border);
}

.pub-item:last-child {
  border-bottom: none;
}

.pub-title {
  font-weight: 600;
  margin-bottom: 0.3rem;
  color: var(--text);
}

.pub-authors {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 0.2rem;
}

.pub-venue {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-style: italic;
}

.pub-links {
  margin-top: 0.4rem;
  display: flex;
  gap: 0.8rem;
}

.pub-links a {
  font-size: 0.85rem;
  color: #fff;
  background: var(--maroon);
  padding: 0.2rem 0.6rem;
  border-radius: 3px;
  transition: background 0.2s;
}

.pub-links a:hover {
  background: var(--orange);
}

/* ===== Footer ===== */
.footer {
  margin-top: 4rem;
  padding: 1.5rem 2rem;
  background: var(--maroon);
  text-align: center;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.75);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .about-section {
    flex-direction: column-reverse;
    gap: 1.5rem;
  }

  .about-photo {
    width: 160px;
  }

  .about-text h1 {
    font-size: 2rem;
  }

  .cv-layout {
    flex-direction: column;
  }

  .cv-sidebar {
    position: static;
    width: 100%;
  }

  .cv-sidebar ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem 1rem;
    border-left: none;
    border-bottom: 3px solid var(--maroon);
    padding-left: 0;
    padding-bottom: 0.8rem;
  }

  .cv-sidebar li {
    margin-bottom: 0;
  }

  .blog-header h1 {
    font-size: 2.5rem;
  }

  .blog-post {
    flex-direction: column;
    gap: 1rem;
  }

  .blog-post-thumbnail {
    width: 100%;
    height: 180px;
    order: -1;
  }

  .menu-toggle {
    display: block;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    flex-direction: column;
    background: var(--maroon);
    padding: 1rem 2rem;
    gap: 0.8rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 100;
  }

  .nav-links.show {
    display: flex;
  }

  .navbar {
    position: relative;
  }

  .container {
    padding: 1.5rem 1rem;
  }
}
