:root {
  color-scheme: light;
  --background: #f6f6f1;
  --foreground: #1e2523;
  --paper: #fffdfa;
  --muted: #69736f;
  --rule: #d8ddd4;
  --accent: #5e7c91;
  --accent-dark: #263b50;
  --blue: #2f6173;
  --green: #66784b;
  --header-bg: rgba(255, 253, 250, 0.95);
  --band-bg: #eef2ec;
  --body-copy: #3c4643;
  --hover-bg: #fff7f2;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --background: #171b1e;
  --foreground: #eef2f3;
  --paper: #20262a;
  --muted: #aab5ba;
  --rule: #3b474d;
  --accent: #83a9be;
  --accent-dark: #b7d0de;
  --blue: #8db6c8;
  --green: #a8b98b;
  --header-bg: rgba(23, 27, 30, 0.95);
  --band-bg: #1b2225;
  --body-copy: #d2dadd;
  --hover-bg: #263138;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--sans);
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
}

a:hover {
  color: var(--accent);
}

a:focus-visible {
  outline: 3px solid rgba(47, 97, 115, 0.45);
  outline-offset: 4px;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1,
h2,
h3 {
  letter-spacing: 0;
}

h2 {
  margin: 0;
  font-size: 2.35rem;
  line-height: 1.12;
}

h3 {
  margin: 0;
  font-size: 1.45rem;
  line-height: 1.3;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--rule);
  background: var(--header-bg);
  backdrop-filter: blur(16px);
}

.site-header-inner {
  display: flex;
  width: min(1120px, 100%);
  min-height: 4rem;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  margin: 0 auto;
  padding: 0.55rem clamp(1rem, 3vw, 2.75rem);
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.brand {
  display: inline-grid;
  width: 2.4rem;
  height: 2.4rem;
  flex: 0 0 auto;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: #ffffff;
  text-decoration: none;
}

.brand:hover {
  border-color: var(--accent);
}

.brand img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.25rem 1.15rem;
  color: var(--muted);
  font-size: 0.92rem;
}

nav a {
  border-bottom: 2px solid transparent;
  padding: 0.55rem 0 0.45rem;
  text-decoration: none;
  white-space: nowrap;
}

nav a[aria-current="page"] {
  border-bottom-color: var(--accent);
  color: var(--foreground);
  font-weight: 700;
}

.theme-toggle {
  display: inline-grid;
  width: 2.25rem;
  height: 2.25rem;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: transparent;
  color: var(--foreground);
  padding: 0;
  font: inherit;
  cursor: pointer;
}

.theme-toggle:hover {
  border-color: var(--accent);
  background: var(--hover-bg);
  color: var(--accent-dark);
}

.theme-toggle:focus-visible {
  outline: 3px solid rgba(94, 124, 145, 0.45);
  outline-offset: 3px;
}

.theme-toggle-icon {
  line-height: 1;
}

.hero {
  border-top: 5px solid var(--accent);
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
  padding: clamp(2.75rem, 6vw, 4.75rem) clamp(1rem, 3vw, 2.75rem)
    clamp(2.75rem, 5vw, 4rem);
}

.hero-inner,
.section-grid,
.content-section,
.site-footer-inner,
.page-intro-inner {
  width: min(1120px, 100%);
  margin: 0 auto;
}

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 320px);
  align-items: start;
  gap: clamp(2.5rem, 6vw, 5rem);
}

.hero-copy {
  max-width: 760px;
}

.eyebrow,
.section-kicker {
  margin: 0 0 0.85rem;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.name-lockup {
  display: grid;
  gap: 1rem;
  margin: 0;
  line-height: 1;
}

.latin-name {
  display: block;
  font-size: 5.2rem;
  font-weight: 750;
}

.han-name {
  display: block;
  color: var(--green);
  font-size: 2.25rem;
  font-weight: 550;
}

.lead {
  max-width: 66ch;
  margin: 2rem 0 0;
  color: var(--body-copy);
  font-size: 1.18rem;
}

.research-lead {
  margin-top: 1rem;
}

.quick-links,
.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.quick-links {
  margin-top: 1.75rem;
}

.quick-links a,
.contact-links a {
  display: inline-flex;
  min-height: 2.55rem;
  align-items: center;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--paper);
  color: var(--accent-dark);
  padding: 0.55rem 0.78rem;
  font-size: 0.92rem;
  font-weight: 650;
  text-decoration: none;
}

.quick-links a:hover,
.contact-links a:hover {
  border-color: var(--accent);
  background: var(--hover-bg);
}

.portrait-area {
  display: grid;
  gap: 1.25rem;
}

.portrait-area .quick-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 0;
}

.portrait-area .quick-links a {
  width: 100%;
  justify-content: center;
  text-align: center;
}

.portrait-area .quick-links .quick-link-wide {
  grid-column: 1 / -1;
}

.portrait-area img {
  width: min(220px, 70vw);
  height: auto;
  aspect-ratio: 1;
  border-radius: 6px;
  object-fit: cover;
}

.portrait-area dl {
  display: grid;
  gap: 0.75rem;
  margin: 0;
  border-left: 3px solid var(--green);
  padding-left: 1rem;
}

.portrait-area div {
  display: grid;
  gap: 0.1rem;
}

dt {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0;
  text-transform: uppercase;
}

dd {
  margin: 0;
  font-weight: 650;
}

.intro-band {
  border-bottom: 1px solid var(--rule);
  background: var(--band-bg);
  padding: clamp(2.5rem, 5vw, 4rem) clamp(1rem, 3vw, 2.75rem);
}

.section-grid {
  display: grid;
  grid-template-columns: minmax(120px, 0.3fr) minmax(0, 1.7fr);
  gap: clamp(1.75rem, 5vw, 4rem);
}

.personal-interests {
  display: grid;
  gap: 1rem;
}

.personal-interests p {
  margin: 0;
  color: var(--body-copy);
  font-size: 1.15rem;
}

.dog-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
  gap: 1rem;
  margin-top: 0.25rem;
}

.dog-card {
  min-width: 0;
  margin: 0;
}

.dog-card img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 4;
  border-radius: 6px;
  object-fit: cover;
}

.dog-card figcaption {
  margin-top: 0.55rem;
  color: var(--foreground);
  font-family: var(--mono);
  font-size: 0.86rem;
  font-weight: 700;
  text-align: center;
}

.intro-band .section-kicker {
  margin: 0;
}

.useful-links-section {
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
  padding: clamp(2.5rem, 5vw, 4rem) clamp(1rem, 3vw, 2.75rem);
}

.useful-links-section .section-kicker {
  margin: 0;
}

.intro-band .section-kicker,
.useful-links-section .section-kicker {
  font-size: 1.05rem;
}

.useful-links-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.useful-link-card {
  display: flex;
  min-height: 6rem;
  flex-direction: column;
  justify-content: center;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--background);
  color: var(--foreground);
  padding: 1rem 1.1rem;
  text-decoration: none;
}

a.useful-link-card:hover {
  border-color: var(--accent);
  background: var(--hover-bg);
  color: var(--accent-dark);
}

.useful-link-card strong {
  font-size: 1.05rem;
}

.arxiv-card {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.8rem;
  justify-content: space-between;
}

.arxiv-categories {
  display: flex;
  gap: 0.5rem;
}

.arxiv-categories a {
  display: inline-grid;
  min-width: 2.7rem;
  min-height: 2.35rem;
  place-items: center;
  border: 1px solid var(--rule);
  border-radius: 6px;
  color: var(--accent-dark);
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
}

.arxiv-categories a:hover {
  border-color: var(--accent);
  background: var(--hover-bg);
}

.directory-link-card {
  grid-column: 1 / -1;
  min-height: 4rem;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}

.directory-link-card span {
  color: var(--accent-dark);
  font-size: 1.2rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.directory-intro {
  width: min(960px, 100%);
  margin: 0 0 1.5rem;
  color: var(--body-copy);
  font-size: 1.05rem;
}

.directory-tools {
  display: grid;
  width: min(960px, 100%);
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  margin: 0 0 0.8rem;
}

.directory-search {
  display: block;
}

.directory-search input {
  display: block;
  width: 100%;
  height: 3.1rem;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: var(--paper);
  padding: 0.65rem 0.9rem;
  color: var(--foreground);
  font: inherit;
  font-size: 1rem;
}

.directory-search input::placeholder {
  color: var(--muted);
}

.directory-search input:focus-visible {
  outline: 3px solid rgba(47, 97, 115, 0.45);
  outline-offset: 2px;
}

.directory-count {
  margin: 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.78rem;
  text-align: right;
  white-space: nowrap;
}

.directory-index {
  display: flex;
  width: min(960px, 100%);
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 0.4rem;
  margin: 0 0 2.25rem;
}

.directory-index a {
  display: inline-grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: var(--paper);
  color: var(--accent-dark);
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
}

.directory-index a:hover {
  border-color: var(--accent);
  background: var(--hover-bg);
}

.directory-groups {
  display: grid;
  width: min(960px, 100%);
  gap: 2rem;
}

.directory-group {
  display: grid;
  grid-template-columns: 2.4rem minmax(0, 1fr);
  gap: 1rem;
  scroll-margin-top: 5.5rem;
}

.directory-group h2 {
  margin: 0.95rem 0 0;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 1.15rem;
  line-height: 1;
}

.directory-group-pinned {
  grid-template-columns: 1fr;
  gap: 0.65rem;
  margin-bottom: 0.25rem;
}

.directory-group-pinned h2 {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.people-directory {
  display: grid;
  width: 100%;
  overflow: hidden;
  margin: 0;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--paper);
  padding: 0;
  list-style: none;
}

.people-directory li + li {
  border-top: 1px solid var(--rule);
}

.people-directory a {
  display: flex;
  min-height: 3.7rem;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1rem;
  color: var(--foreground);
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
}

.people-directory a::after {
  content: "↗";
  flex: 0 0 auto;
  color: var(--accent-dark);
  font-family: var(--mono);
  font-weight: 500;
}

.people-directory a:hover {
  background: var(--hover-bg);
  color: var(--accent-dark);
}

.directory-empty {
  width: min(960px, 100%);
  margin: 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 2rem;
  color: var(--muted);
  text-align: center;
}

.scroll-to-top {
  position: fixed;
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(1rem, env(safe-area-inset-bottom));
  z-index: 30;
  display: grid;
  width: 3rem;
  height: 3rem;
  place-items: center;
  border: 1px solid var(--rule);
  border-radius: 50%;
  background: var(--paper);
  box-shadow: 0 0.4rem 1.2rem rgba(20, 31, 43, 0.18);
  color: var(--accent-dark);
  font-family: var(--mono);
  font-size: 1.3rem;
  line-height: 1;
  opacity: 0;
  transform: translateY(0.7rem);
  pointer-events: none;
  cursor: pointer;
  transition:
    opacity 160ms ease,
    transform 160ms ease,
    border-color 160ms ease,
    background-color 160ms ease;
}

.scroll-to-top.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.scroll-to-top:hover {
  border-color: var(--accent);
  background: var(--hover-bg);
}

.scroll-to-top:focus-visible {
  outline: 3px solid rgba(47, 97, 115, 0.45);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  .scroll-to-top {
    transition: none;
  }
}

.directory-group[hidden],
.directory-index a[hidden],
.directory-empty[hidden] {
  display: none;
}

@media (min-width: 720px) {
  .people-directory {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .people-directory li + li {
    border-top: 0;
  }

  .people-directory li:nth-child(n + 3) {
    border-top: 1px solid var(--rule);
  }

  .people-directory li:nth-child(odd):not(:last-child) {
    border-right: 1px solid var(--rule);
  }
}

@media (max-width: 560px) {
  .directory-tools {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }

  .directory-count {
    text-align: left;
  }

  .directory-index {
    gap: 0.3rem;
    margin-bottom: 1.75rem;
  }

  .directory-index a {
    width: 1.85rem;
    height: 1.85rem;
  }

  .directory-group {
    grid-template-columns: 1.7rem minmax(0, 1fr);
    gap: 0.65rem;
  }

  .directory-group-pinned {
    grid-template-columns: 1fr;
  }

  .directory-group h2 {
    font-size: 1rem;
  }

  .directory-group-pinned h2 {
    font-size: 0.76rem;
  }

  .people-directory a {
    min-height: 3.5rem;
    padding: 0.8rem 0.9rem;
    font-size: 0.96rem;
  }
}

.content-section {
  padding: clamp(3rem, 6vw, 5.5rem) clamp(1rem, 3vw, 2.75rem);
}

.section-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 1rem;
}

.section-title.simple {
  justify-content: flex-start;
}

.section-note {
  max-width: 32ch;
  margin: 0;
  color: var(--muted);
  text-align: right;
}

.page-links {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.page-links article {
  display: flex;
  min-height: 16rem;
  flex-direction: column;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--paper);
  padding: 1.35rem;
}

.page-links article > p:not(.page-number) {
  margin: 0.85rem 0 1.5rem;
  color: var(--body-copy);
}

.page-number {
  margin: 0 0 2rem;
  color: var(--blue);
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 700;
}

.page-links h3 a {
  text-decoration: none;
}

.text-link {
  width: fit-content;
  margin-top: auto;
  color: var(--accent-dark);
  font-weight: 700;
}

.page-intro {
  border-top: 5px solid var(--accent);
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
  padding: 4.5rem clamp(1rem, 3vw, 2.75rem) 4rem;
}

.page-intro-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.75fr);
  align-items: end;
  gap: clamp(2rem, 6vw, 5rem);
}

.page-intro .section-kicker {
  grid-column: 1 / -1;
  margin-bottom: -0.75rem;
}

.page-intro h1 {
  margin: 0;
  font-size: 3.8rem;
  line-height: 1.05;
}

.page-summary {
  margin: 0;
  color: var(--body-copy);
  font-size: 1.08rem;
}

.research-list {
  display: grid;
  gap: 1rem;
}

.research-card {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(1.25rem, 3vw, 2.5rem);
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--paper);
  padding: clamp(1.15rem, 2.3vw, 1.5rem);
}

.research-card > p {
  margin: 0;
  color: var(--body-copy);
}

.research-card div > p {
  margin: 0;
  color: var(--blue);
  font-family: var(--mono);
  font-size: 0.78rem;
}

.research-card h2 {
  margin-top: 0.35rem;
  font-size: 1.5rem;
  line-height: 1.3;
}

.research-card a {
  color: var(--foreground);
}

.dog-poll {
  width: min(680px, 100%);
  margin-top: 1.25rem;
}

.dog-poll iframe {
  display: block;
  width: 100%;
  height: 444px;
  border: 0;
  border-radius: 6px;
  background: #fff;
}

.personal-interests .poll-note {
  margin-top: 0.65rem;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.78rem;
}

.research-groups {
  display: grid;
  gap: 1rem;
}

.research-group {
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--paper);
}

.research-group summary {
  display: flex;
  min-height: 4.5rem;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.35rem;
  color: var(--foreground);
  font-size: 1.3rem;
  font-weight: 750;
  cursor: pointer;
  list-style: none;
}

.research-group summary::-webkit-details-marker {
  display: none;
}

.research-group summary::after {
  content: "+";
  display: inline-grid;
  width: 1.8rem;
  height: 1.8rem;
  flex: 0 0 auto;
  place-items: center;
  color: var(--accent-dark);
  font-family: var(--mono);
  font-size: 1.35rem;
  font-weight: 500;
}

.research-group summary:hover {
  background: var(--hover-bg);
  color: var(--accent-dark);
}

.research-group summary:focus-visible {
  outline: 3px solid rgba(94, 124, 145, 0.45);
  outline-offset: -4px;
}

.research-group[open] summary {
  border-bottom: 1px solid var(--rule);
}

.research-group[open] summary::after {
  content: "−";
}

.research-group .research-list {
  padding: 1rem;
  background: var(--band-bg);
}

.ai-notes-warning {
  margin: 0;
  border-left: 3px solid var(--accent);
  border-radius: 4px;
  background: var(--paper);
  padding: 1rem 1.1rem;
  color: var(--body-copy);
}

.activity-groups {
  display: grid;
  gap: 1rem;
}

.activity-group-body,
.teaching-group-body,
.misc-group-body {
  padding: 1rem;
  background: var(--band-bg);
}

.misc-group-body p {
  margin: 0;
  color: var(--body-copy);
}

.activity-list {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}

.activity-list li {
  display: grid;
  grid-template-columns: minmax(120px, 0.28fr) minmax(0, 1.72fr);
  gap: clamp(1.25rem, 4vw, 3rem);
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
  padding: clamp(1.15rem, 2.3vw, 1.5rem);
}

.activity-list li:first-child {
  border-radius: 6px 6px 0 0;
}

.activity-list li:last-child {
  border-bottom: 0;
  border-radius: 0 0 6px 6px;
}

.activity-date {
  margin: 0;
  color: var(--blue);
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 700;
}

.activity-detail h2 {
  margin: 0;
  font-size: 1.28rem;
  line-height: 1.3;
}

.activity-detail p {
  margin: 0.35rem 0 0;
  color: var(--body-copy);
}

.activity-role {
  color: var(--foreground) !important;
  font-weight: 700;
}

.activity-label {
  color: var(--green);
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.activity-archive {
  display: inline-block;
  margin: 1rem 0.25rem 0.15rem;
}

.activity-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: clamp(2.5rem, 7vw, 6rem);
}

.timeline {
  display: grid;
  gap: 0.7rem;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: talks;
}

.timeline li {
  display: grid;
  grid-template-columns: 2.7rem minmax(0, 1fr);
  align-items: start;
  gap: 1rem;
  border-bottom: 1px solid var(--rule);
  padding: 0.95rem 0;
  counter-increment: talks;
}

.timeline li::before {
  content: counter(talks, decimal-leading-zero);
  color: var(--green);
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 700;
}

.service-panel {
  align-self: start;
  border-left: 3px solid var(--accent);
  padding-left: 1.4rem;
}

.service-panel h2 {
  font-size: 1.7rem;
}

.service-list {
  display: grid;
  gap: 1rem;
  margin: 1.4rem 0 1.5rem;
}

.service-list p {
  margin: 0;
  color: var(--body-copy);
}

.teaching-table {
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--paper);
}

.teaching-row {
  display: grid;
  grid-template-columns: minmax(110px, 0.55fr) minmax(0, 1.5fr)
    minmax(80px, 0.35fr);
  gap: 1rem;
  border-bottom: 1px solid var(--rule);
  padding: 0.9rem 1rem;
}

.teaching-row:last-child {
  border-bottom: 0;
}

.teaching-row span {
  color: var(--muted);
}

.teaching-header {
  background: var(--band-bg);
  color: var(--body-copy);
  font-family: var(--mono);
  font-size: 0.75rem;
  text-transform: uppercase;
}

.visit-counter {
  border-top: 1px solid var(--rule);
  background: var(--paper);
  padding: 1rem clamp(1rem, 3vw, 2.75rem);
  color: var(--muted);
  font: 0.78rem/1.5 var(--mono);
  text-align: center;
}

.visit-counter p {
  width: min(1120px, 100%);
  margin: 0 auto;
}

#sitewide-total {
  color: var(--foreground);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.site-footer {
  border-top: 1px solid var(--foreground);
  background: #263b50;
  color: #fffdfa;
}

.site-footer-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 1.5rem;
  padding: clamp(2.5rem, 5vw, 4rem) clamp(1rem, 3vw, 2.75rem);
}

.site-footer h2 {
  font-size: 2rem;
}

.site-footer p {
  max-width: 62ch;
  margin: 0.45rem 0 0;
  color: #d7dfd9;
}

.site-footer .section-kicker {
  margin: 0 0 0.4rem;
  color: #e7a7a9;
}

@media (max-width: 820px) {
  h2 {
    font-size: 2rem;
  }

  .hero-inner,
  .section-grid,
  .page-intro-inner,
  .research-card,
  .activity-layout,
  .site-footer-inner {
    grid-template-columns: 1fr;
  }

  .latin-name {
    font-size: 4.1rem;
  }

  .han-name {
    font-size: 2rem;
  }

  .portrait-area {
    grid-template-columns: 180px minmax(0, 1fr);
    align-items: center;
  }

  .portrait-area img {
    width: 180px;
  }

  .dog-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .page-links {
    grid-template-columns: 1fr;
  }

  .useful-links-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .page-links article {
    min-height: 0;
  }

  .page-number {
    margin-bottom: 1rem;
  }

  .page-intro .section-kicker {
    grid-column: auto;
    margin-bottom: -1rem;
  }

  .section-note {
    text-align: left;
  }

  .section-title {
    display: grid;
  }

  .site-footer-inner {
    align-items: start;
  }

  .contact-links {
    justify-content: flex-start;
  }
}

@media (max-width: 560px) {
  .site-header {
    position: static;
  }

  .site-header-inner {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.35rem;
    padding-top: 0.8rem;
    padding-bottom: 0.75rem;
  }

  nav {
    width: 100%;
    justify-content: flex-start;
    gap: 0 1rem;
    overflow-x: auto;
  }

  .hero {
    padding-top: 3rem;
  }

  .latin-name {
    font-size: 3.15rem;
  }

  .han-name {
    font-size: 1.75rem;
  }

  .lead {
    font-size: 1.05rem;
  }

  .portrait-area {
    grid-template-columns: 1fr;
  }

  .portrait-area img {
    width: 155px;
  }

  .page-intro {
    padding-top: 3.25rem;
    padding-bottom: 3rem;
  }

  .page-intro h1 {
    font-size: 2.8rem;
  }

  .teaching-header {
    display: none;
  }

  .teaching-row {
    grid-template-columns: 1fr;
    gap: 0.15rem;
  }

  .useful-links-grid {
    grid-template-columns: 1fr;
  }

  .timeline li {
    grid-template-columns: 2.1rem minmax(0, 1fr);
    gap: 0.75rem;
  }

  .activity-list li {
    grid-template-columns: 1fr;
    gap: 0.45rem;
  }

  .dog-poll iframe {
    height: 480px;
  }
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.media-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--paper);
}

.media-card-link {
  display: flex;
  height: 100%;
  flex-direction: column;
  color: inherit;
  text-decoration: none;
}

.media-card-link:hover {
  background: var(--hover-bg);
  color: inherit;
}

.media-cover {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 2 / 3;
  border-bottom: 1px solid var(--rule);
  background: var(--band-bg);
  object-fit: cover;
}

.media-card[data-kind="albums"] .media-cover {
  aspect-ratio: 1;
}

.media-card-copy {
  display: grid;
  gap: 0.45rem;
  padding: 0.9rem;
}

.media-card-title {
  margin: 0;
  font-size: 1rem;
  line-height: 1.3;
}

.media-card-meta {
  margin: 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.72rem;
  line-height: 1.5;
}

.media-card-note {
  margin: 0.2rem 0 0;
  color: var(--body-copy);
  font-size: 0.88rem;
  line-height: 1.5;
}

.media-grid-message {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
}

.review-page {
  min-height: calc(100vh - 4rem);
  border-top: 5px solid var(--accent);
  background: var(--paper);
}

.review-post {
  width: min(720px, 100%);
  margin: 0 auto;
  padding: clamp(2.5rem, 6vw, 5rem) clamp(1rem, 4vw, 2rem)
    clamp(4rem, 8vw, 7rem);
}

.review-back {
  display: inline-block;
  margin-bottom: clamp(2rem, 5vw, 3.5rem);
  color: var(--accent-dark);
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
}

.review-post-header {
  margin-bottom: 2rem;
}

.review-post-header .section-kicker {
  margin-bottom: 0.8rem;
}

.review-post h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.2rem, 7vw, 3.55rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.025em;
}

.review-meta {
  margin: 1rem 0 0;
  color: var(--muted);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.08rem;
  font-style: italic;
}

.review-cover-link {
  display: block;
  width: min(271px, 72vw);
  margin: clamp(2rem, 6vw, 3.5rem) auto;
  text-decoration: none;
}

.review-cover {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--rule);
  border-radius: 4px;
  box-shadow: 0 0.65rem 1.7rem rgba(20, 31, 43, 0.14);
  transition:
    border-color 160ms ease,
    transform 160ms ease;
}

.review-cover-link:hover .review-cover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.review-body {
  color: var(--body-copy);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.08rem, 2vw, 1.22rem);
  line-height: 1.78;
}

.review-body p {
  margin: 0 0 1.35rem;
}

.review-body blockquote {
  margin: 2rem 0;
  border-left: 3px solid var(--accent);
  padding: 0.2rem 0 0.2rem 1.35rem;
  color: var(--foreground);
  font-style: italic;
}

.review-body blockquote p {
  margin: 0;
}

@media (min-width: 700px) {
  .media-grid {
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 1.25rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .review-cover {
    transition: none;
  }
}
