/* Single-page homepage: larger type, a display/body font pair, a scrollable
   news box, and a sticky top bar whose buttons jump between sections. */

:root {
  --display: "Marcellus", Optima, "Gill Sans", "Palatino Linotype", Georgia, serif;
  --sans: "Nunito Sans", "Avenir Next", Avenir, "Helvetica Neue", Arial, sans-serif;
  --ink: #3f4347;
  --navy: #043361;
  --accent: #39c;
  --rule: #e2e5ea;
  --muted: #6d7378;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  font-size: 17.5px;
  line-height: 1.62;
  color: var(--ink);
}

/* Give the single page more room than the old two-page layout had. */
@media (min-width: 961px) {
  .wrapper,
  .topbar-inner { width: min(1180px, calc(100% - 64px)); max-width: none; }
  .page { gap: 44px; }
}

/* ---- Top bar: stays in reach, buttons scroll the page ---- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-brand,
.topbar-brand:hover {
  font-family: var(--display);
  font-size: 1.3rem;
  letter-spacing: 0.01em;
}

.site-nav a {
  position: relative;
  font-size: 0.92rem;
  letter-spacing: 0.02em;
  padding: 6px 12px;
}

.site-nav a::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 100%;
  bottom: 2px;
  height: 2px;
  background: #ffffff;
  transition: right 0.22s ease;
}

.site-nav a:hover::after,
.site-nav a.active::after { right: 12px; }

.site-nav a.active {
  color: #ffffff;
  background-color: rgba(255, 255, 255, 0.18);
}

/* ---- Sidebar ---- */

header h1 {
  font-family: var(--display);
  font-size: 2.2rem;
  letter-spacing: 0.005em;
  margin: 0 0 12px;
}

header position,
header email,
header a { font-size: 1.02rem; }

@media (min-width: 961px) {
  .page > header {
    position: sticky;
    top: 76px;
  }
}

/* ---- Section headings ---- */

section > h2 {
  font-family: var(--display);
  font-size: clamp(2rem, 3.2vw, 2.9rem);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.015em;
  margin: 0 0 24px;
  padding-top: 46px;
  border-top: 1px solid var(--rule);
}

section > h2:first-of-type {
  padding-top: 0;
  border-top: 0;
}

section > h2[id] { scroll-margin-top: 110px; }

section > h3,
section > h4 {
  font-family: var(--display);
  font-weight: 400;
}

section p,
section ul,
section ol { font-size: 1rem; }

section > ul { padding-left: 1.3em; }
section > ul li { margin-bottom: 4px; }

/* ---- News: fixed-height box with its own scroll bar ---- */

.news-scroll {
  max-height: 390px;
  overflow-y: auto;
  padding-right: 18px;
  margin-bottom: 8px;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #a8b6c6 #eef1f5;
}

.news-scroll:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 5px;
}

.news-scroll::-webkit-scrollbar { width: 8px; }
.news-scroll::-webkit-scrollbar-track { background: #eef1f5; border-radius: 999px; }
.news-scroll::-webkit-scrollbar-thumb { background: #a8b6c6; border-radius: 999px; }
.news-scroll::-webkit-scrollbar-thumb:hover { background: #8396a9; }

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

.news-list li {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 18px;
  padding: 14px 0;
  border-bottom: 1px dotted var(--rule);
}

.news-list time {
  color: var(--navy);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding-top: 0.25em;
}

.news-list p {
  margin: 0;
  font-size: 1rem;
  line-height: 1.55;
}

@media (max-width: 600px) {
  .news-list li { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .news-scroll { max-height: 330px; padding-right: 12px; }
}

/* ---- Publications: same reveal effect, larger text ---- */

.publication-list { gap: 40px; }
.publication-details h3 {
  font-family: var(--display);
  font-size: clamp(1.1rem, 1.5vw, 1.3rem);
  font-weight: 400;
  line-height: 1.3;
  margin: 0 0 8px;
}
.publication-details p { font-size: 0.97rem; }
.publication-venue { color: var(--navy); font-weight: 600; }
.publication-note { font-size: 0.82rem; color: var(--muted); }
.publication-award { font-size: 0.9rem; }
.publication-links { font-size: 0.95rem; }

/* ---- Services ---- */

section h4 {
  font-family: var(--sans);
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--navy);
}

section h4 + ul { list-style: none; padding-left: 0; }
section h4 + ul li {
  padding: 7px 0;
  border-bottom: 1px dotted var(--rule);
  font-size: 1rem;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .site-nav a::after { transition: none; }
}

/* Paper titles read as headings, not as links in running text. */
.publication-details h3 a { text-decoration: none; }
.publication-details h3 a:hover,
.publication-details h3 a:focus-visible { text-decoration: underline; text-underline-offset: 3px; }
