:root {
  color-scheme: light;
  --bg: #f4f1eb;
  --surface: #fbf9f5;
  --surface-strong: #ffffff;
  --text: #1b1a18;
  --muted: #67625c;
  --faint: #8b857d;
  --line: #d8d1c8;
  --line-strong: #bcb3a8;
  --accent: #a31f34;
  --accent-deep: #7f1728;
  --accent-soft: rgba(163, 31, 52, 0.09);
  --shadow: 0 30px 80px rgba(42, 32, 23, 0.13);
  --serif: ui-serif, "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --shell: 1160px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #11100e;
  --surface: #171512;
  --surface-strong: #1d1a17;
  --text: #f4f0e9;
  --muted: #b7b0a7;
  --faint: #8f877d;
  --line: #38332e;
  --line-strong: #514a43;
  --accent: #e16477;
  --accent-deep: #f08898;
  --accent-soft: rgba(225, 100, 119, 0.12);
  --shadow: 0 34px 90px rgba(0, 0, 0, 0.38);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 88% 8%, var(--accent-soft), transparent 24rem),
    var(--bg);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  opacity: 0.48;
  background-image:
    linear-gradient(to right, transparent 0, transparent calc(100% - 1px), rgba(127, 112, 97, 0.06) calc(100% - 1px)),
    linear-gradient(to bottom, transparent 0, transparent calc(100% - 1px), rgba(127, 112, 97, 0.045) calc(100% - 1px));
  background-size: 72px 72px;
  mask-image: linear-gradient(to bottom, #000, transparent 55%);
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

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

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
}

::selection {
  color: var(--text);
  background: var(--accent-soft);
}

.shell {
  width: min(calc(100% - 48px), var(--shell));
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 10px 14px;
  color: #fff;
  background: var(--accent);
  border-radius: 8px;
  transform: translateY(-160%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(18px) saturate(135%);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 82px;
  gap: 28px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
  color: var(--text);
  text-decoration: none;
}

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

.brand-mark {
  display: grid;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  place-items: center;
  color: #fff;
  background: var(--accent);
  border-radius: 9px;
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.brand-name {
  overflow: hidden;
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 650;
  letter-spacing: -0.025em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

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

.nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 14px;
  color: var(--muted);
  border-radius: 9px;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: 0.01em;
  text-decoration: none;
  transition: color 160ms ease, background 160ms ease;
}

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

.nav-link[aria-current="page"] {
  color: var(--text);
}

.nav-link[aria-current="page"]::after {
  position: absolute;
  right: 14px;
  bottom: 4px;
  left: 14px;
  height: 2px;
  content: "";
  background: var(--accent);
  border-radius: 999px;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  color: var(--muted);
  cursor: pointer;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 50%;
  transition: color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.theme-toggle:hover {
  color: var(--text);
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.theme-toggle .icon-moon,
:root[data-theme="dark"] .theme-toggle .icon-sun {
  display: none;
}

:root[data-theme="dark"] .theme-toggle .icon-moon {
  display: block;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.14fr) minmax(330px, 0.86fr);
  align-items: center;
  min-height: calc(100svh - 164px);
  padding-block: clamp(56px, 8vw, 108px);
  gap: clamp(58px, 8vw, 112px);
}

.hero-copy {
  max-width: 660px;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 0 0 22px;
  color: var(--accent-deep);
  font-size: 12px;
  font-weight: 760;
  letter-spacing: 0.13em;
  line-height: 1.4;
  text-transform: uppercase;
}

.eyebrow::before {
  width: 36px;
  height: 1px;
  content: "";
  background: currentColor;
}

.hero h1,
.page-title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: -0.055em;
  line-height: 0.98;
}

.hero h1 {
  max-width: none;
  font-size: clamp(34px, 5.6vw, 72px);
  white-space: nowrap;
}

.bio {
  max-width: 660px;
  margin-top: 34px;
  color: var(--muted);
  font-size: clamp(17px, 1.5vw, 19px);
  line-height: 1.72;
}

.bio p {
  margin: 0 0 14px;
}

.bio a {
  color: var(--text);
  text-decoration-color: color-mix(in srgb, var(--accent) 55%, transparent);
}

.research-line {
  display: grid;
  grid-template-columns: 126px minmax(0, 1fr);
  align-items: baseline;
  max-width: 650px;
  margin-top: 30px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  gap: 20px;
}

.research-label {
  color: var(--faint);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.research-value {
  color: var(--text);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.5;
}

.link-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 34px;
  gap: 12px;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  gap: 11px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  transition: color 160ms ease, background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.button-link:hover {
  transform: translateY(-2px);
}

.button-link.primary {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.button-link.primary:hover {
  color: #fff;
  background: var(--accent-deep);
  border-color: var(--accent-deep);
}

.button-link.secondary {
  color: var(--text);
  background: color-mix(in srgb, var(--surface) 76%, transparent);
}

.button-link.secondary:hover {
  color: var(--accent-deep);
  background: var(--surface-strong);
  border-color: var(--accent);
}

.external-mark {
  font-size: 16px;
  font-weight: 500;
  line-height: 1;
  transform: translateY(-1px);
}

.email-link {
  display: inline-block;
  margin-top: 22px;
  color: var(--muted);
  font-size: 14px;
  text-decoration-color: var(--line-strong);
}

.portrait-card {
  position: relative;
  width: min(100%, 470px);
  margin: 0 0 0 auto;
}

.portrait-card::before {
  position: absolute;
  top: 22px;
  right: -22px;
  bottom: -22px;
  left: 22px;
  z-index: -1;
  content: "";
  border: 1px solid color-mix(in srgb, var(--accent) 50%, var(--line));
  border-radius: 26px;
}

.portrait-frame {
  position: relative;
  overflow: hidden;
  aspect-ratio: 3 / 4;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.portrait-frame::after {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
  border-radius: inherit;
}

.portrait-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.portrait-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 17px 2px 0;
  color: var(--faint);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.page-main {
  padding-block: clamp(58px, 7vw, 100px) 110px;
}

.page-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 440px);
  align-items: end;
  padding-bottom: clamp(38px, 5vw, 62px);
  border-bottom: 1px solid var(--line);
  gap: 40px;
}

.page-title {
  font-size: clamp(58px, 7vw, 92px);
}

.page-intro {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.72;
}

.paper-list {
  margin-top: 6px;
}

.paper {
  padding-block: 32px;
  border-bottom: 1px solid var(--line);
}

.paper h2 {
  max-width: 900px;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(20px, 2vw, 24px);
  font-weight: 590;
  letter-spacing: -0.018em;
  line-height: 1.32;
}

.paper h2 a {
  color: var(--text);
  text-decoration: none;
  transition: color 150ms ease;
}

.paper h2 a:hover {
  color: var(--accent-deep);
}

.paper h2 .external-mark {
  display: inline-block;
  margin-left: 5px;
  color: var(--accent);
  font-family: var(--sans);
  font-size: 0.68em;
  vertical-align: 0.12em;
}

.paper-authors,
.paper-venue {
  max-width: 900px;
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
}

.paper-authors .self {
  color: var(--text);
  font-weight: 680;
}

.paper-venue em {
  color: color-mix(in srgb, var(--text) 88%, var(--muted));
  font-family: var(--serif);
  font-style: italic;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  margin-right: 8px;
  padding: 0 8px;
  color: var(--accent-deep);
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 780;
  letter-spacing: 0.09em;
  line-height: 1;
  text-transform: uppercase;
  vertical-align: 1px;
}

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

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 82px;
  color: var(--faint);
  font-size: 12px;
  gap: 24px;
}

.footer-inner a {
  color: var(--muted);
  text-decoration: none;
}

.footer-inner a:hover {
  color: var(--accent-deep);
}

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 48%, transparent);
  outline-offset: 4px;
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-block: 64px 88px;
    gap: 66px;
  }

  .hero-copy {
    max-width: 760px;
  }

  .portrait-card {
    width: min(100%, 560px);
    margin-inline: auto;
  }

  .page-head {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 24px;
  }
}

@media (max-width: 650px) {
  .shell {
    width: min(calc(100% - 32px), var(--shell));
  }

  .header-inner {
    min-height: 70px;
    gap: 12px;
  }

  .brand-mark {
    width: 31px;
    height: 31px;
    border-radius: 8px;
    font-size: 13px;
  }

  .brand-name {
    display: none;
  }

  .header-actions {
    flex: 1;
    justify-content: flex-end;
    gap: 10px;
  }

  .site-nav {
    gap: 0;
  }

  .nav-link {
    min-height: 40px;
    padding-inline: 12px;
    font-size: 13px;
  }

  .theme-toggle {
    width: 38px;
    height: 38px;
  }

  .hero {
    padding-block: 48px 72px;
    gap: 54px;
  }

  .hero h1 {
    font-size: clamp(30px, 9.6vw, 48px);
  }

  .bio {
    margin-top: 28px;
    font-size: 16.5px;
  }

  .research-line {
    grid-template-columns: 1fr;
    margin-top: 24px;
    gap: 6px;
  }

  .research-value {
    font-size: 17px;
  }

  .link-row {
    align-items: stretch;
  }

  .button-link {
    flex: 1 1 100%;
  }

  .portrait-card::before {
    top: 13px;
    right: -10px;
    bottom: -13px;
    left: 10px;
    border-radius: 20px;
  }

  .portrait-frame {
    border-radius: 17px;
  }

  .portrait-note {
    margin-top: 14px;
    font-size: 10px;
  }

  .page-main {
    padding-block: 48px 82px;
  }

  .page-title {
    font-size: clamp(54px, 17vw, 76px);
  }

  .paper {
    padding-block: 27px;
  }

  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    min-height: 96px;
    gap: 2px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
