:root {
  color-scheme: light;
  --canvas: #fbfcfa;
  --ink: #2b2f33;
  --muted: #64717d;
  --subtle: #8b96a0;
  --line: #dfe5e9;
  /* The one accent colour: links, highlights, dates, active states. Change it here only. */
  --accent: #1f6672;
  --accent-soft: #e9f1f2;
  --accent-line: rgba(31, 102, 114, 0.3);
  --accent-focus: rgba(31, 102, 114, 0.25);
  --accent-mark: rgba(31, 102, 114, 0.14);
  --sans: "Google Sans Flex", "Google Sans", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

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

.site-shell {
  min-height: 100vh;
}

.nav-link {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  padding: 4px 0 5px;
  border-bottom: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  transition: color 160ms ease, border-color 160ms ease;
}

.nav-link:hover,
.nav-link.is-active {
  border-color: var(--accent);
  color: var(--ink);
}

.site-layout {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: clamp(58px, 8vw, 120px);
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 72px 40px 0;
}

.profile-sidebar {
  position: sticky;
  top: 28px;
  align-self: start;
  padding-top: 0;
}

.profile-name {
  margin: 0;
  font-family: var(--sans);
  font-weight: 500;
  font-size: 1.7rem;
  letter-spacing: -0.04em;
  line-height: 1.1;
}

.profile-name-link {
  display: inline-block;
}

.profile-role {
  margin: 8px 0 0;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
}



.profile-nav {
  display: grid;
  gap: 1px;
  margin-top: 33px;
  padding-top: 20px;
  border-top: 0;
}

.profile-nav .nav-link {
  justify-content: space-between;
  width: 100%;
  padding: 5px 0;
  border-bottom: 0;
  font-size: 13px;
}

.profile-links {
  display: flex;
  flex-wrap: wrap;
  gap: 13px;
  margin-top: 25px;
}

.profile-links a {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.profile-links a:hover,
.text-link:hover,
.back-link:hover {
  color: var(--accent);
}

.profile-meta {
  margin: 26px 0 0;
  color: var(--subtle);
  font-size: 11px;
}

.page {
  min-width: 0;
}

.content-wrap {
  width: min(100%, 760px);
  margin: 0 auto;
}

.hero {
  padding: 0 0 28px;
}

.hero h2,
.section-heading h1,
.post-header h1,
.error-state h1 {
  max-width: 720px;
  margin: 0;
  font-family: var(--sans);
  font-size: clamp(2.2rem, 3.5vw, 3.2rem);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1.1;
}

.hero-intro {
  max-width: 570px;
  margin: 23px 0 0;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  margin-top: 28px;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 750;
  transition: color 160ms ease;
}

.section {
  padding: 20px 0;
  border-top: 0;
}

.section-about,
.section-first {
  padding-top: 38px;
}

.section-label {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.section-label a {
  margin-left: auto;
  color: var(--ink);
  font-size: 11px;
  letter-spacing: 0;
  text-transform: none;
}

.section-title {
  max-width: 680px;
  margin: 0 0 18px;
  font-family: var(--sans);
  font-size: 1.6rem;
  letter-spacing: -0.045em;
  line-height: 1.12;
}

.body-copy {
  max-width: 680px;
  color: var(--muted);
}

.body-copy p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.8;
}

.body-copy p + p {
  margin-top: 1em;
}

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

.post-card {
  display: flex;
  min-height: 225px;
  flex-direction: column;
  padding: 23px;
  border: 1px solid var(--line);
  transition: border-color 160ms ease;
}

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

.post-card-top {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  color: var(--subtle);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.post-reading {
  white-space: nowrap;
}

.post-card h3 {
  max-width: 360px;
  margin: 28px 0 8px;
  font-family: var(--sans);
  font-size: 1.4rem;
  font-weight: 400;
  letter-spacing: -0.035em;
  line-height: 1.15;
}

.post-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.post-card .text-link {
  margin-top: auto;
  padding-top: 22px;
}

.section-heading {
  padding: 0 0 24px;
}

.section-heading h1 {
  font-size: clamp(2.2rem, 3.5vw, 3.2rem);
}

.section-description {
  max-width: 560px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.75;
}

.publication-list,
.talk-list,
.cv-list {
  border-top: 0;
}

.research-list {
  border-top: 0;
}

.research-area {
  padding: 12px 0;
  border-bottom: 0;
}

.research-area h3 {
  margin: 0;
  font-family: var(--sans);
  font-size: 1.3rem;
  font-weight: 400;
  letter-spacing: -0.035em;
}

.research-area p {
  max-width: 560px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.collection-list,
.portfolio-list {
  border-top: 0;
}

.collection-entry,
.portfolio-entry {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 24px;
  padding: 12px 0;
  border-bottom: 0;
}

.collection-period,
.portfolio-year {
  color: var(--accent);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.collection-entry h3,
.portfolio-entry h3 {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.25;
}

.collection-meta,
.collection-details,
.portfolio-entry p {
  max-width: 560px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.collection-meta {
  color: var(--accent);
}

.collection-entry .text-link,
.portfolio-entry .text-link {
  margin-top: 15px;
}

.publication,
.talk,
.cv-entry {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 24px;
  padding: 12px 0;
  border-bottom: 0;
}

.publication-year,
.talk-date,
.cv-period {
  color: var(--accent);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.publication h3,
.talk h3,
.cv-entry h3 {
  margin: 0;
  font-family: var(--sans);
  font-size: 1.3rem;
  font-weight: 400;
  letter-spacing: -0.035em;
  line-height: 1.2;
}

.publication-authors,
.publication-venue,
.talk-event,
.talk-meta,
.talk-description,
.cv-organization,
.cv-details {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.publication-venue,
.talk-meta {
  color: var(--subtle);
  font-style: italic;
}

.publication-actions,
.talk-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 16px;
}

.copy-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
}

.copy-button:hover {
  color: var(--accent);
}

.cv-section {
  padding-top: 33px;
}

.cv-organization {
  color: var(--accent);
}

.cv-details {
  max-width: 520px;
}

.contact-copy {
  max-width: 560px;
  color: var(--muted);
}

.contact-copy > p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.8;
}

.contact-email {
  display: inline-block;
  margin-top: 20px;
  color: var(--accent);
  font-size: 1rem;
  font-weight: 700;
}

.contact-links-section {
  padding-top: 33px;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
}

code {
  padding: 2px 5px;
  border-radius: 3px;
  background: var(--accent-soft);
  color: var(--ink);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.88em;
}

.empty-state {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 20px 0 10px;
  color: var(--muted);
}

.empty-mark {
  display: grid;
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--accent);
  font-size: 15px;
  line-height: 1;
}

.empty-state h3 {
  margin: 0;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.2rem;
  font-weight: 400;
  letter-spacing: -0.035em;
}

.empty-state p {
  max-width: 540px;
  margin: 5px 0 8px;
  font-size: 13px;
}

.empty-state code {
  color: var(--accent);
  font-size: 11px;
}

.page-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 25px 0 34px;
  color: var(--subtle);
  font-size: 11px;
}

.content-wrap-post {
  padding-top: 25px;
}

.back-link {
  display: inline-flex;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.post-article {
  max-width: 700px;
  padding: 88px 0 125px;
}

.post-header {
  padding-bottom: 44px;
  border-bottom: 0;
}

.post-meta,
.error-label {
  margin: 0 0 14px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
}

.post-meta-divider {
  padding: 0 6px;
  color: var(--subtle);
}

.post-header h1 {
  font-size: clamp(2.6rem, 5vw, 4.7rem);
}

.post-dek {
  max-width: 600px;
  margin: 23px 0 0;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.75;
}

.markdown-body {
  padding-top: 54px;
  color: #3e4b55;
  font-size: 0.96rem;
  line-height: 1.85;
}

.markdown-body p,
.markdown-body ul,
.markdown-body ol,
.markdown-body blockquote,
.markdown-body pre,
.markdown-body hr {
  margin: 0 0 24px;
}

.markdown-body h2,
.markdown-body h3,
.markdown-body h4 {
  margin: 43px 0 14px;
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 400;
  letter-spacing: -0.04em;
  line-height: 1.2;
}

.markdown-body h2 { font-size: 1.75rem; }
.markdown-body h3 { font-size: 1.4rem; }
.markdown-body h4 { font-size: 1.3rem; }

.markdown-body a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: var(--accent-line);
  text-underline-offset: 3px;
}

.markdown-body strong { color: var(--ink); }
.markdown-body ul,
.markdown-body ol { padding-left: 25px; }
.markdown-body li { padding-left: 6px; margin-bottom: 8px; }

.markdown-body blockquote {
  padding: 4px 0 4px 20px;
  border-left: 2px solid var(--accent);
  color: var(--muted);
}

.markdown-body pre {
  overflow-x: auto;
  padding: 16px;
  border: 1px solid var(--line);
  background: #f5f7f8;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.6;
}

.markdown-body pre code {
  padding: 0;
  background: transparent;
}

.markdown-body hr { border: 0; border-top: 0; }
.markdown-body img { display: block; max-width: 100%; height: auto; }

.page-loader,
.post-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40vh;
  color: var(--muted);
  font-size: 13px;
}

.loader-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

.error-state {
  max-width: 620px;
  padding: 80px 0;
}

.error-state h1 { font-size: clamp(2.5rem, 5vw, 4.3rem); }
.error-state p:not(.error-label) { margin-top: 22px; color: var(--muted); }
.error-state code { display: inline-block; margin-top: 18px; }

/* The deployed page ships with the About page already drawn, so without JavaScript
   it stays readable; this bar only explains why the other pages won't open. */
.noscript-message {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 10px 25px;
  border-top: 1px solid var(--line);
  background: var(--canvas);
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.route-pending #app {
  visibility: hidden;
}

@media (max-width: 820px) {
  .site-layout {
    display: block;
    padding: 32px 24px 0;
  }

  .profile-sidebar {
    position: static;
    padding: 0 0 30px;
    border-bottom: 0;
  }


  .profile-nav { max-width: 420px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 22px; padding-top: 15px; }
  .profile-links { margin-top: 18px; }
  .profile-meta { margin-top: 15px; }

  .content-wrap { width: 100%; }
  .hero { padding: 0 0 24px; }
  .hero h2,
  .section-heading h1,
  .post-header h1 { letter-spacing: -0.045em; }

  .section { padding: 20px 0; }
  .section-about,
  .section-first,
  .cv-section { padding-top: 28px; }
  .section-heading { padding: 0 0 20px; }
  .post-grid { grid-template-columns: 1fr; }
  .publication,
  .talk,
  .cv-entry { grid-template-columns: 1fr; gap: 7px; }
  .content-wrap-post { padding-top: 24px; }
  .post-article { padding: 60px 0 85px; }
}

@media (max-width: 480px) {
  .profile-nav { grid-template-columns: 1fr 1fr; }
  .nav-link { font-size: 12px; }
  .hero h2 { font-size: clamp(2.45rem, 12vw, 3.8rem); }
  .page-footer { flex-direction: column; gap: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

/* Fixed rail, compact spacing, and responsive navigation */
.site-shell {
  min-height: 100vh;
  padding-bottom: 58px;
}

.site-layout {
  gap: clamp(44px, 6vw, 84px);
  padding: 32px 40px 72px;
}

.profile-sidebar {
  position: fixed;
  top: 0;
  bottom: 0;
  left: max(40px, calc((100vw - 1180px) / 2 + 40px));
  z-index: 80;
  width: 210px;
  padding: 30px 24px 26px 0;
  border-right: 1px solid var(--line);
  background: var(--canvas);
}

.profile-topbar {
  display: block;
}

.profile-menu {
  display: flex;
  min-height: calc(100vh - 94px);
  flex-direction: column;
}



.profile-nav {
  margin-top: 27px;
  padding-top: 17px;
}

.profile-links {
  gap: 8px;
  margin-top: 22px;
}

.profile-links a {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  transition: border-color 160ms ease, color 160ms ease;
}

.profile-links a:hover {
  border-color: var(--accent);
}

.profile-meta {
  margin-top: auto;
  padding-top: 22px;
}

.page {
  grid-column: 2;
}

.hero {
  padding-bottom: 28px;
}

.hero h2,
.section-heading h1,
.post-header h1,
.error-state h1 {
  font-size: clamp(1.8rem, 2.7vw, 2.4rem);
}

.section {
  padding: 20px 0;
}

.section-about,
.section-first {
  padding-top: 30px;
}

.section-label {
  margin-bottom: 10px;
}

.section-heading {
  padding-bottom: 24px;
}

.section-description {
  margin-top: 17px;
}

.post-article {
  padding-top: 62px;
  padding-bottom: 92px;
}

.page-footer {
  display: none;
}

.menu-toggle,
.menu-toggle-input,
.menu-scrim {
  display: none;
}

.social-icon {
  display: inline-flex;
  width: 16px;
  height: 16px;
  align-items: center;
  justify-content: center;
}

.social-icon svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.contact-link {
  gap: 8px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  padding: 0;
  border: 0;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}



@media (max-width: 820px) {
  .site-shell {
    padding-bottom: 50px;
  }

  .site-layout {
    display: block;
    padding: 88px 24px 64px;
  }

  .profile-sidebar {
    position: fixed;
    inset: 0 0 auto;
    width: 100%;
    height: 64px;
    padding: 0;
    border-right: 0;
    border-bottom: 0;
    background: rgba(251, 252, 250, 0.98);
  }

  .profile-topbar {
    position: relative;
    z-index: 3;
    display: flex;
    height: 64px;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
  }

  .profile-name {
    font-size: 1.4rem;
  }

  .profile-role {
    margin-top: 3px;
    font-size: 11px;
  }

  .menu-toggle {
    display: flex;
    width: 34px;
    height: 34px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 1px solid var(--line);
    border-radius: 50%;
    color: var(--ink);
    cursor: pointer;
  }

  .menu-toggle span {
    display: block;
    width: 13px;
    height: 1px;
    background: currentColor;
    transition: transform 160ms ease;
  }

  .menu-toggle-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
  }

  .profile-menu {
    position: fixed;
    top: 64px;
    bottom: 0;
    left: 0;
    z-index: 2;
    width: min(86vw, 320px);
    min-height: 0;
    padding: 25px 24px 22px;
    border-right: 1px solid var(--line);
    background: var(--canvas);
    box-shadow: 12px 0 28px rgba(31, 41, 51, 0.08);
    transform: translateX(-105%);
    transition: transform 200ms ease;
  }

  .menu-scrim {
    position: fixed;
    inset: 64px 0 0;
    z-index: 1;
    display: block;
    background: rgba(31, 41, 51, 0.16);
    opacity: 0;
    pointer-events: none;
    transition: opacity 200ms ease;
  }

  .menu-toggle-input:checked ~ .profile-menu {
    transform: translateX(0);
  }

  .menu-toggle-input:checked ~ .menu-scrim {
    opacity: 1;
    pointer-events: auto;
  }



  .profile-nav {
    grid-template-columns: 1fr;
    margin-top: 23px;
    padding-top: 15px;
  }

  .profile-links {
    margin-top: 18px;
  }

  .profile-meta {
    margin-top: auto;
  }

  .page {
    grid-column: auto;
  }

  .hero {
    padding: 0 0 24px;
  }

  .section {
    padding: 18px 0;
  }

  .section-about,
  .section-first {
    padding-top: 25px;
  }

  .section-heading {
    padding: 0 0 20px;
  }



}

@media (max-width: 480px) {
  .site-layout {
    padding-right: 20px;
    padding-left: 20px;
  }

  .profile-topbar {
    padding-right: 20px;
    padding-left: 20px;
  }
}

/* Content uses a quieter scale; navigation remains easy to scan. */
.profile-nav .nav-link {
  font-size: 15px;
}

.profile-nav .nav-link.is-active {
  font-size: 16px;
  color: var(--ink);
}

.page .text-link,
.page .post-card p,
.page .research-area p,
.page .collection-meta,
.page .collection-details,
.page .portfolio-entry p,
.page .publication-authors,
.page .publication-venue,
.page .talk-event,
.page .talk-meta,
.page .talk-description,
.page .cv-organization,
.page .cv-details,
.page .empty-state p,
.page .back-link {
  font-size: 12px;
}

.post-card h3,
.collection-entry h3,
.portfolio-entry h3 {
  font-size: 1.25rem;
}

/* Markdown blocks do not introduce separator rules. */
.markdown-body pre {
  border: 0;
}

.markdown-body hr {
  display: none;
}

/* Single collections start immediately after the page introduction. */
.section-first,
.section-about {
  padding-top: 0;
}

.cv-section {
  padding: 12px 0;
}

.section-heading + .cv-section {
  padding-top: 0;
}

.publication-authors,
.publication-venue,
.cv-organization,
.cv-details {
  margin-top: 4px;
}

.publication-actions,
.talk-links {
  margin-top: 8px;
}

.contact-links {
  margin-top: 18px;
}

/* No horizontal separator rules, including fixed chrome and Markdown. */
.section,
.profile-nav,
.profile-sidebar,
.publication-list,
.talk-list,
.cv-list,
.research-list,
.collection-list,
.portfolio-list,
.publication,
.talk,
.cv-entry,
.research-area,
.collection-entry,
.portfolio-entry,
.post-header {
  border-top: 0;
  border-bottom: 0;
}

/* Spacing hierarchy: related text, entries, categories, then major sections. */
.content-wrap {
  --text-gap: 10px;
  --entry-gap: 24px;
  --category-gap: 36px;
  --section-gap: 52px;
}

.hero,
.section-heading,
.content-wrap > .section {
  padding: 0;
}

.hero + .section,
.section-heading + .section,
.content-wrap > .section + .section {
  margin-top: var(--category-gap);
}

.hero + .section,
.content-wrap > .section-about + .section {
  margin-top: var(--section-gap);
}

.hero-intro,
.section-description,
.post-dek {
  margin-top: var(--text-gap);
}

.hero-actions,
.contact-links,
.contact-email {
  margin-top: 12px;
}

.section-label {
  margin-bottom: 14px;
}

.publication-list,
.cv-list,
.talk-list,
.collection-list,
.portfolio-list,
.research-list {
  display: grid;
  gap: var(--entry-gap);
}

.publication,
.cv-entry,
.talk,
.collection-entry,
.portfolio-entry,
.research-area {
  padding: 0;
}

.research-area p,
.collection-meta,
.collection-details,
.portfolio-entry p,
.talk-event,
.talk-meta,
.talk-description {
  margin-top: 4px;
}

.collection-entry .text-link,
.portfolio-entry .text-link {
  margin-top: 8px;
}

.research-list + .hero-actions {
  margin-top: var(--entry-gap);
}

.post-card {
  min-height: 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

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

.post-card h3 {
  margin: 14px 0 6px;
}

.post-card .text-link {
  padding-top: 16px;
}

.post-article {
  padding-top: var(--category-gap);
}

.post-header {
  padding-bottom: 0;
}

.post-meta {
  margin-bottom: var(--text-gap);
}

.markdown-body {
  padding-top: var(--category-gap);
}

.markdown-body > :first-child {
  margin-top: 0;
}

@media (max-width: 820px) {
  .content-wrap {
    --entry-gap: 20px;
    --category-gap: 28px;
    --section-gap: 40px;
  }

  .post-card {
    padding: 18px;
  }
}

/* Date, content, and actions form one entry; mobile preserves reading order. */
.publication,
.talk,
.collection-entry,
.portfolio-entry {
  grid-template-columns: 104px minmax(0, 1fr) 104px;
  gap: 20px;
  align-items: start;
}

.research-area {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 104px;
  gap: 20px;
  align-items: start;
}

.entry-links {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
}

.entry-links .text-link,
.entry-links .copy-button {
  margin: 0;
  text-align: left;
}

.publication > *,
.talk > *,
.collection-entry > *,
.portfolio-entry > *,
.research-area > * {
  min-width: 0;
  overflow-wrap: anywhere;
}

.entry-links:empty {
  display: none;
}

.contact-list {
  display: grid;
  gap: 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.contact-row {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.contact-row .social-icon {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  color: var(--accent);
}

.contact-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
}

.contact-row a,
.contact-missing {
  font-size: 13px;
  overflow-wrap: anywhere;
  color: var(--muted);
}

.contact-row a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.update-list {
  display: grid;
  gap: 16px;
}

.update-entry {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr);
  gap: 20px;
}

.update-entry time {
  font-size: 12px;
  color: var(--accent);
}

.update-entry p {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

@media (max-width: 820px) {
  .publication,
  .talk,
  .collection-entry,
  .portfolio-entry,
  .research-area {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  .entry-links {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px 16px;
  }

  .update-entry {
    grid-template-columns: 104px minmax(0, 1fr);
    gap: 12px;
  }
}

/* Shared typography for the same content roles across all collections. */
.page :is(.publication, .talk, .collection-entry, .portfolio-entry, .research-area, .cv-entry, .post-card) h3 {
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.25rem;
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.25;
}

.page :is(.publication-year, .talk-date, .collection-period, .portfolio-year, .cv-period, .post-date, .post-meta),
.update-entry time {
  color: var(--accent);
  font-size: 12px;
  font-weight: 400;
  font-style: normal;
  font-variant-numeric: tabular-nums;
  line-height: 1.6;
}

.page :is(.publication-year, .talk-date, .collection-period, .portfolio-year, .post-date),
.update-entry time {
  white-space: nowrap;
  overflow-wrap: normal;
}

.page :is(.talk-event, .talk-meta, .collection-meta, .cv-organization, .publication-venue) {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  font-style: normal;
  line-height: 1.6;
}

.talk-context {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.talk-context-dot {
  color: var(--subtle);
  font-weight: 400;
}

.page .collection-meta,
.page .cv-organization {
  font-weight: 700;
}

.cv-details {
  white-space: pre-line;
}

/* Blog posts reuse the gallery's album cards (.album-grid / .album-card / .album-cover). */
.post-cover-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 16px;
  color: var(--accent);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
}

.post-description {
  display: -webkit-box;
  overflow: hidden;
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

/* =====================================================================
   Accent and rich text
   Every highlight on the site uses --accent (defined in :root).
   .rich-text marks anything written in content/ (JSON text fields and
   blog posts), so all text styles look the same wherever they appear.
   ===================================================================== */

::selection {
  background: var(--accent-mark);
}

/* Links */
.rich-text a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: var(--accent-line);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

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

/* Emphasis */
.rich-text strong,
.rich-text b {
  color: var(--accent);
  font-weight: 700;
}

.rich-text a strong,
.rich-text a b {
  color: inherit;
}

.rich-text em,
.rich-text i {
  font-style: italic;
}

.rich-text mark {
  padding: 0 0.2em;
  border-radius: 2px;
  background: var(--accent-mark);
  color: var(--accent);
}

.rich-text u,
.rich-text ins {
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-underline-offset: 3px;
}

.rich-text del,
.rich-text s {
  color: var(--subtle);
  text-decoration-color: var(--accent);
}

.rich-text abbr {
  text-decoration: underline dotted var(--accent);
  text-underline-offset: 3px;
}

.rich-text sup,
.rich-text sub {
  font-size: 0.75em;
  line-height: 0;
}

.rich-text small {
  font-size: 0.85em;
}

/* Code and keys */
.rich-text code {
  background: var(--accent-soft);
  color: var(--accent);
}

.rich-text pre {
  border-color: var(--accent-line);
  background: var(--accent-soft);
}

.rich-text pre code {
  color: var(--ink);
}

.rich-text kbd {
  padding: 0 0.35em;
  border: 1px solid var(--accent-line);
  border-radius: 3px;
  color: var(--accent);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.85em;
}

/* Blog post blocks */
.markdown-body li::marker {
  color: var(--accent);
}

.markdown-body blockquote {
  border-left-color: var(--accent);
}

/* Links and active states outside content text */
.text-link,
.page .text-link,
.back-link,
.page .back-link,
.contact-row a,
.profile-links a {
  color: var(--accent);
}

.text-link:hover,
.page .text-link:hover,
.contact-row a:hover {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: var(--accent-line);
  text-underline-offset: 3px;
}

.nav-link:hover,
.nav-link.is-active,
.profile-nav .nav-link.is-active,
.copy-button:hover,
.back-link:hover,
.profile-links a:hover {
  color: var(--accent);
}

/* Bullet lists in entries (a list in "details" / "description").
   Wrapped lines hang under the text, not under the bullet. */
.entry-bullets,
.page .entry-bullets {
  max-width: 560px;
  margin: 8px 0 0;
  padding-left: 1.15em;
  list-style: disc outside;
  white-space: normal;
}

.entry-bullets li {
  padding-left: 0.25em;
}

.entry-bullets li + li {
  margin-top: 3px;
}

.entry-bullets li::marker {
  color: var(--accent);
}

/* Dates in the left column: one date per line, never split inside a date.
   On narrow screens the column stacks above the entry, so the dates share one line. */
.period-line {
  display: block;
  white-space: nowrap;
}

@media (max-width: 820px) {
  .period-line {
    display: inline;
  }
}

/* Maps: a static tile map (sidebar, and the Contact map before it becomes zoomable). */
.static-map {
  position: absolute;
  inset: 0;
  display: block;
  overflow: hidden;
}

/* Grey the OpenStreetMap tiles so the teal pin is the only colour. */
.map-tile,
.location-map .leaflet-tile-pane {
  filter: grayscale(1) brightness(1.06) contrast(0.88);
}

.map-tile {
  position: absolute;
  width: 256px;
  height: 256px;
  max-width: none;
  user-select: none;
  pointer-events: none;
}

.map-pin {
  position: absolute;
  top: 50%;
  left: 50%;
  display: block;
  width: 26px;
  height: 26px;
  color: var(--accent);
  transform: translate(-50%, -100%);
  filter: drop-shadow(0 1px 1.5px rgba(31, 41, 51, 0.35));
}

.map-pin svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: currentColor;
  stroke: var(--canvas);
  stroke-width: 1.2;
  paint-order: stroke;
}

.map-attribution {
  position: absolute;
  right: 0;
  bottom: 0;
  padding: 1px 5px;
  background: rgba(251, 252, 250, 0.82);
  color: var(--subtle);
  font-size: 9px;
  line-height: 1.5;
}

.map-attribution a {
  color: inherit;
}

/* Sidebar location */
.profile-location {
  margin-top: 20px;
}

.mini-map {
  position: relative;
  display: block;
  height: 84px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--accent-soft);
  transition: border-color 160ms ease;
}

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

/* Shift the map down so the pin, whose tip marks the spot, sits in the middle. */
.mini-map .static-map {
  inset: 10px 0 -10px;
}

.mini-map .map-attribution {
  bottom: 10px;
}

.mini-map .map-pin {
  width: 20px;
  height: 20px;
}

.mini-map .map-attribution {
  font-size: 7px;
}

.profile-location-label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
}

.profile-location-label .social-icon {
  flex: none;
  width: 14px;
  height: 14px;
  color: var(--accent);
}

/* Contact page: contacts on the left, location and map on the right. */
.contact-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 48px;
  align-items: start;
}

.contact-location {
  display: grid;
  gap: 14px;
}

.contact-address {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
  line-height: 1.55;
}

.contact-address strong {
  display: block;
  color: var(--ink);
  font-weight: 600;
}

.location-map {
  position: relative;
  height: 320px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--accent-soft);
  isolation: isolate;
}

.location-map.is-interactive {
  font-family: var(--sans);
}

.map-pin-marker {
  border: 0;
  background: none;
}

.map-pin-marker .map-pin {
  position: static;
  width: 30px;
  height: 30px;
  transform: none;
}

.location-map .leaflet-bar {
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: none;
}

.location-map .leaflet-bar a {
  color: var(--accent);
}

.location-map .leaflet-control-attribution {
  background: rgba(251, 252, 250, 0.82);
  color: var(--subtle);
  font-size: 9px;
}

.location-map .leaflet-control-attribution a {
  color: inherit;
}

.contact-location .entry-links {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 8px 22px;
}

@media (max-width: 820px) {
  .contact-layout {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .location-map {
    height: 260px;
  }
}

/* Phone header: the menu button sits on the left, where the drawer (the desktop sidebar) slides in from. */
@media (max-width: 820px) {
  .profile-topbar {
    justify-content: flex-start;
    gap: 14px;
  }

  .menu-toggle {
    flex: none;
    order: -1;
    transition: border-color 160ms ease, color 160ms ease;
  }

  /* The menu starts right under the header, with no empty band. */
  .profile-menu {
    padding-top: 10px;
  }

  .profile-nav {
    margin-top: 0;
    padding-top: 0;
  }

  /* While the drawer is open, the button becomes a close (×) button. */
  .profile-sidebar:has(.menu-toggle-input:checked) .menu-toggle {
    border-color: var(--accent);
    color: var(--accent);
  }

  .profile-sidebar:has(.menu-toggle-input:checked) .menu-toggle span:first-child {
    transform: translateY(3.5px) rotate(45deg);
  }

  .profile-sidebar:has(.menu-toggle-input:checked) .menu-toggle span:last-child {
    transform: translateY(-3.5px) rotate(-45deg);
  }
}

/* Print header: only on paper and in the generated CV PDF. */
.print-header {
  display: none;
}

/* =====================================================================
   Print (browser "Print" and the automatic CV PDF)
   ===================================================================== */
/* Gallery: album covers, then a photo grid, then a full-screen viewer. */
.album-grid,
.photo-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.photo-grid {
  gap: 8px;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}

.album-card {
  display: block;
}

.album-cover,
.photo-thumb {
  display: block;
  overflow: hidden;
  background: var(--accent-soft);
}

.album-cover {
  aspect-ratio: 1;
  border-radius: 6px;
}

.album-cover img,
.photo-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 240ms ease;
}

.album-card:hover .album-cover img,
.photo-thumb:hover img {
  transform: scale(1.03);
}

.page .album-card h3 {
  margin: 10px 0 0;
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.album-card:hover h3 {
  color: var(--accent);
}

.album-meta {
  margin: 2px 0 0;
  color: var(--accent);
  font-size: 12px;
}

.photo-thumb {
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  border-radius: 4px;
  cursor: zoom-in;
}

.content-wrap > .back-link + .section-heading {
  margin-top: 22px;
}

.lightbox {
  width: 100vw;
  max-width: none;
  height: 100vh;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(12, 16, 20, 0.94);
  color: #f2f4f5;
}

.lightbox::backdrop {
  background: rgba(12, 16, 20, 0.6);
}

.lightbox[open] {
  display: grid;
  place-items: center;
}

.lightbox-figure {
  display: grid;
  justify-items: center;
  gap: 10px;
  max-width: calc(100vw - 140px);
  max-height: 100%;
  margin: 0;
  padding: 56px 0 24px;
}

.lightbox-image {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: calc(100dvh - 130px);
  object-fit: contain;
  background: rgba(255, 255, 255, 0.04);
}

.lightbox-caption {
  max-width: 700px;
  color: #d5dadd;
  font-size: 13px;
  text-align: center;
}

.lightbox-caption:empty {
  display: none;
}

.lightbox-caption a {
  color: #fff;
  text-decoration: underline;
}

.lightbox-counter {
  position: absolute;
  top: 18px;
  left: 22px;
  margin: 0;
  color: #aab3b9;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.lightbox-button {
  position: absolute;
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font: 300 30px/1 var(--sans);
  cursor: pointer;
  transition: background 160ms ease;
}

.lightbox-button:hover {
  background: rgba(255, 255, 255, 0.18);
}

.lightbox-button:focus-visible {
  outline: 3px solid rgba(255, 255, 255, 0.6);
  outline-offset: 2px;
}

.lightbox-close {
  top: 10px;
  right: 14px;
}

.lightbox-prev,
.lightbox-next {
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-prev {
  left: 14px;
}

.lightbox-next {
  right: 14px;
}

@media (max-width: 820px) {
  .album-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 14px;
  }

  .photo-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
  }

  .photo-thumb {
    border-radius: 2px;
  }

  /* On phones, swipe to move between photos; the arrows sit at the bottom. */
  .lightbox-figure {
    max-width: 100vw;
    padding: 56px 0 80px;
  }

  .lightbox-image {
    max-height: calc(100dvh - 170px);
  }

  .lightbox-prev,
  .lightbox-next {
    top: auto;
    bottom: 16px;
    transform: none;
  }
}

@media (max-width: 480px) {
  .photo-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  .album-cover img,
  .photo-thumb img {
    transition: none;
  }

  .album-card:hover .album-cover img,
  .photo-thumb:hover img {
    transform: none;
  }
}

@media print {
  @page {
    size: letter;
    margin: 0.6in 0.65in;
  }

  html,
  body {
    background: #fff;
    font-size: 10.5pt;
  }

  * {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .profile-sidebar,
  .page-footer,
  .page-loader,
  .menu-toggle,
  .menu-scrim,
  .copy-button {
    display: none !important;
  }

  .site-shell,
  .site-layout,
  .page,
  .content-wrap {
    display: block !important;
    width: auto !important;
    max-width: none !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    box-shadow: none !important;
  }

  .print-header {
    display: block;
    margin-bottom: 18pt;
  }

  .print-header h1 {
    margin: 0;
    color: var(--ink);
    font-size: 24pt;
    font-weight: 500;
    letter-spacing: -0.03em;
    line-height: 1.1;
  }

  /* Contacts as icon + username, on one line where they fit. */
  .print-contacts {
    display: flex;
    flex-wrap: wrap;
    gap: 3pt 14pt;
    margin: 7pt 0 0;
    padding: 0;
    list-style: none;
    color: var(--muted);
    font-size: 9.5pt;
  }

  .print-contacts li {
    display: inline-flex;
    align-items: center;
    gap: 4pt;
    white-space: nowrap;
  }

  .print-contacts .social-icon {
    width: 10pt;
    height: 10pt;
    color: var(--accent);
  }

  .print-contacts a {
    color: var(--muted);
    text-decoration: none;
  }

  /* The on-screen heading and "Download PDF" line are replaced by the print header. */
  .print-header ~ .section-heading {
    display: none;
  }

  .section,
  .cv-section,
  .section-first {
    margin: 0 !important;
    padding: 12pt 0 0 !important;
  }

  .section-label {
    margin-bottom: 4pt;
    padding-bottom: 3pt;
    border-bottom: 1px solid var(--accent-line);
  }

  .cv-list {
    gap: 0 !important;
  }

  .period-line {
    display: block;
  }

  .page .cv-period {
    font-size: 9pt;
  }

  .cv-entry {
    grid-template-columns: 0.95in minmax(0, 1fr);
    gap: 12pt;
    padding: 6pt 0;
    break-inside: avoid;
  }

  .page .cv-entry h3 {
    font-size: 11.5pt;
  }

  .page .cv-organization,
  .page .cv-details,
  .page .entry-bullets {
    max-width: none;
    font-size: 9.5pt;
  }

  .entry-bullets li + li {
    margin-top: 1pt;
  }

  .section-label,
  h1,
  h2,
  h3 {
    break-after: avoid;
  }
}
