:root {
  color-scheme: light;
  --serif: 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, serif;
  --sans: 'Avenir Next', Avenir, system-ui, sans-serif;
  --mono: 'IBM Plex Mono', Menlo, Consolas, monospace;
  --paper: #f7f3e9;
  --rail: #eee9dd;
  --projects: #f7f3e9;
  --ink: #242821;
  --secondary: #50574d;
  --accent: #2b5645;
  --rule: #c9c8b9;
  --strong-rule: #414b40;
  --rail-ink: var(--ink);
  --rail-secondary: var(--secondary);
  --rail-accent: var(--accent);
  --rail-rule: var(--rule);
  --grain: radial-gradient(circle, #253c2711 0.55px, transparent 0.8px) 0 0 / 5px 7px;
  --edge: clamp(1.75rem, 3.6vw, 4.5rem);
  --gutter: clamp(2.25rem, 5vw, 6rem);
}

[data-style='blueprint'] {
  --serif: 'Baskerville', 'Times New Roman', serif;
  --paper: #f2f5fc;
  --rail: #182d50;
  --projects: #e4ecfa;
  --ink: #172947;
  --secondary: #435674;
  --accent: #214da9;
  --rule: #a8b7d1;
  --strong-rule: #526a9e;
  --rail-ink: #f2f6ff;
  --rail-secondary: #c7d5ee;
  --rail-accent: #b1caff;
  --rail-rule: #526b93;
}

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.5;
}

a {
  color: inherit;
  text-underline-offset: 0.24em;
}

:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
}

h1, h2, h3, p, ul, ol, pre { margin: 0; }

.section-label, .project-venue, .cv-date {
  font-family: var(--mono);
  font-size: 0.875rem;
}

.section-label {
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.portfolio {
  display: grid;
  grid-template-columns: clamp(17.5rem, 27vw, 32rem) minmax(0, 1fr);
  min-height: 100vh;
  min-height: 100svh;
}

.profile {
  display: flex;
  flex-direction: column;
  padding: clamp(2rem, 5.25vh, 4rem) var(--edge) clamp(1.5rem, 3.5vh, 3rem);
  border-right: 1px solid var(--strong-rule);
  background: var(--rail);
  color: var(--rail-ink);
  color-scheme: inherit;
}

.portrait-frame {
  display: grid;
  width: clamp(7.5rem, min(14vw, 20vh), 13rem);
  aspect-ratio: 1;
  padding: 0.3rem;
  border: 1px solid var(--rail-rule);
  border-radius: 50%;
}

.portrait {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  border-radius: inherit;
  object-fit: cover;
  object-position: 50% 82%;
}

.identity h1 {
  margin-top: 0.9rem;
  font: 600 clamp(1.8rem, 3vw, 3.25rem) / 1.08 var(--serif);
  letter-spacing: -0.045em;
}

.local-name {
  margin-top: 0.28rem;
  color: var(--rail-secondary);
  font-size: 1rem;
  letter-spacing: 0.12em;
}

.affiliations {
  margin-top: 1.4rem;
  padding-top: 0.78rem;
  border-top: 1px solid var(--rail-rule);
}

.profile .section-label { color: var(--rail-accent); }

.affiliation-list, .project-list { padding: 0; list-style: none; }

.affiliation-list {
  margin-top: 0.45rem;
  font-size: 0.9375rem;
  line-height: 1.32;
}

.affiliation-list li { padding: 0.28rem 0; }

.affiliation-list strong { display: block; font-weight: 650; }

.affiliation-list span {
  display: block;
  margin-top: 0.12rem;
  color: var(--rail-secondary);
  font-size: 0.875rem;
}

.scroll-window { position: relative; }

.previous-affiliations .scroll-window {
  border-bottom: 1px solid var(--rail-rule);
}

.scroll-area {
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--scroll-accent, var(--accent)) transparent;
}

.scroll-area:focus-visible { outline: none; }

.scroll-window:has(.scroll-area:focus-visible) {
  outline: 2px solid currentColor;
  outline-offset: 4px;
}

.previous-scroll {
  --scroll-accent: var(--rail-accent);
  max-height: clamp(7.5rem, 21vh, 12rem);
  padding-right: 0.5rem;
}

.project-scroll { max-height: clamp(10rem, 30svh, 32rem); }

.scroll-window[data-scroll-above] { --mask-start: transparent; }
.scroll-window[data-scroll-below] { --mask-end: transparent; }

.scroll-window:is([data-scroll-above], [data-scroll-below]) .scroll-area {
  mask-image: linear-gradient(to bottom, var(--mask-start, #000), #000 1.15rem, #000 calc(100% - 1.15rem), var(--mask-end, #000));
}

.scroll-edge {
  /* Let the blur extend past both sides of the text and taper within the gutters. */
  --blur-bleed: min(1.5rem, var(--edge), var(--gutter));
  --fade-inline: linear-gradient(to right, transparent, #000 var(--blur-bleed), #000 calc(100% - var(--blur-bleed)), transparent);
  position: absolute;
  inset-inline: calc(-1 * var(--blur-bleed));
  height: 1.85rem;
  pointer-events: none;
  visibility: hidden;
}

.scroll-edge-start {
  --fade-direction: to top;
  inset-block-start: 0;
}

.scroll-edge-end {
  --fade-direction: to bottom;
  inset-block-end: 0;
}

.scroll-window[data-scroll-above] .scroll-edge-start,
.scroll-window[data-scroll-below] .scroll-edge-end {
  visibility: visible;
}

.scroll-edge::before,
.scroll-edge::after {
  content: '';
  position: absolute;
  inset: 0;
  mask-composite: intersect;
}

.scroll-edge::before {
  backdrop-filter: blur(2px);
  mask-image: linear-gradient(var(--fade-direction), transparent 5%, #000 80%), var(--fade-inline);
}

.scroll-edge::after {
  backdrop-filter: blur(7px);
  mask-image: linear-gradient(var(--fade-direction), transparent 32%, #000 92%), var(--fade-inline);
}

@media (prefers-reduced-transparency: reduce) {
  .scroll-edge { display: none; }
  .scroll-window:is([data-scroll-above], [data-scroll-below]) .scroll-area { mask-image: none; }
}

.contact {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.05rem;
  padding-top: 1rem;
  color: var(--rail-accent);
  font-size: 0.875rem;
  font-style: normal;
  font-weight: 650;
}

.contact a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
}

.contact svg { flex: none; }
.contact a span { text-decoration: underline; }

.main-column {
  display: grid;
  grid-template-rows: 1fr auto;
}

.intro {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(1.65rem, 3.65vh, 3.5rem) var(--gutter);
  background: var(--paper);
}

.intro .section-label { color: var(--accent); }

.intro h2 {
  margin: 0.15em 0 0.28em;
  font: 400 clamp(2rem, 4.45vw, 5rem) / 1.05 var(--serif);
  letter-spacing: -0.045em;
}

.intro h2 span { color: var(--accent); }

.intro-copy {
  max-width: 62ch;
  color: var(--secondary);
  font-size: clamp(1rem, 1.35vw, 1.2rem);
  line-height: 1.5;
}

.intro-copy p + p { margin-top: 0.65em; }

.intro-copy strong { color: var(--ink); font-weight: 700; }

.intro-copy a {
  color: var(--ink);
  font-weight: 600;
  text-decoration-color: var(--rule);
}

.intro-copy a:hover {
  color: var(--accent);
  text-decoration-color: currentColor;
}

.projects {
  padding: clamp(1.45rem, 3.2vh, 3.25rem) var(--gutter);
  border-top: 1px solid var(--strong-rule);
  background: var(--projects);
}

.projects-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-bottom: 1rem;
}

.projects-heading h2, .project-archive h1 {
  font: 600 clamp(1.8rem, min(3.45vw, 6.25vh), 3.75rem) / 1.06 var(--serif);
  letter-spacing: -0.045em;
}

.see-all {
  color: var(--accent);
  font-size: 0.9375rem;
  font-weight: 700;
}

.page-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
}

.pdf-button {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  padding: 0.34rem 0.75rem;
  border: 1px solid var(--rule);
  border-radius: 0.25rem;
  background: transparent;
  color: var(--accent);
  font: 700 0.875rem / 1.2 var(--sans);
  cursor: pointer;
  transition: border-color 140ms ease, background-color 140ms ease;
}

.pdf-button:hover {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}

.pdf-button svg { flex: none; }

.see-all:hover, .contact a:hover span { text-decoration-thickness: 2px; }

.project {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  align-items: baseline;
  gap: 0.3rem 1.5rem;
  padding: 0.625rem 0;
  border-top: 1px solid var(--rule);
}

.project:last-child { border-bottom: 1px solid var(--rule); }

.project h3 {
  color: var(--ink);
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.35;
}

.project h3 a, .archive-project h2 a { text-decoration: none; }

.project h3 a:hover, .archive-project h2 a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.project p {
  margin-top: 0.12rem;
  color: var(--secondary);
  font-size: 1rem;
}

.project-venue { color: var(--accent); }

.project-archive {
  max-width: 74rem;
  margin-inline: auto;
  padding: clamp(2.25rem, 8vh, 5.5rem) var(--gutter);
}

.archive-project {
  padding-block: 1.2rem;
  border-top: 1px solid var(--rule);
}

.archive-project:last-child { border-bottom: 1px solid var(--rule); }

.archive-project h2 {
  margin-bottom: 0.35rem;
  font: 600 clamp(1.35rem, 2.6vw, 2rem) / 1.2 var(--serif);
}

.project-authors {
  margin-bottom: 0.35rem;
  color: var(--secondary);
  font-size: 0.96rem;
}

.project-authors strong {
  color: var(--ink);
  font-weight: 700;
}

.archive-project .project-venue {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 1rem;
}

.project-links {
  display: inline-flex;
  align-items: baseline;
  gap: 0.75rem;
  font-weight: 600;
}

.project-links a:hover, .bibtex-toggle:hover { text-decoration-thickness: 2px; }

.bibtex-toggle {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 0.24em;
  cursor: pointer;
}

.project-abstract {
  margin-top: 0.65rem;
  color: var(--secondary);
}

.bibtex-panel {
  position: relative;
  margin-top: 0.75rem;
  border: 1px solid var(--rule);
  border-radius: 0.25rem;
  background: color-mix(in srgb, var(--accent) 6%, var(--paper));
}

.bibtex-panel[hidden] { display: none; }

.bibtex-code {
  overflow-x: auto;
  padding: 0.85rem 4.75rem 0.85rem 1rem;
  color: var(--ink);
  font: 0.84rem / 1.5 var(--mono);
}

.bibtex-copy {
  position: absolute;
  top: 0.55rem;
  right: 0.6rem;
  padding: 0.22rem 0.58rem;
  border: 1px solid var(--rule);
  border-radius: 0.2rem;
  background: var(--paper);
  color: var(--accent);
  font: 600 0.78rem / 1.2 var(--mono);
  cursor: pointer;
}

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

.archive-note {
  margin-top: 0.85rem;
  color: var(--secondary);
  font-size: 0.875rem;
}

.cv-header {
  padding-bottom: 1.35rem;
  border-bottom: 1px solid var(--strong-rule);
}

.cv-header .projects-heading {
  align-items: center;
  margin-bottom: 0.45rem;
}

.cv-subtitle {
  color: var(--ink);
  font-size: 1.08rem;
  font-weight: 600;
}

.cv-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.6rem;
  margin-top: 0.25rem;
  color: var(--secondary);
  font-size: 0.9375rem;
}

.cv-section {
  padding-block: 1.5rem;
  border-bottom: 1px solid var(--rule);
}

.cv-section-exp-part1 {
  padding-bottom: 0;
  border-bottom: 0;
}

.cv-section-exp-part2 { padding-top: 1.3rem; }
.cv-section-last { border-bottom: 0; }

.cv-section > .section-label {
  margin-bottom: 0.85rem;
  color: var(--accent);
}

.cv-lead {
  color: var(--ink);
  font-size: 1.06rem;
}

.cv-entries {
  display: grid;
  gap: 1.3rem;
}

.cv-entry-head, .cv-entry-sub {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.2rem 1.25rem;
}

.cv-entry h3 {
  font-size: 1.06rem;
  font-weight: 700;
}

.cv-date {
  color: var(--accent);
  white-space: nowrap;
}

.cv-entry-sub {
  margin-top: 0.12rem;
  color: var(--secondary);
  font-size: 0.96rem;
}

.cv-detail {
  margin-top: 0.18rem;
  color: var(--secondary);
  font-size: 0.9375rem;
}

.cv-bullets {
  margin-top: 0.45rem;
  padding-left: 1.2rem;
  color: var(--secondary);
  font-size: 0.96rem;
}

.cv-bullets li + li { margin-top: 0.28rem; }
.cv-bullets strong { color: var(--ink); }

.cv-teaching-list { margin-top: 0; }

.cv-pub-list {
  padding-left: 1.5rem;
  color: var(--secondary);
  font-size: 0.975rem;
}

.cv-pub-list li + li { margin-top: 0.65rem; }
.cv-pub-list strong, .cv-pub-list a { color: var(--ink); }
.cv-pub-list a:hover { color: var(--accent); }

.cv-award-list {
  display: grid;
  gap: 0.7rem;
  padding: 0;
  list-style: none;
}

.cv-award-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  column-gap: 1.5rem;
  align-items: baseline;
}

.cv-award-copy strong {
  display: block;
  font-size: 0.98rem;
  font-weight: 650;
}

.cv-award-copy span {
  display: block;
  margin-top: 0.08rem;
  color: var(--secondary);
  font-size: 0.92rem;
}

.print-only-label, .print-page-footer { display: none; }

[data-style='ivory'] :is(.profile, .intro, .projects, .project-archive) {
  background-image: var(--grain);
}

[data-style='blueprint'] .profile {
  color-scheme: dark;
  background-image: linear-gradient(135deg, #11244200, #0d204078);
}

[data-style='blueprint'] .portrait-frame {
  width: clamp(7.5rem, min(14vw, 20vh), 13rem);
  padding: 0.38rem;
  border-radius: 0;
  outline: 1px solid var(--rail-rule);
  outline-offset: 0.2rem;
}

[data-style='blueprint'] .intro::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: 0 0 0 45%;
  background-image: linear-gradient(#2b59b32c 1px, transparent 1px), linear-gradient(90deg, #2b59b32c 1px, transparent 1px);
  background-size: 24px 24px;
  mask-image: radial-gradient(ellipse at 100% 0%, black, transparent 75%);
}

[data-style='blueprint'] :is(.projects-heading h2, .project-archive h1) { font-weight: 500; }

[data-style='blueprint'] .project {
  grid-template-columns: minmax(8.75rem, max-content) minmax(0, 1fr);
  column-gap: 1.25rem;
}

[data-style='blueprint'] .project-venue {
  grid-column: 1;
  grid-row: 1;
}

@media (max-width: 62rem) {
  :root { --gutter: 2.25rem; }
  .project { column-gap: 1rem; }
}

@media (max-width: 56rem) {
  [data-style='blueprint'] .project { grid-template-columns: minmax(0, 1fr); row-gap: 0.2rem; }
  [data-style='blueprint'] .project-venue { grid-row: auto; }
}

@media (width > 48rem) {
  .previous-affiliations {
    display: flex;
    flex: 1 0 auto;
    flex-direction: column;
  }

  .previous-affiliations .scroll-window {
    flex: 1 0 auto;
    min-height: 7.5rem;
  }

  .previous-scroll {
    position: absolute;
    inset: 0;
    max-height: none;
  }
}

@media (max-width: 48rem) {
  :root { --edge: clamp(1rem, 5vw, 2.25rem); --gutter: var(--edge); }
  .portfolio, .main-column { display: block; }
  .profile { border-right: 0; border-bottom: 1px solid var(--strong-rule); }

  .identity {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    column-gap: 1rem;
  }

  .identity .portrait-frame {
    grid-row: span 2;
    width: clamp(5rem, 20vw, 7.5rem);
  }

  .identity h1 {
    align-self: end;
    margin-top: 0;
    font-size: clamp(2rem, 7vw, 3rem);
  }

  .local-name { align-self: start; }
  .intro, .projects { padding-block: 2.25rem; }
  .project-scroll { max-height: max(18rem, 43svh); }
  .intro h2 {
    font-size: clamp(1.35rem, 7.2vw, 3.5rem);
    overflow-wrap: anywhere;
  }
}

@media (max-width: 42rem) {
  .cv-award-list li { grid-template-columns: minmax(0, 1fr); row-gap: 0.15rem; }
}

@media (max-width: 34rem) {
  .project { grid-template-columns: minmax(0, 1fr); }
}

@page {
  size: letter portrait;
  margin: 0;
}

@media print {
  :root {
    --paper: #fff;
    --ink: #141920;
    --secondary: #374151;
    --accent: #2b5645;
    --rule: #cbd5e1;
    --strong-rule: #334155;
  }

  [data-style='blueprint'] {
    --paper: #fff;
    --ink: #141920;
    --secondary: #374151;
    --accent: #214da9;
    --rule: #cbd5e1;
    --strong-rule: #334155;
  }

  html, body {
    margin: 0;
    padding: 0;
    background: #fff !important;
    background-image: none !important;
    color: var(--ink);
    font-size: 9.1pt;
    line-height: 1.35;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .page-nav { display: none !important; }

  .project-archive, .cv-page {
    max-width: none;
    margin: 0;
    padding: 0;
    background: none !important;
  }

  .cv-print-sheet {
    display: flex;
    flex-direction: column;
    height: 10.96in;
    padding: 0.42in 0.52in 0.38in;
  }

  .cv-print-sheet-1 {
    break-after: page;
    page-break-after: always;
  }

  .cv-header {
    padding-bottom: 6.5pt;
    border-bottom: 1pt solid var(--strong-rule);
  }

  .cv-header .projects-heading { margin-bottom: 2pt; }
  .cv-header h1 { font-size: 18.5pt; line-height: 1.06; }
  .cv-subtitle { font-size: 9.5pt; }
  .cv-meta { font-size: 8.7pt; }

  .cv-section {
    padding-block: 6.5pt;
    border-bottom: 0.6pt solid var(--rule);
  }

  .cv-section-exp-part1 {
    padding-bottom: 0;
    border-bottom: 0;
  }

  .cv-section-exp-part2 { padding-top: 0; }

  .cv-section-last {
    padding-bottom: 0;
    border-bottom: 0;
  }

  .cv-section > .section-label, .print-only-label {
    margin-bottom: 4pt;
    font-size: 7.6pt;
  }

  .print-only-label {
    display: block;
    color: var(--accent);
  }

  .cv-lead { font-size: 9pt; }
  .cv-entries { display: block; }

  .cv-entry {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .cv-entry + .cv-entry { margin-top: 6pt; }
  .cv-entry h3 { font-size: 9.3pt; }
  .cv-entry-sub, .cv-detail, .cv-bullets { font-size: 8.8pt; }
  .cv-date { font-size: 8.1pt; }

  .cv-bullets {
    margin-top: 2pt;
    padding-left: 1.05rem;
  }

  .cv-bullets li + li { margin-top: 1.5pt; }

  .cv-pub-list {
    padding-left: 1.25rem;
    font-size: 8.8pt;
  }

  .cv-pub-list li {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .cv-pub-list li + li { margin-top: 3pt; }
  .cv-page .archive-note { margin-top: 3pt; font-size: 7.9pt; }

  .cv-award-list { display: block; }

  .cv-award-list li {
    display: grid;
    grid-template-columns: minmax(0, 1fr) max-content;
    column-gap: 1rem;
    align-items: baseline;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .cv-award-list li + li { margin-top: 4pt; }
  .cv-award-copy strong { font-size: 9.1pt; }
  .cv-award-copy span { margin-top: 0; font-size: 8.5pt; }

  .cv-pub-list a, .cv-entry-sub a, .cv-meta a { text-decoration: none; }

  .print-page-footer {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-top: auto;
    padding-top: 6pt;
    border-top: 0.5pt solid var(--rule);
  }

  .print-watermark-text {
    color: #7b8494;
    font-family: var(--sans);
    font-size: 7.8pt;
  }

  .print-page-num {
    color: var(--accent);
    font-family: var(--mono);
    font-size: 8.5pt;
    font-weight: 700;
  }
}
