/* Shared presentation for the research and teaching pages. */
:root {
  color-scheme: light;
  --paper: #f7f7f2;
  --ink: #273444;
  --accent: #17365d;
  --muted: #5c6c7e;
  --rule: #d8dee6;
  --soft: #edf1f6;
  --serif: Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

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

html {
  scroll-padding-top: 2rem;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

::selection {
  color: var(--accent);
  background: #dce6f2;
}

a {
  color: var(--accent);
  text-underline-offset: 0.22em;
  text-decoration-thickness: 1px;
}

a:hover {
  text-decoration-color: currentColor;
}

a:focus-visible,
.table-wrapper:focus-visible {
  outline: 3px solid #9b641d;
  outline-offset: 5px;
  border-radius: 2px;
}

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

figure,
h1,
h2,
h3,
p {
  margin: 0;
}

h1,
h2,
h3 {
  font-weight: 400;
}

.container {
  width: min(1180px, calc(100% - 96px));
  margin-inline: auto;
}

.visually-hidden,
.skip-link:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link:focus {
  position: fixed;
  z-index: 10;
  top: 12px;
  left: 16px;
  padding: 10px 18px;
  background: var(--paper);
  color: var(--accent);
  font-weight: 600;
}

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

.header-inner {
  min-height: 94px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 39px;
  height: 39px;
  flex: 0 0 39px;
  place-items: center;
  border: 1px solid #90a4bc;
  border-radius: 50%;
  font-family: var(--serif);
  font-size: 29px;
  line-height: 1;
  letter-spacing: 0;
  padding: 0 0 2px;
}

.brand-name {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.primary-nav {
  display: flex;
  align-items: center;
  gap: 32px;
  flex-wrap: wrap;
}

.primary-nav a {
  padding-block: 9px;
  color: var(--muted);
  font-size: 14px;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.primary-nav a:hover,
.primary-nav a[aria-current="page"] {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  align-items: center;
  gap: 80px;
  padding-block: 78px 76px;
}

.eyebrow,
.nav-label,
.grant-label {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
  letter-spacing: 0.16em;
  font-weight: 600;
  text-transform: uppercase;
}

.hero .eyebrow {
  margin-bottom: 22px;
}

.hero h1 {
  max-width: 720px;
  color: var(--accent);
  font-family: var(--serif);
  font-size: clamp(2.6rem, 4.8vw, 4.15rem);
  line-height: 1.08;
  letter-spacing: -0.047em;
  text-wrap: balance;
}

.hero-role {
  margin-top: 24px;
  color: var(--accent);
  font-size: 17px;
  font-weight: 500;
}

.hero-affiliation {
  margin-top: 3px;
  color: var(--muted);
  font-size: 15px;
}

.hero-affiliation a {
  color: inherit;
}

.hero-university {
  display: block;
  width: 125px;
  max-width: 100%;
  margin-top: 12px;
}

.hero-university img {
  display: block;
  width: 100%;
  height: auto;
  mix-blend-mode: multiply;
}

.hero-summary {
  max-width: 650px;
  margin-top: 23px;
  font-size: 16px;
  line-height: 1.8;
}

.research-interests {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 9px;
  margin-top: 20px;
}

.research-interests span {
  padding: 3px 10px;
  border: 1px solid var(--rule);
  border-radius: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.profile-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-top: 26px;
}

.profile-icons a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 4px;
}

.profile-icons a:hover { background: var(--soft); }
.profile-icons img { width: 30px; height: 30px; object-fit: contain; }
.profile-icons a.profile-icon-arxiv { width: 70px; }
.profile-icons .profile-icon-arxiv img { width: 62px; height: 28px; }

.hero-portrait {
  align-self: center;
  width: 260px;
  max-width: 100%;
  justify-self: end;
}

.hero-portrait > img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: auto;
  object-fit: contain;
  border-radius: 2px;
}

.content-layout {
  display: grid;
  grid-template-columns: 172px minmax(0, 1fr);
  align-items: start;
  gap: 60px;
  padding-top: 38px;
  border-top: 1px solid var(--rule);
}

.section-nav {
  position: sticky;
  top: 34px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.section-nav .nav-label {
  margin-bottom: 17px;
}

.section-nav > nav {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.section-nav a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  font-size: 13px;
  text-decoration: none;
}

.section-nav a:hover {
  text-decoration: underline;
}

.section-nav a span {
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.sidebar-sponsors {
  width: 100%;
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--rule);
}

.sidebar-sponsors .nav-label { margin-bottom: 18px; }
.sponsor-logos { display: flex; flex-direction: column; align-items: flex-start; gap: 22px; }
.sidebar-sponsors a { display: block; max-width: 100%; padding: 0; }
.sponsor-logos img { height: auto; max-width: 100%; object-fit: contain; }
.sponsor-logo-fwf { width: 172px; }
.sponsor-logo-aei { width: 124px; }

.content {
  min-width: 0;
}

.publication-section,
.funding-section,
.teaching-section {
  margin-bottom: 62px;
  scroll-margin-top: 32px;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  margin-bottom: 12px;
}

.section-heading .eyebrow {
  margin-bottom: 7px;
}

.section-heading h2,
.teaching-section > h2,
.funding-section > h2 {
  color: var(--accent);
  font-family: var(--serif);
  font-size: 32px;
  line-height: 1.2;
  letter-spacing: -0.03em;
}

.section-count {
  padding-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.section-intro {
  margin-top: 12px;
  margin-bottom: 23px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.75;
}

.publication {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 18px;
  padding-block: 27px;
  border-bottom: 1px solid var(--rule);
}

.pub-number {
  padding-top: 5px;
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.03em;
}

.pub-body {
  min-width: 0;
}

.pub-title {
  color: var(--accent);
  font-family: var(--serif);
  font-size: 21px;
  line-height: 1.4;
  letter-spacing: -0.014em;
  overflow-wrap: anywhere;
}

.pub-title a {
  text-decoration: none;
}

.pub-title a:hover {
  text-decoration: underline;
  text-decoration-thickness: 1px;
}

.pub-authors {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.pub-details {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 15px;
  margin-top: 12px;
  font-size: 12px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.pub-details > * {
  min-width: 0;
  max-width: 100%;
}

.pub-details cite {
  font-style: normal;
}

.pub-status {
  padding: 2px 7px;
  border-radius: 2px;
  color: var(--accent);
  background: var(--soft);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.pub-year {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.pub-link {
  font-weight: 500;
  text-decoration-color: #99aabd;
}

.pub-images {
  grid-column: 2 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  margin-top: 12px;
  min-width: 0;
  max-width: 100%;
}

.figure-link {
  display: block;
  width: 160px;
  max-width: 100%;
  line-height: 0;
  cursor: default;
}

.pub-images img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  max-height: none;
  object-fit: contain;
  mix-blend-mode: multiply;
}

.figure--aomoto { width: 130px; }
.figure--coxeter { width: 260px; }
.figure--cone { width: 100px; }
.figure--mean-section { width: 180px; }
.figure--plank { width: 230px; }
.figure--hadamard { width: 110px; }


/* Progressive enhancement: the original images supply layout and fallback. */
.rotating-figure { max-width: 100%; min-width: 0; flex: 0 1 auto; }
.rotating-figure[data-rotation="aomoto"] { width: 130px; }
.rotating-figure[data-rotation="coxeter"] { width: 260px; }
.rotating-figure > .figure-link { position: relative; width: 100%; }
.rotation-canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; pointer-events: none; }
.rotating-figure.is-rendered .rotation-canvas { opacity: 1; }
.rotating-figure.is-rendered .figure-link > img { opacity: 0; }
.rotation-point-label { display: none; position: absolute; transform: translate(4px, -1px); color: #111; font: italic 12px/1 Georgia, serif; pointer-events: none; }
.rotating-figure.is-rendered .rotation-point-label:not([hidden]) { display: block; }
@media print {
  .rotating-figure.is-rendered .figure-link > img { opacity: 1; }
  .rotation-canvas, .rotation-point-label { display: none !important; }
}

.funding-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  margin-top: 24px;
}

.funding-item {
  display: flex;
  flex-direction: column;
  align-items: start;
  padding: 25px 26px;
  background: var(--soft);
  border-top: 2px solid #90a4bc;
}

.funding-item .grant-label,
.funding-item .grant-meta {
  color: #53647a;
}

.funding-item h3 {
  margin-top: 12px;
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1.35;
}

.funding-item > p:not(.grant-label) {
  margin-top: 13px;
  font-size: 13px;
  line-height: 1.75;
}

.grant-meta {
  margin-top: 13px;
  color: var(--muted);
  font-size: 12px;
}

.grant-logo {
  width: 160px;
  max-width: 100%;
  height: auto;
  max-height: 65px;
  margin-top: 23px;
  object-fit: contain;
  object-position: left center;
}

.teaching-hero {
  grid-template-columns: minmax(0, 1fr);
  padding-block: 70px 65px;
}

.teaching-hero h1 {
  font-size: clamp(2.75rem, 5vw, 4.15rem);
}

.teaching-hero .hero-summary {
  max-width: 670px;
}

.teaching-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 14px;
  line-height: 1.75;
}

.table-wrapper {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
}

.teaching-table th {
  padding: 13px 16px 13px 0;
  border-bottom: 1px solid #a7b5c5;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.teaching-table td {
  padding: 20px 20px 20px 0;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}

.teaching-table th:first-child,
.teaching-table td:first-child {
  width: 18%;
  font-variant-numeric: tabular-nums;
}

.teaching-table th:nth-child(2),
.teaching-table td:nth-child(2) {
  width: 29%;
}

.teaching-table td:last-child,
.teaching-table th:last-child {
  padding-right: 0;
}

.teaching-table td p + p {
  margin-top: 6px;
}

.teaching-table td ul {
  margin: 0;
  padding-left: 17px;
}

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

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px 30px;
  padding-block: 29px;
  color: var(--muted);
  font-size: 12px;
}

.footer-inner p:last-child {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
}

.back-to-top {
  text-decoration-color: #99aabd;
}

@media (max-width: 1050px) {
  .hero {
    grid-template-columns: minmax(0, 1fr) 220px;
    gap: 46px;
  }

  .teaching-hero {
    grid-template-columns: minmax(0, 1fr);
  }

  .content-layout {
    grid-template-columns: 145px minmax(0, 1fr);
    gap: 38px;
  }

  .publication {
    grid-template-columns: 25px minmax(0, 1fr);
    gap: 12px 16px;
  }

  .pub-images {
    grid-column: 2;
    justify-content: flex-start;
    margin-top: 5px;
  }

  .funding-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 800px) {
  .sidebar-sponsors { margin-top: 14px; padding-top: 20px; }
  .sidebar-sponsors .nav-label { margin-bottom: 18px; }
  .sponsor-logos { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 24px; }
  .sponsor-logo-fwf { width: 156px; }
  .sponsor-logo-aei { width: 100px; }

  .container {
    width: calc(100% - 56px);
  }

  .header-inner {
    min-height: 82px;
  }

  .hero {
    padding-block: 56px;
    grid-template-columns: minmax(0, 1fr) 200px;
    gap: 32px;
  }

  .hero h1 {
    font-size: 43px;
  }

  .hero-role {
    font-size: 15px;
  }

  .hero-affiliation {
    font-size: 14px;
  }

  .hero-summary {
    font-size: 15px;
  }

  .content-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 33px;
    padding-top: 24px;
  }

  .section-nav {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px 26px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--rule);
  }

  .section-nav .nav-label {
    margin: 0;
  }

  .section-nav > nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 7px 26px;
  }

  .section-nav a {
    gap: 8px;
  }

  .publication {
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 18px;
  }

  .pub-images {
    grid-column: 2 / -1;
    margin-top: 0;
  }

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

  .teaching-hero {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 600px) {
  .container {
    width: calc(100% - 40px);
  }

  .header-inner {
    min-height: 80px;
    flex-wrap: wrap;
    gap: 10px 20px;
    padding-block: 19px;
  }

  .site-brand {
    gap: 10px;
  }

  .brand-mark {
    width: 32px;
    height: 32px;
    flex-basis: 32px;
    font-size: 25px;
  }

  .brand-name {
    font-size: 14px;
  }

  .primary-nav {
    gap: 21px;
  }

  .primary-nav a {
    font-size: 13px;
    padding-block: 5px;
  }

  .hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
    padding-block: 42px 40px;
  }

  .hero h1 {
    max-width: 400px;
    font-size: clamp(2.5rem, 9vw, 3.4rem);
  }

  .hero .eyebrow {
    margin-bottom: 17px;
  }

  .hero-role {
    margin-top: 20px;
  }

  .hero-summary {
    margin-top: 18px;
  }

  .hero-portrait {
    display: block;
    width: 220px;
    justify-self: start;
  }

  .hero-portrait > img {
    width: 100%;
    height: auto;
    flex: none;
  }

  .figure--cone { max-width: calc((100% - 12px) / 2); }
  .figure--hadamard { width: 110px; }
  .figure--aomoto { width: 130px; }

  .profile-links {
    gap: 10px 20px;
    margin-top: 24px;
  }

  .section-nav {
    gap: 5px 20px;
  }

  .section-nav .nav-label {
    width: 100%;
    margin-bottom: 4px;
  }

  .section-heading h2,
  .teaching-section > h2,
  .funding-section > h2 {
    font-size: 29px;
  }

  .section-count {
    font-size: 11px;
  }

  .publication {
    grid-template-columns: 22px minmax(0, 1fr);
    gap: 12px;
    padding-block: 24px;
  }

  .pub-title {
    font-size: 20px;
  }

  .pub-images {
    grid-column: 2;
    margin-top: 5px;
  }

  .publication-section,
  .funding-section,
  .teaching-section {
    margin-bottom: 45px;
  }

  .funding-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }

  .funding-item {
    padding: 22px;
  }

  .teaching-table {
    font-size: 13px;
    line-height: 1.7;
  }

  .teaching-table th,
  .teaching-table td {
    padding: 15px 12px 15px 0;
  }

  .teaching-table th:first-child,
  .teaching-table td:first-child,
  .teaching-table th:nth-child(2),
  .teaching-table td:nth-child(2) {
    width: 25%;
  }

  .teaching-table td:last-child {
    overflow-wrap: anywhere;
  }

  .footer-inner {
    align-items: start;
    padding-block: 24px;
  }
}

@media (max-width: 380px) {
  .header-inner {
    align-items: start;
    flex-direction: column;
    gap: 10px;
  }

  .primary-nav {
    gap: 20px;
  }

  .hero h1 {
    font-size: 40px;
  }

  .section-heading {
    gap: 12px;
  }
}

/* Place compact research figures beside the text when there is room. */
@media (min-width: 701px) {
  .publication.has-figures {
    grid-template-columns: 28px minmax(0, 1fr) clamp(190px, 20vw, 260px);
  }

  .publication.has-figures > .pub-images {
    grid-column: 3;
    grid-row: 1;
    align-self: center;
    justify-content: flex-end;
    flex-wrap: nowrap;
    gap: 12px;
    margin-top: 0;
  }

  .pub-images .figure-link {
    flex: 0 1 auto;
    min-width: 0;
  }
}

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

@media print {
  .pub-images img { mix-blend-mode: normal; }
  :root {
    --paper: #fff;
    --ink: #111;
    --accent: #111;
    --muted: #444;
    --rule: #bbb;
  }

  body {
    font-size: 10pt;
  }

  .container {
    width: 100%;
  }

  .primary-nav,
  .section-nav,
  .back-to-top,
  .skip-link {
    display: none;
  }

  .header-inner {
    min-height: 45px;
  }

  .hero {
    grid-template-columns: minmax(0, 1fr) 120px;
    gap: 28px;
    padding-block: 25px;
  }

  .hero h1 {
    font-size: 32pt;
  }

  .hero .eyebrow,
  .hero-role,
  .hero-summary,
  .research-interests,
  .profile-links {
    margin-top: 10px;
    margin-bottom: 0;
  }

  .hero-role,
  .hero-summary,
  .hero-affiliation {
    font-size: 10pt;
  }

  .hero-portrait {
    width: 120px;
  }

  .content-layout {
    display: block;
    padding-top: 20px;
  }

  .publication-section,
  .teaching-section,
  .funding-section {
    margin-bottom: 25px;
  }

  .section-heading h2,
  .teaching-section > h2,
  .funding-section > h2 {
    font-size: 21pt;
  }

  .publication {
    padding-block: 14px;
    break-inside: avoid;
  }

  .pub-title {
    font-size: 13pt;
  }

  .pub-authors,
  .pub-details {
    font-size: 9pt;
    margin-top: 5px;
  }

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

  .funding-item {
    break-inside: avoid;
    padding: 15px;
    border: 1px solid var(--rule);
    background: #fff;
  }

  .teaching-hero {
    grid-template-columns: minmax(0, 1fr);
  }

  .teaching-table {
    display: table;
    font-size: 10pt;
  }

  .teaching-table thead {
    position: static;
    display: table-header-group;
    width: auto;
    height: auto;
    clip: auto;
    clip-path: none;
  }

  .teaching-table tbody {
    display: table-row-group;
  }

  .teaching-table tr {
    display: table-row;
    break-inside: avoid;
  }

  .teaching-table td,
  .teaching-table td:first-child,
  .teaching-table td:nth-child(2) {
    display: table-cell;
    width: auto;
    padding: 10px;
    border-bottom: 1px solid var(--rule);
  }

  .teaching-table td::before {
    content: none;
  }

  .footer-inner {
    padding-block: 15px;
  }
}

/* Direct interaction with the mathematical figures. */
.rotating-figure[data-rotation="plank"] { width: 230px; }
.rotating-figure[data-rotation="plank"].is-rendered { display: grid; grid-template-columns: 68px minmax(0, 1fr); gap: 4px 8px; align-items: center; }
.rotating-figure[data-rotation="plank"].is-rendered > .figure-link { grid-column: 2; grid-row: 1; width: 100%; max-width: 130px; height: auto; aspect-ratio: 1; margin-inline: auto; }
@media print {
  .rotating-figure[data-rotation="plank"].is-rendered { display: block; }
  .rotating-figure[data-rotation="plank"].is-rendered > .figure-link { width: 100%; max-width: none; height: auto; aspect-ratio: auto; }
}
.figure-link.is-interactive { cursor: move; touch-action: none; user-select: none; -webkit-user-select: none; }
.figure-link.is-interactive.is-dragging { cursor: grabbing; }
.zone-width-control { display: none; position: relative; grid-column: 1; grid-row: 1; width: 68px; height: 130px; color: var(--muted); font-size: 10px; line-height: 1.4; }
.rotating-figure.is-rendered .zone-width-control { display: block; }
.zone-width-heading { display: none; grid-column: 2; grid-row: 2; align-items: center; justify-content: center; gap: 8px; color: var(--muted); font-size: 10px; line-height: 1.4; }
.rotating-figure.is-rendered .zone-width-heading { display: flex; }
.zone-width-endpoints { position: absolute; inset: 0 28px 0 0; display: flex; flex-direction: column; justify-content: space-between; text-align: right; white-space: pre-line; }
.zone-width-heading output { color: var(--accent); font-variant-numeric: tabular-nums; }
.zone-width-slider { position: absolute; right: 0; display: block; width: 24px; height: 100%; margin: 0; padding: 0; writing-mode: vertical-lr; direction: rtl; appearance: none; -webkit-appearance: none; background: transparent; cursor: ns-resize; accent-color: var(--accent); touch-action: none; }
.zone-width-slider::-webkit-slider-runnable-track { width: 3px; height: 100%; border-radius: 3px; background: linear-gradient(to top, var(--accent) 0 var(--zone-progress), var(--rule) var(--zone-progress) 100%); }
.zone-width-slider::-webkit-slider-thumb { appearance: none; -webkit-appearance: none; width: 13px; height: 13px; margin-top: 0; margin-left: -5px; border: 2px solid var(--paper); border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.zone-width-slider::-moz-range-track { width: 3px; height: 100%; border-radius: 3px; background: var(--rule); }
.zone-width-slider::-moz-range-progress { width: 3px; background: var(--accent); }
.zone-width-slider::-moz-range-thumb { width: 10px; height: 10px; border: 2px solid var(--paper); border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.zone-width-slider:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
@media print { .zone-width-control, .zone-width-heading { display: none !important; } }
.rotation-focus-ring { position: absolute; inset-block: 0; left: 0; border: 2px solid var(--accent); border-radius: 50%; opacity: 0; pointer-events: none; }
.figure-link:focus-visible .rotation-focus-ring { opacity: .65; }
@media print { .rotation-focus-ring { display: none; } }

[data-diagram] {
  position: relative;
}
[data-diagram] > img {
  display: block;
}
.diagram-motion-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
  mix-blend-mode: multiply;
}
.diagram-motion-layer[hidden] {
  display: none;
}
@media (prefers-reduced-motion: reduce), print {
  .diagram-motion-layer { display: none; }
}

/* Interactive cone figures retain their existing 100px image-link dimensions. */
.cone-figure {
  position: relative;
}

.cone-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
}

.cone-figure.is-cone-rendered {
  cursor: move;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.cone-figure.is-cone-rendered > img {
  opacity: 0;
}

.cone-figure.is-cone-rendered .cone-canvas {
  opacity: 1;
}

.cone-figure.is-cone-dragging {
  cursor: grabbing;
}

@media print {
  .cone-figure.is-cone-rendered > img {
    opacity: 1;
  }

  .cone-canvas {
    display: none !important;
  }
}

/* Matching navy navigation surfaces; append after the shared stylesheet. */
.site-header,
.section-nav {
  color: #f7f7f2;
  background: #17365d;
}

.site-header {
  border-bottom-color: #17365d;
}

.site-header .site-brand,
.site-header .primary-nav a:hover,
.site-header .primary-nav a[aria-current="page"] {
  color: #fff;
}

.site-header .brand-mark {
  border-color: #99b0ca;
}

.site-header .primary-nav a {
  color: #d5dfec;
}

.site-header .primary-nav a:hover,
.site-header .primary-nav a[aria-current="page"] {
  border-bottom-color: #fff;
}

/* Expand into the existing gutters so sidebar content keeps its width. */
.section-nav {
  width: calc(100% + 40px);
  margin-inline: -20px;
  padding: 25px 20px;
  border: 0;
  border-radius: 3px;
}

.section-nav a {
  color: #fff;
  text-decoration-color: #c7d4e5;
}

.section-nav a:hover {
  color: #fff;
  text-decoration-color: #fff;
}

.section-nav .nav-label,
.section-nav a span {
  color: #c7d4e5;
}

.section-nav .sidebar-sponsors {
  border-top-color: #526c8b;
}

/* Both source logos have transparent backgrounds; grants retain their colours. */
.section-nav .sponsor-logos img {
  filter: brightness(0) invert(1);
}

.site-header a:focus-visible,
.section-nav a:focus-visible {
  outline-color: #f4d79d;
}

@media (min-width: 801px) and (max-width: 1050px) {
  .section-nav {
    width: calc(100% + 32px);
    margin-inline: -16px;
    padding: 23px 16px;
  }
}

@media (max-width: 800px) {
  .section-nav {
    width: 100%;
    margin-inline: 0;
    padding: 22px;
    border: 0;
  }

  .section-nav > .nav-label {
    flex-basis: 100%;
    margin-bottom: 4px;
  }

  .section-nav > nav {
    gap: 7px 24px;
  }

  .section-nav .sidebar-sponsors {
    margin-top: 15px;
    padding-top: 18px;
  }

  .section-nav .sidebar-sponsors .nav-label {
    margin-bottom: 16px;
  }

  .section-nav .sponsor-logos {
    gap: 20px;
  }
}

@media (max-width: 600px) {
  .section-nav {
    padding: 20px;
  }

  .section-nav > nav {
    gap: 5px 18px;
  }

  .section-nav .sponsor-logos {
    gap: 18px;
  }

  .section-nav .sponsor-logo-fwf {
    width: 136px;
  }

  .section-nav .sponsor-logo-aei {
    width: 86px;
  }
}

@media print {
  .site-header {
    color: #111;
    background: #fff;
    border-bottom-color: #bbb;
  }

  .site-header .site-brand {
    color: #111;
  }

  .site-header .brand-mark {
    border-color: #888;
  }

  .section-nav .sponsor-logos img {
    filter: none;
  }
}

/* The live Coxeter gallery accompanies the name on both pages. */
.header-identity {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px 30px;
  min-width: 0;
}

.header-identity .site-brand {
  flex: 0 0 auto;
}

.header-figures {
  width: 232px;
  max-width: 100%;
  flex: 0 0 auto;
  line-height: 0;
}

.header-figures .rotating-figure[data-rotation="coxeter"],
.header-figures .figure-link {
  width: 100%;
}

.header-figures img {
  display: block;
  width: 100%;
  height: auto;
}

.site-header .rotation-focus-ring {
  border-color: #fff;
}

/* Academic profiles sit directly on the navy sidebar, below its heading. */
.section-nav > .sidebar-profiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) minmax(0, 1.9fr) minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  width: 100%;
  max-width: 216px;
  margin: 0 0 20px;
  padding: 0;
  background: transparent;
  flex: 0 0 auto;
}

.section-nav .sidebar-profiles a,
.section-nav .sidebar-profiles a.profile-icon-arxiv {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  width: 100%;
  height: 34px;
  padding: 0;
  gap: 0;
}

.section-nav .sidebar-profiles img {
  width: 28px;
  height: 28px;
  max-width: 100%;
  object-fit: contain;
}

.section-nav .sidebar-profiles .profile-icon-arxiv img {
  width: 54px;
  height: 25px;
  filter: brightness(0) invert(1);
}

.section-nav .sidebar-profiles a:hover {
  background: rgb(255 255 255 / 10%);
}

.section-nav .sidebar-profiles a:focus-visible {
  outline-color: #f4d79d;
}

@media screen {
  .site-header .header-inner {
    flex-wrap: wrap;
    gap: 14px 32px;
    padding-block: 17px;
  }

  .site-header .primary-nav {
    flex: 0 0 auto;
  }

  .hero:not(.teaching-hero) {
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 64px;
  }

  .hero-portrait {
    width: 320px;
  }
}

@media screen and (max-width: 1050px) {
  .header-identity {
    gap: 16px 24px;
  }

  .hero:not(.teaching-hero) {
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 36px;
  }

  .hero-portrait {
    width: 300px;
  }
}

@media screen and (max-width: 800px) {
  .site-header .header-inner {
    gap: 14px 24px;
  }

  .hero:not(.teaching-hero) {
    grid-template-columns: minmax(0, 1fr) 260px;
    gap: 28px;
  }

  .hero-portrait {
    width: 260px;
  }

  .section-nav > .sidebar-profiles {
    margin-bottom: 12px;
  }

  .section-nav > .sidebar-profiles + nav {
    flex-basis: 100%;
  }
}

@media screen and (max-width: 600px) {
  .site-header .header-inner {
    align-items: flex-start;
    gap: 18px;
    padding-block: 21px;
  }

  .header-identity {
    gap: 18px 24px;
  }

  .header-figures {
    width: 232px;
  }

  .hero:not(.teaching-hero) {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
  }

  .hero-portrait {
    width: 260px;
    justify-self: start;
  }
}

/* The portrait and name start on the same row beneath the research heading. */
.hero > .eyebrow {
  grid-column: 1 / -1;
  margin-bottom: 0;
}

@media screen {
  .hero:not(.teaching-hero) {
    align-items: start;
    row-gap: 22px;
  }

  .hero-portrait {
    align-self: start;
  }
}

@media screen and (max-width: 600px) {
  .hero-portrait {
    margin-top: 10px;
  }
}

@media print {
  .hero:not(.teaching-hero) {
    row-gap: 12px;
    align-items: start;
  }

  .hero > .eyebrow {
    margin: 0;
  }

  .hero-portrait {
    align-self: start;
  }

  .header-figures,
  .section-nav > .sidebar-profiles {
    display: none;
  }
}

/* Research support stays beside the first articles, with complete grant details. */
.content-layout--research {
  grid-template-columns: 216px minmax(0, 1fr);
  column-gap: 48px;
}

.section-nav--grants {
  position: static;
}

.sidebar-grants {
  width: 100%;
  min-width: 0;
  margin-top: 19px;
  padding-top: 20px;
  border-top: 1px solid #526c8b;
  scroll-margin-top: 28px;
}

.sidebar-grants > .nav-label {
  margin-bottom: 7px;
}

.sidebar-grants h2 {
  color: #fff;
  font-family: var(--serif);
  font-size: 21px;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.sidebar-grants .funding-grid {
  grid-template-columns: minmax(0, 1fr);
  gap: 21px;
  margin-top: 21px;
}

.sidebar-grants .funding-item {
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.sidebar-grants .funding-item + .funding-item {
  padding-top: 20px;
  border-top: 1px solid #526c8b;
}

.sidebar-grants .grant-label {
  color: #c7d4e5;
  font-size: 10px;
  line-height: 1.6;
  letter-spacing: 0.09em;
}

.sidebar-grants .funding-item h3 {
  margin-top: 8px;
  color: #fff;
  font-size: 18px;
  line-height: 1.3;
}

.sidebar-grants .funding-item > p:not(.grant-label) {
  margin-top: 9px;
  color: #e0e8f2;
  font-size: 12px;
  line-height: 1.6;
}

.sidebar-grants .grant-meta {
  overflow-wrap: anywhere;
}

.sidebar-grants .grant-meta a {
  display: inline;
  padding: 0;
  color: #fff;
  font-size: inherit;
  text-decoration: underline;
  text-decoration-color: #9bb0cb;
}

.sidebar-grants .grant-funder {
  display: block;
  max-width: 100%;
  padding: 0;
}

.sidebar-grants .grant-logo {
  width: 148px;
  max-height: 55px;
  margin-top: 14px;
  filter: brightness(0) invert(1);
}

.sidebar-grants .grant-logo-aei {
  width: 106px;
}

/* Short viewports use normal page scrolling; tall screens can pin the panel. */
@media (min-width: 1051px) and (min-height: 900px) {
  .section-nav--grants {
    position: sticky;
    top: 24px;
    max-height: calc(100dvh - 48px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #9bb0cb transparent;
  }
}

@media (min-width: 801px) and (max-width: 1050px) {
  .content-layout--research {
    grid-template-columns: 188px minmax(0, 1fr);
    column-gap: 32px;
  }
}

@media (max-width: 800px) {
  .content-layout--research {
    grid-template-columns: minmax(0, 1fr);
  }
  .sidebar-grants {
    flex-basis: 100%;
    margin-top: 15px;
    padding-top: 18px;
  }
  .sidebar-grants .funding-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 25px;
  }
  .sidebar-grants .funding-item + .funding-item {
    padding-top: 0;
    border-top: 0;
  }
}

@media (max-width: 520px) {
  .sidebar-grants .funding-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }
  .sidebar-grants .funding-item + .funding-item {
    padding-top: 18px;
    border-top: 1px solid #526c8b;
  }
}

@media print {
  .section-nav--grants {
    display: block;
    position: static;
    width: 100%;
    max-height: none;
    margin: 0 0 24px;
    padding: 0;
    overflow: visible;
    color: #111;
    background: transparent;
  }
  .section-nav--grants > .nav-label,
  .section-nav--grants > nav {
    display: none;
  }
  .sidebar-grants {
    margin: 0;
    padding: 0;
    border: 0;
  }
  .sidebar-grants .funding-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 28px;
  }
  .sidebar-grants .funding-item + .funding-item {
    padding-top: 0;
    border-top: 0;
  }
  .sidebar-grants h2,
  .sidebar-grants .funding-item h3,
  .sidebar-grants .grant-label,
  .sidebar-grants .nav-label,
  .sidebar-grants .grant-meta a,
  .sidebar-grants .funding-item > p:not(.grant-label) {
    color: #111;
  }
  .sidebar-grants .grant-logo {
    filter: none;
  }
}
