:root {
  --bg: #eef1ee;
  --bg-elevated: #f7f8f6;
  --ink: #1c1f1d;
  --muted: #5c6560;
  --line: #d2d8d3;
  --accent: #2f6f5e;
  --accent-soft: rgba(47, 111, 94, 0.12);
  --cover-ink: #f3f5f2;
  --cover-muted: rgba(243, 245, 242, 0.72);
  --serif: "Source Serif 4", "Iowan Old Style", "Palatino Linotype", Palatino, serif;
  --sans: "IBM Plex Sans", "Segoe UI", sans-serif;
  --max: 720px;
  --wide: 880px;
  --pad: clamp(1.25rem, 4vw, 2.5rem);
  --radius: 2px;
  --topbar-h: 3.5rem;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 12% -10%, rgba(47, 111, 94, 0.08), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(28, 31, 29, 0.04), transparent 50%),
    var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  transition: color 0.2s ease, text-underline-offset 0.2s ease;
}

a:hover {
  color: #245648;
  text-underline-offset: 0.28em;
}

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

button {
  font: inherit;
}

/* —— Cover —— */
.cover {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: #1e1f21;
  transition: opacity 0.95s var(--ease), transform 0.95s var(--ease), visibility 0.95s;
}

html.skip-cover .cover {
  display: none;
}

.cover.is-leaving {
  opacity: 0;
  transform: translateY(-6%);
  pointer-events: none;
  visibility: hidden;
}

.cover-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.cover-content {
  position: relative;
  z-index: 1;
  text-align: center;
  color: var(--cover-ink);
  padding: var(--pad);
  max-width: 40rem;
}

.cover-stage {
  opacity: 0;
  transform: translateY(18px);
}

.cover-content.is-ready .cover-stage {
  animation: cover-rise 0.85s var(--ease) both;
}

.cover-content.is-ready .cover-kicker { animation-delay: 0.05s; }
.cover-content.is-ready .cover-name { animation-delay: 0.18s; }
.cover-content.is-ready .cover-tagline { animation-delay: 0.32s; }
.cover-content.is-ready .cover-cta { animation-delay: 0.48s; }
.cover-content.is-ready .cover-links { animation-delay: 0.62s; }

@keyframes cover-rise {
  to {
    opacity: 1;
    transform: none;
  }
}

.cover-kicker {
  margin: 0 0 1rem;
  font-size: 0.75rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--cover-muted);
}

.cover-name {
  margin: 0;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(2.6rem, 8vw, 4.4rem);
  letter-spacing: -0.02em;
  line-height: 1.05;
}

.cover-tagline {
  margin: 1rem 0 2rem;
  color: var(--cover-muted);
  font-size: clamp(1rem, 2.4vw, 1.15rem);
}

.cover-cta {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
}

.cover-enter {
  appearance: none;
  border: 1px solid rgba(243, 245, 242, 0.55);
  background: transparent;
  color: var(--cover-ink);
  padding: 0.75rem 1.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.78rem;
  cursor: pointer;
  box-shadow: 0 0 0 0 rgba(243, 245, 242, 0);
  animation: enter-pulse 2.4s ease-in-out infinite;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.cover-enter:hover,
.cover-enter:focus-visible {
  background: var(--cover-ink);
  color: #1e1f21;
  border-color: var(--cover-ink);
  outline: none;
  animation: none;
  box-shadow: none;
}

@keyframes enter-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(243, 245, 242, 0); }
  50% { box-shadow: 0 0 0 8px rgba(243, 245, 242, 0.08); }
}

.cover-hint {
  display: block;
  color: var(--cover-muted);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  animation: hint-bob 1.8s ease-in-out infinite;
}

@keyframes hint-bob {
  0%, 100% { transform: translateY(0); opacity: 0.55; }
  50% { transform: translateY(4px); opacity: 1; }
}

.cover-links {
  display: flex;
  justify-content: center;
  gap: 1.25rem;
  margin-top: 1.75rem;
}

.cover-links a {
  color: var(--cover-muted);
  text-decoration: none;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.cover-links a:hover {
  color: var(--cover-ink);
  border-bottom-color: rgba(243, 245, 242, 0.45);
}

/* —— Site shell —— */
.site {
  min-height: 100vh;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}

.site.is-visible {
  opacity: 1;
  transform: none;
}

.site[hidden] {
  display: none !important;
}

html.skip-cover .site[hidden] {
  display: block !important;
}

html.skip-cover .site {
  opacity: 1;
  transform: none;
  transition: none;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 var(--pad);
  background: rgba(238, 241, 238, 0.86);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.read-progress {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 0%;
  background: var(--accent);
  pointer-events: none;
  transition: width 0.08s linear;
}

.topbar-brand {
  font-family: var(--serif);
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.15rem 1rem;
}

.nav a {
  position: relative;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  padding-bottom: 0.15rem;
  transition: color 0.2s ease;
}

.nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s var(--ease);
}

.nav a:hover,
.nav a.is-active {
  color: var(--ink);
}

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

.nav-toggle {
  display: none;
  width: 2.25rem;
  height: 2.25rem;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  height: 1px;
  margin: 6px 4px;
  background: var(--ink);
  transition: transform 0.25s var(--ease), opacity 0.2s ease;
}

.nav-toggle[aria-expanded="true"] span:first-child {
  transform: translateY(3.5px) rotate(40deg);
}

.nav-toggle[aria-expanded="true"] span:last-child {
  transform: translateY(-3.5px) rotate(-40deg);
}

.main {
  width: min(100%, var(--wide));
  margin: 0 auto;
  padding: 3rem var(--pad) 4.5rem;
}

.section {
  padding: 3.25rem 0;
  border-bottom: 1px solid var(--line);
  scroll-margin-top: calc(var(--topbar-h) + 0.75rem);
}

.section:last-of-type {
  border-bottom: 0;
}

.section-label {
  margin: 0 0 0.4rem;
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
}

.section-title {
  margin: 0 0 1.75rem;
  font-family: var(--serif);
  font-size: clamp(1.75rem, 3.2vw, 2.25rem);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.15;
}

/* Reveal on scroll */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.reveal.is-in {
  opacity: 1;
  transform: none;
}

/* About */
.about-grid {
  display: grid;
  grid-template-columns: 148px 1fr;
  gap: 2.25rem;
  align-items: start;
}

.about-avatar {
  width: 140px;
  height: 140px;
  object-fit: cover;
  border-radius: 50%;
  filter: grayscale(14%);
  box-shadow: 0 0 0 3px var(--bg-elevated), 0 0 0 4px rgba(47, 111, 94, 0.35);
  transition: filter 0.35s ease, transform 0.35s var(--ease);
}

.about-avatar:hover {
  filter: grayscale(0%);
  transform: scale(1.02);
}

.about-role {
  margin: 0 0 0.35rem;
  font-weight: 500;
}

.about-meta {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.about-bio {
  margin: 0 0 1.25rem;
  max-width: var(--max);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chip {
  display: inline-block;
  padding: 0.25rem 0.7rem;
  border: 1px solid var(--line);
  background: var(--bg-elevated);
  color: var(--muted);
  font-size: 0.8rem;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.chip:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

/* Lists / timeline */
.timeline,
.plain-list,
.pub-list,
.card-list,
.award-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.timeline,
.card-list {
  position: relative;
  padding-left: 1.35rem;
}

.timeline::before,
.card-list::before {
  content: "";
  position: absolute;
  left: 0.28rem;
  top: 0.35rem;
  bottom: 0.35rem;
  width: 1px;
  background: linear-gradient(to bottom, var(--accent), var(--line) 30%, var(--line));
}

.timeline-item,
.card-item {
  position: relative;
  padding: 1.15rem 0 1.15rem 0.35rem;
  border-top: 0;
}

.timeline-item::before,
.card-item::before {
  content: "";
  position: absolute;
  left: -1.2rem;
  top: 1.45rem;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--bg);
  border: 1.5px solid var(--accent);
  box-shadow: 0 0 0 3px var(--bg);
}

.pub-item {
  padding: 1.15rem 0;
  border-top: 1px solid var(--line);
}

.pub-item:first-child {
  border-top: 0;
  padding-top: 0;
}

.item-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.35rem 1rem;
  margin-bottom: 0.35rem;
  align-items: baseline;
}

.item-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
}

.item-sub {
  margin: 0.15rem 0 0.45rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.item-period {
  color: var(--ink);
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.badge-now {
  display: inline-block;
  padding: 0.1rem 0.4rem;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.detail-list {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--ink);
}

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

.detail-list li + li {
  margin-top: 0.25rem;
}

.news-item {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  gap: 1rem;
  padding: 0.9rem 0 0.9rem 0.9rem;
  border-top: 1px solid var(--line);
  border-left: 2px solid transparent;
  transition: border-left-color 0.2s ease, background 0.2s ease;
}

.news-item:first-child {
  border-top: 0;
}

.news-item:hover {
  border-left-color: var(--accent);
  background: rgba(255, 255, 255, 0.35);
}

.news-date {
  color: var(--muted);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

.news-text {
  margin: 0;
}

/* Publications */
.pub-item {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 1.25rem;
  align-items: start;
}

.pub-item.no-image {
  grid-template-columns: 1fr;
}

.pub-thumb {
  width: 96px;
  height: 72px;
  object-fit: cover;
  background: var(--accent-soft);
  border: 1px solid var(--line);
  transition: transform 0.35s var(--ease), border-color 0.25s ease;
}

.pub-item:hover .pub-thumb {
  transform: scale(1.04);
  border-color: var(--accent);
}

.pub-status {
  display: inline-block;
  margin-bottom: 0.35rem;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.pub-title {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.35;
  font-family: var(--serif);
}

.pub-authors {
  margin: 0 0 0.25rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.pub-venue {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
}

.pub-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.88rem;
}

.pub-links a {
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}

/* Awards */
.award-item {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.35rem 1.25rem;
  padding: 0.85rem 0;
  border-top: 1px solid var(--line);
  align-items: baseline;
}

.award-item:first-child {
  border-top: 0;
  padding-top: 0;
}

.award-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 500;
}

.award-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Skills */
.skills-grid {
  display: grid;
  gap: 1.15rem;
}

.skill-block h3 {
  margin: 0 0 0.4rem;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}

.skill-block p {
  margin: 0;
}

/* Contact */
.contact-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.contact-list li {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  gap: 1rem;
  padding: 0.65rem 0;
  border-top: 1px solid var(--line);
  align-items: center;
}

.contact-list li:first-child {
  border-top: 0;
  padding-top: 0;
}

.contact-label {
  color: var(--muted);
  font-size: 0.85rem;
}

.contact-cta {
  display: inline-block;
  padding: 0.45rem 0.95rem;
  border: 1px solid var(--accent);
  color: var(--accent);
  text-decoration: none;
  letter-spacing: 0.04em;
  font-size: 0.88rem;
  transition: background 0.2s ease, color 0.2s ease;
}

.contact-cta:hover {
  background: var(--accent);
  color: #fff;
  text-underline-offset: 0.18em;
}

.footer {
  padding: 1.75rem var(--pad) 2.75rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.82rem;
  border-top: 1px solid var(--line);
}

/* Responsive */
@media (max-width: 800px) {
  .nav-toggle {
    display: block;
    margin-left: auto;
  }

  .nav {
    position: absolute;
    top: var(--topbar-h);
    left: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0 var(--pad);
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    background: rgba(238, 241, 238, 0.98);
    border-bottom: 1px solid transparent;
    transition: max-height 0.35s var(--ease), opacity 0.25s ease, padding 0.25s ease, border-color 0.25s ease;
  }

  .nav.is-open {
    max-height: 70vh;
    opacity: 1;
    padding: 0.5rem var(--pad) 1rem;
    border-bottom-color: var(--line);
    overflow: auto;
  }

  .nav a {
    padding: 0.55rem 0;
    border-top: 1px solid var(--line);
    font-size: 0.95rem;
  }

  .nav a::after {
    display: none;
  }

  .about-grid {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .pub-item {
    grid-template-columns: 1fr;
  }

  .pub-thumb {
    width: 120px;
    height: 90px;
  }

  .news-item,
  .contact-list li {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }

  .award-meta {
    white-space: normal;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .cover,
  .site,
  .reveal,
  .cover-stage,
  .cover-enter,
  .cover-hint,
  .nav,
  .pub-thumb,
  .about-avatar,
  .read-progress {
    transition: none !important;
    animation: none !important;
  }

  .cover-stage,
  .reveal,
  .site {
    opacity: 1 !important;
    transform: none !important;
  }
}
