:root {
  --font-sans: "Inter", sans-serif;
  --font-serif: "Playfair Display", serif;
  --container: 1180px;
  --radius-lg: 28px;
  --radius-md: 20px;
  --radius-sm: 14px;
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.18);
  --transition: 0.22s ease;
}

/* Default: Light mode */
html[data-theme="light"] {
  --bg: #ffffff;
  --bg-gradient-1: #f8fbff;
  --bg-gradient-2: #eef4fb;
  --panel: rgba(255, 255, 255, 0.76);
  --panel-strong: rgba(255, 255, 255, 0.95);
  --line: rgba(31, 78, 216, 0.10);
  --line-strong: rgba(31, 78, 216, 0.18);
  --text: #172033;
  --muted: #5b6475;
  --soft: #6c7688;
  --primary: #1f4ed8;
  --primary-strong: #183aa3;
  --accent: #0f172a;
  --gold: #9b7a28;
  --card-shadow: 0 18px 40px rgba(20, 31, 56, 0.08);
  --header-bg: rgba(255, 255, 255, 0.84);
  --grid: rgba(31, 78, 216, 0.045);
  --orb-1: rgba(142, 202, 230, 0.26);
  --orb-2: rgba(31, 78, 216, 0.14);
  --btn-primary-text: #ffffff;
  --metric-bg: rgba(31, 78, 216, 0.04);
  --tag-bg: rgba(31, 78, 216, 0.05);
  --hero-card-bg: linear-gradient(180deg, rgba(255,255,255,0.90), rgba(248,251,255,0.88));
  --body-bg: linear-gradient(180deg, var(--bg-gradient-1) 0%, var(--bg-gradient-2) 100%);
}

/* Dark mode */
html[data-theme="dark"] {
  --bg: #061224;
  --bg-gradient-1: #071224;
  --bg-gradient-2: #06111f;
  --panel: rgba(13, 30, 56, 0.68);
  --panel-strong: rgba(12, 26, 47, 0.9);
  --line: rgba(156, 187, 255, 0.16);
  --line-strong: rgba(169, 194, 255, 0.28);
  --text: #edf4ff;
  --muted: #aebed9;
  --soft: #7f94b5;
  --primary: #7eb6ff;
  --primary-strong: #99c4ff;
  --accent: #d8e8ff;
  --gold: #d6c28c;
  --card-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
  --header-bg: rgba(5, 14, 28, 0.72);
  --grid: rgba(126, 182, 255, 0.045);
  --orb-1: rgba(79, 125, 214, 0.35);
  --orb-2: rgba(18, 101, 176, 0.32);
  --btn-primary-text: #071224;
  --metric-bg: rgba(130, 170, 255, 0.06);
  --tag-bg: rgba(130, 170, 255, 0.07);
  --hero-card-bg: linear-gradient(180deg, rgba(18, 37, 67, 0.84), rgba(10, 22, 40, 0.92));
  --body-bg:
    radial-gradient(circle at top left, rgba(57, 104, 181, 0.22), transparent 32%),
    radial-gradient(circle at 85% 12%, rgba(43, 89, 173, 0.25), transparent 26%),
    linear-gradient(180deg, #071224 0%, #08172b 35%, #06111f 100%);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--body-bg);
  line-height: 1.75;
  overflow-x: hidden;
  transition: background 0.3s ease, color 0.3s ease;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: all var(--transition);
}

a:hover {
  color: var(--primary-strong);
}

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

.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,0.75), rgba(0,0,0,0.05));
  pointer-events: none;
  z-index: -3;
}

.bg-orb {
  position: fixed;
  border-radius: 999px;
  filter: blur(80px);
  pointer-events: none;
  z-index: -2;
  opacity: 0.55;
}

.bg-orb-1 {
  width: 380px;
  height: 380px;
  top: -80px;
  left: -70px;
  background: var(--orb-1);
}

.bg-orb-2 {
  width: 360px;
  height: 360px;
  right: -80px;
  top: 180px;
  background: var(--orb-2);
}

.container {
  width: min(var(--container), calc(100% - 56px));
  margin: 0 auto;
}

.glass-card {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--card-shadow);
  backdrop-filter: blur(18px);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 999;
  background: var(--header-bg);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}

.nav-wrap {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.02em;
}

.nav {
  display: flex;
  align-items: center;
  gap: 26px;
}

.nav a {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.96rem;
}

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

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.theme-toggle,
.nav-cv {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  color: var(--accent);
  font-weight: 600;
  background: var(--tag-bg);
}

.theme-toggle {
  gap: 8px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.95rem;
}

.theme-toggle:hover,
.nav-cv:hover {
  border-color: var(--primary);
}

.menu-btn {
  display: none;
  border: 1px solid var(--line-strong);
  background: var(--tag-bg);
  color: var(--accent);
  width: 44px;
  height: 44px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 1.2rem;
}

.hero {
  padding: 78px 0 56px;
}

.hero-layout {
  display: grid;
  grid-template-columns: 1.25fr 0.85fr;
  gap: 34px;
  align-items: center;
}

.hero-kicker,
.section-kicker,
.project-topline,
.side-card-label,
.exp-label {
  margin: 0 0 12px;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.8rem;
  font-weight: 700;
}

.hero-title {
  margin: 0 0 12px;
  font-family: var(--font-serif);
  font-size: clamp(3.2rem, 7vw, 5.4rem);
  line-height: 0.98;
  letter-spacing: -0.03em;
  color: var(--accent);
}

.hero-subtitle {
  margin: 0 0 18px;
  font-size: 1.18rem;
  color: var(--text);
  max-width: 820px;
}

.hero-description {
  margin: 0 0 28px;
  color: var(--muted);
  font-size: 1.02rem;
  max-width: 760px;
}

.hero-buttons,
.hero-links,
.pub-links,
.project-links,
.contact-links,
.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.hero-links {
  margin-top: 8px;
  margin-bottom: 30px;
}

.hero-links a,
.pub-links a,
.project-links a,
.contact-links a {
  color: var(--primary);
  font-weight: 600;
}

.hero-links a:hover,
.pub-links a:hover,
.project-links a:hover,
.contact-links a:hover {
  color: var(--primary-strong);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 20px;
  border-radius: 999px;
  font-weight: 700;
  border: 1px solid transparent;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-strong) 100%);
  color: var(--btn-primary-text);
  box-shadow: 0 16px 30px rgba(31, 78, 216, 0.16);
}

.btn-primary:hover {
  color: var(--btn-primary-text);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--tag-bg);
  color: var(--accent);
  border-color: var(--line-strong);
}

.btn-secondary:hover {
  color: var(--accent);
  border-color: var(--primary);
  transform: translateY(-1px);
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 28px;
}

.metric-card {
  padding: 18px 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--metric-bg);
}

.metric-value {
  display: block;
  font-size: 1.08rem;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 6px;
}

.metric-label {
  display: block;
  color: var(--soft);
  font-size: 0.92rem;
}

.hero-right {
  display: grid;
  gap: 18px;
}

.portrait-shell {
  position: relative;
  padding: 18px;
  border-radius: 34px;
  border: 1px solid var(--line);
  background: var(--hero-card-bg);
  box-shadow: var(--card-shadow);
  overflow: hidden;
}

.portrait-glow {
  position: absolute;
  inset: auto -10% -25% auto;
  width: 220px;
  height: 220px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(141, 186, 255, 0.32), transparent 70%);
  filter: blur(18px);
}

.portrait {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: #dfe8f5;
}

.hero-side-card {
  padding: 22px;
  border-radius: 22px;
}

.hero-side-card h3 {
  margin: 0 0 8px;
  font-size: 1.18rem;
  color: var(--accent);
}

.hero-side-card p {
  margin: 0;
  color: var(--muted);
}

.section {
  padding: 66px 0;
}

.section-heading {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 26px;
}

.section-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  height: 58px;
  border-radius: 18px;
  border: 1px solid var(--line-strong);
  background: var(--tag-bg);
  color: var(--accent);
  font-weight: 800;
  font-size: 1rem;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(1.9rem, 3.4vw, 3rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--accent);
}

.about-grid {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr;
  gap: 22px;
}

.about-card,
.info-card,
.research-card,
.timeline-entry,
.publication-card,
.project-card,
.exp-card,
.contact-panel {
  border-radius: var(--radius-lg);
}

.about-card,
.info-card,
.exp-card,
.contact-panel {
  padding: 28px;
}

.about-card p {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 1rem;
}

.about-card p:last-child {
  margin-bottom: 0;
}

.info-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.info-row:last-child {
  border-bottom: none;
}

.info-key {
  color: var(--soft);
  font-size: 0.86rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}

.info-value {
  color: var(--accent);
  font-weight: 600;
}

.research-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.research-card {
  padding: 24px;
  position: relative;
  overflow: hidden;
}

.research-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
}

.research-number {
  display: inline-flex;
  margin-bottom: 14px;
  font-size: 0.85rem;
  color: var(--gold);
  font-weight: 700;
  letter-spacing: 0.14em;
}

.research-card h3 {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 1.12rem;
}

.research-card p {
  margin: 0;
  color: var(--muted);
}

.timeline-list {
  display: grid;
  gap: 16px;
}

.timeline-entry {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 22px;
  padding: 24px 26px;
}

.timeline-date {
  color: var(--gold);
  font-weight: 800;
  font-size: 0.96rem;
  letter-spacing: 0.06em;
}

.timeline-body h3 {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 1.08rem;
}

.timeline-body p {
  margin: 0;
  color: var(--muted);
}

.publication-stack {
  display: grid;
  gap: 18px;
}

.publication-card {
  position: relative;
  padding: 28px;
}

.publication-card.featured {
  border-color: rgba(214, 194, 140, 0.36);
}

.pub-badge {
  display: inline-flex;
  margin-bottom: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(214, 194, 140, 0.12);
  color: var(--gold);
  border: 1px solid rgba(214, 194, 140, 0.2);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.publication-card h3 {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 1.3rem;
  line-height: 1.35;
}

.pub-authors,
.pub-desc {
  margin: 0 0 10px;
  color: var(--muted);
}

.pub-venue {
  margin: 0 0 10px;
  color: var(--primary);
  font-weight: 800;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.project-card {
  padding: 24px;
}

.project-card h3 {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 1.16rem;
}

.project-card p {
  margin: 0 0 18px;
  color: var(--muted);
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.project-tags span {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--tag-bg);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
}

.exp-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.exp-item {
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

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

.exp-item h3 {
  margin: 0 0 6px;
  color: var(--accent);
}

.exp-item p {
  margin: 0 0 6px;
  color: var(--muted);
}

.exp-item span {
  color: var(--soft);
  font-size: 0.95rem;
}

.contact-panel {
  text-align: center;
  padding: 40px 28px;
}

.contact-panel h2 {
  margin: 0 0 10px;
  font-size: clamp(2rem, 4vw, 3rem);
  color: var(--accent);
}

.contact-panel p {
  max-width: 780px;
  margin: 0 auto 24px;
  color: var(--muted);
}

.bottom-links {
  justify-content: center;
  margin-top: 18px;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 26px 0 36px;
}

.footer-wrap {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.footer-wrap p {
  margin: 0;
  color: var(--soft);
  font-size: 0.94rem;
}

@media (max-width: 1080px) {
  .hero-layout,
  .about-grid,
  .exp-grid,
  .research-grid,
  .project-grid {
    grid-template-columns: 1fr;
  }

  .hero-right {
    max-width: 560px;
  }

  .hero-metrics {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .nav {
    display: none;
    position: absolute;
    top: 82px;
    right: 24px;
    width: min(280px, calc(100% - 48px));
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    padding: 18px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: var(--panel-strong);
    box-shadow: var(--card-shadow);
  }

  .nav.show {
    display: flex;
  }

  .menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .timeline-entry {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .theme-text {
    display: none;
  }
}

@media (max-width: 640px) {
  .container {
    width: calc(100% - 28px);
  }

  .hero {
    padding-top: 44px;
  }

  .hero-title {
    font-size: 2.8rem;
  }

  .section {
    padding: 54px 0;
  }

  .section-heading {
    align-items: flex-start;
  }

  .section-index {
    min-width: 50px;
    height: 50px;
  }
}