:root {
  color-scheme: light;
  --paper: #f3f7f9;
  --surface: #ffffff;
  --ink: #1c2d36;
  --ink-soft: #5b6d76;
  --line: #d6e1e5;
  --line-strong: #b7cbd3;
  --spruce: #315e72;
  --spruce-deep: #244653;
  --mint: #c4dde8;
  --accent: #3e7188;
  --sans: Inter, Aptos, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --serif: Iowan Old Style, Baskerville, "Times New Roman", Times, serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #101a1f;
  --surface: #18252b;
  --ink: #eef5f7;
  --ink-soft: #afbfc6;
  --line: #2a3a42;
  --line-strong: #435a65;
  --spruce: #213e4b;
  --spruce-deep: #172d37;
  --mint: #a4c8d7;
  --accent: #78aec4;
}

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

html {
  scroll-behavior: auto;
}

body {
  min-width: 0;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body.nav-open {
  overflow: hidden;
}

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

button {
  color: inherit;
  font: inherit;
}

img,
svg {
  display: block;
}

img {
  max-width: 100%;
}

svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

::selection {
  background: var(--mint);
  color: var(--spruce-deep);
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  z-index: 200;
  top: 12px;
  left: 12px;
  padding: 9px 14px;
  transform: translateY(-150%);
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  font-size: 0.875rem;
  font-weight: 700;
  transition: transform 150ms ease;
}

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

.icon-button {
  display: grid;
  width: 38px;
  height: 38px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transition: border-color 140ms ease, background-color 140ms ease;
}

.icon-button:hover {
  border-color: var(--line-strong);
  background: var(--surface);
}

.icon-button svg {
  width: 17px;
  height: 17px;
}

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

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

.about-section {
  padding-bottom: clamp(1.875rem, 2.5vw, 2.25rem);
  border-bottom: 1px solid var(--line);
}

h1,
h2 {
  font-family: var(--serif);
  font-weight: 500;
}

h1 {
  margin: 0;
  font-size: clamp(2.35rem, 3vw, 3.5rem);
  letter-spacing: -0.04em;
  line-height: 1.05;
}

.academic-role {
  margin: 0.75rem 0 0;
  color: var(--ink-soft);
  font-size: clamp(1rem, 1.1vw, 1.15rem);
  font-weight: 600;
  line-height: 1.5;
}

.bio {
  max-width: 74ch;
  margin-top: clamp(1.5rem, 2.5vw, 1.875rem);
  padding-left: 1.25rem;
  border-left: 2px solid var(--line-strong);
}

.bio p {
  margin: 0;
  color: var(--ink-soft);
  font-size: clamp(1rem, 1.05vw, 1.1rem);
}

.bio p + p {
  margin-top: 0.8125rem;
}

.bio a,
.news-list a {
  color: var(--ink);
  font-weight: 650;
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-underline-offset: 3px;
}

.bio a:hover,
.news-list a:hover {
  color: var(--accent);
}

.academic-section {
  padding: clamp(1.75rem, 2.6vw, 2.125rem) 0;
  border-bottom: 1px solid var(--line);
}

.academic-section h2 {
  margin: 0 0 1.125rem;
  font-size: clamp(1.85rem, 2.2vw, 2.25rem);
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.interest-list {
  display: block;
  margin: 0;
  padding-left: 1.15rem;
  list-style: disc;
}

.interest-list li {
  padding-left: 0.25rem;
  color: var(--ink-soft);
  font-size: 1rem;
}

.interest-list li + li {
  margin-top: 0.4375rem;
}

.interest-list li::marker {
  color: var(--accent);
}

.news-list {
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line-strong);
  list-style: none;
}

.news-list li {
  display: grid;
  grid-template-columns: 5.625rem minmax(0, 1fr);
  padding: 0.875rem 0;
  border-bottom: 1px solid var(--line);
  gap: 1.375rem;
}

.news-list time {
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 0.98rem;
  font-style: italic;
  white-space: nowrap;
}

.news-list p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.98rem;
  line-height: 1.55;
}

.site-footer {
  padding: 1.25rem 0 0;
  color: var(--ink-soft);
  font-size: 0.72rem;
}

.site-footer p {
  margin: 0;
}

@media (max-width: 520px) {
  h1 {
    font-size: clamp(2.1rem, 9vw, 2.55rem);
    line-height: 1.05;
  }

  .news-list li {
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 14px;
  }
}

@media (max-width: 380px) {
  .news-list li {
    grid-template-columns: 1fr;
    gap: 3px;
  }
}

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

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}

/* Keep the original monitor scale, then compact desktop type on laptop widths. */
@media screen and (min-width: 1101px) {
  html {
    font-size: clamp(90%, 0.8333vw, 100%);
  }
}

@media screen and (min-width: 1101px) and (max-width: 1919px) {
  h1 {
    font-size: clamp(2.35rem, 2.7vw, 3.5rem);
  }

  .academic-role {
    font-size: clamp(1rem, 0.99vw, 1.15rem);
  }

  .bio p {
    font-size: clamp(1rem, 0.945vw, 1.1rem);
  }

  .academic-section h2 {
    font-size: clamp(1.85rem, 1.98vw, 2.25rem);
  }
}
