:root {
  --bg: #f5f9ff;
  --surface: rgba(255, 255, 255, 0.86);
  --surface-2: rgba(232, 244, 255, 0.88);
  --text: #08111f;
  --muted: #4f5f75;
  --line: rgba(14, 165, 233, 0.22);
  --accent: #0284c7;
  --accent-dark: #c026d3;
  --accent-soft: rgba(14, 165, 233, 0.11);
  --shadow: 0 18px 55px rgba(8, 17, 31, 0.10), 0 0 28px rgba(14, 165, 233, 0.08);
  --cyber-magenta: #d946ef;
  --cyber-violet: #7c3aed;
  --cyber-cyan: #06b6d4;
  --cyber-blue: #0284c7;
  --cyber-panel: rgba(255, 255, 255, 0.84);
  --radius: 22px;
  --max-width: 1120px;
}

html[data-theme="dark"] {
  --bg: #060711;
  --surface: rgba(13, 18, 38, 0.92);
  --surface-2: rgba(20, 27, 55, 0.94);
  --text: #f6f8ff;
  --muted: #c2c9e8;
  --line: rgba(103, 232, 249, 0.22);
  --accent: #67e8f9;
  --accent-dark: #f472ff;
  --accent-soft: rgba(103, 232, 249, 0.13);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.52), 0 0 32px rgba(103, 232, 249, 0.08);
  --cyber-magenta: #f472ff;
  --cyber-violet: #8b5cf6;
  --cyber-cyan: #67e8f9;
  --cyber-blue: #38bdf8;
  --cyber-panel: rgba(10, 14, 31, 0.86);
}

* { box-sizing: border-box; }
html {
  scroll-behavior: auto;
  scroll-padding-top: 120px;
}

@media (max-width: 768px) {
  html { scroll-padding-top: 92px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}
a { color: inherit; text-decoration: none; }
p { margin: 0; color: var(--muted); }
h1, h2, h3 { margin: 0; line-height: 1.15; letter-spacing: -0.04em; }
h1 { font-size: clamp(3rem, 8vw, 6.5rem); }
h2 { font-size: clamp(2rem, 4vw, 3.4rem); }
h3 { font-size: 1.25rem; }

.container { width: min(var(--max-width), calc(100% - 40px)); margin: 0 auto; }
.section { padding: 96px 0; }
.section {
  content-visibility: auto;
  contain-intrinsic-size: 900px;
}

.hero.section,
.research-directions.section {
  content-visibility: visible;
  contain-intrinsic-size: auto;
}

.alt { background: var(--surface); }
.skip-link {
  position: absolute; left: -999px; top: 10px; padding: 10px 14px; background: var(--text); color: white; z-index: 20;
}
.skip-link:focus { left: 10px; }

.site-header {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(219, 226, 234, 0.7);
}
.nav { height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand {
  width: 44px; height: 44px; display: grid; place-items: center;
  flex: 0 0 44px;
  position: relative;
  z-index: 2;
  border-radius: 14px; background: var(--text); color: white; font-weight: 800;
  overflow: hidden;
}
.brand img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.brand-avatar {
  inline-size: 44px;
  block-size: 44px;
  max-inline-size: 44px;
  max-block-size: 44px;
  border-radius: 14px;
  object-fit: cover;
}
.nav-links {
  display: flex;
  gap: clamp(8px, 1.1vw, 16px);
  align-items: center;
  min-width: 0;
  max-width: calc(100% - 64px);
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  white-space: nowrap;
  color: var(--muted);
  font-weight: 600;
  padding: 8px 10px 8px 16px;
  border: 1px solid transparent;
  border-radius: 999px;
}
.nav-links::-webkit-scrollbar { display: none; }
.nav-links a:hover { color: var(--text); }
.nav-toggle { display: none; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text); padding: 10px 14px; font-weight: 700; }

.avatar-button {
  border: 0;
  padding: 0;
  cursor: pointer;
  flex: 0 0 44px;
}

.avatar-button:focus-visible,
.theme-option:focus-visible,
.avatar-modal:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.avatar-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 28px;
  background: rgba(8, 17, 31, 0.78);
  backdrop-filter: blur(18px);
}

.avatar-modal[hidden] { display: none; }

.avatar-modal-frame {
  width: min(72vw, 520px);
  aspect-ratio: 1 / 1;
  border-radius: 999px;
  padding: 10px;
  background: linear-gradient(135deg, var(--surface), var(--accent-soft));
  border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--line));
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.38);
  cursor: pointer;
}

.avatar-modal-frame img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: 999px;
}

.theme-selector {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 78%, var(--accent-soft));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.theme-option {
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 800;
  padding: 6px 10px;
}

.theme-option.active {
  background: var(--accent);
  color: white;
}

html[data-theme="dark"] .theme-option.active {
  color: #08111f;
}

.timeline-item h3 a:hover { color: var(--accent); }

.hero { padding-top: 104px; }
.hero-grid { display: grid; grid-template-columns: 1.35fr 0.65fr; gap: 48px; align-items: center; }
.eyebrow { color: var(--accent); font-weight: 800; text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.78rem; margin-bottom: 14px; }
.subtitle { margin-top: 18px; font-size: 1.2rem; color: var(--text); font-weight: 700; }
.hero-text { margin-top: 22px; max-width: 780px; font-size: 1.13rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 46px; padding: 0 18px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); font-weight: 800;
  box-shadow: 0 4px 18px rgba(16, 24, 39, 0.05);
}
.button:hover { transform: translateY(-1px); border-color: #c0cad6; }
.button.primary { background: var(--accent); border-color: var(--accent); color: white; }
.button.primary:hover { background: var(--accent-dark); }
.hero-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 30px; box-shadow: var(--shadow);
}
.hero-card h2 { font-size: 1.35rem; margin-bottom: 16px; }
.hero-card ul { margin: 0; padding-left: 20px; color: var(--muted); }
.hero-card li + li { margin-top: 10px; }

.section-heading { max-width: 860px; margin-bottom: 34px; }
.section-copy { margin-top: 12px; max-width: 820px; }
.positioning-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.card, .timeline-item, .repo-card, .award-card, .project-card, .competition-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px;
}
.card p, .timeline-item p, .repo-card p, .award-card p, .project-card p, .competition-card p { margin-top: 12px; }
.card:hover, .repo-card:hover, .award-card:hover, .project-card:hover, .competition-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); transition: 180ms ease; }

.paper-list { display: grid; gap: 18px; }
.paper {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 24px;
  align-items: stretch;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  overflow: hidden;
}
.paper:hover { box-shadow: var(--shadow); transform: translateY(-2px); transition: 180ms ease; }
.paper.featured { border-color: #b9c7ff; background: linear-gradient(135deg, #ffffff, var(--accent-soft)); }
.paper-left {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}
.paper-meta {
  color: var(--accent);
  font-weight: 800;
  font-size: 0.9rem;
  line-height: 1.35;
}
.paper-venue { display: block; }
.paper-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.paper-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 11px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--accent);
  border: 1px solid var(--line);
  font-weight: 800;
  font-size: 0.86rem;
}
.paper-links a:hover { background: white; border-color: #bcc7d6; }
.paper-main {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}
.paper-copy {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.paper-copy p { color: var(--muted); }
.paper-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 0.72 / 1;
  background: linear-gradient(180deg, #f8fafc, #e7edf7);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 14px 34px rgba(16, 24, 39, 0.11);
}
.paper-thumb canvas,
.paper-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.thumb-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  text-align: center;
  color: var(--muted);
  font-weight: 800;
  background:
    linear-gradient(135deg, rgba(25,71,229,0.12), rgba(255,255,255,0.3)),
    repeating-linear-gradient(0deg, rgba(16,24,39,0.06) 0 1px, transparent 1px 18px);
}
.thumb-fallback span { display: block; color: var(--accent); font-size: 0.8rem; letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 8px; }
.thumb-loading::after {
  content: "Rendering PDF preview…";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.9);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-align: center;
  box-shadow: 0 6px 18px rgba(16,24,39,0.08);
}

.repo-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.repo-card span { display: block; font-weight: 800; font-size: 1.1rem; }
.project-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.project-card h3 { font-size: 1.2rem; }
.project-card h3 a { color: var(--text); }
.project-card h3 a:hover,
.project-card p a:hover { color: var(--accent); }
.project-card p a { color: var(--accent); font-weight: 850; }
.project-meta {
  display: inline-flex;
  margin-bottom: 12px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 900;
}

.competition-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.competition-card h3 { font-size: 1.12rem; line-height: 1.35; }
.competition-card h3 a { color: var(--text); }
.competition-card h3 a:hover { color: var(--accent); }
.competition-meta {
  display: inline-flex;
  margin-bottom: 12px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 900;
}
.featured-competition {
  border-color: #b9c7ff;
  background: linear-gradient(135deg, var(--surface), var(--accent-soft));
}
.media-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.media-card {
  overflow: hidden;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 10px 28px rgba(16, 24, 39, 0.06);
}
.media-preview {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #111827;
  overflow: hidden;
  border: 0;
  cursor: pointer;
  padding: 0;
}
.media-preview img,
.media-preview iframe {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border: 0;
}
.media-preview.external {
  display: grid;
  place-items: center;
  color: white;
  background: linear-gradient(135deg, #101827, #1947e5);
}
.play-badge {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 64px;
  height: 64px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--accent);
  display: grid;
  place-items: center;
  font-size: 1.5rem;
  box-shadow: 0 15px 40px rgba(0,0,0,0.28);
}
.media-body { padding: 20px; }
.media-body h3 { font-size: 1.15rem; }
.media-body p { margin-top: 8px; }
.media-actions { margin-top: 14px; display: flex; gap: 10px; flex-wrap: wrap; }
.media-actions a {
  color: var(--accent);
  font-weight: 800;
}
.award-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.award-card {
  position: relative;
}

.award-year {
  display: inline-flex;
  margin-bottom: 12px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 900;
  font-size: 0.82rem;
}


.text-link {
  display: inline-flex;
  margin-top: 14px;
  color: var(--accent);
  font-weight: 900;
}

.text-link:hover {
  text-decoration: underline;
}

.research-directions { overflow: hidden; }
.direction-carousel {
  background: linear-gradient(180deg, #ffffff, #f8fbff);
  border: 1px solid var(--line);
  border-radius: 34px;
  padding: 28px;
  box-shadow: var(--shadow);
}
.direction-kicker {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.direction-title {
  margin-top: 16px;
  max-width: 980px;
  font-size: clamp(1.55rem, 3vw, 2.55rem);
}
.direction-summary {
  margin-top: 22px;
  max-width: 980px;
  font-size: 1.03rem;
  color: var(--muted);
}
.direction-stage {
  position: relative;
  margin-top: 26px;
  height: clamp(320px, 48vw, 610px);
  min-height: 0;
  overflow: hidden;
  border-radius: 30px;
  background:
    linear-gradient(90deg, rgba(247, 248, 251, 0.92), rgba(255,255,255,0.28) 15%, rgba(255,255,255,0.28) 85%, rgba(247, 248, 251, 0.92)),
    #ffffff;
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.8), 0 18px 42px rgba(16, 24, 39, 0.08);
  transition: height 320ms cubic-bezier(0.2, 0, 0, 1);
}

.direction-stage.is-resizing {
  will-change: height;
}
.direction-track {
  position: absolute;
  inset: 0;
  min-height: 100%;
  contain: layout paint;
}

.direction-stage,
.direction-track,
.direction-card,
.direction-card img {
  transform: translateZ(0);
}

.direction-stage {
  contain: layout paint;
}

.direction-card {
  position: absolute;
  top: 50%;
  width: min(88%, 1060px);
  border: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  cursor: zoom-in;
  border-radius: 24px;
  transform: translate(-50%, -50%) scale(0.82);
  transition:
    left 340ms cubic-bezier(0.2, 0, 0, 1),
    transform 340ms cubic-bezier(0.2, 0, 0, 1),
    opacity 320ms linear,
    filter 320ms linear;
  will-change: auto;
  backface-visibility: hidden;
  transform-origin: center center;
}

.direction-card img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  border-radius: 22px;
  background: #ffffff;
  border: 1px solid var(--line);
  box-shadow: 0 18px 44px rgba(16, 24, 39, 0.12);
  transition:
    border-radius 320ms linear,
    box-shadow 320ms linear,
    filter 320ms linear,
    opacity 320ms linear;
}
.direction-card.is-active {
  left: 50%;
  z-index: 3;
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  filter: none;
}
.direction-card.is-prev {
  left: 2%;
  z-index: 1;
  opacity: 0.28;
  transform: translate(-50%, -50%) scale(0.78);
  filter: saturate(0.75) blur(0.15px);
  pointer-events: none;
}
.direction-card.is-next {
  left: 98%;
  z-index: 1;
  opacity: 0.28;
  transform: translate(-50%, -50%) scale(0.78);
  filter: saturate(0.75) blur(0.15px);
  pointer-events: none;
}

.direction-card.is-far-prev {
  left: -44%;
  z-index: 0;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.72);
  filter: saturate(0.72) blur(0.2px);
  pointer-events: none;
}

.direction-card.is-far-next {
  left: 144%;
  z-index: 0;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.72);
  filter: saturate(0.72) blur(0.2px);
  pointer-events: none;
}

.direction-track.slide-left .direction-card,
.direction-track.slide-right .direction-card {
  will-change: left, transform, opacity, filter;
}

.direction-title,
.direction-summary,
.direction-kicker {
  transition: opacity 150ms linear, transform 180ms cubic-bezier(0.2, 0, 0, 1);
}

.direction-copy-changing .direction-title,
.direction-copy-changing .direction-summary,
.direction-copy-changing .direction-kicker {
  opacity: 0;
  transform: translateY(4px);
}

@media (prefers-reduced-motion: reduce) {
  .direction-stage,
  .direction-card,
  .direction-card img,
  .direction-title,
  .direction-summary,
  .direction-kicker {
    transition: none;
  }
}

.direction-card:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 5px;
}
.direction-card.is-active::after {
  content: "";
  display: none;
  position: absolute;
  right: 18px;
  bottom: 18px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(16, 24, 39, 0.72);
  color: white;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.02em;
}
.direction-controls {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  margin-top: 20px;
}
.direction-button {
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(16, 24, 39, 0.05);
}
.direction-button:hover,
.direction-button:focus-visible {
  transform: translateY(-1px);
  border-color: #b7c2d1;
  outline: none;
}
.direction-dots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}
.direction-dot {
  width: 11px;
  height: 11px;
  border-radius: 999px;
  border: 0;
  background: #c7d1df;
  cursor: pointer;
}
.direction-dot.active {
  width: 34px;
  background: var(--accent);
}
.direction-lightbox[hidden] { display: none; }
.direction-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  gap: 12px;
  padding: 24px;
  background: rgba(8, 13, 24, 0.92);
  cursor: zoom-out;
}
.direction-lightbox img {
  max-width: min(96vw, 1600px);
  max-height: 86vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 22px 80px rgba(0, 0, 0, 0.35);
}
.direction-lightbox p {
  color: rgba(255, 255, 255, 0.82);
  font-weight: 800;
  text-align: center;
}
.direction-lightbox-close {
  position: fixed;
  top: 18px;
  right: 18px;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.28);
  background: rgba(255,255,255,0.12);
  color: #ffffff;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
}
body.direction-expanded { overflow: hidden; }

.academic-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.academic-card {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: 0 10px 28px rgba(16, 24, 39, 0.06);
}
.academic-card:hover,
.service-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
  transition: 180ms ease;
}
.academic-logo-frame {
  position: relative;
  width: 112px;
  height: 112px;
  display: grid;
  place-items: center;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff, var(--surface-2));
  overflow: hidden;
}
.academic-logo {
  position: relative;
  z-index: 1;
  display: block;
  width: 82%;
  height: 82%;
  object-fit: contain;
}
.academic-logo-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--accent);
  font-weight: 900;
  letter-spacing: 0.08em;
}
.academic-year {
  display: inline-flex;
  margin-bottom: 10px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 900;
}
.academic-content p { margin-top: 10px; }
.thesis-title {
  color: var(--text);
  font-weight: 600;
}
.status-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin-top: 14px;
  padding: 7px 12px;
  border-radius: 999px;
  background: #064e3b;
  color: #ffffff !important;
  border: 1px solid #34d399;
  box-shadow: 0 0 0 1px rgba(52, 211, 153, 0.18), 0 8px 18px rgba(6, 78, 59, 0.22);
  text-shadow: none;
  font-weight: 900;
  font-size: 0.85rem;
  letter-spacing: 0.01em;
}

[data-theme="dark"] .status-pill {
  background: #022c22;
  color: #ffffff !important;
  border-color: #2dd4bf;
  box-shadow: 0 0 0 1px rgba(45, 212, 191, 0.24), 0 0 14px rgba(45, 212, 191, 0.20);
}
.academic-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 14px;
}
.service-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.service-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
}
.service-card-large { grid-column: span 2; }
.service-card p { margin-top: 12px; }
.service-card a,
.service-list a,
.reviewer-grid a {
  color: var(--accent);
  font-weight: 850;
}
.service-list {
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
  display: grid;
  gap: 14px;
}
.service-list li {
  padding-left: 18px;
  border-left: 3px solid var(--accent-soft);
}
.service-list span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}
.reviewer-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.reviewer-grid span {
  display: block;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--bg);
  color: var(--muted);
}
.reviewer-grid strong {
  color: var(--text);
  margin-right: 6px;
}

.timeline { display: grid; gap: 18px; }
.role { margin-top: 8px; color: var(--text); font-weight: 800; }
.contact-card {
  background: var(--text); color: white; border-radius: 32px; padding: 56px;
  box-shadow: var(--shadow);
}
.contact-card p { color: #cbd5e1; max-width: 840px; margin-top: 16px; }
.contact-card .eyebrow { color: #aebcff; margin-top: 0; }
.contact-card .button { background: rgba(255,255,255,0.08); color: white; border-color: rgba(255,255,255,0.18); }
.contact-card .button.primary { background: white; color: var(--text); border-color: white; }

.footer { padding: 28px 0; border-top: 1px solid var(--line); }
.footer-inner { display: flex; justify-content: space-between; gap: 20px; align-items: center; }
.footer a { font-weight: 800; color: var(--accent); }



/* Cyberpunk light mode polish: bright neon-academic palette with strong readability. */
html[data-theme="light"] body {
  background:
    radial-gradient(circle at 10% 8%, rgba(217, 70, 239, 0.16), transparent 30%),
    radial-gradient(circle at 88% 10%, rgba(6, 182, 212, 0.18), transparent 32%),
    radial-gradient(circle at 52% 88%, rgba(124, 58, 237, 0.10), transparent 34%),
    linear-gradient(135deg, #f8fbff 0%, #eef8ff 46%, #f8f4ff 100%);
}

html[data-theme="light"] .alt {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(240, 249, 255, 0.88)),
    radial-gradient(circle at 82% 10%, rgba(217, 70, 239, 0.10), transparent 34%);
}

html[data-theme="light"] .site-header {
  background: rgba(248, 251, 255, 0.78);
  border-bottom: 1px solid rgba(14, 165, 233, 0.24);
  box-shadow: 0 12px 34px rgba(8, 17, 31, 0.08), 0 0 22px rgba(6, 182, 212, 0.10);
}

html[data-theme="light"] .brand,
html[data-theme="light"] .avatar-button {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.20), rgba(217, 70, 239, 0.18));
  border: 1px solid rgba(6, 182, 212, 0.32);
  box-shadow: 0 0 24px rgba(6, 182, 212, 0.18), 0 0 18px rgba(217, 70, 239, 0.08);
}

html[data-theme="light"] .nav-links,
html[data-theme="light"] .nav-toggle,
html[data-theme="light"] .theme-selector,
html[data-theme="light"] .button,
html[data-theme="light"] .direction-button {
  background: linear-gradient(135deg, rgba(240, 253, 255, 0.80), rgba(253, 244, 255, 0.74));
  border-color: rgba(14, 165, 233, 0.34);
  box-shadow: 0 12px 34px rgba(8, 17, 31, 0.08), 0 0 22px rgba(6, 182, 212, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(16px);
}


html[data-theme="light"] .nav-links {
  border-radius: 999px;
  padding-left: 18px;
  padding-right: 10px;
}

html[data-theme="dark"] .nav-links {
  border-radius: 999px;
  padding-left: 18px;
  padding-right: 10px;
}

html[data-theme="light"] .nav-links a,
html[data-theme="light"] .theme-option,
html[data-theme="light"] .direction-button {
  color: #334155;
}

html[data-theme="light"] .nav-links a:hover,
html[data-theme="light"] .theme-option:hover,
html[data-theme="light"] .direction-button:hover,
html[data-theme="light"] .text-link,
html[data-theme="light"] .footer a,
html[data-theme="light"] .paper-links a,
html[data-theme="light"] .media-actions a,
html[data-theme="light"] .service-card a,
html[data-theme="light"] .service-list a,
html[data-theme="light"] .reviewer-grid a {
  color: var(--cyber-blue);
}

html[data-theme="light"] .theme-option.active,
html[data-theme="light"] .button.primary {
  color: #ffffff;
  background: linear-gradient(135deg, var(--cyber-blue), var(--cyber-magenta));
  border-color: rgba(255, 255, 255, 0.35);
  box-shadow: 0 0 24px rgba(6, 182, 212, 0.26), 0 0 28px rgba(217, 70, 239, 0.13);
}

html[data-theme="light"] .eyebrow,
html[data-theme="light"] .direction-kicker,
html[data-theme="light"] .award-year,
html[data-theme="light"] .reference-role,
html[data-theme="light"] .paper-meta {
  color: var(--cyber-blue);
  text-shadow: 0 0 16px rgba(6, 182, 212, 0.16);
}

html[data-theme="light"] h1,
html[data-theme="light"] h2,
html[data-theme="light"] h3,
html[data-theme="light"] .subtitle,
html[data-theme="light"] .role,
html[data-theme="light"] .direction-title {
  color: #08111f;
}

html[data-theme="light"] p,
html[data-theme="light"] .section-copy,
html[data-theme="light"] .direction-summary,
html[data-theme="light"] .hero-card ul,
html[data-theme="light"] .reference-details li,
html[data-theme="light"] .paper-copy p,
html[data-theme="light"] .media-body p,
html[data-theme="light"] .academic-card p,
html[data-theme="light"] .service-card p,
html[data-theme="light"] .timeline-item p {
  color: #4b5b70;
}

html[data-theme="light"] .hero-card,
html[data-theme="light"] .card,
html[data-theme="light"] .timeline-item,
html[data-theme="light"] .repo-card,
html[data-theme="light"] .award-card,
html[data-theme="light"] .paper,
html[data-theme="light"] .media-card,
html[data-theme="light"] .reference-card,
html[data-theme="light"] .academic-card,
html[data-theme="light"] .service-card {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.92), rgba(248,251,255,0.86)),
    radial-gradient(circle at 90% 0%, rgba(6, 182, 212, 0.10), transparent 34%);
  border-color: rgba(14, 165, 233, 0.20);
  box-shadow: 0 18px 52px rgba(8, 17, 31, 0.08), inset 0 1px 0 rgba(255,255,255,0.82);
}

html[data-theme="light"] .card:hover,
html[data-theme="light"] .repo-card:hover,
html[data-theme="light"] .award-card:hover,
html[data-theme="light"] .paper:hover,
html[data-theme="light"] .reference-card:hover,
html[data-theme="light"] .academic-card:hover,
html[data-theme="light"] .service-card:hover {
  border-color: rgba(217, 70, 239, 0.30);
  box-shadow: 0 20px 64px rgba(8, 17, 31, 0.12), 0 0 30px rgba(6, 182, 212, 0.13), 0 0 24px rgba(217, 70, 239, 0.09);
}

html[data-theme="light"] .paper.featured {
  border-color: rgba(217, 70, 239, 0.34);
  background:
    linear-gradient(135deg, rgba(255,255,255,0.96), rgba(239, 246, 255, 0.88)),
    radial-gradient(circle at 100% 0%, rgba(217, 70, 239, 0.12), transparent 38%);
}

html[data-theme="light"] .paper-links a,
html[data-theme="light"] .award-year,
html[data-theme="light"] .direction-kicker {
  background: rgba(6, 182, 212, 0.10);
  border-color: rgba(6, 182, 212, 0.18);
}

html[data-theme="light"] .paper-thumb,
html[data-theme="light"] .academic-logo-frame,
html[data-theme="light"] .reference-photo {
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(14, 165, 233, 0.24);
  box-shadow: 0 16px 40px rgba(8, 17, 31, 0.10), 0 0 18px rgba(6, 182, 212, 0.08);
}

html[data-theme="light"] .direction-carousel {
  background:
    radial-gradient(circle at 0% 0%, rgba(6, 182, 212, 0.14), transparent 30%),
    radial-gradient(circle at 100% 0%, rgba(217, 70, 239, 0.13), transparent 34%),
    linear-gradient(180deg, rgba(255,255,255,0.92), rgba(239, 248, 255, 0.94));
  border-color: rgba(14, 165, 233, 0.28);
  box-shadow: 0 26px 76px rgba(8, 17, 31, 0.12), 0 0 38px rgba(6, 182, 212, 0.10), inset 0 1px 0 rgba(255,255,255,0.78);
}

html[data-theme="light"] .direction-stage {
  background:
    linear-gradient(90deg, rgba(238, 248, 255, 0.98), rgba(255,255,255,0.45) 14%, rgba(255,255,255,0.45) 86%, rgba(248, 244, 255, 0.98)),
    radial-gradient(circle at 50% 30%, rgba(6, 182, 212, 0.12), transparent 42%),
    #ffffff;
  border-color: rgba(14, 165, 233, 0.24);
  box-shadow: inset 0 0 30px rgba(6, 182, 212, 0.06), 0 18px 48px rgba(8, 17, 31, 0.10);
}

html[data-theme="light"] .direction-card img {
  background: #ffffff;
  border-color: rgba(14, 165, 233, 0.28);
  box-shadow: 0 20px 60px rgba(8, 17, 31, 0.13), 0 0 24px rgba(6, 182, 212, 0.14);
}

html[data-theme="light"] .direction-card.is-prev,
html[data-theme="light"] .direction-card.is-next {
  opacity: 0.30;
  filter: saturate(0.88) brightness(0.96) blur(0.2px);
}

html[data-theme="light"] .direction-dot {
  background: rgba(100, 116, 139, 0.28);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.62);
}

html[data-theme="light"] .direction-dot.active {
  background: linear-gradient(135deg, var(--cyber-blue), var(--cyber-magenta));
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.24);
}

html[data-theme="light"] .media-preview.external {
  background: linear-gradient(135deg, #e0f2fe, #c7d2fe 45%, #f5d0fe);
  color: #08111f;
}

html[data-theme="light"] .play-badge {
  background: rgba(255,255,255,0.88);
  color: var(--cyber-blue);
  border: 1px solid rgba(14, 165, 233, 0.30);
}

html[data-theme="light"] .contact-card {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(circle at 10% 18%, rgba(34, 211, 238, 0.24), transparent 30%),
    radial-gradient(circle at 92% 12%, rgba(217, 70, 239, 0.22), transparent 32%),
    radial-gradient(circle at 50% 100%, rgba(124, 58, 237, 0.18), transparent 40%),
    linear-gradient(135deg, #020617 0%, #07111f 45%, #111827 100%);
  border: 1px solid rgba(103, 232, 249, 0.46);
  box-shadow:
    0 28px 84px rgba(8, 17, 31, 0.36),
    0 0 44px rgba(34, 211, 238, 0.20),
    inset 0 1px 0 rgba(255, 255, 255, 0.10);
}

html[data-theme="light"] .contact-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(rgba(103, 232, 249, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(217, 70, 239, 0.04) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,0.9), rgba(0,0,0,0.18));
  pointer-events: none;
}

html[data-theme="light"] .contact-card::after {
  content: "";
  position: absolute;
  inset: 1px;
  z-index: -1;
  border-radius: 31px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    inset 0 0 42px rgba(34, 211, 238, 0.08),
    inset 0 0 52px rgba(217, 70, 239, 0.06);
  pointer-events: none;
}

html[data-theme="light"] .contact-card .eyebrow {
  color: #67e8f9;
  text-shadow:
    0 0 14px rgba(103, 232, 249, 0.75),
    0 0 26px rgba(34, 211, 238, 0.35);
}

html[data-theme="light"] .contact-card h2 {
  color: #f8fbff;
  letter-spacing: -0.045em;
  text-shadow:
    0 0 18px rgba(34, 211, 238, 0.32),
    0 0 34px rgba(217, 70, 239, 0.18),
    0 3px 18px rgba(0, 0, 0, 0.55);
}

html[data-theme="light"] .contact-card p {
  color: #dbeafe;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.32);
}

html[data-theme="light"] .contact-card .hero-actions {
  position: relative;
  z-index: 2;
}

html[data-theme="light"] .contact-card .button {
  background:
    linear-gradient(135deg, rgba(15, 23, 42, 0.92), rgba(30, 41, 59, 0.78));
  color: #f8fbff;
  border: 1px solid rgba(103, 232, 249, 0.42);
  box-shadow:
    0 0 18px rgba(34, 211, 238, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

html[data-theme="light"] .contact-card .button:hover {
  border-color: rgba(217, 70, 239, 0.62);
  box-shadow:
    0 0 24px rgba(217, 70, 239, 0.24),
    0 0 32px rgba(34, 211, 238, 0.16);
}

html[data-theme="light"] .contact-card .button.primary {
  background: linear-gradient(135deg, #67e8f9 0%, #a78bfa 48%, #d946ef 100%);
  color: #020617;
  border-color: rgba(255, 255, 255, 0.50);
  box-shadow:
    0 0 26px rgba(34, 211, 238, 0.34),
    0 0 34px rgba(217, 70, 239, 0.20);
}

html[data-theme="light"] .contact-card .button.primary:hover {
  filter: saturate(1.08) brightness(1.04);
}

html[data-theme="light"] .footer {
  border-top-color: rgba(14, 165, 233, 0.20);
}


/* Cyberpunk dark mode polish: improves contrast, carousel readability, and card glow. */
html[data-theme="dark"] body {
  background:
    radial-gradient(circle at 12% 8%, rgba(244, 114, 255, 0.18), transparent 32%),
    radial-gradient(circle at 86% 12%, rgba(103, 232, 249, 0.18), transparent 30%),
    radial-gradient(circle at 52% 88%, rgba(56, 189, 248, 0.12), transparent 34%),
    linear-gradient(135deg, #05060f 0%, #080b18 46%, #0b1023 100%);
}

html[data-theme="dark"] .alt {
  background:
    linear-gradient(180deg, rgba(10, 14, 31, 0.72), rgba(12, 17, 37, 0.94)),
    radial-gradient(circle at 78% 12%, rgba(244, 114, 255, 0.12), transparent 36%);
}

html[data-theme="dark"] .site-header {
  background: rgba(5, 6, 15, 0.78);
  border-bottom: 1px solid rgba(103, 232, 249, 0.22);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.32), 0 0 18px rgba(103, 232, 249, 0.08);
}

html[data-theme="dark"] .brand,
html[data-theme="dark"] .avatar-button {
  background: linear-gradient(135deg, rgba(103,232,249,0.24), rgba(244,114,255,0.26));
  border: 1px solid rgba(103, 232, 249, 0.34);
  box-shadow: 0 0 22px rgba(103, 232, 249, 0.18);
}

html[data-theme="dark"] .nav-links,
html[data-theme="dark"] .nav-toggle,
html[data-theme="dark"] .theme-selector,
html[data-theme="dark"] .button,
html[data-theme="dark"] .direction-button {
  background: rgba(10, 14, 31, 0.72);
  border-color: rgba(103, 232, 249, 0.24);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.30), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

html[data-theme="dark"] .nav-links a,
html[data-theme="dark"] .theme-option,
html[data-theme="dark"] .direction-button {
  color: #dbeafe;
}

html[data-theme="dark"] .nav-links a:hover,
html[data-theme="dark"] .theme-option:hover,
html[data-theme="dark"] .direction-button:hover,
html[data-theme="dark"] .text-link,
html[data-theme="dark"] .footer a,
html[data-theme="dark"] .paper-links a,
html[data-theme="dark"] .media-actions a {
  color: var(--cyber-cyan);
}

html[data-theme="dark"] .theme-option.active,
html[data-theme="dark"] .button.primary {
  color: #04111f;
  background: linear-gradient(135deg, var(--cyber-cyan), var(--cyber-magenta));
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: 0 0 26px rgba(103, 232, 249, 0.32), 0 0 34px rgba(244, 114, 255, 0.16);
}

html[data-theme="dark"] .eyebrow,
html[data-theme="dark"] .direction-kicker,
html[data-theme="dark"] .award-year,
html[data-theme="dark"] .reference-role,
html[data-theme="dark"] .paper-meta {
  color: var(--cyber-cyan);
  text-shadow: 0 0 18px rgba(103, 232, 249, 0.25);
}

html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3,
html[data-theme="dark"] .subtitle,
html[data-theme="dark"] .role,
html[data-theme="dark"] .direction-title {
  color: #fbfdff;
}

html[data-theme="dark"] p,
html[data-theme="dark"] .section-copy,
html[data-theme="dark"] .direction-summary,
html[data-theme="dark"] .hero-card ul,
html[data-theme="dark"] .reference-details li,
html[data-theme="dark"] .paper-copy p,
html[data-theme="dark"] .media-body p,
html[data-theme="dark"] .academic-card p,
html[data-theme="dark"] .service-card p,
html[data-theme="dark"] .timeline-item p {
  color: #cbd5f5;
}

html[data-theme="dark"] .hero-card,
html[data-theme="dark"] .card,
html[data-theme="dark"] .timeline-item,
html[data-theme="dark"] .repo-card,
html[data-theme="dark"] .award-card,
html[data-theme="dark"] .paper,
html[data-theme="dark"] .media-card,
html[data-theme="dark"] .reference-card,
html[data-theme="dark"] .academic-card,
html[data-theme="dark"] .service-card {
  background:
    linear-gradient(180deg, rgba(14, 20, 43, 0.94), rgba(8, 12, 28, 0.94)),
    radial-gradient(circle at 85% 0%, rgba(103, 232, 249, 0.12), transparent 34%);
  border-color: rgba(103, 232, 249, 0.22);
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.36), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

html[data-theme="dark"] .card:hover,
html[data-theme="dark"] .repo-card:hover,
html[data-theme="dark"] .award-card:hover,
html[data-theme="dark"] .paper:hover,
html[data-theme="dark"] .reference-card:hover,
html[data-theme="dark"] .academic-card:hover,
html[data-theme="dark"] .service-card:hover {
  border-color: rgba(244, 114, 255, 0.34);
  box-shadow: 0 20px 64px rgba(0, 0, 0, 0.46), 0 0 32px rgba(103, 232, 249, 0.12), 0 0 26px rgba(244, 114, 255, 0.10);
}

html[data-theme="dark"] .paper.featured {
  border-color: rgba(244, 114, 255, 0.46);
  background:
    linear-gradient(135deg, rgba(18, 24, 52, 0.98), rgba(55, 29, 83, 0.76)),
    radial-gradient(circle at 100% 0%, rgba(244, 114, 255, 0.18), transparent 36%);
}

html[data-theme="dark"] .paper-links a,
html[data-theme="dark"] .award-year,
html[data-theme="dark"] .direction-kicker {
  background: rgba(103, 232, 249, 0.10);
  border-color: rgba(103, 232, 249, 0.20);
}

html[data-theme="dark"] .paper-thumb,
html[data-theme="dark"] .academic-logo-frame,
html[data-theme="dark"] .reference-photo {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(103, 232, 249, 0.26);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.38);
}

html[data-theme="dark"] .thumb-fallback {
  background:
    linear-gradient(135deg, rgba(103, 232, 249, 0.16), rgba(244, 114, 255, 0.10)),
    repeating-linear-gradient(0deg, rgba(255,255,255,0.06) 0 1px, transparent 1px 18px);
}

html[data-theme="dark"] .direction-carousel {
  background:
    radial-gradient(circle at 0% 0%, rgba(103, 232, 249, 0.16), transparent 30%),
    radial-gradient(circle at 100% 0%, rgba(244, 114, 255, 0.16), transparent 32%),
    linear-gradient(180deg, rgba(11, 16, 37, 0.96), rgba(6, 9, 22, 0.98));
  border-color: rgba(103, 232, 249, 0.32);
  box-shadow: 0 26px 90px rgba(0, 0, 0, 0.50), 0 0 44px rgba(103, 232, 249, 0.10), inset 0 1px 0 rgba(255,255,255,0.06);
}

html[data-theme="dark"] .direction-stage {
  background:
    linear-gradient(90deg, rgba(6, 9, 22, 0.96), rgba(14, 20, 43, 0.42) 14%, rgba(14, 20, 43, 0.42) 86%, rgba(6, 9, 22, 0.96)),
    radial-gradient(circle at 50% 30%, rgba(103, 232, 249, 0.12), transparent 42%),
    #070a16;
  border-color: rgba(103, 232, 249, 0.30);
  box-shadow: inset 0 0 32px rgba(103, 232, 249, 0.08), 0 18px 60px rgba(0, 0, 0, 0.44);
}

html[data-theme="dark"] .direction-card img {
  background: #f9fbff;
  border-color: rgba(103, 232, 249, 0.40);
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.50), 0 0 26px rgba(103, 232, 249, 0.18);
}

html[data-theme="dark"] .direction-card.is-prev,
html[data-theme="dark"] .direction-card.is-next {
  opacity: 0.34;
  filter: saturate(0.92) brightness(0.82) blur(0.2px);
}

html[data-theme="dark"] .direction-card.is-active::after {
  display: none;
}

html[data-theme="dark"] .direction-dot {
  background: rgba(203, 213, 245, 0.36);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.05);
}

html[data-theme="dark"] .direction-dot.active {
  background: linear-gradient(135deg, var(--cyber-cyan), var(--cyber-magenta));
  box-shadow: 0 0 20px rgba(103, 232, 249, 0.28);
}

html[data-theme="dark"] .direction-lightbox {
  background:
    radial-gradient(circle at 20% 15%, rgba(244, 114, 255, 0.16), transparent 36%),
    radial-gradient(circle at 80% 20%, rgba(103, 232, 249, 0.14), transparent 34%),
    rgba(3, 5, 12, 0.94);
}

html[data-theme="dark"] .direction-lightbox img,
html[data-theme="dark"] .avatar-modal-frame {
  border: 1px solid rgba(103, 232, 249, 0.40);
  box-shadow: 0 30px 110px rgba(0, 0, 0, 0.70), 0 0 44px rgba(103, 232, 249, 0.20), 0 0 52px rgba(244, 114, 255, 0.14);
}

html[data-theme="dark"] .media-preview.external {
  background: linear-gradient(135deg, #0b1023, #312e81 45%, #0891b2);
}

html[data-theme="dark"] .play-badge {
  background: rgba(6, 9, 22, 0.86);
  color: var(--cyber-cyan);
  border: 1px solid rgba(103, 232, 249, 0.34);
}

html[data-theme="dark"] .contact-card {
  background:
    radial-gradient(circle at 88% 18%, rgba(244, 114, 255, 0.22), transparent 34%),
    linear-gradient(135deg, #05060f, #0f172a 52%, #111827);
  border: 1px solid rgba(103, 232, 249, 0.26);
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.58), 0 0 38px rgba(103, 232, 249, 0.12);
}

html[data-theme="dark"] .contact-card p,
html[data-theme="dark"] .contact-card .eyebrow {
  color: #dbeafe;
}

html[data-theme="dark"] .contact-card .button.primary {
  background: linear-gradient(135deg, var(--cyber-cyan), var(--cyber-magenta));
  color: #04111f;
}

html[data-theme="dark"] .footer {
  border-top-color: rgba(103, 232, 249, 0.22);
}

html[data-theme="light"] .nav-links.open {
  background: #f8fbff;
}

html[data-theme="dark"] .nav-links.open {
  background: #0a0e1f;
}

@media (min-width: 861px) and (max-width: 1180px) {
  .nav-links {
    gap: 8px;
    font-size: 0.86rem;
    padding-inline: 12px 8px;
  }

  .theme-selector {
    transform: scale(0.92);
    transform-origin: right center;
  }
}

@media (max-width: 980px) {
  .paper-main { grid-template-columns: 150px minmax(0, 1fr); }
}

@media (max-width: 860px) {
  .section { padding: 72px 0; }
  .hero-grid, .positioning-grid, .repo-grid, .project-grid, .competition-grid, .media-grid, .award-grid, .academic-grid, .service-grid { grid-template-columns: 1fr; }
  .direction-carousel { padding: 20px; border-radius: 26px; }
  .direction-stage { height: clamp(245px, 58vw, 440px); border-radius: 22px; }
  .direction-card { width: 90%; }
  .direction-card.is-prev { left: -35%; opacity: 0.24; transform: translate(-50%, -50%) scale(0.78); }
  .direction-card.is-next { left: 135%; opacity: 0.24; transform: translate(-50%, -50%) scale(0.78); }
  .direction-card.is-active::after { right: 10px; bottom: 10px; font-size: 0.7rem; padding: 6px 9px; }
  .direction-controls { grid-template-columns: 1fr; }
  .direction-button { width: 100%; }
  .paper { grid-template-columns: 1fr; gap: 16px; }
  .paper-left { border-bottom: 1px solid var(--line); padding-bottom: 14px; }
  .paper-main { grid-template-columns: 120px minmax(0, 1fr); gap: 16px; }
  .nav-toggle { display: inline-flex; }
  .nav-links {
    position: absolute;
    left: 20px;
    right: 20px;
    top: 80px;
    display: none;
    flex-direction: column;
    gap: 14px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: var(--surface);
    box-shadow: var(--shadow);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .nav-links.open { display: flex; }
  .academic-card { grid-template-columns: 1fr; }
  .academic-logo-frame { width: 96px; height: 96px; }
  .service-card-large { grid-column: span 1; }
  .reviewer-grid { grid-template-columns: 1fr; }
  .contact-card { padding: 34px; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 560px) {
  .container { width: min(var(--max-width), calc(100% - 28px)); }
  .hero { padding-top: 72px; }
  .paper { padding: 16px; }
  .paper-main { grid-template-columns: 96px minmax(0, 1fr); gap: 14px; }
  .paper-thumb { border-radius: 12px; }
  .paper-copy { gap: 8px; }
  .paper-copy h3 { font-size: 1.06rem; }
  .button { width: 100%; }
  .direction-stage { height: clamp(210px, 62vw, 360px); }
  .direction-card { width: 94%; }
  .direction-card img { border-radius: 14px; }
  .direction-summary { font-size: 0.98rem; }
  .direction-lightbox { padding: 10px; }
  .direction-lightbox img { max-width: 98vw; max-height: 82vh; border-radius: 12px; }
}

#pairalign-paper,
#codecsep-paper,
#wav2tok2-paper,
#wav2tok-paper,
#enc-dec-awe-paper {
  scroll-margin-top: 120px;
}

@media (max-width: 768px) {
  #pairalign-paper,
  #codecsep-paper,
  #wav2tok2-paper,
  #wav2tok-paper,
  #enc-dec-awe-paper {
    scroll-margin-top: 92px;
  }
}

.paper-jump,
.pairalign-jump {
  color: inherit;
  font-weight: inherit;
  text-decoration: underline;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

.paper-jump:hover,
.paper-jump:focus-visible,
.pairalign-jump:hover,
.pairalign-jump:focus-visible {
  color: var(--accent);
}

@media (max-width: 1100px) {
  .competition-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Unified compact navigation: single Menu button + theme selector */
.nav {
  position: relative;
}

.nav-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 78%, var(--accent-soft));
  color: var(--text);
  padding: 9px 16px;
  font: inherit;
  font-weight: 800;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.nav-toggle:hover,
.nav-toggle[aria-expanded="true"] {
  color: var(--accent);
  transform: translateY(-1px);
}

.nav-links {
  position: absolute;
  top: calc(100% + 10px);
  right: 20px;
  left: auto;
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  width: min(320px, calc(100vw - 40px));
  max-width: none;
  min-width: 240px;
  max-height: calc(100vh - 96px);
  overflow-y: auto;
  overflow-x: hidden;
  white-space: normal;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-8px) scale(0.98);
  transition: opacity 150ms linear, transform 150ms linear, visibility 150ms linear;
}

.nav-links.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.nav-links a {
  display: flex;
  align-items: center;
  min-height: 38px;
  padding: 9px 12px;
  border-radius: 14px;
  color: var(--muted);
}

.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--text);
  background: color-mix(in srgb, var(--accent-soft) 68%, transparent);
}

.experience-subsection {
  margin-top: 38px;
  padding-top: 34px;
  border-top: 1px solid var(--line);
}

.experience-subsection .compact-heading {
  margin-bottom: 22px;
}

.experience-subsection .section-copy {
  max-width: 880px;
}

@media (min-width: 861px) and (max-width: 1180px) {
  .nav-links {
    gap: 6px;
    font-size: 0.95rem;
    padding: 12px;
  }

  .theme-selector {
    transform: none;
  }
}

@media (max-width: 860px) {
  .nav {
    gap: 10px;
  }

  .nav-actions {
    gap: 8px;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .nav-links {
    top: calc(100% + 10px);
    left: 14px;
    right: 14px;
    width: auto;
    min-width: 0;
    display: flex;
  }

  .theme-selector {
    gap: 2px;
    padding: 3px;
  }

  .theme-option {
    font-size: 0.76rem;
    padding: 6px 8px;
  }
}

@media (max-width: 560px) {
  .nav-actions {
    gap: 6px;
  }

  .nav-toggle {
    padding-inline: 12px;
  }

  .theme-option {
    padding-inline: 7px;
  }
}

html[data-theme="light"] .nav-links,
html[data-theme="dark"] .nav-links {
  border-radius: 24px;
  padding: 12px;
}

.avatar-modal-frame {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  max-width: min(92vw, 520px);
  padding: 22px;
}

.avatar-profile-info {
  width: 100%;
  padding: 18px 20px;
  border-radius: 22px;
  text-align: center;
  background: rgba(2, 6, 23, 0.86);
  border: 1px solid rgba(45, 212, 191, 0.40);
  box-shadow:
    0 0 0 1px rgba(56, 189, 248, 0.12),
    0 0 28px rgba(45, 212, 191, 0.16);
  backdrop-filter: blur(18px);
}

.avatar-profile-info h2 {
  margin: 0 0 8px;
  color: #ffffff;
  font-size: clamp(1.35rem, 3vw, 1.9rem);
  font-weight: 900;
  letter-spacing: -0.03em;
}

.avatar-profile-info p {
  margin: 4px 0;
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.98rem;
  font-weight: 600;
}

.avatar-profile-info a {
  display: inline-flex;
  margin-top: 10px;
  color: #67e8f9;
  font-weight: 800;
  text-decoration: none;
  word-break: break-word;
}

.avatar-profile-info a:hover {
  color: #a7f3d0;
  text-decoration: underline;
  text-underline-offset: 4px;
}

html[data-theme="light"] .avatar-profile-info h2,
html[data-theme="dark"] .avatar-profile-info h2 {
  color: #ffffff;
}

html[data-theme="light"] .avatar-profile-info p,
html[data-theme="dark"] .avatar-profile-info p {
  color: rgba(255, 255, 255, 0.9);
}

html[data-theme="light"] .avatar-profile-info a,
html[data-theme="dark"] .avatar-profile-info a {
  color: #67e8f9;
}

@media (max-width: 560px) {
  .avatar-modal-frame {
    max-width: 94vw;
    padding: 16px;
    gap: 14px;
  }

  .avatar-profile-info {
    padding: 16px;
    border-radius: 18px;
  }

  .avatar-profile-info p {
    font-size: 0.92rem;
  }
}



/* Smooth pop-up transitions for avatar profile and research-direction lightbox. */
.avatar-modal,
.direction-lightbox {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 220ms linear,
    visibility 220ms linear;
}

.avatar-modal.is-open,
.direction-lightbox.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.avatar-modal-frame {
  opacity: 0;
  transform: translateY(10px) scale(0.965);
  transition:
    opacity 180ms linear,
    transform 220ms linear;
  will-change: opacity, transform;
}

.avatar-modal.is-open .avatar-modal-frame {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.direction-lightbox img {
  opacity: 0;
  transform: translateY(10px) scale(0.965);
  transition:
    opacity 180ms linear,
    transform 220ms linear;
  will-change: opacity, transform;
}

.direction-lightbox.is-open img {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.direction-lightbox p,
.direction-lightbox-close {
  opacity: 0;
  transition: opacity 180ms linear;
}

.direction-lightbox.is-open p,
.direction-lightbox.is-open .direction-lightbox-close {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .direction-card,
  .direction-title,
  .direction-summary,
  .direction-kicker,
  .avatar-modal,
  .avatar-modal-frame,
  .direction-lightbox,
  .direction-lightbox img,
  .direction-lightbox p,
  .direction-lightbox-close {
    transition: none;
    transform: none;
  }
}


@media (max-width: 860px) {
  .direction-card.is-far-prev { left: -88%; opacity: 0; transform: translate(-50%, -50%) scale(0.74); }
  .direction-card.is-far-next { left: 188%; opacity: 0; transform: translate(-50%, -50%) scale(0.74); }
}

/* Carousel side-click navigation: left side = previous, right side = next, center = expand. */
.direction-card.is-active {
  cursor: zoom-in;
}

.direction-card.is-active img {
  user-select: none;
  -webkit-user-drag: none;
}

@media (hover: hover) and (pointer: fine) {
  .direction-card.is-active:hover img {
    filter: saturate(1.02) contrast(1.01);
  }
}

/* Mobile competitions: stack one challenge after another.
   This intentionally comes after the <=1100px two-column rule. */
@media (max-width: 860px) {
  .competition-grid {
    grid-template-columns: 1fr;
  }
}

.external-person-link {
  color: var(--accent);
  font-weight: 850;
  text-decoration: underline;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

.external-person-link:hover,
.external-person-link:focus-visible {
  color: var(--accent-dark);
}

.paper-thumb img {
  content-visibility: auto;
}

