/* Site styles. Spacing sits on a 4px scale; type uses the ramp below.
   Source Serif for headings and prose, Arial for details. */

:root {
  --paper: #ffffff;
  --ink: #161616;
  --ink-2: #363636;
  --muted: #6e6e6e;
  --faint: #b8b8b8;
  --rule: #e3e3e3;
  --wash: #f3f3f3;
  --line: #949494;
  --accent: #9d2f35;

  --c-pod: #b23a48;
  --c-mes: #c99a2e;
  --c-endo: #3d6fa3;
  --c-pec: #8467b0;
  --c-pt: #3f8466;
  --c-dt: #4a9eaa;
  --c-fib: #b3b3b3;
  --c-imm: #e07b39;
  --c-scl: #9a9a9a;

  --serif: "Source Serif 4", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: Arial, "Helvetica Neue", Helvetica, sans-serif;
  --type-display: 400 32px/40px var(--serif);
  --type-title: 400 20px/28px var(--serif);
  --type-lead: 400 18px/28px var(--serif);
  --type-heading: 500 16px/24px var(--serif);
  --type-prose: 400 16px/24px var(--serif);
  --type-body: 400 14px/22px var(--sans);
  --type-reading: 400 16px/26px var(--sans);
  --type-dateline: 400 15px/24px var(--sans);
  --type-small: 400 12px/20px var(--sans);

  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: var(--type-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
::selection { background: color-mix(in srgb, var(--accent) 16%, transparent); }
p, li { text-wrap: pretty; }
h1, h2, h3 { margin: 0; font-weight: 500; text-wrap: balance; }
em, i { font-style: normal; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

a {
  color: inherit;
  text-decoration: underline 1px;
  text-underline-offset: 3px;
  text-decoration-color: var(--line);
  transition: text-decoration-color .2s var(--ease), color .2s var(--ease);
}
a:hover { text-decoration-color: currentColor; }

/* links into the interactive figures */
a.fig-link {
  color: var(--ink-2);
  text-decoration: underline dotted 1.5px;
  text-decoration-color: var(--accent);
}
a.fig-link:hover { color: var(--accent); text-decoration-style: solid; text-decoration-thickness: 1px; text-decoration-color: currentColor; }

/* home */

.page { max-width: 620px; margin: 0 auto; padding: 96px 24px 32px; }

.name, .fig-title { font: var(--type-display); letter-spacing: -.015em; }
.bio, .lead { margin: 12px 0 0; font: var(--type-lead); color: var(--ink-2); }
.bio { text-wrap: wrap; }
.reveal { padding: 0; border: 0; background: none; font: inherit; color: inherit; cursor: pointer; text-decoration: underline 1px; text-underline-offset: 3px; text-decoration-color: var(--line); transition: text-decoration-color .2s var(--ease); }
.reveal:hover, .reveal[aria-expanded="true"] { text-decoration-color: currentColor; }
.note { display: block; overflow: hidden; color: var(--muted); opacity: 0; transition: height .24s var(--ease), opacity .24s var(--ease); }
.note-in { display: block; padding: 8px 0; }
.note.on { opacity: 1; }
.note[hidden] { display: none; }

.hero { display: block; margin: 32px 0 0; text-decoration: none; }
.hero-plate { display: block; position: relative; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); touch-action: pan-y; box-sizing: content-box; aspect-ratio: 1000 / 300; }
.hero-plate canvas { display: block; width: 100%; cursor: pointer; }
canvas, .plate svg { animation: appear .24s var(--ease); }
@keyframes appear { from { opacity: 0; } }

.sec { margin-top: 24px; }
.hero + .sec { margin-top: 32px; }
.sec > h2 { font: var(--type-title); letter-spacing: -.005em; color: var(--ink); padding-top: 20px; border-top: 1px solid var(--rule); margin-bottom: 12px; }

.entry { margin: 0 0 16px; }
.entry:last-child { margin-bottom: 0; }
.entry-head { display: flex; justify-content: space-between; align-items: baseline; gap: 0 16px; }
.org { font: var(--type-heading); color: var(--ink); min-width: 0; }
.date { font: var(--type-small); color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.desc { margin: 0; color: var(--muted); }
.role { color: var(--ink-2); }

.org .at { font-weight: 400; color: var(--ink-2); }

/* contact */
.check { margin: 0; font: var(--type-prose); color: var(--ink-2); }
.check .mail { display: inline-block; white-space: nowrap; color: var(--ink); text-decoration: none; line-height: 20px; border-bottom: 1px solid var(--line); transition: border-color .2s var(--ease); }
.check .mail:hover { border-bottom-color: var(--ink); }
.rot { display: inline-block; vertical-align: bottom; white-space: nowrap; }
.rot a {
  display: inline-block;
  position: relative;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  line-height: 20px;
  transition: width .45s var(--ease), border-color .2s var(--ease);
}
.rot a:hover { border-bottom-color: var(--ink); }
.rot .l { display: inline-block; transition: transform .38s var(--ease), opacity .3s var(--ease); transition-delay: calc(var(--i) * 16ms); }
.rot .l.pre { transform: translateY(-.45em); opacity: 0; }
.rot .l.out { transform: translateY(.45em); opacity: 0; transition-duration: .24s, .2s; transition-delay: calc(var(--i) * 8ms); }
.rot-old { position: absolute; left: 0; top: 0; white-space: nowrap; pointer-events: none; }
.rot-measure { position: absolute; visibility: hidden; white-space: nowrap; pointer-events: none; }

.foot { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--rule); display: flex; gap: 4px 24px; flex-wrap: wrap; font: var(--type-small); color: var(--muted); font-variant-numeric: tabular-nums; }

/* figure pages */

.back { display: inline-flex; gap: 4px; align-items: center; min-height: 44px; margin: -12px 0 0 -8px; padding: 0 8px; color: var(--muted); text-decoration: none; }
.back:hover { color: var(--ink); }
.fig-title { margin-top: 12px; }

.fig { margin: 24px 0 0; }
.fig-bar { display: flex; justify-content: space-between; gap: 4px 20px; flex-wrap: wrap; margin-bottom: 8px; color: var(--muted); min-height: 20px; }
.fig-bar b { font-weight: 500; color: var(--ink); }
.fig-bar-sub { margin-top: 16px; }
.plate { position: relative; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.plate canvas, .plate svg { display: block; width: 100%; }
.plate svg { overflow: visible; }
.tissue-plate, .spec [data-plate], .spec [data-err] { box-sizing: content-box; }
.tissue-plate { aspect-ratio: 1000 / 620; }
.spec [data-plate] { aspect-ratio: 680 / 300; }
.spec [data-err] { aspect-ratio: 680 / 72; }

.controls { display: grid; gap: 12px; margin-top: 20px; color: var(--ink-2); }
.ctl { display: grid; grid-template-columns: 192px minmax(0, 1fr) 80px; align-items: center; gap: 16px; }
.ctl output { text-align: right; color: var(--ink); font-variant-numeric: tabular-nums; }
.checks { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 4px; }
.checks label { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
input[type="range"], input[type="checkbox"] { accent-color: var(--ink); }
input[type="range"] { width: 100%; margin: 0; cursor: pointer; }
input[type="checkbox"] { width: 16px; height: 16px; margin: 0; cursor: pointer; }

.stats { display: flex; flex-wrap: wrap; gap: 4px 24px; margin-top: 20px; padding-top: 12px; border-top: 1px solid var(--rule); color: var(--muted); }
.stat-n { color: var(--ink); font-weight: 500; font-variant-numeric: tabular-nums; }
.stat-n small { font-size: inherit; font-weight: 400; color: var(--muted); margin-left: 4px; }
.stat-l { margin-left: 4px; }

/* photography */
.reel { --w: clamp(200px, 46vw, 264px); position: relative; display: flex; gap: 8px; margin: 32px 0 0; overflow-x: auto; touch-action: pan-y; outline-offset: -2px; }
.shot { flex: none; width: var(--w); aspect-ratio: 4 / 3; margin: 0; background: var(--wash); }
.shot img { display: block; width: 100%; height: 100%; user-select: none; transition: opacity .32s var(--ease); }
.reel.live { display: block; height: calc(var(--w) * .75); overflow: hidden; overflow-x: clip; overflow-y: visible; }
.reel.live .shot { position: absolute; top: calc(var(--w) * -.09375); left: 50%; width: calc(var(--w) * 1.25); margin-left: calc(var(--w) * -.625); will-change: transform; backface-visibility: hidden; }
.reel.live.open { overflow: visible; }
.reel.live img:not(.in) { opacity: 0; }

.shot img { cursor: pointer; }
.shot img:focus-visible { outline-offset: -4px; }
.reel-switch { margin: 32px 0 0; color: var(--muted); }
.reel-switch[hidden] { display: none; }
.lightbox { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: rgba(0, 0, 0, 0); cursor: pointer; transition: background .32s var(--ease); }
.lightbox[open] { display: flex; align-items: center; justify-content: center; }
.lightbox.on { background: rgba(0, 0, 0, .8); }
.lightbox:focus { outline: none; }
.lightbox img { display: block; width: min(90vw, calc(88vh * 4 / 3)); height: auto; aspect-ratio: 4 / 3; cursor: default; will-change: transform; }

/* writings */
.days { list-style: none; margin: 24px 0 0; padding: 0; }
.day-head { display: block; width: 100%; padding: 8px 0; border: 0; background: none; font: var(--type-prose); color: var(--ink-2); text-align: left; cursor: pointer; }
.day-date { font: var(--type-dateline); }
.day-title { font-weight: 500; color: var(--ink); text-decoration: underline 1px; text-underline-offset: 3px; text-decoration-color: var(--line); transition: text-decoration-color .2s var(--ease); }
.day-num { font: var(--type-dateline); color: var(--muted); font-variant-numeric: tabular-nums; }
.day-head[aria-expanded="true"] .day-title { text-decoration-color: currentColor; }
.day-body { overflow: hidden; color: var(--ink-2); opacity: 0; transition: height .24s var(--ease), opacity .24s var(--ease); }
.day-body.on { opacity: 1; }
.day-body[hidden] { display: none; }
.day-in { padding: 0 0 12px; font: var(--type-reading); }
.day-in p { margin: 0 0 12px; }
.day-in p:last-child { margin-bottom: 0; }

/* resume */
.popup[open] { flex-direction: column; gap: 8px; }
.popup { --sheet-h: min(100dvh - 72px, 92vw * 1.2943); cursor: default; }
.resume-sheet { width: calc(var(--sheet-h) / 1.2943); height: var(--sheet-h); overflow: hidden; background: var(--paper); }
.resume-sheet { position: relative; }
.resume-sheet:focus { outline: none; }
.fold { position: fixed; inset: 0; overflow: hidden; perspective: 900px; pointer-events: none; }
.fold-cast { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform, opacity; background: rgba(0, 0, 0, .55); filter: blur(28px); }
.fold[hidden] { display: none; }
.fold-root { position: absolute; left: 0; top: 0; transform-style: preserve-3d; will-change: transform; }
.fold-panel { position: absolute; transform-style: preserve-3d; will-change: transform; }
.fold-face { position: absolute; inset: -1px; background-color: var(--paper); backface-visibility: hidden; }
.fold-back { background-color: #f4f4f4; transform: rotateY(180deg); }
.fold-ghost { position: absolute; inset: 0; opacity: .1; transform: scaleX(-1); }
.fold-shade { position: absolute; inset: 0; opacity: 0; }
.resume-sheet img { display: block; width: 100%; height: auto; aspect-ratio: auto; cursor: auto; will-change: auto; }
.popup-foot { width: calc(var(--sheet-h) / 1.2943); font: var(--type-small); text-align: right; }
.popup-foot a { color: rgba(255, 255, 255, .7); text-decoration-color: rgba(255, 255, 255, .4); }
.popup-foot a:hover { color: #ffffff; text-decoration-color: #ffffff; }

/* tissue */
.legend { list-style: none; margin: 24px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(192px, 1fr)); gap: 0 24px; }
.legend button { width: 100%; display: grid; grid-template-columns: 8px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 4px 0; background: none; border: 0; cursor: pointer; text-align: left; font: var(--type-body); color: var(--ink-2); white-space: nowrap; transition: opacity .2s var(--ease); }
.legend button i { width: 8px; height: 8px; border-radius: 50%; background: var(--sw); }
.legend button span:last-child { color: var(--muted); font-variant-numeric: tabular-nums; }
.legend:has(button[aria-pressed="true"]) button:not([aria-pressed="true"]) { opacity: .55; }
.tissue-plate { cursor: crosshair; touch-action: pan-y; }
.tag { position: absolute; top: 8px; right: 8px; z-index: 1; padding: 4px 8px; background: var(--paper); border: 1px solid var(--rule); font: var(--type-small); color: var(--muted); pointer-events: none; transition: opacity .15s var(--ease); }
.tag:empty { opacity: 0; }
.tag b { font-weight: 500; color: var(--ink); }

/* spectra */
.spec svg text { font-family: var(--sans); font-size: 14px; fill: var(--muted); }
.spec .pk { stroke-width: 1.6; transition: stroke .25s var(--ease); }
.spec .pk-q, .spec .pk-l { stroke: var(--faint); }
.spec .pk-q.m { stroke: var(--ink); }
.spec .pk-l.m { stroke: var(--accent); }
.spec .pk-n { stroke-dasharray: 2 2; }
.spec .pk-hit { stroke: transparent; stroke-width: 10; cursor: crosshair; }
.spec .axis { stroke: var(--rule); }
.spec-tip { position: absolute; pointer-events: none; z-index: 2; padding: 4px 8px; background: var(--paper); border: 1px solid var(--rule); font: var(--type-small); color: var(--ink); white-space: nowrap; opacity: 0; transform: translate(-50%, calc(-100% - 8px)); transition: opacity .15s; }
.spec-tip.on { opacity: 1; }
.err-band { fill: var(--wash); transition: x .35s var(--ease), width .35s var(--ease); }
.err-curve { fill: none; stroke: var(--accent); stroke-width: 1.2; transition: opacity .3s var(--ease); }
.err-dot { transition: cx .5s var(--ease), fill .25s; }

/* exclusivity */
.xgrid { position: relative; padding: 32px 0 8px; }
.xrow { display: grid; grid-template-columns: 152px minmax(0, 1fr); align-items: center; height: 32px; color: var(--ink-2); transition: opacity .3s var(--ease); }
.xrow[data-off="true"] { opacity: .6; }
.xtrack { position: relative; height: 100%; }
.xseg { position: absolute; top: 8px; height: 16px; left: calc(var(--a) * 100%); width: calc((var(--b) - var(--a)) * 100%); transition: left .5s var(--ease), width .5s var(--ease), opacity .3s; }
.xseg.base { background: var(--ink); }
.xseg.dev { background: repeating-linear-gradient(135deg, var(--faint) 0 1px, transparent 1px 4px); }
.xseg.pte, .sw-pte { background: repeating-linear-gradient(90deg, var(--ink) 0 2px, transparent 2px 4px); }
.xseg.gain, .sw-gain { background: color-mix(in srgb, var(--ink) 45%, var(--paper)); }
.xseg.ped, .sw-ped { background: var(--accent); }
.sw { display: inline-block; width: 16px; height: 8px; }
.xaxis { position: relative; height: 24px; margin-left: 152px; font: var(--type-small); color: var(--muted); }
.xaxis span { position: absolute; top: 8px; transform: translateX(-50%); font-variant-numeric: tabular-nums; }
.xlines { position: absolute; top: 0; bottom: 0; left: 152px; right: 0; pointer-events: none; }
.xlines i { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--rule); }
.xmark { position: absolute; top: 16px; bottom: 0; width: 1px; transition: left .5s var(--ease); }
.xmark::after { content: attr(data-label); position: absolute; top: -16px; left: 4px; font: var(--type-small); white-space: nowrap; }
.xmark.zero { background: var(--muted); }
.xmark.zero::after { left: auto; right: 4px; color: var(--muted); }
.xmark.entry { background: var(--accent); }
.xmark.entry::after { color: var(--accent); }
.xmark.entry.flip::after { left: auto; right: 4px; }

/* small screens */

@media (max-width: 599px) {
  .page { padding: 48px 16px 32px; }
  .hero-plate { aspect-ratio: 1000 / 560; }
  .entry-head { flex-wrap: wrap; }
  .ctl { grid-template-columns: minmax(0, 1fr) 72px; gap: 4px 12px; }
  .ctl > span:first-child { grid-column: 1 / -1; }
  .xrow { grid-template-columns: 104px minmax(0, 1fr); font: var(--type-small); }
  .xaxis { margin-left: 104px; }
  .xlines { left: 104px; }
  .xmark.entry::after { content: "Generic"; }
  .spec svg text { font-size: 18px; }
}

@media (max-width: 400px) {
  .check .mail { display: inline; white-space: normal; }
}

@media (pointer: coarse) {
  .legend button, .checks label { min-height: 44px; }
  .ctl input[type="range"] { height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 1ms !important; transition-delay: 0s !important; animation-duration: 1ms !important; }
}
