:root {
  color-scheme: light;
  scrollbar-gutter: stable;
  --paper: #fff;
  --ink: #474e54;
  --secondary: #626b73;
  --link: #226c84;
  --rule: #dfe3e5;
  --panel: #f2f5f6;
  --title-background: #262e36;
  --control-border: #b9c0c4;
  --muted-ink: #737b81;
  --muted-background: #f5f6f6;
  --footer-background: #f4f5f5;
  --note-background: #edf5f7;
  --note-border: #8cb3c1;
  --sans: system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Consolas, monospace;
}

@supports (color: light-dark(white, black)) {
  :root {
    color-scheme: light dark;
    --paper: light-dark(#fff, #171c21);
    --ink: light-dark(#474e54, #d7dfe6);
    --secondary: light-dark(#626b73, #a7b3bd);
    --link: light-dark(#226c84, #8fcee3);
    --rule: light-dark(#dfe3e5, #39444e);
    --panel: light-dark(#f2f5f6, #242e36);
    --title-background: light-dark(#262e36, #222b33);
    --control-border: light-dark(#b9c0c4, #687581);
    --muted-ink: light-dark(#737b81, #9aa7b1);
    --muted-background: light-dark(#f5f6f6, #212a32);
    --footer-background: light-dark(#f4f5f5, #1d252c);
    --note-background: light-dark(#edf5f7, #24343e);
    --note-border: light-dark(#8cb3c1, #6698ad);
  }

  :root[data-theme="light"] { color-scheme: light; }
  :root[data-theme="dark"] { color-scheme: dark; }
}

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

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 1.125rem/1.5 var(--sans);
}

a {
  color: var(--link);
  text-underline-offset: 0.18em;
  text-decoration-thickness: 0.07em;
}

a:hover { text-decoration-thickness: 0.12em; }

:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 4px;
}

h1, h2, h3 {
  margin: 0;
  line-height: 1.2;
  font-weight: 700;
  overflow-wrap: anywhere;
}

h1 { font-size: clamp(1.875rem, 5vw, 2.65rem); }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.18rem; }

.site-width {
  width: min(100% - 2.25rem, 78rem);
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 1;
  transform: translateY(calc(-100% - 1rem));
  padding: 0.5rem 0.75rem;
  background: var(--paper);
}
.skip-link:focus { transform: none; }

.site-header { border-bottom: 1px solid var(--rule); }

.nav {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.35rem 6.75rem;
  min-height: 5rem;
  align-content: center;
  padding-block: 0.7rem;
}

.nav ul, .social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 1.15rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav ul { column-gap: 2.15rem; }

.nav a {
  display: inline-block;
  padding-block: 0.2rem;
  color: var(--secondary);
  text-decoration: none;
}

.nav a:hover, .nav a[aria-current="page"], .nav .section-current { text-decoration: underline; }

.nav .site-name {
  color: var(--secondary);
  font-size: 1em;
  font-weight: 700;
}

.theme-toggle {
  margin-inline-start: auto;
  padding: 0.25rem 0.55rem;
  border: 1px solid var(--control-border);
  border-radius: 0.2rem;
  background: var(--paper);
  color: var(--secondary);
  font: inherit;
  font-size: 0.875rem;
  cursor: pointer;
}

.theme-toggle:hover, .theme-toggle[aria-pressed="true"] { background: var(--panel); }

main {
  flex: 1;
  min-width: 0;
}

.page-title {
  display: grid;
  align-items: center;
  min-height: 10rem;
  padding-block: 2.75rem;
  background: var(--title-background);
  color: #fbfcfd;
}

.page-title h1 { max-width: 68rem; }

.editorial-layout {
  display: grid;
  grid-template-columns: 12.25rem minmax(0, 1fr);
  align-items: start;
  column-gap: 4.125rem;
  padding-block: 2.2rem 4rem;
}

.editorial-content { min-width: 0; }

.profile {
  position: sticky;
  top: 2rem;
  color: var(--secondary);
  font-size: 0.875rem;
}

.profile p { margin: 0; }

.profile-photo {
  display: block;
  width: 6.75rem;
  height: 6.75rem;
  object-fit: cover;
  background: #fff;
  padding: 4px;
  border: 1px solid var(--rule);
  border-radius: 50%;
  margin-bottom: 0.55rem;
}

.profile .profile-name {
  margin-bottom: 0.45rem;
  color: var(--ink);
  font-size: 1.125rem;
  font-weight: 700;
}

.social-links { gap: 0.15rem 0.85rem; }
.social-links a, .site-footer a { display: inline-block; padding-block: 0.15rem; }

.profile-contact-list {
  display: grid;
  gap: 0.55rem;
  margin: 1.25rem 0 0;
  padding: 0;
  list-style: none;
}

.profile-contact-list li, .profile-contact-list a {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.profile-contact-list a { color: inherit; text-decoration: none; }
.profile-contact-list a:hover, .profile-contact-list a:focus-visible { text-decoration: underline; }

.profile-contact-list svg {
  flex: none;
  width: 0.8rem;
  height: 0.8rem;
  fill: var(--ink);
}

.profile-contact-list .profile-linkedin { fill: var(--link); }
.profile-disclosure { display: none; }

.home-research { padding-top: 1.4rem; }

.home-research > h2 {
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--rule);
  color: var(--secondary);
  font-size: 1.125rem;
}

.index-page {
  max-width: 48rem;
  padding-top: 1.9rem;
}

.entry-list, .topic-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.entry {
  padding-block: 0.78rem 0;
}

.entry + .entry { margin-top: 1.35rem; }
.entry h2, .entry h3 { font-size: 1.125rem; }
.entry h2 a, .entry h3 a { text-decoration: none; }
.entry h2 a:hover, .entry h3 a:hover,
.entry h2 a:focus-visible, .entry h3 a:focus-visible { text-decoration: underline; }

.home-research .entry { max-width: 37rem; }
.home-research .entry + .entry { margin-top: 1.85rem; }
.home-research .entry h3 { font-size: clamp(1.25rem, 2.5vw, 1.42rem); }
.home-research .entry h3 a { color: var(--ink); }
.home-research .entry-summary { font-size: 0.875rem; }

.entry-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.1rem 0.85rem;
  margin: 0.32rem 0 0;
  color: var(--secondary);
  font-size: 0.84rem;
}

.entry-summary { margin: 0.38rem 0 0; }
.home-research .entry-summary + .entry-meta { margin-top: 0.2rem; }

.archive-link { margin: 2rem 0 0; font-size: 0.95rem; }
.archive-back { margin: 0 0 0.75rem; }

.pagination {
  display: flex;
  width: fit-content;
  max-width: 100%;
  margin-top: 2.75rem;
  overflow-x: auto;
  border: 1px solid var(--control-border);
  border-radius: 0.2rem;
  font-size: 0.875rem;
  font-weight: 700;
}

.pagination > * {
  display: grid;
  flex: none;
  place-items: center;
  min-width: 2.25rem;
  padding: 0.4rem 0.7rem;
  color: var(--secondary);
}

.pagination > * + * { border-inline-start: 1px solid var(--control-border); }
.pagination a { text-decoration: none; }
.pagination a:hover { background: var(--panel); }
.pagination a:focus-visible { outline-offset: -3px; }
.pagination [aria-current="page"] { background: var(--secondary); color: var(--paper); }
.pagination [aria-disabled="true"], .pagination-gap { color: var(--muted-ink); background: var(--muted-background); }

@media (max-width: 30rem) {
  .pagination { font-size: 0.8rem; }
  .pagination > * { min-width: 1.7rem; padding-inline: 0.4rem; }
}

.archive-year + .archive-year { margin-top: 2.4rem; }
.archive-year .entry:first-child { padding-top: 1.35rem; }

.archive-year h2 {
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--rule);
  font-size: 1.4rem;
}

.topic-list { margin-top: 0.85rem; }

.topic-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 1rem;
  padding-block: 0.7rem;
  border-bottom: 1px solid var(--rule);
}

.topic-group + .topic-group { margin-top: 2.15rem; }

.topic-group h2 {
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--rule);
  font-size: 1.35rem;
}

.topic-group h2 a { color: var(--ink); text-decoration: none; }
.topic-group h2 a:hover, .topic-group h2 a:focus-visible { text-decoration: underline; }

.topic-group ul {
  margin: 0.8rem 0 0;
  padding-inline-start: 1.75em;
}

.topic-group li + li { margin-top: 0.35rem; }

.topic-list span, .site-footer {
  color: var(--secondary);
  font-size: 0.9rem;
}

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

.site-footer .site-width {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.15rem 1.25rem;
  padding-block: 1.3rem;
}

@media (width >= 68rem) {
  .index-page:has(.archive-year) { margin-inline-start: 2rem; }
}

@media (width < 64rem) {
  .editorial-layout { grid-template-columns: minmax(0, 1fr); row-gap: 1.9rem; }
  .home-research, .index-page { padding-top: 0; }

  .profile {
    position: static;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    width: fit-content;
    max-width: 100%;
    color: var(--ink);
    font-size: 0.84rem;
  }

  .profile-photo { flex: none; width: 2.4rem; height: 2.4rem; margin: 0; padding: 0; }
  .profile .profile-name { margin-bottom: 0.1rem; font-size: 1.06rem; }
  .profile-contact-list { display: none; }
  .profile-disclosure { position: relative; display: block; flex: none; }

  .profile-disclosure summary {
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--control-border);
    border-radius: 0.15rem;
    color: var(--secondary);
    font-weight: 650;
  }

  .profile-disclosure .social-links {
    position: absolute;
    z-index: 1;
    inset: calc(100% + 0.25rem) 0 auto auto;
    display: block;
    min-width: 7rem;
    padding: 0.35rem 0.6rem;
    border: 1px solid var(--rule);
    background: var(--paper);
  }
}

@media (max-width: 43rem) {
  body { font-size: 1rem; }
  .site-width { width: calc(100% - 2rem); }
  .nav { min-height: 4.5rem; gap: 0.2rem 1.65rem; padding-block: 0.55rem; }
  .nav ul { gap: 0.15rem 1rem; }
  .page-title { min-height: 8.5rem; padding-block: 1.95rem; }
  .editorial-layout { padding-block: 1.9rem 3rem; }
  .home-research > h2, .profile .profile-name { font-size: 1rem; }
  .profile { gap: 0.75rem; font-size: 0.8rem; }
  .profile-photo { width: 2.25rem; height: 2.25rem; }
}

@media (max-width: 26rem) {
  .nav { column-gap: 0.8rem; }
  .nav ul { column-gap: 0.7rem; }
  .theme-toggle { padding-inline: 0.4rem; }
}
