:root {
  --bg: #f6f2e9;
  --bg-wash: #ede7dc;
  --text: #101317;
  --muted: #3a3d44;
  --line: #d9d1c2;
  --accent: #101317;
  --surface: #f8f4eb;
  --surface-soft: rgba(248, 244, 235, 0.78);
  --chip-soft: rgba(248, 244, 235, 0.56);
  --mark-bg: #eee8db;
  --mark-text: #101317;
  --focus: #101317;
  --chip-shadow: 0 7px 18px rgba(16, 19, 23, 0.26);
  --chip-shadow-hover: 0 11px 24px rgba(16, 19, 23, 0.34);
}

:root[data-theme="dark"] {
  --bg: #101317;
  --bg-wash: #1a2026;
  --text: #f6f2e9;
  --muted: #ddd7cb;
  --line: #2a3138;
  --accent: #f6f2e9;
  --surface: #171c22;
  --surface-soft: rgba(23, 28, 34, 0.8);
  --chip-soft: rgba(23, 28, 34, 0.58);
  --mark-bg: #1d232a;
  --mark-text: #f6f2e9;
  --focus: #f6f2e9;
  --chip-shadow: 0 7px 18px rgba(255, 255, 255, 0.14);
  --chip-shadow-hover: 0 11px 24px rgba(255, 255, 255, 0.24);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(1100px 700px at 100% -8%, var(--bg-wash), transparent 65%),
    var(--bg);
  color: var(--text);
  font-family: "Plus Jakarta Sans", "Avenir Next", "Helvetica Neue", sans-serif;
  line-height: 1.65;
  letter-spacing: 0.001em;
}

.page {
  width: min(860px, calc(100% - 3rem));
  margin: 0 auto;
  padding: 6.4rem 0 5rem;
}

.theme-toggle {
  position: fixed;
  top: 1rem;
  right: 1rem;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  backdrop-filter: blur(4px);
  color: var(--text);
  border-radius: 999px;
  width: 2.4rem;
  height: 2.4rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--chip-shadow);
  transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease, box-shadow 180ms ease;
}

.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: var(--chip-shadow-hover);
}

.theme-icon {
  display: none;
}

/* Light mode: show moon (click to go dark) */
:root .icon-moon { display: block; }

/* Dark mode: show sun (click to go light) */
:root[data-theme="dark"] .icon-moon { display: none; }
:root[data-theme="dark"] .icon-sun { display: block; }

.theme-toggle:focus-visible,
a:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.intro {
  padding-bottom: 1.4rem;
  margin-bottom: 1.2rem;
}

.intro-row {
  display: flex;
  align-items: flex-start;
  gap: 2.4rem;
}

.intro-text {
  flex: 1;
  min-width: 0;
}

.profile-photo {
  width: 180px;
  height: 180px;
  object-fit: cover;
  border-radius: 1.2rem;
  border: 2px solid var(--line);
  box-shadow:
    0 7px 24px rgba(16, 19, 23, 0.16),
    0 2px 8px rgba(16, 19, 23, 0.1);
  flex-shrink: 0;
  margin-top: 0.3rem;
}

:root[data-theme="dark"] .profile-photo {
  border-color: #2a3138;
  box-shadow:
    0 7px 26px rgba(0, 0, 0, 0.5),
    0 2px 8px rgba(0, 0, 0, 0.35);
}

.name {
  margin: 0;
  font-size: clamp(2.5rem, 5.8vw, 4rem);
  line-height: 1.06;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.tagline {
  margin: 0.72rem 0 0;
  color: var(--muted);
  font-size: clamp(1.1rem, 2.4vw, 1.34rem);
}

.socials {
  margin-top: 1.55rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.62rem;
}

.dissertation-chip-row {
  margin-top: 0.9rem;
}

.publication-links a.dissertation-chip {
  text-transform: none;
  letter-spacing: 0.02em;
  font-size: 0.78rem;
  padding: 0.3rem 0.74rem;
}

.social-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.36rem 0.66rem 0.36rem 0.48rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  text-decoration: none;
  color: var(--text);
  background: var(--chip-soft);
  font-size: 0.95rem;
  font-weight: 500;
  box-shadow: var(--chip-shadow);
  transition: transform 180ms ease, border-color 180ms ease, color 180ms ease, background-color 180ms ease, box-shadow 180ms ease;
}

.social-link:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: var(--chip-shadow-hover);
  transform: translateY(-1px);
}

.social-mark {
  min-width: 1.7rem;
  height: 1.7rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--mark-bg);
  color: var(--mark-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.64rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.02em;
  transition: border-color 160ms ease;
}

.social-icon {
  width: 1.3rem;
  height: 1.3rem;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.social-icon.icon-fill {
  fill: currentColor;
  stroke: none;
}

.social-icon.icon-code {
  width: 1.3rem;
  height: 1.3rem;
}

.social-icon.icon-x {
  width: 1.34rem;
  height: 1.34rem;
}

.social-icon.icon-cap {
  width: 1.3rem;
  height: 1.3rem;
}

.social-icon.icon-link {
  width: 1.3rem;
  height: 1.3rem;
}

:root[data-theme="dark"] .social-mark {
  border-color: #39424b;
}

.mark-x {
  font-size: 0.72rem;
  text-transform: lowercase;
}

.mark-gh {
  font-size: 0.56rem;
}

.mark-gs {
  font-size: 0.56rem;
  letter-spacing: -0.02em;
}

.mark-in {
  font-size: 0.62rem;
  text-transform: lowercase;
}

.publications h2 {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: var(--text);
  display: inline-block;
  padding-bottom: 0.3rem;
  border-bottom: 2px solid var(--text);
}

.publications {
  max-width: 100%;
}

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

.publication {
  margin-left: 0;
  padding: 0.35rem 0;
}

.publication + .publication::before {
  content: "\00b7";
  display: block;
  text-align: center;
  color: var(--line);
  font-size: 1.2rem;
  line-height: 1;
  margin-bottom: 0.35rem;
}

.publication-title {
  margin: 0;
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1.4;
  color: var(--text);
}

.publication-authors,
.publication-venue {
  margin: 0.28rem 0 0;
  font-size: 0.96rem;
  line-height: 1.5;
}

.publication-authors {
  color: var(--text);
  opacity: 0.85;
}

:root[data-theme="dark"] .publication-authors {
  color: #f6f2e9;
  opacity: 0.96;
}

.publication-venue {
  color: var(--muted);
  margin-top: 0.38rem;
  padding-left: 0.56rem;
  border-left: 2px solid var(--line);
  font-size: 0.91rem;
  letter-spacing: 0.008em;
  font-style: italic;
}

:root[data-theme="dark"] .publication-venue {
  color: #c9c3b6;
  border-left-color: #434c55;
}

.award-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-style: normal;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.14rem 0.56rem 0.14rem 0.44rem;
  margin-left: 0.5rem;
  vertical-align: middle;
  position: relative;
  top: -0.1rem;
  line-height: 1.4;
  box-shadow: var(--chip-shadow);
}

.award-icon {
  flex-shrink: 0;
}

:root[data-theme="dark"] .award-badge {
  color: #f6f2e9;
  background: #1d232a;
  border-color: #3b444d;
}

.publication-links {
  margin: 0.72rem 0 0;
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.publication-links a {
  color: var(--text);
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 0.55rem;
  padding: 0.28rem 0.62rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  background: var(--surface);
  box-shadow: var(--chip-shadow);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease, color 180ms ease, background-color 180ms ease;
}

.publication-links a + a::before {
  content: none;
}

.publication-links a:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: var(--chip-shadow-hover);
  transform: translateY(-1px);
}

:root[data-theme="dark"] .publication-links a {
  color: #f6f2e9;
  background: #1d232a;
  border-color: #3b444d;
}

:root[data-theme="dark"] .publication-links a:hover {
  color: #f6f2e9;
  border-color: var(--accent);
  background: #232b33;
}

.publication-links a:active {
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}

@media (max-width: 700px) {
  .page {
    width: min(860px, calc(100% - 1.25rem));
    padding: 5.1rem 0 3.4rem;
  }

  .intro-row {
    flex-direction: column-reverse;
    gap: 1.4rem;
  }

  .profile-photo {
    width: 130px;
    height: 130px;
    border-radius: 1rem;
  }

  .theme-toggle {
    top: 0.72rem;
    right: 0.72rem;
    font-size: 0.74rem;
  }

  .social-link {
    font-size: 0.9rem;
  }

  .publication-title {
    font-size: 0.98rem;
  }

  .publication-authors,
  .publication-venue {
    font-size: 0.9rem;
  }

  .publication {
    padding: 1.05rem 0;
  }
}
