:root {
  --bg: #f3f3f2;
  --bg-card: #ffffff;
  --surface: #eceae8;
  --text: #242525;
  --muted: #5f6160;
  --accent: #9b5e2d;
  --accent-soft: #f1e4d8;
  --line: #d3d1ce;
  --shadow: 0 10px 30px rgba(38, 33, 28, 0.10);
  --radius: 14px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Source Sans 3", "Segoe UI", Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(980px 350px at 8% -30%, rgba(155, 94, 45, 0.15), transparent 68%),
    radial-gradient(820px 320px at 88% -24%, rgba(119, 96, 78, 0.10), transparent 72%),
    var(--bg);
  line-height: 1.6;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover,
a:focus-visible {
  text-decoration: underline;
}

.shell {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px;
}

.top-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(243, 243, 242, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.nav-inner {
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  font-family: "Source Sans 3", "Segoe UI", Arial, sans-serif;
  font-size: 1.05rem;
  letter-spacing: 0.01em;
  font-weight: 700;
  color: var(--text);
}

.primary-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  font-weight: 600;
}

.layout {
  display: grid;
  grid-template-columns: minmax(260px, 300px) minmax(0, 1fr);
  gap: 40px;
  padding-top: 34px;
  padding-bottom: 56px;
}

.sidebar {
  position: sticky;
  top: 92px;
  align-self: start;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}

.portrait {
  width: 100%;
  max-width: 240px;
  border-radius: 12px;
  display: block;
  margin-bottom: 14px;
}

h1,
h2,
h3,
h4 {
  line-height: 1.25;
  margin: 0;
}

h2,
h3,
h4 {
  font-family: "Source Sans 3", "Segoe UI", Arial, sans-serif;
  font-weight: 700;
}

.sidebar h1 {
  font-family: "Source Sans 3", "Segoe UI", Arial, sans-serif;
  font-weight: 700;
  font-size: 1.6rem;
  margin-bottom: 8px;
}

.role,
.focus,
.email {
  margin: 0 0 10px;
  color: var(--muted);
}

.email a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  text-decoration: none;
}

.email i {
  color: var(--accent);
}

.email a:hover,
.email a:focus-visible {
  text-decoration: underline;
}

.sidebar-links {
  margin: 14px 0 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.sidebar-links .btn:not(.btn-cv) {
  width: 2.55rem;
  height: 2.55rem;
  padding: 0;
}

.sidebar-links .btn-cv {
  flex: 0 0 100%;
  width: auto;
  height: 2.55rem;
  padding: 0 14px;
  gap: 7px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 12px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  font-weight: 600;
  background: var(--accent);
  color: #fff;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.btn:hover,
.btn:focus-visible {
  text-decoration: none;
  background: #7f4c23;
}

.btn.btn-muted {
  border-color: var(--line);
  background: var(--surface);
  color: var(--text);
}

.btn.btn-muted:hover,
.btn.btn-muted:focus-visible {
  background: #e4e1de;
}

.btn i {
  font-size: 0.9em;
}

.sidebar-links .btn i,
.sidebar-links .icon-svg {
  width: 1.05rem;
  height: 1.05rem;
  font-size: 1.05rem;
}

.icon-svg {
  display: block;
  fill: currentColor;
}

.icon-bsky {
  color: #1877d8;
}

.content {
  min-width: 0;
}

.panel {
  scroll-margin-top: 88px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px;
  margin-bottom: 24px;
}

.reveal {
  opacity: 0;
  transform: translateY(12px);
  animation: fade-up 0.55s ease forwards;
}

.reveal:nth-of-type(2) {
  animation-delay: 0.1s;
}

.reveal:nth-of-type(3) {
  animation-delay: 0.2s;
}

@keyframes fade-up {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

h2 {
  font-size: 2rem;
  margin-bottom: 12px;
  color: var(--text);
}

h3 {
  font-size: 1.35rem;
  margin: 28px 0 14px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}

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

.updates {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
}

.updates h3 {
  margin-top: 0;
}

.updates ul {
  margin: 0 0 10px;
  padding-left: 18px;
}

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

.section-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
  margin-bottom: 14px;
}

.section-nav a {
  display: inline-block;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 0.9rem;
  color: var(--text);
}

.research-group {
  scroll-margin-top: 88px;
}

.paper {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-card);
  padding: 14px;
  margin-bottom: 12px;
}

.paper.compact {
  background: #faf8f6;
}

.paper-title {
  font-size: 1.1rem;
  margin-bottom: 6px;
}

.paper-authors,
.paper-meta,
.paper-note {
  margin-bottom: 6px;
  color: var(--muted);
}

.paper-meta,
.paper-note {
  font-size: 0.96rem;
}

.toggle {
  appearance: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.87rem;
  font-weight: 600;
  padding: 5px 11px;
  cursor: pointer;
}

.toggle:hover,
.toggle:focus-visible {
  background: var(--accent-soft);
  text-decoration: none;
}

.toggle:focus-visible,
.btn:focus-visible,
.primary-nav a:focus-visible,
.section-nav a:focus-visible {
  outline: 2px solid #8e592d;
  outline-offset: 2px;
}

.abstract {
  margin-top: 10px;
  padding: 12px;
  border-left: 3px solid var(--line);
  background: #f7f2ed;
}

.abstract p {
  margin: 0;
}

.site-footer {
  color: var(--muted);
  font-size: 0.9rem;
  padding: 6px 4px 0;
}

.site-footer p {
  margin: 0;
}

@media (max-width: 980px) {
  .layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .sidebar {
    position: static;
  }

  .portrait {
    max-width: 200px;
  }
}

@media (max-width: 620px) {
  .shell {
    padding: 0 14px;
  }

  .nav-inner {
    min-height: 56px;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: 10px 0;
  }

  .primary-nav {
    gap: 12px;
    font-size: 0.94rem;
  }

  .sidebar-links {
    gap: 8px;
  }

  .sidebar-links .btn:not(.btn-cv) {
    width: 2.4rem;
    height: 2.4rem;
  }

  .sidebar-links .btn-cv {
    flex-basis: 100%;
    height: 2.4rem;
    padding: 0 12px;
  }

  h2 {
    font-size: 1.7rem;
  }

  h3 {
    font-size: 1.2rem;
  }

  .panel {
    padding: 18px;
  }
}
