/* ========================================
   CSS Variables & Base Styles
   ======================================== */

:root {
  /* Colors */
  --bg: #0a0a12;
  --surface: #13131f;
  --elevated: #1c1c2e;
  --accent: #a78bfa;
  --accent-light: #a78bfa;
  --accent-hover: #a78bfa;
  --accent-glow: rgba(167, 139, 250, 0.35);
  --accent-original: #9d5af5;
  --text-primary: #e8e8f0;
  --text-secondary: #9090a8;
  --border: rgba(255, 255, 255, 0.08);
  --border-accent: rgba(167, 139, 250, 0.4);

  /* Typography */
  --font-family: 'Inter', system-ui, sans-serif;
  --font-mono: 'Fira Code', monospace;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-primary);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--accent-light);
  text-decoration: underline;
  transition: color 0.25s ease;
}

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

img {
  max-width: 100%;
  height: auto;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
}

/* Disable context menu on images */
img, .pinterest-gallery, .portfolio-grid {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* ========================================
   Header
   ======================================== */

header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 16px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: transparent;
  transition: all 0.3s ease;
}

header.scrolled {
  backdrop-filter: blur(12px);
  background: rgba(10, 10, 18, 0.8);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
}

.logo img {
  height: 36px;
  width: auto;
}

nav {
  display: flex;
  gap: 32px;
}

nav a {
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  position: relative;
  padding-bottom: 4px;
  transition: color 0.25s ease;
}

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

nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.25s ease;
}

nav a:hover::after,
nav a.active::after {
  width: 100%;
}

/* Mobile Menu Toggle */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 28px;
  cursor: pointer;
  z-index: 1001;
  padding: 8px;
  line-height: 1;
}

/* Close icon when menu is open */
.menu-toggle[aria-expanded="true"] {
  position: fixed;
  top: 12px;
  right: 20px;
  font-size: 32px;
  z-index: 1003;
}

/* ========================================
   Hero Section
   ======================================== */

#hero {
  height: 100vh;
  min-height: 600px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  background: linear-gradient(to bottom, rgba(10, 10, 18, 0.45), rgba(10, 10, 18, 0.75)),
              var(--surface);
  position: relative;
  overflow: hidden;
}

#hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url('/hero.webp');
  background-size: cover;
  background-position: center;
  opacity: 0.3;
}

#hero h1 {
  font-size: 72px;
  font-weight: 700;
  color: #fff;
  position: relative;
  z-index: 1;
  margin-bottom: 16px;
}

#hero p {
  font-size: 20px;
  color: var(--text-secondary);
  position: relative;
  z-index: 1;
}

/* ========================================
   Section Styles
   ======================================== */

section {
  padding: 40px 24px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 40px;
  max-width: 1000px;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.section-header h2 {
  font-size: 24px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-primary);
  flex: 1;
  cursor: pointer;
}

.section-header h2:hover {
  color: var(--accent-light);
}

.section-header a {
  font-size: 14px;
  color: var(--accent);
}

.section-header a:hover {
  color: var(--accent-original);
}

/* ========================================
   About Section
   ======================================== */

#about {
  text-align: center;
}

#about p {
  max-width: 680px;
  margin: 0 auto;
  font-size: 18px;
  line-height: 1.85;
  color: var(--text-secondary);
}

/* About Banner */
.about-banner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 40px;
  text-align: left;
  padding: 20px;
}

.about-banner-avatar {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.about-banner-content {
  flex: 1;
}

.about-banner-content h2 {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.about-banner-title {
  font-size: 14px;
  color: var(--accent-light);
  margin-bottom: 16px;
}

.about-banner-title a {
  color: var(--accent-light);
}

.about-banner-title a:hover {
  color: var(--accent-original);
}

.about-banner-desc {
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 40px;
}

.about-banner-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.about-banner-links a {
  font-size: 13px;
  color: var(--accent-light);
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 20px;
  transition: all 0.25s ease;
  text-decoration: none;
}

.about-banner-links a:hover {
  border-color: var(--accent-light);
}

/* ========================================
   Carousel Styles
   ======================================== */

.carousel-container {
  max-width: 900px;
  margin: 0 auto;
  position: relative;
}

/* Home Page Cards */
.home-carousel-container {
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.home-carousel-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.home-carousel-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.home-cards-scroll {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  padding: 10px 0;
  cursor: grab;
  user-select: none;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.home-cards-scroll::-webkit-scrollbar {
  display: none;
}

.home-cards-scroll:active {
  cursor: grabbing;
}

.home-cards {
  display: flex;
  gap: 20px;
}

.home-card {
  display: flex;
  flex-direction: column;
  width: 280px;
  flex-shrink: 0;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  text-decoration: none;
  transition: all 0.25s ease;
  scroll-snap-align: start;
}

.home-card:hover {
  border-color: var(--accent-light);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.home-card-icon {
  width: 100%;
  height: 120px;
  border-radius: 8px;
  object-fit: cover;
  margin-bottom: 12px;
  background: transparent;
}

/* Home card with cover-image class */
.home-card .cover-image {
  width: 100%;
  height: 160px;
  border-radius: 8px;
  object-fit: cover;
  margin-bottom: 12px;
  background: transparent;
}

.home-card .cover-placeholder {
  width: 100%;
  height: 160px;
  border-radius: 8px;
  background: var(--elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  font-size: 32px;
  color: var(--accent);
}

.home-card-icon-placeholder {
  width: 100%;
  height: 120px;
  border-radius: 8px;
  background: var(--elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.home-card-icon-placeholder svg {
  width: 40px;
  height: 40px;
  color: var(--accent);
}

.hidden {
  display: none !important;
}

.home-card-info {
  display: flex;
  flex-direction: column;
}

.home-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
  line-height: 1.3;
}

.home-card-author {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.home-card-time {
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.home-card-journal {
  font-size: 11px;
  color: var(--accent-light);
  margin-bottom: 6px;
}

.home-card-type {
  font-size: 11px;
  color: var(--accent-light);
  margin-bottom: 6px;
}

.home-card-keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
}

.home-card-keywords .keyword-tag {
  font-size: 10px;
  padding: 3px 8px;
  background: rgba(167, 139, 250, 0.12);
  border: 1px solid rgba(167, 139, 250, 0.25);
  border-radius: 10px;
  color: var(--accent-light);
}

/* Home card type button - same as research keywords */
.home-card .keyword-tag {
  font-size: 11px;
  padding: 4px 10px;
  background: rgba(167, 139, 250, 0.12);
  border: 1px solid rgba(167, 139, 250, 0.25);
  border-radius: 12px;
  color: var(--accent-light);
  cursor: pointer;
  transition: all 0.2s ease;
}

.home-card .keyword-tag:hover {
  background: rgba(157, 90, 245, 0.25);
  border-color: var(--accent-original);
  transform: translateY(-1px);
}

/* Related cards - use same styles as home-card */
.related-carousel-container {
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.related-carousel-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.related-carousel-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.related-cards {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  padding: 10px 0;
  flex: 1;
}

.related-cards::-webkit-scrollbar {
  display: none;
}

.related-card {
  display: flex;
  flex-direction: column;
  width: 280px;
  flex-shrink: 0;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  text-decoration: none;
  transition: all 0.25s ease;
  scroll-snap-align: start;
}

.related-card:hover {
  border-color: var(--accent-light);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.related-card img {
  width: 100%;
  height: 160px;
  border-radius: 8px;
  object-fit: cover;
  margin-bottom: 12px;
  background: transparent;
}

.related-card-info {
  padding: 0;
}

.related-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.related-card-author {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.related-card-description {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.related-card-time {
  font-size: 12px;
  color: var(--text-secondary);
}

.related-card-journal {
  font-size: 11px;
  color: var(--accent-light);
  font-style: italic;
  margin-top: 4px;
}

.related-card-keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
}

.related-card-keywords .keyword-tag {
  font-size: 10px;
  padding: 2px 6px;
  background: rgba(167, 139, 250, 0.12);
  border: 1px solid rgba(167, 139, 250, 0.25);
  border-radius: 8px;
  color: #a78bfa;
}

.carousel {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
}

.carousel-track {
  display: flex;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.carousel-slide {
  min-width: 100%;
  position: relative;
  cursor: pointer;
}

.carousel-slide img,
.carousel-slide iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 10px;
}

.carousel-slide .slide-content {
  padding: 20px 0;
}

.carousel-slide .slide-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.carousel-slide .slide-description {
  font-size: 14px;
  color: var(--text-secondary);
}

/* Carousel Controls */
.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  background: rgba(10, 10, 18, 0.6);
  border: none;
  border-radius: 50%;
  color: var(--text-primary);
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s ease;
  z-index: 10;
}

.carousel-arrow:hover {
  background: var(--accent);
}

.carousel-arrow.prev {
  left: 16px;
}

.carousel-arrow.next {
  right: 16px;
}

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
}

.carousel-dots button {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: none;
  background: var(--text-secondary);
  cursor: pointer;
  transition: all 0.25s ease;
  padding: 0;
}

.carousel-dots button.active {
  background: var(--accent);
  transform: scale(1.2);
}

/* ========================================
   Project Cards (List Pages)
   ======================================== */

.project-list {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.project-card {
  display: flex;
  gap: 24px;
  padding: 24px;
  background: var(--surface);
  border-radius: 10px;
  border: 1px solid var(--border);
  text-decoration: none;
  transition: all 0.25s ease;
}

.project-card:hover {
  transform: translateY(-2px);
  border-left: 3px solid var(--accent);
  box-shadow: 0 0 0 1px var(--border), 0 4px 24px rgba(0, 0, 0, 0.4);
}

.project-card .cover-image {
  width: 200px;
  height: 140px;
  flex-shrink: 0;
  border-radius: 8px;
  object-fit: cover;
  background: transparent;
}

.project-card .cover-placeholder {
  width: 200px;
  height: 140px;
  flex-shrink: 0;
  border-radius: 8px;
  background: var(--elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  color: var(--accent);
}

.project-card .project-info {
  flex: 1;
  display: flex !important;
  flex-direction: column;
  justify-content: center;
}

#research-list .project-info {
  display: flex !important;
}

#research-list .project-info > div {
  display: block !important;
}

.project-card .project-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.project-card .project-meta {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}

.project-card .category-tag {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 20px;
  font-weight: 500;
}

.category-tag.research {
  background: rgba(37, 99, 235, 0.2);
  color: #60a5fa;
  border: 1px solid rgba(37, 99, 235, 0.4);
}

.category-tag.design {
  background: rgba(124, 58, 237, 0.2);
  color: #a78bfa;
  border: 1px solid rgba(124, 58, 237, 0.4);
}

.category-tag.software {
  background: rgba(5, 150, 105, 0.2);
  color: #34d399;
  border: 1px solid rgba(5, 150, 105, 0.4);
}

.project-card .project-abstract {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 12px;
}

.project-card .read-more {
  font-size: 14px;
  color: var(--accent);
  font-weight: 500;
}

.project-card .project-author,
#research-list .project-card .project-author {
  font-size: 14px !important;
  color: var(--text-secondary) !important;
  margin-bottom: 4px !important;
  display: block !important;
  visibility: visible !important;
}

.project-card .project-time,
#research-list .project-card .project-time {
  font-size: 13px !important;
  color: var(--text-secondary) !important;
  margin-bottom: 8px !important;
  display: block !important;
  visibility: visible !important;
}

.project-card .project-journal,
#research-list .project-card .project-journal {
  font-size: 13px !important;
  color: var(--accent-light) !important;
  margin-bottom: 8px !important;
  display: block !important;
  visibility: visible !important;
}

.project-card .project-keywords,
#research-list .project-card .project-keywords {
  display: flex !important;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.project-card .keyword-tag,
#research-list .project-card .keyword-tag {
  font-size: 11px;
  padding: 4px 10px;
  background: rgba(167, 139, 250, 0.12);
  border: 1px solid rgba(167, 139, 250, 0.25);
  border-radius: 12px;
  color: var(--accent-light);
  cursor: pointer;
  transition: all 0.2s ease;
}

.project-card .keyword-tag:hover,
#research-list .project-card .keyword-tag:hover {
  background: rgba(157, 90, 245, 0.25);
  border-color: var(--accent-original);
  transform: translateY(-1px);
}

/* Research page layout */
#research-list {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Research page - circular icons, no square background */
#research-list .project-card .cover-image {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: transparent;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  object-fit: cover;
}

#research-list .project-card .cover-placeholder {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: var(--elevated);
}

/* Projects page - same as research page */
#projects-list .project-card {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 20px;
}

#projects-list .project-info {
  display: flex !important;
}

#projects-list .project-info > div {
  display: block !important;
}

#projects-list .project-card .project-author {
  font-size: 14px !important;
  color: var(--text-secondary) !important;
  margin-bottom: 4px !important;
}

#projects-list .project-card .project-time {
  font-size: 13px !important;
  color: var(--text-secondary) !important;
  margin-bottom: 8px !important;
}

#projects-list .project-card .project-keywords {
  display: flex !important;
  flex-wrap: wrap;
  gap: 8px;
}

#projects-list .project-card .keyword-tag {
  font-size: 11px;
  padding: 4px 10px;
  background: rgba(167, 139, 250, 0.12);
  border: 1px solid rgba(167, 139, 250, 0.25);
  border-radius: 12px;
  color: #a78bfa;
}

/* Projects page - circular icons */
#projects-list .project-card .cover-image {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: transparent;
  image-rendering: -webkit-optimize-contrast;
  object-fit: cover;
}

#projects-list .project-card .cover-placeholder {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: var(--elevated);
}

/* Projects page layout */
#projects-list {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ========================================
   Contact Section
   ======================================== */

#contact {
  text-align: center;
}

#contact h2 {
  font-size: 24px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 40px;
}

.contact-card {
  max-width: 500px;
  margin: 0 auto;
  background: var(--elevated);
  border-radius: 14px;
  padding: 40px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.contact-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.contact-row svg {
  width: 24px;
  height: 24px;
  color: var(--accent);
  flex-shrink: 0;
}

.contact-row .label {
  font-size: 14px;
  color: var(--text-secondary);
  width: 90px;
  flex-shrink: 0;
}

.contact-row a {
  color: var(--text-primary);
  font-size: 14px;
}

.contact-row a:hover {
  color: var(--accent-original);
}

/* ========================================
   Footer
   ======================================== */

footer {
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: 50px 40px;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 24px;
}

.footer-logo img {
  height: 45px;
}

.footer-links {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.footer-links a {
  font-size: 14px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.25s ease;
}

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

.footer-copyright {
  width: 100%;
  text-align: center;
  margin-top: 24px;
  font-size: 14px;
  color: var(--text-secondary);
}

/* ========================================
   Project Detail Page
   ======================================== */

.project-hero {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  margin-top: 80px;
}

.project-title-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px 24px 0;
}

.project-title-container h1 {
  font-size: 32px;
  font-weight: 700;
  color: white;
  margin: 0;
}

.article-cover {
  max-width: 800px;
  margin: 5px auto 0;
  display: block;
}

.breadcrumb {
  max-width: 800px;
  margin: 24px auto;
  padding: 0 24px;
  font-size: 14px;
  color: var(--text-secondary);
}

.breadcrumb a {
  color: var(--text-secondary);
}

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

.back-button {
  display: inline-block;
  margin-bottom: 16px;
  padding: 0 24px;
  font-size: 14px;
  color: var(--text-secondary);
}

.back-button:hover {
  color: var(--accent);
}

#article-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

#article-content h1 {
  font-size: 36px;
  font-weight: 700;
  color: white;
  margin-bottom: 0.4em;
}

#article-content h2 {
  font-size: 24px;
  color: var(--accent-hover);
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.3em;
  margin-top: 2em;
  margin-bottom: 1em;
}

#article-content h3 {
  font-size: 20px;
  font-weight: 600;
  color: white;
  margin-top: 1.5em;
  margin-bottom: 0.75em;
}

#article-content p {
  color: var(--text-secondary);
  line-height: 1.85;
  margin-bottom: 1.25em;
}

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

#article-content a:hover {
  color: var(--accent-original);
}

#article-content img {
  max-width: 100%;
  border-radius: 10px;
  margin: 1.5em auto;
  display: block;
}

#article-content code {
  background: var(--elevated);
  border-radius: 4px;
  padding: 0.15em 0.4em;
  font-family: var(--font-mono);
  font-size: 0.9em;
}

#article-content pre {
  background: var(--elevated);
  border-radius: 8px;
  padding: 1.5em;
  overflow-x: auto;
  margin: 1.5em 0;
}

#article-content pre code {
  background: none;
  padding: 0;
}

#article-content blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 1em;
  margin: 1.5em 0;
  font-style: italic;
  color: var(--text-secondary);
}

#article-content ul,
#article-content ol {
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 1.25em;
  padding-left: 1.5em;
}

#article-content li {
  margin-bottom: 0.5em;
}

/* ========================================
   Page Header (List Pages)
   ======================================== */

.page-header {
  padding: 160px 24px 60px;
  background: linear-gradient(to bottom, rgba(10, 10, 18, 0.7), rgba(10, 10, 18, 0.9)),
              url('../../hero.webp');
  background-size: cover;
  background-position: center;
  text-align: center;
}

.page-header h1 {
  font-size: 48px;
  font-weight: 700;
  margin-bottom: 16px;
}

.page-header p {
  font-size: 18px;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
}

/* ========================================
   Filter Bar (Blogs Page)
   ======================================== */

.filter-bar {
  max-width: 900px;
  margin: 40px auto;
  padding: 0 24px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 8px 20px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.25s ease;
}

.filter-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

/* ========================================
   Placeholder Pages
   ======================================== */

.placeholder-content {
  max-width: 800px;
  margin: 120px auto 80px;
  padding: 0 24px;
  text-align: center;
}

.placeholder-content h1 {
  font-size: 48px;
  margin-bottom: 24px;
}

.placeholder-content p {
  font-size: 18px;
  color: var(--text-secondary);
}

/* ========================================
   About Page
   ======================================== */

.about-page {
  padding-top: 80px;
}

.about-hero {
  padding: 60px 24px;
  background: linear-gradient(135deg, var(--surface) 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--border);
}

.about-section {
  padding: 60px 24px;
}

.about-section:nth-child(even) {
  background: var(--surface);
}

.about-container {
  max-width: 900px;
  margin: 0 auto;
}

.about-section-title {
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent-light);
  margin-bottom: 32px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.about-intro {
  font-size: 20px;
  line-height: 1.8;
  color: var(--text-secondary);
  text-align: center;
}

/* Timeline */
.timeline {
  position: relative;
  padding-left: 30px;
}

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

.timeline-item {
  position: relative;
  margin-bottom: 40px;
}

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

.timeline-marker {
  position: absolute;
  left: -35px;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
}

.timeline-content h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.timeline-meta {
  font-size: 14px;
  color: var(--accent-light);
  margin-bottom: 8px;
}

.timeline-detail {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.timeline-supervisor {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.timeline-interest {
  font-size: 14px;
  color: var(--text-secondary);
}

.timeline-tasks {
  margin: 12px 0 0;
  padding-left: 20px;
}

.timeline-tasks li {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  line-height: 1.6;
}

/* Publications */
.about-subsection-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 32px 0 20px;
}

.publication-list {
  list-style: none;
  padding: 0;
}

.publication-list li {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 16px;
  padding-left: 20px;
  position: relative;
}

.publication-list li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--accent);
}

.pub-author {
  color: var(--text-primary);
}

.publication-list em {
  color: var(--text-primary);
  font-style: italic;
}

.publication-list a {
  color: var(--accent-light);
}

.publication-list a:hover {
  color: var(--accent-original);
}

/* Software Grid */
.software-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.software-card {
  background: var(--elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px;
  transition: all 0.25s ease;
  text-decoration: none;
}

.software-card a {
  text-decoration: none;
}

.software-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.software-card h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.software-card p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 12px;
  line-height: 1.6;
}

.software-meta {
  font-size: 12px;
  color: var(--accent);
  font-family: var(--font-mono);
}

/* Awards */
.awards-list {
  list-style: none;
  padding: 0;
}

.awards-list li {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 16px;
  padding-left: 20px;
  position: relative;
}

.awards-list li::before {
  content: '★';
  position: absolute;
  left: 0;
  color: var(--accent);
}

.award-year {
  font-weight: 600;
  color: var(--text-primary);
}

.awards-list a {
  color: var(--accent-light);
}

.awards-list a:hover {
  color: var(--accent-original);
}

/* Experience List (Talks, Teaching, Grants, etc.) */
.experience-list {
  list-style: none;
  padding: 0;
}

.experience-list li {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 16px;
  padding-left: 20px;
  position: relative;
}

.experience-list li::before {
  content: '›';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: bold;
}

.exp-year {
  font-weight: 600;
  color: var(--text-primary);
  margin-right: 8px;
}

.experience-list strong {
  color: var(--accent-light);
  font-weight: 600;
}

.experience-list a {
  color: var(--accent-light);
}

.experience-list a:hover {
  color: var(--accent-original);
}

.experience-list em {
  font-style: italic;
}

/* Contact in About */
.about-contact .contact-card {
  max-width: 600px;
}

/* ========================================
   Research Page
   ======================================== */

.research-filters {
  padding: 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.research-layout {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  gap: 32px;
  padding: 24px;
}

.research-sidebar {
  width: 280px;
  flex-shrink: 0;
  position: sticky;
  top: 100px;
  height: fit-content;
}

.filter-section {
  margin-bottom: 24px;
}

.filter-section label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.filter-section .filter-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.filter-section input,
.filter-section select {
  width: 100%;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 14px;
}

.filter-section input:focus,
.filter-section select:focus {
  outline: none;
  border-color: var(--accent-light);
}

.filter-section input::placeholder {
  color: var(--text-secondary);
}

/* Year filter buttons */
.year-filter-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.year-btn {
  padding: 4px 0;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  color: var(--accent-light);
  font-size: 14px;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
}

.year-btn:hover {
  color: var(--accent-original) !important;
  background: transparent !important;
}

.year-btn.active {
  background: transparent !important;
  color: var(--accent-original) !important;
  font-weight: 600;
}

.research-main {
  flex: 1;
  min-width: 0;
}

.no-results {
  text-align: center;
  padding: 60px;
  color: var(--text-secondary);
  font-size: 16px;
}

.time-filter select:focus {
  outline: none;
  border-color: var(--accent-light);
}

.no-results {
  text-align: center;
  padding: 60px;
  color: var(--text-secondary);
}

/* ========================================
   Responsive Styles
   ======================================== */

/* Tablet Landscape */
@media (max-width: 1200px) {
  .research-layout {
    padding: 16px;
    gap: 24px;
  }

  .research-sidebar {
    width: 240px;
  }
}

/* Tablet Portrait */
@media (max-width: 1024px) {
  .carousel-container {
    max-width: 100%;
    padding: 0 16px;
  }

  .home-card {
    width: 240px;
  }

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

  .research-sidebar {
    width: 100%;
    position: static;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    padding: 16px;
    background: var(--surface);
    border-radius: 10px;
    margin-bottom: 16px;
  }

  .filter-section {
    flex: 1;
    min-width: 200px;
    margin-bottom: 0;
  }

  .year-filter-list {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .year-btn {
    padding: 4px 12px;
  }
}

/* Mobile Large / Small Tablet */
@media (max-width: 768px) {
  .home-carousel-btn {
    display: none;
  }

  .related-carousel-btn {
    display: flex;
  }

  .home-card {
    width: 260px;
  }

  .related-card {
    width: 260px;
  }

  header {
    padding: 12px 20px;
    width: 100%;
    left: 0;
    right: 0;
  }

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

  .logo img {
    height: 36px !important;
    width: auto !important;
    max-width: 150px !important;
    object-fit: contain !important;
  }

  .footer-logo img {
    height: 45px !important;
  }

  nav {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: var(--bg);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 24px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 9999;
  }

  nav.open {
    opacity: 1 !important;
    visibility: visible !important;
    background: #0a0a12 !important;
    z-index: 9999 !important;
    width: 100vw !important;
    height: 100vh !important;
    overflow: hidden !important;
  }

  nav a {
    font-size: 24px;
    color: var(--text-primary) !important;
  }

  .menu-toggle {
    display: block !important;
    z-index: 10001 !important;
    position: relative;
    color: var(--text-primary) !important;
  }

  /* Close button when menu is open - works after scroll too */
  .menu-toggle[aria-expanded="true"] {
    position: fixed !important;
    top: 12px !important;
    right: 20px !important;
    font-size: 32px !important;
    z-index: 10002 !important;
    color: var(--text-primary) !important;
  }

  /* When header is scrolled, menu button stays visible */
  header.scrolled .menu-toggle {
    color: var(--text-primary) !important;
  }

  #hero {
    min-height: 500px;
    padding: 0 20px;
  }

  #hero h1 {
    font-size: 42px;
  }

  #hero p {
    font-size: 16px;
  }

  .about-banner {
    flex-direction: column;
    text-align: center;
    gap: 24px;
  }

  .about-banner-avatar {
    width: 120px;
    height: 120px;
  }

  .about-banner-content h2 {
    font-size: 22px;
  }

  .about-banner-links {
    justify-content: center;
  }

  .section-header {
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-align: center;
  }

  section {
    padding: 60px 16px;
  }

  /* Project cards - stack vertically */
  .project-card {
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
  }

  /* Force vertical layout for projects list */
  #projects-list .project-card {
    flex-direction: column !important;
  }

  .project-card .cover-image,
  .project-card .cover-placeholder {
    width: 100%;
    height: 200px;
    border-radius: 8px;
    max-width: 100%;
    object-fit: cover;
  }

  #research-list .project-card .cover-image,
  #research-list .project-card .cover-placeholder,
  #projects-list .project-card .cover-image,
  #projects-list .project-card .cover-placeholder {
    width: 100%;
    height: 180px;
    border-radius: 8px;
  }

  #projects-list {
    max-width: 100%;
    padding: 0 16px;
    width: 100%;
    box-sizing: border-box;
  }

  /* Research sidebar becomes stacked */
  .research-sidebar {
    flex-direction: column;
  }

  .filter-section {
    min-width: 100%;
  }

  .footer-content {
    flex-direction: column;
    text-align: center;
  }

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

  .contact-card {
    padding: 24px;
  }

  .contact-row {
    flex-wrap: wrap;
  }

  .page-header {
    padding: 120px 16px 40px;
  }

  .page-header h1 {
    font-size: 36px;
  }

  .page-header p {
    font-size: 16px;
  }

  .filter-container {
    flex-direction: column;
  }

  /* Home carousel */
  .home-carousel-container {
    padding: 0 16px;
  }

  /* Article content */
  #article-content {
    padding: 24px 16px 60px;
  }

  .project-hero {
    margin-top: 60px;
  }

  .project-title-container {
    padding: 16px;
  }

  .project-title-container h1 {
    font-size: 26px;
  }

  /* Filter bar */
  .filter-bar {
    padding: 0 16px;
    justify-content: center;
  }

  /* About page */
  .about-section {
    padding: 40px 16px;
  }

  .about-intro {
    font-size: 18px;
  }

  .software-grid {
    grid-template-columns: 1fr;
  }
}

/* Small Mobile */
@media (max-width: 480px) {
  #hero h1 {
    font-size: 36px;
  }

  #hero p {
    font-size: 14px;
  }

  .project-card .project-title {
    font-size: 16px;
  }

  .project-card .project-abstract {
    font-size: 13px;
  }

  #article-content h1 {
    font-size: 28px;
  }

  #article-content h2 {
    font-size: 20px;
  }

  #article-content p {
    font-size: 15px;
  }

  .filter-btn {
    padding: 6px 14px;
    font-size: 13px;
  }

  /* About Page Mobile */
  .about-banner {
    flex-direction: column;
    text-align: center;
    gap: 24px;
    padding: 12px;
  }

  .about-banner-avatar {
    width: 100px;
    height: 100px;
  }

  .about-banner-content h2 {
    font-size: 20px;
  }

  .about-banner-desc {
    font-size: 14px;
    margin-bottom: 24px;
  }

  .about-banner-links {
    justify-content: center;
    gap: 8px;
  }

  .about-banner-links a {
    font-size: 12px;
    padding: 5px 12px;
  }

  .timeline {
    padding-left: 20px;
  }

  .timeline::before {
    left: 0;
  }

  .timeline-marker {
    left: -25px;
    width: 10px;
    height: 10px;
  }

  .software-grid {
    grid-template-columns: 1fr;
  }

  /* Footer */
  footer {
    padding: 24px 16px;
  }

  .footer-links {
    gap: 16px;
  }

  .footer-links a {
    font-size: 13px;
  }

  /* Contact */
  .contact-card {
    padding: 20px 16px;
  }

  .contact-row .label {
    width: 70px;
    font-size: 13px;
  }

  .contact-row a {
    font-size: 13px;
    word-break: break-all;
  }

  /* Research filters */
  .research-filters {
    padding: 16px;
  }

  .filter-section label,
  .filter-section .filter-label {
    font-size: 11px;
  }

  .filter-section input,
  .filter-section select {
    padding: 8px 12px;
    font-size: 13px;
  }

  /* Breadcrumb */
  .breadcrumb {
    padding: 0 16px;
    font-size: 13px;
  }

  /* Page header */
  .page-header {
    padding: 100px 16px 30px;
  }

  .page-header h1 {
    font-size: 28px;
  }

  /* Placeholder */
  .placeholder-content h1 {
    font-size: 32px;
  }

  .placeholder-content p {
    font-size: 16px;
  }
}

/* Extra Small */
@media (max-width: 360px) {
  .logo img {
    height: 33px !important;
    max-width: 120px !important;
    object-fit: contain !important;
  }

  .footer-logo img {
    height: 40px !important;
  }

  #hero h1 {
    font-size: 28px;
  }

  .home-card {
    width: 220px;
  }

  .related-card {
    width: 220px;
  }

  .project-card .cover-image,
  .project-card .cover-placeholder {
    height: 160px;
  }

  .about-banner-avatar {
    width: 80px;
    height: 80px;
  }
}
