:root {
  --bg: #f9fafb;
  --panel: #ffffff;
  --text: #0f172a;
  --muted: #475569;
  --border: #e2e8f0;
  --accent: #1d4ed8;
  --accent-soft: #e0e7ff;
  --accent-border: #c7d2fe;
  --primary: #0f172a;
  --primary-text: #ffffff;
  --frost: rgba(249, 250, 251, 0.85);
  --radius: 12px;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-serif: "Source Serif 4", "Iowan Old Style", serif;
}

:root[data-theme="dark"] {
  --bg: #0b1220;
  --panel: #0f172a;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --border: #1f2937;
  --accent: #60a5fa;
  --accent-soft: rgba(96, 165, 250, 0.14);
  --accent-border: rgba(96, 165, 250, 0.55);
  --primary: #3b82f6;
  --primary-text: #f8fafc;
  --frost: rgba(15, 23, 42, 0.9);
  --shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

html {
  scroll-behavior: smooth;
}

button {
  font: inherit;
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.text-link {
  color: var(--accent);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  text-decoration-skip-ink: none;
}

.small-note {
  font-size: 12px;
  margin: 4px 0 0;
}

.text-link:hover {
  color: var(--primary);
}

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

.masthead {
  position: sticky;
  top: 0;
  backdrop-filter: blur(8px);
  background: var(--frost);
  border-bottom: 1px solid var(--border);
}

.nav-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
  padding: 16px 0;
}

.wordmark {
  font-weight: 700;
  letter-spacing: 0.02em;
}

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

.nav {
  display: flex;
  justify-content: center;
  gap: 18px;
  font-weight: 500;
  color: var(--muted);
  flex-wrap: nowrap;
  white-space: nowrap;
}

.nav a {
  padding: 8px 10px;
  border-radius: 8px;
  transition: background 120ms ease;
  position: relative;
}

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

.nav a::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 2px;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 150ms ease;
  opacity: 0.85;
}

.nav a:hover::after,
.nav a:focus-visible::after {
  transform: scaleX(1);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  margin-left: -150px;
}

.brand-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-logo img {
  width: clamp(70px, 18vw, 120px);
  height: auto;
  display: none;
}

.brand-logo .logo-light {
  display: block;
}

.brand-logo .logo-dark {
  display: none;
}

:root[data-theme="dark"] .brand-logo .logo-light {
  display: none;
}

:root[data-theme="dark"] .brand-logo .logo-dark {
  display: block;
}

@media (max-width: 640px) {
  .brand-logo img {
    width: 90px;
  }
}

@media (max-width: 480px) {
  .brand {
    gap: 8px;
    margin-left: 0;
  }

  .brand-logo img {
    width: 76px;
  }
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 600;
  background: var(--panel);
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}

#theme-toggle {
  min-width: 40px;
  justify-content: center;
  padding: 0;
}

.theme-toggle {
  width: 40px;
  height: 40px;
  justify-content: center;
  align-items: center;
  padding: 6px;
  gap: 0;
  border-radius: 12px;
}

.theme-icon {
  display: none;
  color: var(--muted);
}

.theme-toggle svg {
  display: block;
}

:root[data-theme="light"] #theme-toggle .sun {
  display: inline-flex;
}

:root[data-theme="dark"] #theme-toggle .moon {
  display: inline-flex;
}

main {
  padding: 32px 0 64px;
}

.intro {
  padding: 32px 0 12px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(260px, 0.7fr);
  gap: 28px;
  align-items: center;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-size: 12px;
  margin: 0 0 6px;
  font-weight: 600;
}

h1,
h2 {
  margin: 0 0 12px;
}

h1 {
  font-family: var(--font-serif);
  font-size: clamp(32px, 5vw, 44px);
  line-height: 1.35;
}

h2 {
  font-size: clamp(24px, 4vw, 30px);
}

h3 {
  margin: 0 0 6px;
  font-size: 18px;
}

.lede {
  font-size: 18px;
  color: var(--muted);
  margin: 0 0 18px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 14px;
}

.chips span {
  padding: 6px 10px;
  border-radius: 10px;
  background: var(--panel);
  border: 1px solid var(--border);
}

.cta-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.button {
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 10px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
}

.btn-icon {
  width: 18px;
  height: 18px;
  display: block;
  flex: 0 0 auto;
}

.linkedin-icon {
  color: var(--text);
}

.button.primary {
  background: var(--primary);
  color: var(--primary-text);
  border-color: var(--primary);
}

:root[data-theme="dark"] .button.primary {
  background: #ffffff;
  color: #0f172a;
  border-color: #ffffff;
}

:root[data-theme="dark"] .button.primary:hover {
  background: #e5e7eb;
  border-color: #e5e7eb;
}

.button.subtle {
  background: var(--panel);
}

.button:hover {
  border-color: #cbd5e1;
  background: var(--accent-soft);
}

.section {
  padding: 36px 0;
  border-top: 1px solid var(--border);
}

.intro,
.section {
  scroll-margin-top: 96px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.grid {
  display: grid;
  gap: 16px;
}

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

.grid.three {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.note {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

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

.portrait-card {
  margin: 0;
  text-align: center;
}

.portrait {
  width: 100%;
  max-width: 340px;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: 47% 50%;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  background: var(--panel);
}

.stack {
  display: grid;
  gap: 14px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}

.card:hover {
  transform: translateY(-3px);
  border-color: var(--accent-border);
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.12);
}

.project .body {
  margin-bottom: 12px;
}

.meta-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.tag {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 170px;
  font-size: 13px;
  color: var(--muted);
  background: var(--accent-soft);
  border-radius: 8px;
  padding: 4px 10px;
  border: 1px solid var(--accent-border);
}

.tag-sub {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}

.list {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  display: grid;
  gap: 6px;
}

.list.bullets {
  list-style: disc;
}

.list.tight {
  gap: 4px;
}

.contact-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}

.contact-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.resource-links .button {
  min-width: 96px;
  justify-content: center;
}

.publication-card {
  display: grid;
  grid-template-columns: minmax(260px, 0.95fr) minmax(0, 1.1fr);
  gap: 16px;
  align-items: stretch;
}

.publication-media {
  display: flex;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: #000;
}

.publication-content {
  display: grid;
  gap: 10px;
}

.publication-video {
  width: 100%;
  display: block;
  height: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #000;
}

.cite-block {
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 10px 12px;
}

.cite-block summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--muted);
  outline: none;
}

.cite-block pre {
  margin: 10px 0 0;
  padding: 10px;
  background: var(--bg);
  border-radius: 8px;
  border: 1px solid var(--border);
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.5;
}

@media (max-width: 900px) {
  .publication-card {
    grid-template-columns: 1fr;
  }
}

.footer {
  border-top: 1px solid var(--border);
  padding: 16px 0 24px;
  background: var(--panel);
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 14px;
}

@media (max-width: 720px) {
  .nav-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px 0;
  }

  .nav-row > div {
    flex: 1 1 auto;
    min-width: 0;
  }

  #theme-toggle,
  .nav-row .pill {
    order: 2;
  }

  .nav-row .pill {
    margin-left: auto;
  }

  .nav {
    order: 3;
    width: 100%;
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
  }

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

