:root {
  --ink: #17202a;
  --ink-strong: #0d1b24;
  --muted: #5b6774;
  --paper: #fbfcfa;
  --surface: #ffffff;
  --surface-tint: #f1f7f4;
  --line: #d8e3df;
  --navy: #11293b;
  --teal: #0f766e;
  --teal-dark: #115e59;
  --gold: #b7791f;
  --link: #0b5cad;
  --shadow: 0 18px 42px rgba(23, 32, 42, 0.1);
  --bg-gradient: linear-gradient(180deg, #fbfcfa 0%, #eef6f3 46%, #f7f8fb 100%);
  --nav-bg: rgba(255, 255, 255, 0.93);
  --footer-bg: #dfeae6;
  --footer-ink: #334155;
  --dropdown-bg: #ffffff;
  --dropdown-border: #d8e3df;
}

[data-theme="dark"] {
  --ink: #e6edf3;
  --ink-strong: #f3f6f8;
  --muted: #94a3b8;
  --paper: #0d1b24;
  --surface: #15222b;
  --surface-tint: #1a2a35;
  --line: #2d3f4b;
  --navy: #cfe6e1;
  --teal: #5eead4;
  --teal-dark: #99f6e4;
  --gold: #e8b562;
  --link: #7dd3fc;
  --shadow: 0 18px 42px rgba(0, 0, 0, 0.45);
  --bg-gradient: linear-gradient(180deg, #0d1b24 0%, #0a1620 46%, #0d1b24 100%);
  --nav-bg: rgba(13, 27, 36, 0.92);
  --footer-bg: #0a1620;
  --footer-ink: #cfe6e1;
  --dropdown-bg: #15222b;
  --dropdown-border: #2d3f4b;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Aptos, "Segoe UI", "Helvetica Neue", sans-serif;
  line-height: 1.7;
  color: var(--ink);
  background: var(--bg-gradient);
  transition: background 200ms ease, color 200ms ease;
}

a {
  color: var(--link);
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid rgba(15, 118, 110, 0.35);
  outline-offset: 3px;
}

.container {
  width: min(92%, 1120px);
  margin: 0 auto;
}

.topnav {
  background: var(--nav-bg);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(14px);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 13px 0;
}

.nav-brand {
  display: inline-flex;
  align-items: center;
  min-width: max-content;
  color: var(--ink-strong);
  font-family: Charter, Georgia, serif;
  font-size: 1.05rem;
  font-weight: 700;
  text-decoration: none;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.topnav a:not(.nav-brand),
.nav-group > summary,
.theme-toggle {
  color: #244057;
  text-decoration: none;
  font-weight: 650;
  font-size: 0.9rem;
  padding: 7px 10px;
  border-radius: 999px;
  transition: background 160ms ease, color 160ms ease;
}

.topnav a:not(.nav-brand):hover,
.topnav a:not(.nav-brand).active,
.nav-group > summary:hover,
.nav-group[open] > summary,
.nav-group.nav-group-active > summary,
.theme-toggle:hover {
  background: #e5f2ee;
  color: var(--teal-dark);
}

[data-theme="dark"] .topnav a:not(.nav-brand),
[data-theme="dark"] .nav-group > summary,
[data-theme="dark"] .theme-toggle {
  color: #cfe6e1;
}

[data-theme="dark"] .topnav a:not(.nav-brand):hover,
[data-theme="dark"] .topnav a:not(.nav-brand).active,
[data-theme="dark"] .nav-group > summary:hover,
[data-theme="dark"] .nav-group[open] > summary,
[data-theme="dark"] .nav-group.nav-group-active > summary,
[data-theme="dark"] .theme-toggle:hover {
  background: rgba(94, 234, 212, 0.16);
  color: var(--teal-dark);
}

.nav-group {
  position: relative;
}

.nav-group > summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  user-select: none;
}

.nav-group > summary::-webkit-details-marker {
  display: none;
}

.nav-group > summary::after {
  content: "\25BE";
  font-size: 0.72rem;
  margin-left: 2px;
  opacity: 0.75;
}

.nav-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 180px;
  display: flex;
  flex-direction: column;
  padding: 6px;
  background: var(--dropdown-bg);
  border: 1px solid var(--dropdown-border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  z-index: 20;
}

.nav-dropdown a {
  padding: 8px 12px;
  border-radius: 8px;
  white-space: nowrap;
}

.theme-toggle {
  background: transparent;
  border: 1px solid var(--line);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  width: 40px;
  height: 34px;
  min-width: 40px;
  padding: 0;
  font-size: 1rem;
  line-height: 1;
  text-align: center;
}

.theme-toggle::before {
  content: "☀";
}

[data-theme="dark"] .theme-toggle::before {
  content: "☾";
}

.hero {
  color: white;
  padding: 70px 0 64px;
  background:
    linear-gradient(135deg, rgba(17, 41, 59, 0.98), rgba(15, 73, 69, 0.96)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.08) 0 1px, transparent 1px 58px);
}

.page-hero {
  padding: 46px 0 42px;
}

.hero-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.75fr);
  gap: 38px;
  align-items: center;
}

.eyebrow {
  margin: 0 0 14px;
  color: #b7f0e4;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  font-family: Charter, Georgia, serif;
  font-size: 3.15rem;
  line-height: 1.08;
  font-weight: 700;
}

.subtitle {
  max-width: 900px;
  margin: 14px 0 0;
  color: #d5e6e4;
  font-size: 1.08rem;
}

.intro {
  max-width: 880px;
  margin: 22px 0 0;
  color: #f0f7f5;
  font-size: 1.06rem;
}

.buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  background: var(--gold);
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 800;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.18);
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.btn:hover {
  background: #9b6218;
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.2);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.12);
  color: #f7fbfa;
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: none;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.2);
}

.hero-panel {
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  padding: 24px;
  background: rgba(7, 24, 33, 0.36);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.18);
}

.hero-panel h2 {
  color: white;
  border: 0;
  padding: 0;
  margin: 0 0 14px;
  font-size: 1.05rem;
}

.signal-list {
  display: grid;
  gap: 14px;
  margin: 0;
}

.signal-list div {
  padding-left: 14px;
  border-left: 3px solid #7dd3c7;
}

.signal-list dt {
  font-weight: 800;
  color: #ffffff;
}

.signal-list dd {
  margin: 2px 0 0;
  color: #d5e6e4;
}

.signal-list.signal-list-light {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px 20px;
  box-shadow: var(--shadow);
}

.signal-list.signal-list-light div {
  border-left-color: var(--teal);
}

.signal-list.signal-list-light dt {
  color: var(--ink-strong);
}

.signal-list.signal-list-light dd {
  color: var(--ink);
}

[data-theme="dark"] .signal-list.signal-list-light dt {
  color: var(--ink-strong);
}

[data-theme="dark"] .signal-list.signal-list-light dd {
  color: var(--ink);
}

main {
  padding: 48px 0 64px;
}

section {
  margin-bottom: 42px;
}

section[id] {
  scroll-margin-top: 96px;
}

h2 {
  color: var(--navy);
  border-bottom: 2px solid var(--line);
  padding-bottom: 8px;
  margin: 0 0 18px;
  font-family: Charter, Georgia, serif;
  font-size: 1.75rem;
}

h3 {
  margin: 0 0 8px;
  color: var(--ink-strong);
  line-height: 1.28;
}

p {
  margin: 0 0 14px;
}

.lead {
  max-width: 850px;
  color: #334155;
  font-size: 1.06rem;
}

.card,
.education-item,
.experience-item,
.highlight-box {
  background: var(--surface);
  padding: 20px;
  margin-top: 14px;
  border: 1px solid rgba(216, 227, 223, 0.9);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.card {
  transition: transform 160ms ease, border-color 160ms ease;
}

.card:hover {
  transform: translateY(-2px);
  border-color: rgba(15, 118, 110, 0.28);
}

.section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}

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

.feature-card {
  border-top: 4px solid var(--teal);
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.metric {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-tint);
}

.metric strong {
  display: block;
  color: var(--teal-dark);
  font-size: 1.4rem;
  line-height: 1.2;
}

.metric span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.94rem;
}

.section-grid .card a,
.card a,
.pub-list h3 a,
.contact-links a {
  color: var(--link);
  text-decoration: none;
  font-weight: 700;
}

.section-grid .card a:hover,
.card a:hover,
.pub-list h3 a:hover,
.contact-links a:hover {
  text-decoration: underline;
}

.education-header,
.experience-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  flex-wrap: wrap;
}

.edu-org,
.experience-org {
  margin: 0;
  font-weight: 700;
  color: var(--teal-dark);
}

.edu-meta,
.experience-meta,
.muted {
  margin: 2px 0 0;
  color: var(--muted);
}

.edu-thesis {
  margin-top: 4px;
  color: var(--muted);
  font-style: italic;
}

.education-date,
.experience-date {
  font-weight: 800;
  color: #334155;
  white-space: nowrap;
}

.simple-list,
.topic-list {
  margin: 0;
  padding-left: 22px;
}

.simple-list li,
.topic-list li {
  margin-bottom: 8px;
}

.topic-list {
  columns: 2;
  column-gap: 32px;
}

.topic-list li {
  break-inside: avoid;
}

.pub-list {
  display: grid;
  gap: 14px;
}

.pub-list h3 {
  margin-top: 0;
  margin-bottom: 8px;
  font-size: 1.08rem;
}

.pub-badge {
  display: inline-flex;
  align-items: center;
  margin-bottom: 10px;
  padding: 4px 9px;
  border-radius: 999px;
  background: #e5f2ee;
  color: var(--teal-dark);
  font-size: 0.78rem;
  font-weight: 800;
}

.pub-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 10px;
}

.pub-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--surface-tint);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.pub-tag-theory { color: #6d28d9; border-color: rgba(109, 40, 217, 0.35); }
.pub-tag-algorithm { color: var(--teal-dark); border-color: rgba(15, 118, 110, 0.35); }
.pub-tag-benchmark { color: #92400e; border-color: rgba(146, 64, 14, 0.35); }
.pub-tag-implementation { color: var(--link); border-color: rgba(11, 92, 173, 0.35); }
.pub-tag-visualization { color: #b91c1c; border-color: rgba(185, 28, 28, 0.35); }
.pub-tag-uq { color: #047857; border-color: rgba(4, 120, 87, 0.35); }
.pub-tag-llm { color: #be185d; border-color: rgba(190, 24, 93, 0.35); }

[data-theme="dark"] .pub-tag-theory { color: #c4b5fd; border-color: rgba(196, 181, 253, 0.4); }
[data-theme="dark"] .pub-tag-algorithm { color: #5eead4; border-color: rgba(94, 234, 212, 0.4); }
[data-theme="dark"] .pub-tag-benchmark { color: #fbbf77; border-color: rgba(251, 191, 119, 0.4); }
[data-theme="dark"] .pub-tag-implementation { color: #93c5fd; border-color: rgba(147, 197, 253, 0.4); }
[data-theme="dark"] .pub-tag-visualization { color: #fca5a5; border-color: rgba(252, 165, 165, 0.4); }
[data-theme="dark"] .pub-tag-uq { color: #6ee7b7; border-color: rgba(110, 231, 183, 0.4); }
[data-theme="dark"] .pub-tag-llm { color: #f9a8d4; border-color: rgba(249, 168, 212, 0.4); }

.publication-meta {
  color: var(--muted);
}

.pub-trail {
  margin: 8px 0 0;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--muted);
}

.pub-trail a {
  color: var(--muted);
  text-decoration: underline;
  font-weight: 600;
}

.pub-trail a:hover {
  color: var(--link);
}

.contact-links p:last-child,
.card p:last-child,
footer p:last-child {
  margin-bottom: 0;
}

footer {
  background: var(--footer-bg);
  padding: 22px 0;
  font-size: 0.95rem;
  color: var(--footer-ink);
}

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

.footer-copy {
  margin: 0;
}

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

.footer-links a {
  color: var(--footer-ink);
  text-decoration: none;
  font-weight: 650;
}

.footer-links a:hover {
  text-decoration: underline;
}

[data-theme="dark"] .card,
[data-theme="dark"] .education-item,
[data-theme="dark"] .experience-item,
[data-theme="dark"] .highlight-box {
  border-color: var(--line);
}

[data-theme="dark"] .metric {
  border-color: var(--line);
}

[data-theme="dark"] .pub-badge {
  background: rgba(94, 234, 212, 0.16);
  color: var(--teal-dark);
}

[data-theme="dark"] .lead {
  color: var(--ink);
}

[data-theme="dark"] h2 {
  border-bottom-color: var(--line);
}

[data-theme="dark"] .education-date,
[data-theme="dark"] .experience-date {
  color: var(--ink);
}

@media (max-width: 900px) {
  .hero-layout,
  .feature-grid,
  .metric-row {
    grid-template-columns: 1fr;
  }
}

.nav-toggle {
  display: none;
}

.nav-toggle-bar {
  display: block;
  height: 2px;
  width: 22px;
  background: currentColor;
  border-radius: 2px;
  transition: transform 200ms ease, opacity 200ms ease;
}

.pub-list h3,
.pub-list h3 a,
.experience-org,
.edu-org {
  overflow-wrap: anywhere;
  word-break: break-word;
}

@media (max-width: 760px) {
  main {
    padding: 30px 0 40px;
  }

  section {
    margin-bottom: 30px;
  }

  h2 {
    font-size: 1.45rem;
  }

  .hero {
    padding: 40px 0 36px;
  }

  .page-hero {
    padding: 28px 0 26px;
  }

  .hero h1 {
    font-size: 2.15rem;
  }

  .buttons {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
  }

  .btn {
    width: 100%;
  }

  .education-date,
  .experience-date {
    white-space: normal;
  }

  .topic-list {
    columns: 1;
  }

  .card,
  .education-item,
  .experience-item,
  .highlight-box {
    padding: 16px;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .nav-inner {
    flex-wrap: wrap;
    padding: 10px 0;
  }

  .nav-toggle {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 36px;
    margin-left: auto;
    padding: 0 9px;
    background: transparent;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: #244057;
    cursor: pointer;
  }

  [data-theme="dark"] .nav-toggle {
    color: #cfe6e1;
  }

  .nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) {
    opacity: 0;
  }

  .nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  .nav-links {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 4px;
    padding: 10px 0 4px;
  }

  .nav-links.is-open {
    display: flex;
  }

  .topnav a:not(.nav-brand),
  .nav-group > summary {
    padding: 10px 12px;
    font-size: 0.95rem;
    border-radius: 8px;
  }

  .nav-group {
    width: 100%;
  }

  .nav-group > summary {
    width: 100%;
  }

  .nav-dropdown {
    position: static;
    box-shadow: none;
    border: 0;
    padding: 4px 0 4px 14px;
    background: transparent;
  }

  .theme-toggle {
    width: 40px;
    height: 36px;
    margin-left: 8px;
    margin-top: 0;
  }
}

@media (max-width: 420px) {
  .hero h1 {
    font-size: 1.78rem;
  }

  .hero {
    padding: 32px 0 30px;
  }

  .page-hero {
    padding: 22px 0 22px;
  }

  h2 {
    font-size: 1.3rem;
  }

  .container {
    width: min(94%, 1120px);
  }

  .pub-list h3 {
    font-size: 1rem;
  }
}

.research-cluster {
  margin-bottom: 18px;
}

.research-cluster h3 {
  margin-bottom: 6px;
  color: var(--teal-dark);
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.skip-link {
  position: absolute;
  top: -48px;
  left: 0;
  padding: 10px 14px;
  background: var(--navy);
  color: #ffffff;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
  z-index: 100;
  border-radius: 0 0 8px 0;
  transition: top 160ms ease;
}

.skip-link:focus {
  top: 0;
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}
