:root {
  color-scheme: light;
  --paper: #fafaf8;
  --ink: #292b2c;
  --muted: #626566;
  --link: #345b83;
  --line: #e1e3df;
  --serif: 'Newsreader', Georgia, serif;
  --mono: 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --duration: 220ms;
  --page-gutter: max(clamp(20px, 4vw, 48px), env(safe-area-inset-left), env(safe-area-inset-right));
  --page-top: clamp(24px, 7svh, 72px);
  --page-bottom: clamp(24px, 4svh, 48px);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 18px/1.7 var(--serif); -webkit-font-smoothing: antialiased; }
.ambient-background { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.ambient-field { position: absolute; display: block; inset: 0; width: 100%; height: 100%; }
.reactive-text-inline { display: inline-block; max-width: 100%; }
::selection { background: #dfe8ef; }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 3px; transition: color var(--duration) var(--ease); }
a:hover { color: #183d63; }
button, input { font: inherit; }
a:focus-visible, button:focus-visible, input:focus-visible, canvas:focus-visible { outline: 2px solid var(--link); outline-offset: 5px; }
[hidden] { display: none !important; }
main:focus { outline: none; }
h1, h2, p, figure { margin: 0; }
h1, h2 { font-weight: 500; line-height: 1.2; }
h1 { font-size: 30px; letter-spacing: -.45px; }
h2 { font-size: 24px; letter-spacing: -.2px; }
.site { position: relative; z-index: 1; display: flex; flex-direction: column; width: min(100% - var(--page-gutter) * 2, 900px); min-height: calc(100svh - var(--page-top) - var(--page-bottom)); margin: var(--page-top) auto var(--page-bottom); }
.site-header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 24px; padding-bottom: clamp(16px, 3svh, 24px); border-bottom: 1px solid var(--line); }
.name { color: var(--ink); font-size: 30px; font-weight: 500; letter-spacing: -.6px; line-height: 1.2; text-decoration: none; }
.identity p { margin-top: 5px; font-size: 14px; color: var(--muted); }
.site-header nav { display: flex; flex-wrap: wrap; gap: 0 26px; max-width: 100%; flex-shrink: 0; font-size: 16px; }
.site-header nav a { position: relative; display: inline-flex; align-items: center; min-height: 44px; color: var(--muted); text-decoration: none; padding: 8px 0; }
.site-header nav a::after { content: ''; position: absolute; right: 0; bottom: 6px; left: 0; height: 1px; background: currentColor; transform: scaleX(0); transform-origin: left; transition: transform var(--duration) var(--ease); }
.site-header nav a[aria-current='page'], .site-header nav a:focus-visible { color: var(--ink); }
.site-header nav a[aria-current='page']::after, .site-header nav a:focus-visible::after { transform: scaleX(1); }
main { display: flex; flex: 1; flex-direction: column; min-width: 0; margin-top: clamp(28px, 5svh, 48px); }
.page-section { width: 100%; min-width: 0; }
.page-section + .page-section { margin-top: 64px; }
.page-section[hidden] + .page-section { margin-top: 0; }
.biography p + p { margin-top: 24px; }
.home { max-width: none; }
.home-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: clamp(32px, 4vw, 48px); align-items: center; }
.biography { min-width: 0; max-width: 60ch; }
.attractor { min-width: 0; width: 100%; }
.attractor-plot { position: relative; height: auto; aspect-ratio: 4 / 3; max-height: 340px; }
#attractor-canvas { display: block; width: 100%; height: 100%; cursor: grab; touch-action: pan-y; outline: none; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
#attractor-canvas:active { cursor: grabbing; }
.plot-hint { position: absolute; bottom: 7px; right: 0; font: 10px/1.5 var(--mono); color: var(--muted); pointer-events: none; }
.attractor figcaption { display: flex; justify-content: center; align-items: center; min-height: 44px; margin-top: 8px; font-size: 15px; }
#attractor-title { text-align: center; color: var(--muted); }
.attractor:focus-within #attractor-title { text-decoration: underline; text-decoration-color: var(--link); text-underline-offset: 5px; }
.page-intro { margin-top: 14px; color: var(--muted); font-size: 18px; }
.research { max-width: 1120px; }
.research-group + .research-group { margin-top: 48px; }
.research-group-heading { margin-bottom: 24px; }
.research-group-heading h2 { font-size: clamp(22px, 1.8vw, 28px); }
.research-list { padding: 0; margin: 0; list-style: none; }
.research-list > .research-entry:first-child { padding-top: 0; border-top: 0; }
.research-entry { padding-block: 26px; border-top: 1px solid var(--line); }
.research-details { min-width: 0; }
.research-details h2, .research-details h3 { margin: 0; font-size: clamp(23px, 1.9vw, 30px); font-weight: 500; line-height: 1.3; letter-spacing: -.2px; }
.research-details > p { max-width: 65ch; margin-top: 12px; color: var(--muted); font-size: clamp(17px, 1.3vw, 21px); line-height: 1.6; }
.technical-projects { margin: 0; padding-left: 1.2em; font-size: clamp(18px, 1.4vw, 23px); line-height: 1.65; }
.technical-projects li + li { margin-top: 14px; }
.project-tools { color: var(--muted); }
.cv { max-width: 1120px; }
.resume-request { margin-top: 32px; font-size: clamp(16px, 1.2vw, 19px); }
.resume-request a { display: inline-block; padding-block: 8px; }
.cv-group { margin-top: 40px; }
.cv-group + .cv-group { margin-top: 48px; padding-top: 32px; border-top: 1px solid var(--line); }
.cv-timeline { --date-width: clamp(160px, 15vw, 210px); --timeline-gap: clamp(36px, 4vw, 64px); list-style: none; padding: 0; margin: 32px 0 0; }
.cv-entry { position: relative; display: grid; grid-template-columns: var(--date-width) minmax(0, 1fr); gap: var(--timeline-gap); padding-bottom: clamp(36px, 4vw, 56px); }
.cv-entry:last-child { padding-bottom: 0; }
.cv-entry::before, .cv-entry::after { content: ''; position: absolute; left: calc(var(--date-width) + var(--timeline-gap) / 2); }
.cv-entry::before { width: 1px; top: 12px; bottom: -12px; background: var(--line); }
.cv-entry:last-child::before { display: none; }
.cv-entry::after { top: 8px; width: 9px; height: 9px; margin-left: -4px; border: 1px solid var(--link); border-radius: 50%; background: var(--paper); }
.cv-date { padding-top: 3px; color: var(--muted); font: 12px/1.6 var(--mono); font-variant-numeric: tabular-nums; }
.cv-details { min-width: 0; }
.cv-details h3 { margin: 0; font-weight: 500; font-size: clamp(23px, 1.9vw, 30px); line-height: 1.25; }
.cv-role { margin-top: 7px; font-size: clamp(18px, 1.4vw, 22px); line-height: 1.4; }
.cv-location { margin-top: 5px; color: var(--muted); font-size: 15px; line-height: 1.5; }
.cv-description { max-width: 58ch; margin-top: 14px; color: var(--muted); font-size: clamp(17px, 1.3vw, 21px); line-height: 1.6; }
.blog { display: flex; flex: 1; flex-direction: column; }
.blog-placeholder { display: flex; flex: 1; flex-direction: column; align-items: center; justify-content: center; min-height: 240px; padding: 24px 0; text-align: center; }
.blog-doodle { display: block; width: min(200px, 100%); height: auto; aspect-ratio: 5 / 4; object-fit: cover; }
.blog-placeholder .page-intro { margin-top: 2px; font-size: 16px; }
.notes .page-intro { max-width: 580px; }
.notes-list { list-style: none; padding: 0; margin: 16px 0 0; }
.note-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; padding: 20px 0; border-top: 1px solid var(--line); transition: background-color var(--duration) var(--ease); }
.note-row > div { min-width: 0; }
.note-row:focus-within { background: rgb(52 91 131 / .035); }
.note-title { color: inherit; text-decoration: none; }
.note-title:focus-visible { color: var(--link); text-decoration: underline; }
.note-course { display: inline-block; margin-bottom: 6px; color: var(--muted); font: 12px/1.6 var(--mono); letter-spacing: .04em; text-decoration: none; }
a.note-course:hover { text-decoration: underline; }
.note-row h3 { margin: 0; font-size: clamp(20px, 2.1vw, 23px); line-height: 1.3; font-weight: 500; letter-spacing: -.2px; }
.note-origin, .note-detail { font-size: 15px; color: var(--muted); line-height: 1.5; }
.note-origin { margin-top: 6px; }
.note-detail { margin-top: 4px; max-width: 560px; }
.note-pdf { align-self: center; justify-self: start; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 10px 13px; border: 1px solid var(--line); border-radius: 3px; background: transparent; font: 12px/1.5 var(--mono); text-decoration: none; white-space: nowrap; transition: color var(--duration) var(--ease), background-color var(--duration) var(--ease), border-color var(--duration) var(--ease), transform var(--duration) var(--ease); }
.note-pdf:focus-visible { border-color: var(--link); background: #f1f3f2; color: #183d63; }
.note-pdf:active { transform: scale(.98); background: #e9eef1; }
.note-pdf svg { width: 17px; height: 19px; flex-shrink: 0; }
.note-pdf .pdf-arrow { font-size: 15px; transition: transform var(--duration) var(--ease); }
.notes-footnote { border-top: 1px solid var(--line); padding-top: 20px; margin-top: 4px; max-width: 620px; font-size: 15px; line-height: 1.5; color: var(--muted); }
.notes-group { margin-top: 36px; }
.notes-group + .notes-group { margin-top: 44px; }
.notes-group-heading { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; }
.notes-group-heading h2 { font-size: clamp(21px, 2.1vw, 23px); }
.notes-group-heading > span { color: var(--muted); font: 12px/1.5 var(--mono); white-space: nowrap; }
.cv > .visually-hidden + .cv-group, .notes > .visually-hidden + .notes-group { margin-top: 0; }
.pdf-preview-open { overflow: hidden; }
.pdf-preview { width: min(1040px, calc(100% - max(16px, env(safe-area-inset-left), env(safe-area-inset-right)) * 2)); height: min(960px, calc(100dvh - 48px)); max-width: none; max-height: none; margin: auto; padding: 0; border: 1px solid var(--line); border-radius: 6px; color: var(--ink); background: var(--paper); box-shadow: 0 20px 80px rgb(0 0 0 / .15); }
.pdf-preview[open] { display: flex; flex-direction: column; }
.pdf-preview::backdrop { background: rgb(20 27 33 / .4); }
.pdf-preview-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 20px 24px 16px; border-bottom: 1px solid var(--line); }
.pdf-preview-header > div { min-width: 0; }
.pdf-preview-header h2 { font-size: clamp(20px, 2vw, 27px); overflow-wrap: anywhere; }
#pdf-preview-meta { margin-top: 8px; color: var(--muted); font: 12px/1.6 var(--mono); }
.pdf-preview button { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 44px; height: 44px; padding: 0; border: 1px solid var(--line); border-radius: 3px; color: var(--ink); background: transparent; cursor: pointer; }
.pdf-preview button:hover:not(:disabled) { background: #eef1ed; border-color: var(--link); }
.pdf-preview button:disabled { opacity: .35; cursor: default; }
.pdf-preview-close svg { width: 22px; height: 22px; }
.pdf-preview-body { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 24px; background: #eceeea; }
.pdf-preview-page { max-width: 900px; margin-inline: auto; }
.pdf-preview-page img { display: block; width: 100%; height: auto; background: white; box-shadow: 0 2px 10px rgb(0 0 0 / .06); }
.pdf-preview-status { max-width: 38ch; margin: 48px auto; color: var(--muted); text-align: center; font-size: 18px; }
.pdf-preview-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; flex-shrink: 0; gap: 8px 16px; margin: 0; padding: 12px 24px; border-top: 1px solid var(--line); font-size: 17px; }
.pdf-preview-full { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; }
.pdf-preview-pagination { display: flex; align-items: center; gap: 12px; }
#pdf-preview-count { min-width: 5ch; text-align: center; color: var(--muted); font: 12px/1.5 var(--mono); }
.site-footer { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line); }
.social-links { display: flex; flex-wrap: wrap; align-items: center; gap: 8px clamp(12px, 2.2vw, 28px); }
.social-links a { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; color: #111; border-radius: 3px; text-decoration: none; transition: color var(--duration) var(--ease), transform var(--duration) var(--ease); }
.social-links svg { display: block; width: 28px; height: 28px; }
.social-links a:focus-visible { color: var(--link); }
.math { max-width: 660px; }
.plot { height: 340px; position: relative; margin-top: 16px; }
#knot-canvas { display: block; width: 100%; height: 100%; cursor: grab; touch-action: pan-y; }
#knot-canvas:active { cursor: grabbing; }
.figure-controls { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 15px; }
.figure-controls label { display: flex; align-items: center; gap: 12px; }
.figure-controls input { accent-color: var(--link); width: 110px; height: 28px; margin: 0; }
.figure-controls output { width: 32px; color: var(--muted); font-variant-numeric: tabular-nums; }
.figure-buttons { display: flex; gap: 20px; }
.figure-buttons button { padding: 8px 0; min-height: 36px; border: 0; color: var(--link); background: none; cursor: pointer; }
.figure-buttons button:hover { text-decoration: underline; text-underline-offset: 3px; }
figcaption { font-size: 16px; color: var(--muted); margin-top: 18px; }
.equation { display: flex; flex-wrap: wrap; column-gap: 26px; row-gap: 4px; margin-top: 16px; font-size: 16px; color: var(--muted); font-style: italic; }
.no-script { position: absolute; inset: 40% 0; text-align: center; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip-link { position: absolute; z-index: 2; left: 24px; top: -70px; padding: 10px 16px; background: var(--ink); color: white; font-size: 16px; }
.skip-link:focus { top: 12px; }
@media (min-width: 821px) and (min-height: 501px) {
  body { font-size: clamp(21px, 1.55vw, 26px); }
  .site { width: min(100% - var(--page-gutter) * 2, clamp(1040px, 84vw, 1440px)); }
  .name, h1 { font-size: clamp(34px, 2.8vw, 46px); }
  h2 { font-size: clamp(26px, 2vw, 32px); }
  .identity p { font-size: clamp(16px, 1.05vw, 18px); }
  .site-header nav { gap: 32px; font-size: clamp(18px, 1.2vw, 21px); }
  .biography { transform: translateY(-28px); }
  .biography p + p { margin-top: 28px; }
  .attractor-plot { aspect-ratio: 6 / 5; max-height: 520px; }
  .attractor figcaption { font-size: clamp(17px, 1.1vw, 20px); }
  .page-intro { font-size: 1em; }
  .notes .page-intro { max-width: 60ch; }
  .notes-group-heading h2 { font-size: clamp(26px, 2vw, 32px); }
  .notes-group-heading > span, .note-course { font-size: clamp(12px, .85vw, 14px); }
  .note-row { padding-block: clamp(22px, 2vw, 28px); }
  .note-row h3 { font-size: clamp(24px, 1.8vw, 30px); }
  .note-origin, .note-detail { font-size: clamp(16px, 1.05vw, 18px); }
  .note-pdf { min-height: 48px; padding: 12px 16px; font-size: clamp(13px, .9vw, 15px); }
  .blog-doodle { width: clamp(240px, 18vw, 300px); }
  .blog-placeholder .page-intro { font-size: clamp(18px, 1.2vw, 21px); }
  .math { max-width: 900px; }
  .plot { height: clamp(340px, 33vw, 480px); }
}
@media (max-width: 820px) {
  body { line-height: 1.65; }
  .site { max-width: 620px; }
  .home-layout { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .attractor { width: min(100%, 440px); margin-inline: auto; }
  .biography p + p { margin-top: 22px; }
}
@media (max-width: 700px) {
  :root {
    --page-gutter: max(clamp(20px, 6vw, 32px), env(safe-area-inset-left), env(safe-area-inset-right));
    --page-top: max(28px, env(safe-area-inset-top));
    --page-bottom: max(24px, env(safe-area-inset-bottom));
  }
  .ambient-background { opacity: .38; }
  .site-header { flex-direction: column; align-items: stretch; gap: 0; padding-bottom: 0; border-bottom: 0; }
  .name { font-size: 32px; letter-spacing: -.7px; }
  .identity p { margin-top: 7px; font: 12px/1.6 var(--mono); letter-spacing: .015em; }
  .site-header nav { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; margin-top: 20px; border-block: 1px solid var(--line); font-size: clamp(14px, 4vw, 16px); }
  .site-header nav a { justify-content: center; min-height: 48px; padding: 10px 0; }
  .site-header nav a::after { right: 8px; bottom: -1px; left: 8px; height: 2px; }
  main { margin-top: 28px; }
  .home-layout { gap: 12px; }
  .biography { font-size: 19px; line-height: 1.6; text-wrap: pretty; }
  .biography p + p { margin-top: 20px; font-size: 18px; }
  .attractor { width: min(100%, 360px); margin-top: 4px; }
  .attractor-plot { max-height: 270px; }
  .attractor figcaption { min-height: 32px; margin-top: 0; font-size: 14px; }
  .research-entry { padding-block: 24px; }
  .research-entry:last-child { padding-bottom: 0; }
  .research-details h2, .research-details h3 { font-size: 24px; line-height: 1.25; letter-spacing: -.35px; text-wrap: balance; }
  .research-details h2 a, .research-details h3 a { text-decoration-color: #bccbd9; }
  .research-details > p { margin-top: 12px; font-size: 17px; line-height: 1.65; text-wrap: pretty; }
  .research-group + .research-group { margin-top: 32px; padding-top: 28px; border-top: 1px solid var(--line); }
  .research-group-heading { margin-bottom: 16px; }
  .research-group-heading h2 { font-size: 22px; }
  .technical-projects { font-size: 18px; line-height: 1.55; }
  .project-tools { display: block; margin-top: 6px; font-size: 15px; }
  .cv-group > h2, .notes-group-heading h2 { font-size: 24px; }
  .cv-group + .cv-group { margin-top: 36px; padding-top: 28px; }
  .cv-timeline { margin-top: 24px; }
  .cv-entry { display: block; padding-left: 24px; padding-bottom: 32px; }
  .cv-entry::before, .cv-entry::after { left: 4px; }
  .cv-entry::after { top: 9px; width: 7px; height: 7px; margin-left: -3px; }
  .cv-date { margin-bottom: 8px; }
  .cv-details h3 { font-size: 22px; line-height: 1.3; text-wrap: pretty; }
  .cv-role { margin-top: 6px; font-size: 17px; line-height: 1.5; }
  .cv-location { margin-top: 4px; font-size: 14px; }
  .cv-description { margin-top: 12px; font-size: 16px; line-height: 1.65; text-wrap: pretty; }
  .resume-request { margin-top: 28px; font-size: 16px; line-height: 1.5; }
  .notes-group-heading { gap: 8px; }
  .notes-group-heading > span { font-size: 12px; }
  .notes-group + .notes-group { margin-top: 36px; }
  .site-footer { margin-top: 40px; padding-top: 16px; }
  .social-links { gap: 16px; }
  .social-links a { color: var(--ink); }
  .social-links svg { width: 24px; height: 24px; }
}
@media (max-width: 540px) {
  .notes-list { margin-top: 18px; }
  .note-row { grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 14px 0 16px; }
  .note-row > div { display: contents; }
  .note-course { display: inline-flex; align-items: center; justify-self: start; grid-area: 1 / 1 / auto / -1; min-height: 28px; margin-bottom: 0; }
  .note-row h3 { grid-area: 2 / 1 / auto / -1; font-size: 22px; line-height: 1.3; text-wrap: pretty; }
  .note-origin { grid-area: 3 / 1; align-self: center; margin-top: 0; }
  .note-origin, .note-detail { font-size: 14px; }
  .note-pdf { grid-area: 3 / 2; justify-self: end; gap: 6px; min-width: 78px; padding: 10px; background: var(--paper); }
  .pdf-label-prefix { display: none; }
  .pdf-preview { width: 100%; max-width: 100%; height: 100dvh; max-height: 100dvh; border: 0; border-radius: 0; }
  .pdf-preview-header { padding: max(16px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) 16px max(20px, env(safe-area-inset-left)); gap: 12px; }
  .pdf-preview-header h2 { font-size: 21px; line-height: 1.3; }
  #pdf-preview-meta { font-size: 12px; line-height: 1.6; }
  .pdf-preview-body { padding: 12px max(12px, env(safe-area-inset-right)) 12px max(12px, env(safe-area-inset-left)); }
  .pdf-preview-footer { flex-wrap: nowrap; gap: 12px; padding: 12px max(20px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left)); font-size: 15px; }
  .pdf-preview-full { min-width: 0; line-height: 1.4; }
  .pdf-preview-pagination { gap: 6px; }
  .plot { height: 280px; }
  .figure-controls { flex-wrap: wrap; gap: 8px 16px; font-size: 14px; }
  .figure-controls label { gap: 8px; }
  .figure-controls input { width: 76px; }
  .figure-buttons { margin-left: auto; gap: 14px; }
  .figure-buttons button { min-height: 44px; }
  .equation { flex-direction: column; }
}
@media (min-width: 821px) and (max-height: 500px) {
  .attractor-plot { max-height: 240px; }
}
@media (hover: hover) and (pointer: fine) {
  .site-header nav a:hover { color: var(--ink); }
  .site-header nav a:hover::after { transform: scaleX(1); }
  .social-links a:hover { color: var(--link); transform: translateY(-2px); }
  .note-row:hover { background: rgb(52 91 131 / .035); }
  .note-row:hover .note-title { color: var(--link); }
  .note-title:hover { text-decoration: underline; }
  .note-pdf:hover { transform: translateY(-1px); border-color: var(--link); background: #f1f3f2; color: #183d63; }
  .note-pdf:hover .pdf-arrow { transform: translate(2px, -2px); }
}
@media (prefers-reduced-motion: reduce) {
  .reactive-text { translate: none !important; }
  a, .social-links a, .note-row, .note-pdf .pdf-arrow, .site-header nav a::after { transition: none; }
  .social-links a:hover { transform: none; }
  .note-pdf:hover, .note-pdf:active, .note-pdf:hover .pdf-arrow { transform: none; }
}
