/* davidhaomd.com — one stylesheet for the homepage. Colors and fonts are tokens at the top. */

:root {
  --ink: #1a1a1a;
  --ink-2: #3d3d3d;
  --muted: #555555;
  --faint: #6e6e6e;
  --line: #e3e1da;
  --paper: #ffffff;
  --cobalt: #213da8;
  --cobalt-dark: #172c7a;
  --cobalt-deep: #1a3088;   /* the contact band: a deeper blue than the accent */
  --cobalt-line: #8495cf;
  --cobalt-text: #dadff4;
  --nejm: #b8132a;          /* NEJM-style red, only for marking the NEJM videos */
  --sans: "Inter Tight", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --gutter: clamp(16px, 4vw, 56px);
  --section: clamp(64px, 8vw, 112px);
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; }
/* Some browsers (Safari on iPhone and iPad) give button text their own blue; buttons here take the page's colors */
button { -webkit-appearance: none; appearance: none; color: inherit; -webkit-text-fill-color: currentColor; }
p, h1, h2, h3, figure { margin: 0; }

a { color: var(--cobalt); text-underline-offset: 4px; }
a:hover { color: var(--cobalt-dark); }
a:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 3px; }

.skip {
  position: absolute; left: -9999px; top: 8px;
  background: var(--cobalt); color: #fff; padding: 10px 14px; z-index: 10;
}
.skip:focus { left: 8px; color: #fff; }
.skip:hover { color: #fff; }

/* Browser surfaces: selection and keyboard focus use the site's cobalt */
::selection { background: #d6dcfa; color: var(--ink); }
:where(a, button, [tabindex]):focus-visible { outline: 2px solid var(--cobalt); outline-offset: 3px; }
.contact :where(a, button):focus-visible { outline-color: #fff; }

.wrap {
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.tap { display: inline-flex; align-items: center; min-height: 44px; }

/* Labels in the monospace font: the eyebrow, figure numbers and section numbers */
.label { font-family: var(--mono); font-size: 13px; color: var(--cobalt); }
.label--caps { letter-spacing: 0.06em; text-transform: uppercase; }
.label--muted { color: var(--faint); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; min-height: 48px;
  padding: 0 22px; font-size: 16px; font-weight: 500; text-decoration: none;
  border: 1px solid transparent;
}
.btn--solid { background: var(--cobalt); color: #fff; }
.btn--solid:hover { background: var(--cobalt-dark); color: #fff; }
.btn--line { border-color: var(--ink); color: var(--ink); }
.btn--line:hover { background: var(--ink); color: #fff; }
.btn--white { background: #fff; color: var(--cobalt); }
.btn--white:hover { background: var(--cobalt-text); color: var(--cobalt-dark); }
.btn--white-line { border-color: #fff; color: #fff; }
.btn--white-line:hover { background: #fff; color: var(--cobalt); }

/* Header: stays at the top on larger screens, so Collaborate is always in reach */
.site-header { border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, 0.94); position: sticky; top: 0; z-index: 5; backdrop-filter: blur(8px); }
/* The header button uses the same size and weight as the menu beside it */
.btn--small { min-height: 44px; padding: 0 18px; font-size: inherit; font-weight: 400; }
.header-cta { font-size: 18px; }
.nav { margin-left: auto; }
.site-header .wrap {
  display: flex; justify-content: space-between; align-items: center;
  gap: 8px 24px; flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px;
}
.brand { gap: 6px; font-size: 18px; color: var(--ink); text-decoration: none; }
.brand:hover { color: var(--ink); }
.brand span { color: var(--faint); }
.nav { display: flex; flex-wrap: wrap; gap: 0 24px; font-size: 18px; }
.nav a { color: var(--ink); text-decoration: none; }
.nav a:hover { color: var(--cobalt); }
html { scroll-padding-top: 80px; }

/* Hero */
.hero { padding-top: clamp(40px, 5vw, 72px); padding-bottom: clamp(64px, 8vw, 112px); }
.hero-grid {
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(32px, 5vw, 80px); align-items: center;
}
.hero-text { display: flex; flex-direction: column; gap: 28px; }
.hero h1 {
  font-weight: 400; font-size: clamp(40px, 4.7vw, 68px);
  line-height: 1.02; letter-spacing: -0.035em; text-wrap: balance;
}
/* A quiet way in to /atlas: the word "pain" keeps the headline's colour and carries only a faint dotted line, the
   usual sign that a word holds something more; hovered or focused, it turns blue and the line becomes solid */
.egg { color: inherit; text-decoration: underline dotted #b4b1a8; text-decoration-thickness: 0.055em; text-underline-offset: 0.14em; transition: color 0.25s, text-decoration-color 0.25s; }
.egg:hover, .egg:focus-visible { color: var(--cobalt); text-decoration-style: solid; text-decoration-color: var(--cobalt); }
@media (prefers-reduced-motion: reduce) { .egg { transition: none; } }
.lede { font-size: 19px; line-height: 1.55; color: var(--ink-2); max-width: 600px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-note { margin-top: -12px; font-size: 14px; line-height: 1.5; color: var(--muted); }
.hero-figure { display: flex; flex-direction: column; gap: 10px; }
.hero-figure img { width: 100%; height: auto; aspect-ratio: 10 / 7; object-fit: cover; }
figcaption { font-family: var(--mono); font-size: 13px; color: var(--faint); }
figcaption b { font-weight: 400; color: var(--cobalt); }
/* The portrait: large, so the face goes with the name. Name and posts sit right under it. */
.hero-portrait { gap: 16px; }
.hero-portrait img { aspect-ratio: 1; object-position: 50% 25%; background: #e9eef0; }
.who { display: flex; flex-direction: column; gap: 3px; font-family: var(--sans); }
.who-name { font-size: clamp(26px, 2.6vw, 34px); font-weight: 500; line-height: 1.15; letter-spacing: -0.02em; color: var(--ink); margin-bottom: 4px; }
.who-role { font-size: 15px; line-height: 1.45; color: var(--muted); }
/* A quiet text link beside the buttons */
.more { display: inline-flex; align-items: center; min-height: 48px; padding: 0 6px; font-size: 16px; font-weight: 500; color: var(--ink); text-decoration: underline; text-decoration-color: var(--cobalt); text-decoration-thickness: 2px; text-underline-offset: 6px; }
.more:hover { color: var(--cobalt); }

/* About: the bio on the left; posts, training and Fig. 0 on the right */
.about-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(32px, 5vw, 80px); align-items: start; }
.about-text { display: flex; flex-direction: column; gap: 18px; max-width: 640px; }
.about-text p { font-size: 18px; line-height: 1.65; color: var(--ink-2); }
.about-text .actions { margin-top: 10px; align-items: center; }
.facts { margin: 0; display: flex; flex-direction: column; }
.facts div { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.facts div:last-child { border-bottom: 1px solid var(--line); }
.facts dt { font-size: 12px; padding-top: 3px; }
.facts dd { margin: 0; font-size: 16px; line-height: 1.45; }
/* The statement's three verbs link to the three parts of the page */
.statement a { color: var(--cobalt); text-decoration-thickness: 2px; text-underline-offset: 6px; }
/* Care: one drawing of the spine stays in view while three steps scroll past it; each step plays its treatment */
.care-story { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: clamp(32px, 5vw, 72px); align-items: start; }
.care-figure { position: sticky; top: 104px; }
.care-fig { display: block; width: 100%; height: auto; }
.care-steps { list-style: none; margin: 0; padding: 0; }
.care-step-text { display: flex; flex-direction: column; gap: 10px; }
.care-step { display: flex; flex-direction: column; justify-content: center; gap: 10px; min-height: 90vh; opacity: 0.32; transition: opacity 0.3s; }
.care-step.is-active { opacity: 1; }
.care-step h3 { font-size: clamp(24px, 2.4vw, 32px); font-weight: 500; line-height: 1.15; letter-spacing: -0.02em; }
.care-step p:not(.label) { font-size: 18px; line-height: 1.6; color: var(--ink-2); max-width: 440px; }
.care-layer { opacity: 0; transition: opacity 0.35s; }
.care-fig[data-active="block"] [data-layer="block"],
.care-fig[data-active="pump"] [data-layer="pump"],
.care-fig[data-active="stim"] [data-layer="stim"] { opacity: 1; }
.care-spread { fill: var(--cobalt); opacity: 0.22; transform-box: view-box; }
.care-spread--mid { transform-origin: 400px 300px; }
.care-shaft { fill: none; stroke: #333; stroke-width: 2.6; stroke-linecap: butt; }
.care-bevel { fill: #333; }
.care-hub-part { fill: #fbfaf7; stroke: #222; stroke-width: 1.8; }
.care-hub-rib { fill: none; stroke: #222; stroke-width: 1.2; }
.care-hub-cap { fill: var(--cobalt); }
/* Fig. 1's syringe and tubing, and Fig. 3's Tuohy needles. The needles are hidden unless the script is placing them,
   since the finished drawing has them withdrawn. */
.care-barrel { fill: none; stroke: #222; stroke-width: 1.8; }
.care-fluid { fill: var(--cobalt); opacity: 0.55; }
.care-stopper { fill: #222; }
.care-tube { fill: none; stroke: #222; stroke-width: 5.6; stroke-linecap: round; }
.care-tube-in { fill: none; stroke: #fbfaf7; stroke-width: 3; stroke-linecap: round; }
.care-tube-fluid { fill: none; stroke: var(--cobalt); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 100; }
.care-tuohy { opacity: 0; }
.care-reservoir { fill: var(--cobalt); opacity: 0.22; }
.care-tuohy-shaft { fill: none; stroke: #333; stroke-width: 4.4; }
.care-draw { fill: none; stroke: var(--cobalt); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 100; }
/* The pump and the stimulator are drawn in black like the spine; what they deliver (catheter, medicine, leads,
   contacts, pulses) is the blue */
.care-device { fill: #fbfaf7; stroke: #222; stroke-width: 3.2; stroke-linejoin: round; }
.care-device-line { fill: none; stroke: #222; stroke-width: 2; }
.care-dot { fill: #222; }
.care-drop, .care-contacts rect { fill: var(--cobalt); }
.care-drop { offset-path: path("M586 452C540 500 440 604 400 540L400 250"); offset-distance: 100%; opacity: 0; }
.care-ring, .care-pulse { fill: none; stroke: var(--cobalt); stroke-width: 4; opacity: 0; transform-box: fill-box; transform-origin: center; }
/* The treatments follow the scroll: site.js moves each part as its step passes (needles in, catheter and lead
   drawn, the syringes emptied), so scrolling back runs it backwards. Without the script, or with motion off,
   every part sits in its finished place. Only the last touches loop, once a step has fully played (.is-done). */
.care-ring.care-ring--tip { stroke-width: 2; }
.care-pool { fill: var(--cobalt); opacity: 0.22; transform-box: view-box; transform-origin: 400px 250px; }
.care-device-fill { fill: #fbfaf7; }
.care-layer.is-done .care-ring--tip { animation: care-spread 2.4s ease-out infinite; }
.care-layer.is-done .care-drop { animation: care-drop 2.6s ease-in-out infinite; }
.care-layer.is-live .care-pulse { animation: care-pulse 1.8s ease-out infinite; }
.care-layer.is-live .care-pulse--2 { animation-delay: 0.6s; }
.care-layer.is-live .care-pulse--3 { animation-delay: 1.2s; }
@keyframes care-spread { 0% { opacity: 0.8; transform: scale(1); } 60%, 100% { opacity: 0; transform: scale(4.5); } }
@keyframes care-drop { 0% { offset-distance: 0%; opacity: 0; } 8% { opacity: 1; } 80% { offset-distance: 100%; opacity: 1; } 90%, 100% { offset-distance: 100%; opacity: 0; } }
@keyframes care-pulse { from { opacity: 0.75; transform: scale(0.5); } to { opacity: 0; transform: scale(3.4); } }
@media (max-width: 760px) {
  .care-story { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .care-figure { top: 0; z-index: 2; background: var(--paper); padding-bottom: 12px; }
  /* Each step is one beat of scroll (PACE.beat in site.js), as on wide screens; its text stays just below the
     pinned drawing while the procedure plays */
  .care-step { display: block; min-height: 90vh; }
  .care-step-text { position: sticky; top: calc((100vw - 32px) * 0.8 + 24px); display: flex; flex-direction: column; gap: 10px; padding-top: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .care-fig * { animation: none !important; }
  .care-layer, .care-step { transition: none; }
}

/* Scroll reveal: site.js adds .reveal to blocks below the first screen and .is-in when each comes into view.
   Siblings arrive one after another (--i). The classes come off afterwards, so nothing here outlives the reveal. */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.7s ease-out, transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1); transition-delay: calc(var(--i, 0) * 80ms); }
.reveal.is-in { opacity: 1; transform: none; }

/* Running text inside a section, and the small note under it */
.prose { display: flex; flex-direction: column; gap: 14px; max-width: min(720px, 66ch); }
.prose p { font-size: 18px; line-height: 1.65; color: var(--ink-2); }
.prose .note { font-size: 15px; line-height: 1.55; color: var(--muted); }
/* A second block inside a section, such as the talks under Teaching */
.subsection { display: flex; flex-direction: column; gap: 20px; padding-top: clamp(32px, 4vw, 48px); border-top: 1px solid var(--line); scroll-margin-top: 80px; }
.subhead { font-size: clamp(22px, 2.2vw, 28px); font-weight: 500; letter-spacing: -0.01em; }
.subnote { font-size: 16px; line-height: 1.55; color: var(--muted); margin-top: -10px; }


/* Selected work */
.work-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(48px, 6vw, 88px) clamp(24px, 3vw, 48px);
}
.tile { display: flex; flex-direction: column; gap: 14px; color: var(--ink); text-decoration: none; }
.tile:hover { color: var(--ink); }
/* Each figure sits in a frame, so its moving parts can be laid over the drawing in the drawing's own pixels */
.fig { display: block; position: relative; overflow: hidden; aspect-ratio: 10 / 7; background: #f1f0ec; outline: 1px solid transparent; transition: outline-color 0.15s; isolation: isolate; }
.fig img { width: 100%; height: 100%; object-fit: cover; }
.fig-over { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.tile:hover .fig, .tile:focus-visible .fig { outline-color: var(--cobalt); }

/* Figures follow the scroll. site.js sets --p on each figure, from 0 as it enters the screen to 1 once it is well
   in view, and every moving part is placed from that number, so scrolling back runs it backwards. Without the
   script --p is 1 and each figure shows its finished state. Pointing at a tile replays its motion. */
.fig { --p: 1; }
/* Fig. 1 is drawn in the page: a dial from 1 to 10, 20 degrees a step. The needle falls from 7 to 4 as you scroll down. */
.dial-major { fill: none; stroke: #222; stroke-width: 4; stroke-linecap: round; }
.dial-label { font-family: var(--sans); font-size: 44px; fill: #222; text-anchor: middle; }
.dial-needle { transform-box: view-box; transform-origin: 700px 817px; transform: rotate(calc(30deg - 60deg * var(--p))); }
.tile:is(:hover, :focus-visible) .dial-needle { animation: dial-fall 1.8s cubic-bezier(0.3, 1.2, 0.5, 1) both; }
@keyframes dial-fall { 0%, 18% { transform: rotate(30deg); } 100% { transform: rotate(-30deg); } }
/* Fig. 2: the talk reaches the room. The seats are drawn in the page, one dot each, and a blue wave passes through
   them from the front row to the back as the figure plays (--p): each seat turns blue as the wave,
   about three rows deep, reaches it, then settles back. The wave has left the back row before the end, so the finished
   figure is plain seats around the blue podium. --t is the seat's row, from 0 at the front to 1 at the back. Pointing at the tile plays it again. */
@property --p { syntax: "<number>"; inherits: true; initial-value: 1; }
.seat { --w: clamp(0, 1.4 - max(var(--p) * 2 - 0.45 - var(--t), var(--t) + 0.45 - var(--p) * 2) * 3.5, 1);
  fill: color-mix(in srgb, #213DA8 calc(var(--w) * 100%), #222); }
.tile:is(:hover, :focus-visible) .fig--hall { animation: hall-play 2.2s linear both; }
@keyframes hall-play { from { --p: 0; } to { --p: 1; } }
/* Fig. 3: play turns to pause and the progress bar fills */
.video-play { opacity: calc(1 - (var(--p) - 0.12) * 14); }
.video-pause { opacity: calc((var(--p) - 0.12) * 14); }
.video-track, .video-bar { stroke: #fff; stroke-width: 6; stroke-linecap: round; }
.video-track { opacity: min(0.35, calc((var(--p) - 0.12) * 5)); }
.video-bar { transform-box: fill-box; transform-origin: left center; transform: scaleX(var(--p)); }
.tile:is(:hover, :focus-visible) .video-play { opacity: 0; }
.tile:is(:hover, :focus-visible) .video-pause { opacity: 1; }
.tile:is(:hover, :focus-visible) .video-bar { animation: video-fill 4s linear both; }
@keyframes video-fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
/* Fig. 4 is drawn in the page: each sound wave swells and falls around its own baseline as the page moves */
.fig-draw { display: block; width: 100%; height: 100%; }
.wave { fill: none; stroke: #222; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transform-origin: 0 0;
  transform: scaleY(calc(1 + 0.42 * sin(var(--p) * 9 + var(--i) * 0.6))); }
.wave--blue { stroke: var(--cobalt); stroke-width: 5; }
.tile:is(:hover, :focus-visible) .wave { animation: wave-pulse 1.3s ease-in-out infinite alternate; animation-delay: calc(var(--i) * -0.12s); }
@keyframes wave-pulse { from { transform: scaleY(0.55); } to { transform: scaleY(1.45); } }
/* Fig. 5: the needle advances to its target, then the injection spreads */
.needle-shaft { stroke: var(--cobalt); stroke-width: 7; stroke-linecap: round; stroke-dasharray: 694; stroke-dashoffset: calc(694 * (1 - min(1, var(--p) * 1.3))); }
.needle-tip { fill: var(--cobalt); opacity: calc((var(--p) - 0.74) * 20); }
.needle-ring { fill: none; stroke: var(--cobalt); stroke-width: 4; transform-box: fill-box; transform-origin: center;
  transform: scale(calc(1 + 5 * max(0, var(--p) - 0.78) / 0.22)); opacity: min(calc((var(--p) - 0.78) * 16), calc((1 - var(--p)) * 6)); }
.tile:is(:hover, :focus-visible) .needle-shaft { animation: needle-advance 1.3s ease-out both; }
.tile:is(:hover, :focus-visible) .needle-tip { animation: needle-arrive 1.3s linear both; }
.tile:is(:hover, :focus-visible) .needle-ring { animation: needle-spread 1.4s ease-out 1.3s infinite; }
@keyframes needle-advance { from { stroke-dashoffset: 694; } to { stroke-dashoffset: 0; } }
@keyframes needle-arrive { 0%, 88% { opacity: 0; } 100% { opacity: 1; } }
@keyframes needle-spread { from { opacity: 0.8; transform: scale(1); } to { opacity: 0; transform: scale(6); } }
/* Fig. 6 is drawn in the page: site.js turns the circle, square and triangle in space around the ball.
   Lines passing behind the ball are drawn before it, lines in front after it. */
.spin-axis { fill: none; stroke: #222; stroke-width: 2; stroke-dasharray: 9 9; }
.spin-back path, .spin-front path { fill: none; stroke: #222; stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.spin-back path { stroke: #8f8d86; }
.spin-ball { fill: var(--cobalt); }
@media (prefers-reduced-motion: reduce) {
  .fig { --p: 1 !important; }
  .fig *, .tile .fig img { animation: none !important; transition: none !important; }
}
.tile-text { display: flex; flex-direction: column; gap: 4px; }
.tile-text .label { font-size: 12px; }
.tile h3 { font-size: 20px; font-weight: 500; }
a.tile[href^="http"] h3::after { content: " ↗" / ""; color: var(--faint); font-weight: 400; }
.tile p { font-size: 15px; line-height: 1.5; color: var(--muted); }
/* Fig. 7 spans the row: drawing on the left, text and both journal links on the right */
.tile--wide { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 14px clamp(24px, 3vw, 48px); align-items: center; }
.tile--wide .tile-text { gap: 8px; max-width: 620px; }
/* Fig. 7: each journal cover is a link; pointing at it (or focusing it) lifts it and outlines it in cobalt */
.journals { display: block; width: 100%; height: auto; aspect-ratio: 10 / 7; }
.journal { cursor: pointer; transition: transform 0.2s ease; }
.journal:hover, .journal:focus-visible { transform: translateY(-16px); outline: none; }
.journal-page { transition: stroke 0.2s; }
.journal:hover .journal-page, .journal:focus-visible .journal-page { stroke: var(--cobalt); stroke-width: 5; }
.journal-title { font-family: var(--sans); font-size: 58px; font-weight: 500; letter-spacing: -0.02em; fill: var(--ink); }
.journal-go { font-family: var(--mono); font-size: 30px; fill: var(--cobalt); opacity: 0; transition: opacity 0.2s; }
.journal:hover .journal-go, .journal:focus-visible .journal-go { opacity: 1; }
@media (hover: none) { .journal-go { opacity: 1; } }
/* Fig. 7: the editor's marks (circle, note line, caret, tick) write themselves in one after another as the figure
   scrolls into view (--p from site.js), and again when the figure is pointed at */
.journals { --p: 1; }
.edit-mark { stroke-dasharray: 1; }
.edit-mark.m1 { stroke-dashoffset: calc(1 - clamp(0, var(--p) / 0.35, 1)); }
.edit-mark.m2 { stroke-dashoffset: calc(1 - clamp(0, (var(--p) - 0.3) / 0.2, 1)); }
.edit-mark.m3 { stroke-dashoffset: calc(1 - clamp(0, (var(--p) - 0.5) / 0.2, 1)); }
.edit-mark.m4 { stroke-dashoffset: calc(1 - clamp(0, (var(--p) - 0.7) / 0.25, 1)); }
.tile--wide:hover .edit-mark { animation: mark-write 0.7s ease-out both; }
.tile--wide:hover .edit-mark.m2 { animation-delay: 0.5s; }
.tile--wide:hover .edit-mark.m3 { animation-delay: 0.9s; }
.tile--wide:hover .edit-mark.m4 { animation-delay: 1.2s; }
@keyframes mark-write { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) {
  .journal { transition: none; } .journal:hover, .journal:focus-visible { transform: none; }
  .journals { --p: 1 !important; } .edit-mark { animation: none !important; }
}
@media (max-width: 600px) { .tile--wide { grid-template-columns: minmax(0, 1fr); } }
/* Teaching: a still grid, three across, two on tablets and phones. Each figure plays as it rises up the screen. */
.teach-stage { display: flex; flex-direction: column; gap: 32px; }
@media (max-width: 600px) {
  .work-grid { gap: 36px 16px; }
  .work-grid .tile { gap: 10px; }
  .work-grid .tile h3 { font-size: 17px; }
  .work-grid .tile p { font-size: 14px; }
}

/* Numbered sections */
.section { padding: var(--section) 0; border-bottom: 1px solid var(--line); }
.section--first { border-top: 1px solid var(--line); }
.section--last { border-bottom: 0; }
.section .wrap { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 40px; }
/* The section's name: large, with its number above, and it stays in view beside a long section */
.section-title { display: flex; flex-direction: column; gap: 10px; align-self: start; position: sticky; top: 96px; font-size: clamp(28px, 2.5vw, 36px); font-weight: 500; line-height: 1.05; letter-spacing: -0.025em; }
.section-num { font-family: var(--mono); font-size: 14px; font-weight: 400; letter-spacing: 0; color: var(--cobalt); }
.section-body { display: flex; flex-direction: column; gap: 32px; }
.statement { font-size: clamp(24px, 2.6vw, 34px); line-height: 1.3; letter-spacing: -0.015em; max-width: 900px; }
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 40px; }

/* Line icons, drawn like the figures */
.icon { width: 40px; height: 40px; flex-shrink: 0; fill: none; stroke: var(--cobalt); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
/* The research cards' small drawings follow the figures: ink lines with one blue detail */
.icon--fig { stroke: var(--ink); stroke-width: 1.5; }
.icon--fig .hl { stroke: var(--cobalt); stroke-width: 2; }

/* Cards for research questions and talks */
.cards { display: grid; gap: 16px; }
.cards--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cards--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card { display: flex; flex-direction: column; gap: 12px; padding: 24px; background: #f7f6f2; }
.card h3 { font-size: 21px; font-weight: 500; line-height: 1.3; }
.card p { font-size: 15px; line-height: 1.55; color: var(--muted); }
/* Talks I give most: four rows that open, one at a time, to the speaker bio and the request button */
.talk-rows { border-bottom: 1px solid var(--line); }
.talk-row { border-top: 1px solid var(--line); }
.talk-row > summary { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; align-items: baseline; gap: 0 12px; padding: 26px 0; cursor: pointer; list-style: none; }
.talk-row > summary::-webkit-details-marker { display: none; }
.talk-row > summary::after { content: "+"; font-size: 26px; font-weight: 400; line-height: 1; color: var(--cobalt); transition: transform 0.25s; }
.talk-row[open] > summary::after { transform: rotate(45deg); }
.talk-num { font-family: var(--mono); font-size: 14px; color: var(--cobalt); }
.talk-head { display: flex; flex-direction: column; gap: 6px; }
.talk-title { font-size: clamp(24px, 2.5vw, 34px); font-weight: 400; line-height: 1.15; letter-spacing: -0.02em; color: var(--ink); transition: color 0.15s; }
.talk-row > summary:hover .talk-title, .talk-row[open] .talk-title { color: var(--cobalt); }
.talk-for { font-size: 16px; line-height: 1.5; color: var(--muted); }
.talk-open { display: flex; flex-direction: column; gap: 14px; padding: 0 0 32px 84px; max-width: 860px; animation: talk-open 0.35s ease-out; }
@keyframes talk-open { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@media (max-width: 600px) {
  .talk-row > summary { grid-template-columns: 40px minmax(0, 1fr) auto; padding: 20px 0; }
  .talk-open { padding-left: 0; }
}
@media (prefers-reduced-motion: reduce) { .talk-open { animation: none; } .talk-row > summary::after { transition: none; } }
}

/* Research cards open their papers; talk cards pick the organizer bio */
.card--choice { color: var(--ink); text-decoration: none; outline: 1px solid transparent; transition: outline-color 0.15s; cursor: pointer; }
.card--choice:hover { outline-color: var(--cobalt); color: var(--ink); }
.card-title { font-size: 21px; font-weight: 500; line-height: 1.3; color: var(--ink); }
.card-count { margin-top: auto; padding-top: 6px; font-family: var(--mono); font-size: 12px; color: var(--cobalt); }
.card--filter { flex-direction: column; }
.card--filter[aria-pressed="true"] .card-count { font-weight: 500; }
.card--choice { font: inherit; text-align: left; border: 0; width: 100%; }
.card--choice[aria-pressed="true"] { background: #fff; outline: 2px solid var(--cobalt); }
.bio-focus { font-size: 14px; color: var(--muted); }
.bio-focus b { font-weight: 500; color: var(--cobalt); }
/* Publications: one square per paper, stacked by year. A chosen research card turns its papers cobalt. */
/* The questions and the chart are pinned below the header while the squares fill in (site.js sets the track's
   height, and pins only when the whole stage fits on the screen); the paper card and list come after */
.research-stage, .pub-more { display: flex; flex-direction: column; gap: 32px; }
.research-track.is-pinned { box-sizing: content-box; }
.research-track.is-pinned .research-stage { position: sticky; top: 96px; }
@media (max-width: 600px) { .research-track.is-pinned .research-stage { top: 12px; } }
/* Where the questions and the chart don't fit on the screen together (most phones), site.js holds the chart alone
   while it fills in, and adds an empty block (.pub-run) below it as the room for the run */
.research-track.is-pinned-chart .pubs { position: sticky; top: var(--pin, 12px); }
.pub-run[hidden] { display: none; }
.pubs { display: flex; flex-direction: column; gap: 14px; scroll-margin-top: 16px; }
.pubs-head { display: flex; flex-direction: column; gap: 4px; }
.pubs-head .label { font-size: 12px; }
.pub-status { display: flex; flex-wrap: wrap; align-items: center; gap: 0 20px; font-size: 16px; }
.pub-status[hidden] { display: none; }
.pubs .btn { font-family: inherit; background: none; cursor: pointer; }
.pubs .btn--line:hover { background: var(--ink); }
.pubs .btn[hidden] { display: none; }
.pub-chart { display: flex; align-items: flex-end; gap: clamp(8px, 2vw, 28px); padding: 20px 20px 12px; background: #f1f0ec; overflow-x: auto; }
.pub-chart[hidden] { display: none; }
.pub-year { display: flex; flex-direction: column; align-items: center; gap: 8px; flex: 1 0 auto; }
.pub-stack { display: flex; flex-wrap: wrap-reverse; justify-content: center; gap: 3px; width: calc(4 * 14px + 3 * 3px); }
.pub-square { width: 14px; height: 14px; background: #c9c5bb; transition: background-color 0.15s, opacity 0.15s; }
.pub-square:hover { outline: 2px solid var(--ink); outline-offset: 1px; }
/* The stacks build with the scroll: site.js marks the chart .scrub and gives a square .is-in once the page has moved
   far enough, one question after another, so scrolling back up takes them away again */
.pub-chart.scrub .pub-square { opacity: 0; transform: translateY(-16px); transition: opacity 0.25s, transform 0.3s cubic-bezier(0.3, 1.3, 0.5, 1), background-color 0.15s; }
.pub-chart.scrub .pub-square.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .pub-chart .pub-square { opacity: 1 !important; transform: none !important; }
}
.pub-chart[data-theme]:not([data-theme="all"]) .pub-square { background: #e4e1d9; }
.pub-chart[data-theme="access"] .pub-square[data-theme="access"],
.pub-chart[data-theme="safety"] .pub-square[data-theme="safety"],
.pub-chart[data-theme="nerve"] .pub-square[data-theme="nerve"] { background: var(--cobalt); }
/* The NEJM videos are squares like any other paper; only their label carries the journal's red */
.pub-year-label.pub-year-label--video { color: var(--nejm); }
.pub-year-label { font-family: var(--mono); font-size: 12px; color: var(--muted); }
/* The peek: a small picture and title of one paper, which fades to the next as the stacks fill or a square is
   pointed at; it keeps its space while empty so nothing below it moves */
.pub-peek { display: grid; grid-template-columns: 72px minmax(0, 1fr); align-items: center; gap: 14px; max-width: 560px; min-height: 72px; color: var(--ink); text-decoration: none; transition: opacity 0.3s; }
.pub-peek[hidden] { display: none; }
.pub-peek.is-empty { opacity: 0; pointer-events: none; }
.pub-peek.is-fading { opacity: 0; transition-duration: 0.12s; }
.pub-peek img, .pub-peek .pub-peek-blank { width: 72px; height: 72px; object-fit: cover; background: #f1f0ec; }
.pub-peek-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pub-peek-meta { font-family: var(--mono); font-size: 12px; color: var(--faint); }
.pub-peek-title { font-size: 16px; line-height: 1.35; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.pub-peek-go { font-size: 14px; color: var(--cobalt); }
.pub-peek:hover .pub-peek-title { color: var(--cobalt); }
/* One paper, explained: the shared body map beside its plain-language summary (papercard.js) */
.paper-card { display: grid; grid-template-columns: minmax(180px, 280px) minmax(0, 1fr); gap: 28px; align-items: start; padding: 24px; background: #f1f0ec; }
.paper-card-fig { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.paper-card-text { display: flex; flex-direction: column; gap: 10px; max-width: 34em; }
.paper-card-meta { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.paper-card-title { font-size: 20px; font-weight: 500; line-height: 1.3; letter-spacing: -0.01em; color: var(--ink); text-wrap: balance; }
.paper-card-plain { font-size: 18px; line-height: 1.55; color: var(--ink-2); text-wrap: pretty; }
.paper-card-link { align-self: flex-start; margin-top: 4px; font-size: 16px; }
.paper-card-link::after { content: " ↗"; }
.bodymap { width: 100%; max-width: 280px; height: auto; display: block; }
.bm-line { fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.bm-cord { fill: none; stroke: #f3de95; stroke-width: 5; stroke-linecap: round; }
.bm-bone { fill: none; stroke: var(--ink); stroke-width: 0.8; opacity: 0.3; }
.bm-part { fill: #fff; stroke: var(--ink); stroke-width: 1.4; }
.bm-lit-line { fill: none; stroke: var(--cobalt); stroke-width: 3.2; stroke-linecap: round; stroke-dasharray: 400; stroke-dashoffset: 400; animation: bm-draw 0.9s 0.25s ease-out forwards; }
.bm-lit-dot { fill: var(--cobalt); }
.bm-lit-fill { fill: var(--cobalt); }
.bm-fillless { fill: none; }
.bm-nerve { fill: none; stroke: #f3de95; stroke-width: 5; stroke-linecap: round; }
.bm-nerve--big { stroke-width: 12; }
.bm-zoom { fill: #fff; stroke: var(--ink); stroke-width: 1.2; }
.bm-leader { fill: none; stroke: var(--ink); stroke-width: 0.8; stroke-dasharray: 2 3; }
.bm-skin { stroke-dasharray: 3 3; opacity: 0.6; }
.bm-needle { stroke: var(--ink); stroke-width: 2.4; stroke-linecap: round; }
.bm-thin { fill: none; stroke: var(--ink); stroke-width: 1.1; stroke-linecap: round; stroke-linejoin: round; }
.bm-organ { fill: #fff; fill-opacity: 0.6; stroke: var(--ink); stroke-width: 1.1; }
.bm-vessel { fill: none; stroke: var(--ink); stroke-width: 4; stroke-opacity: 0.35; stroke-linecap: round; }
.bm-cable { fill: none; stroke: #8a8a8a; stroke-width: 2.6; stroke-linecap: round; }
.bm-tube { fill: none; stroke: #8a8a8a; stroke-width: 1.6; stroke-linecap: round; }
.bm-flow { fill: none; stroke: var(--cobalt); stroke-width: 1.4; stroke-dasharray: 3 5; opacity: 0.7; }
.bm-beam { fill: none; stroke: var(--cobalt); stroke-width: 1.6; stroke-dasharray: 6 4; }
.bm-glow { fill: none; stroke: var(--cobalt); stroke-width: 1.4; opacity: 0.55; }
.bm-incision { fill: none; stroke: var(--cobalt); stroke-width: 2; stroke-dasharray: 2 3; }
.bm-tumor { fill: #c9c7c1; stroke: var(--ink); stroke-width: 1; }
.bm-cover { fill: #f1f0ec; }
.bm-phantom { fill: none; stroke: var(--ink); stroke-width: 1.2; stroke-dasharray: 4 4; opacity: 0.5; }
.bm-muscle { fill: #fff; stroke: var(--cobalt); stroke-width: 1.6; }
.bm-hatch { fill: none; stroke: var(--cobalt); stroke-width: 1.2; opacity: 0.7; }
.bm-ring { fill: none; stroke: var(--cobalt); stroke-width: 1.4; opacity: 0; transform-box: fill-box; transform-origin: center; animation: bm-pulse 2.4s 0.6s ease-out infinite; }
@keyframes bm-draw { to { stroke-dashoffset: 0; } }
@keyframes bm-pulse { 0% { opacity: 0.8; transform: scale(0.7); } 100% { opacity: 0; transform: scale(1.35); } }
@media (prefers-reduced-motion: reduce) {
  .bm-lit-line { animation: none; stroke-dashoffset: 0; }
  .bm-ring { animation: none; opacity: 0.5; }
}
@media (max-width: 600px) {
  /* on a phone the body map sits beside the title, and the summary runs the full width below */
  .paper-card { grid-template-columns: 120px minmax(0, 1fr); gap: 10px 14px; padding: 18px 16px; }
  .paper-card-fig { grid-row: 1 / span 2; }
  .paper-card-text { display: contents; }
  .paper-card-meta { grid-column: 2; align-self: end; }
  .paper-card-title { grid-column: 2; align-self: start; }
  .paper-card-plain, .paper-card-link { grid-column: 1 / -1; }
  .paper-card-title { font-size: 18px; }
  .paper-card-plain { font-size: 17px; }
}
.paper-card-fig.is-diagram { align-items: stretch; }
@media (max-width: 600px) {
  .paper-card:has(.is-diagram) { grid-template-columns: minmax(0, 1fr); }
  .paper-card:has(.is-diagram) .paper-card-fig { grid-row: auto; }
  .paper-card:has(.is-diagram) .paper-card-meta, .paper-card:has(.is-diagram) .paper-card-title { grid-column: 1; }
}
/* Procedure and subject drawings (procedures.js), in the patient guides' style */
.procedure { width: 100%; max-width: 300px; height: auto; display: block; }
.paper-card-img { width: 100%; max-width: 320px; height: auto; display: block; margin: 0 auto; filter: brightness(1.013); }
.pr-bone { fill: #fff; stroke: var(--ink); stroke-width: 1.3; }
.pr-bone-line, .pr-thin { fill: none; stroke: var(--ink); stroke-width: 1.2; stroke-linecap: round; }
.pr-thick { stroke-width: 7; stroke-linejoin: round; }
.pr-fillless { fill: none; }
.pr-skin { fill: none; stroke: var(--ink); stroke-width: 1.5; }
.pr-disc { fill: #e9e6df; stroke: var(--ink); stroke-width: 0.8; }
.pr-dura { fill: none; stroke: var(--ink); stroke-width: 1; }
.pr-csf { fill: #eef1f9; stroke: none; }
.pr-roots { fill: none; stroke: #e7cf7e; stroke-width: 1.4; }
.pr-cord { fill: #f3de95; stroke: var(--ink); stroke-width: 1; }
.pr-organ { fill: #fff; fill-opacity: 0.5; stroke: var(--ink); stroke-width: 0.9; stroke-dasharray: 3 3; }
.pr-tissue { fill: #fff; stroke: var(--ink); stroke-width: 1.6; stroke-linejoin: round; }
.pr-artery-o { fill: none; stroke: var(--ink); stroke-width: 13; stroke-linecap: round; }
.pr-artery-i { fill: none; stroke: #fff; stroke-width: 10; stroke-linecap: round; }
.pr-layer { fill: #e9e6dd; stroke: none; }
.pr-fatcell { fill: #fbf3d6; stroke: #b9ad8c; stroke-width: 1; }
.pr-lump { fill: #fbf3d6; stroke: var(--cobalt); stroke-width: 3; }
.pr-lung { fill: #f7f6f2; }
.pr-screen { fill: none; stroke: var(--ink); stroke-width: 2; }
.pr-skin--dash { stroke-dasharray: 8 6; stroke: var(--cobalt); }
.pr-device--ghost { fill: none; stroke-dasharray: 6 4; }
.pr-lead--kink { stroke-width: 4; }
.pr-incision--maybe { stroke-dasharray: 8 6; }
.pr-ghost .pr-bone, .pr-ghost .pr-disc, .pr-ghost .pr-joint, .pr-ghost .pr-csf { fill: none; stroke: var(--cobalt); stroke-dasharray: 5 4; }
.pr-tissue--hit { stroke: var(--cobalt); }
.pr-crease { fill: none; stroke: var(--ink); stroke-width: 1.1; stroke-linecap: round; }
.pr-crease--soft { opacity: 0.45; }
.pr-aorta-o { fill: none; stroke: var(--ink); stroke-width: 26; stroke-linecap: round; }
.pr-aorta-i { fill: none; stroke: #fff; stroke-width: 22.5; stroke-linecap: round; }
.pr-vessel { fill: #fff; stroke: var(--ink); stroke-width: 1.3; }
.pr-vessel--hit { stroke: var(--cobalt); stroke-width: 2; }
.pr-vessel-line { fill: none; stroke: var(--ink); stroke-width: 1.3; }
.pr-lig { fill: #ece5d3; stroke: var(--ink); stroke-width: 1; }
.pr-lig--soft { fill: #f4efe3; }
.pr-lig-line { fill: none; stroke: #cfc6b0; stroke-width: 9; }
.pr-lig-line--wide { stroke-width: 14; }
.pr-surface { fill: none; stroke: var(--ink); stroke-width: 0.9; stroke-dasharray: 3 3; opacity: 0.6; }
.pr-hole { fill: #f1f0ec; stroke: var(--ink); stroke-width: 0.9; }
.pr-joint { fill: #e9e6df; stroke: var(--ink); stroke-width: 1; }
.pr-nerve { fill: none; stroke: #f3de95; stroke-width: 6; stroke-linecap: round; }
.pr-nerve--big { stroke-width: 14; }
.pr-nerve--gray { stroke-width: 8; }
.pr-nerve-fine { fill: none; stroke: #e2c56a; stroke-width: 1.6; }
.pr-artery { fill: none; stroke: var(--ink); stroke-width: 4; stroke-linecap: round; }
.pr-bone--faint { opacity: 0.45; }
.pr-lead--fine { stroke-width: 2.4; }
.pr-fold { fill: none; stroke: var(--ink); stroke-width: 0.9; stroke-dasharray: 3 3; opacity: 0.5; }
.pr-nerve-dot { fill: #f3de95; stroke: var(--ink); stroke-width: 0.9; }
.pr-nerve-x { fill: #f3de95; stroke: var(--ink); stroke-width: 1.2; }
.pr-needle { stroke: var(--ink); stroke-width: 2.6; stroke-linecap: round; }
.pr-hub { fill: #fff; stroke: var(--ink); stroke-width: 1.3; }
.pr-lead { fill: none; stroke: var(--cobalt); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.pr-lead--thick { stroke-width: 6; }
.pr-contact { fill: var(--cobalt); }
.pr-device { fill: #fff; stroke: var(--ink); stroke-width: 1.4; }
.pr-spread { fill: var(--cobalt); opacity: 0.22; }
.pr-spread-line { fill: none; stroke: var(--cobalt); stroke-width: 10; opacity: 0.22; }
.pr-beam { fill: none; stroke: var(--ink); stroke-width: 0.8; stroke-dasharray: 3 4; opacity: 0.5; }
.pr-muscle { fill: #f6e3dc; stroke: var(--ink); stroke-width: 1; }
.pr-join { fill: var(--cobalt); }
.pr-airway { fill: none; stroke: var(--ink); stroke-width: 1.4; stroke-linecap: round; }
.pr-tube-out { fill: none; stroke: var(--ink); stroke-linecap: round; stroke-linejoin: round; }
.pr-tube-in { fill: none; stroke: #f8f6f1; stroke-linecap: round; stroke-linejoin: round; }
.pr-ring { fill: none; stroke: var(--ink); stroke-width: 0.8; opacity: 0.4; }
.pr-lead--tube { stroke-width: 7; opacity: 0.9; }
.pr-cuff--flat { opacity: 0.6; }
.pr-bulge { fill: #d9d2c0; }
.pr-dura--hot { stroke: var(--cobalt); stroke-width: 3; }
.pr-bubble { fill: #fff; stroke: var(--cobalt); stroke-width: 2; }
.pr-beam--hit { stroke: var(--cobalt); stroke-width: 2; opacity: 0.8; }
.pr-incision { fill: none; stroke: var(--cobalt); stroke-width: 3; stroke-dasharray: 4 5; }
.pr-device--hit { stroke: var(--cobalt); stroke-width: 2.5; }
.pr-cable { fill: none; stroke: #8a8a8a; stroke-width: 3; stroke-linecap: round; }
.pr-neuroma { fill: #f3de95; stroke: var(--cobalt); stroke-width: 2; }
.pr-signal { fill: none; stroke: var(--cobalt); stroke-width: 2; stroke-dasharray: 6 6; }
.pr-phantom { fill: none; stroke: var(--ink); stroke-width: 1; stroke-dasharray: 4 4; opacity: 0.45; }
.pr-hatch { fill: none; stroke: var(--cobalt); stroke-width: 1.4; }
.pr-ray { fill: none; stroke: var(--ink-2); stroke-width: 1.4; stroke-linecap: round; }
.pr-ray--hit { stroke: var(--cobalt); }
.pr-pinch { fill: none; stroke: var(--cobalt); stroke-width: 2.4; }
.pr-glow { fill: none; stroke: var(--cobalt); stroke-width: 6; opacity: 0.25; }
.pr-person { fill: #fff; stroke: var(--ink); stroke-width: 1.4; }
.pr-person--hit { stroke: var(--cobalt); stroke-width: 2.2; }
.pr-play { fill: var(--cobalt); }
.pr-tile { fill: #fff; stroke: var(--ink); stroke-width: 1; }
.pr-tile--hit { stroke: var(--cobalt); stroke-width: 2; }
.pr-lens { fill: #fff; fill-opacity: 0.6; stroke: var(--cobalt); stroke-width: 3; }
.pr-handle { fill: none; stroke: var(--ink); stroke-width: 7; stroke-linecap: round; }
.pr-route { fill: none; stroke: var(--cobalt); stroke-width: 2.4; stroke-dasharray: 6 6; }
.pr-faint { opacity: 0.4; }
.pr-bone--ghost { stroke: var(--cobalt); fill: #fff; fill-opacity: 0.4; stroke-dasharray: 4 3; }
.pr-flow-line { fill: none; stroke: var(--cobalt); stroke-width: 2; stroke-dasharray: 3 5; }
.pr-fat { fill: #f6efd8; stroke: var(--cobalt); stroke-width: 2; }
.pr-bulge-line { fill: none; stroke: var(--cobalt); stroke-width: 2.5; }
.pr-heart { fill: #f6e3dc; stroke: var(--ink); stroke-width: 1.4; }
.pr-tube { fill: none; stroke: #8a8a8a; stroke-width: 2; stroke-linecap: round; }
.pr-cuff { fill: #fff; fill-opacity: 0.6; stroke: var(--cobalt); stroke-width: 1.8; }
.pr-leak { fill: none; stroke: var(--cobalt); stroke-width: 1.6; stroke-linecap: round; }
.pr-body { fill: #fff; stroke: var(--ink); stroke-width: 1.3; }
.pr-arrow { fill: none; stroke: var(--cobalt); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.pr-fluid { fill: var(--cobalt); opacity: 0.35; }
.pr-button { fill: var(--cobalt); }
.paper-card-credit { font-family: var(--mono); font-size: 11px; color: var(--faint); text-align: center; }
/* The card opens under the chart, growing out of the square that was chosen */
.pub-card { position: relative; }
.pub-card[hidden] { display: none; }
.pub-card-close { position: absolute; top: 8px; right: 8px; z-index: 1; min-width: 44px; min-height: 44px; border: 0; background: none; font: inherit; font-size: 15px; color: var(--muted); cursor: pointer; }
.pub-card-close:hover { color: var(--ink); }
.pub-card .paper-card { padding-right: 56px; }
.pub-card.is-opening .paper-card { transform-origin: var(--ox, 50%) var(--oy, 0); animation: card-grow 0.42s cubic-bezier(0.2, 0.8, 0.2, 1); }
.pub-card.is-opening .paper-card-text { animation: card-text 0.5s 0.12s ease-out both; }
@keyframes card-grow { from { transform: scale(0.04); opacity: 0.4; } to { transform: none; opacity: 1; } }
@keyframes card-text { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .pub-card.is-opening .paper-card, .pub-card.is-opening .paper-card-text { animation: none; } }
/* Switching to another paper while the card is open: the new picture appears already drawn */
.pub-card.is-swap .bm-lit-line { animation: none; stroke-dashoffset: 0; }
.pub-square.has-summary { cursor: pointer; }
.pub-square.is-open { outline: 2px solid var(--ink); outline-offset: 2px; }
/* On touch screens the squares can't be pointed at, so the hint says what to do instead */
.pub-tip { display: none; font-size: 15px; color: var(--muted); }
.pub-list:empty { display: none; }
.pub-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 32px; }
.pub-item { position: relative; display: flex; flex-direction: column; gap: 3px; padding: 14px 0; border-top: 1px solid var(--line); }
.pub-item-meta { font-family: var(--mono); font-size: 12px; color: var(--faint); }
.pub-item-plain { position: relative; z-index: 1; font-size: 15px; line-height: 1.5; color: var(--ink-2); text-wrap: pretty; }
.pub-item[data-theme="video"] .pub-item-meta { color: var(--nejm); }
.pub-item-title { font-size: 16px; line-height: 1.4; color: var(--ink); text-decoration: none; }
/* A faint underline at rest, so the titles read as links on touch screens too */
a.pub-item-title { text-decoration: underline; text-decoration-color: var(--line, #d9d6cf); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a.pub-item-title::after { content: ""; position: absolute; inset: 0; }
.pub-item:hover a.pub-item-title { color: var(--cobalt); text-decoration: underline; text-underline-offset: 3px; }
.pub-noscript { font-size: 16px; color: var(--muted); }
@media (hover: none) {
  .pub-square { pointer-events: none; }
  .pub-square.has-summary { pointer-events: auto; }
  .pub-tip:not([hidden]) { display: block; }
}
@media (max-width: 600px) {
  .pub-list { grid-template-columns: minmax(0, 1fr); }
  .pub-chart { padding: 16px 12px 10px; gap: 4px; }
  .pub-year { flex: 1 1 0; min-width: 0; }
  .pub-year-label { min-height: 2.5em; text-align: center; line-height: 1.25; }
  .pub-stack { width: calc(3 * 10px + 2 * 3px); }
  .pub-square { width: 10px; height: 10px; }
  .pub-year-label { font-size: 11px; }
}

/* Ready-to-use bio for people who invite a talk */
.organizers { display: flex; flex-direction: column; gap: 14px; padding: clamp(20px, 3vw, 32px); border: 1px solid var(--line); }
.organizers { gap: 0; padding: 0; }
.organizers > summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 56px; padding: 0 clamp(20px, 3vw, 32px); cursor: pointer; list-style: none; }
.organizers > summary::-webkit-details-marker { display: none; }
.organizers > summary::after { content: "+"; font-size: 20px; color: var(--cobalt); }
.organizers[open] > summary::after { content: "–"; }
.organizers[open] { padding-bottom: clamp(6px, 1.5vw, 18px); }
.organizers[open] > :not(summary) { margin: 0 clamp(20px, 3vw, 32px) 14px; }
.speaking-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; }
/* Inside the open panel: the headshot beside the bio and its buttons */
.organizer-body { display: grid; grid-template-columns: 148px minmax(0, 1fr); gap: 24px 28px; align-items: start; padding-top: 4px; }
.organizer-photo { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; background: #e9eef0; }
.organizer-text { display: flex; flex-direction: column; gap: 14px; max-width: 760px; }
@media (max-width: 600px) { .organizer-body { grid-template-columns: minmax(0, 1fr); } .organizer-photo { width: 120px; } .card--talk { padding: 22px 52px 22px 20px; gap: 16px; } .talk-icon { width: 60px; height: 60px; } .talk-icon .icon { width: 36px; height: 36px; } }
.bio { font-size: 17px; line-height: 1.65; color: var(--ink-2); }
.organizers-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; font-size: 16px; font-weight: 500; }
.copy { font-family: inherit; background: none; cursor: pointer; }



/* Contact band */
.contact { background: var(--cobalt-deep); color: #fff; padding: var(--section) 0; }
.contact .btn--white { color: var(--cobalt-deep); }
.contact .btn--white-line:hover { color: var(--cobalt-deep); }
.contact .wrap { display: flex; flex-direction: column; gap: 40px; }
.contact h2 {
  font-weight: 400; font-size: clamp(40px, 6.4vw, 96px);
  line-height: 1; letter-spacing: -0.035em; max-width: 1100px;
}
.contact .two { max-width: 1100px; }
.path { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; border-top: 1px solid var(--cobalt-line); padding-top: 16px; }
.path h3 { font-size: 20px; font-weight: 500; }
.path p { font-size: 16px; line-height: 1.6; color: var(--cobalt-text); }
.path .path-for { font-family: var(--mono); font-size: 12px; color: var(--cobalt-text); }
.path .path-send { font-size: 15px; color: #fff; }
.path .path-send a { color: #fff; }
.path .btn { margin-top: auto; }
.paths { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px; }
@media (max-width: 960px) { .paths { grid-template-columns: minmax(0, 1fr); max-width: 640px; } }
.paths .path { gap: 10px; padding-bottom: 4px; }
.paths .path .btn { margin-top: 8px; }

/* Contact form, in the blue band. There is no email address on the site; messages go through this form. */
.contact-form { display: flex; flex-direction: column; gap: 22px; max-width: 760px; border-top: 1px solid var(--cobalt-line); padding-top: 24px; }
.form-head { display: flex; flex-direction: column; gap: 8px; }
.form-head h3 { font-size: 24px; font-weight: 500; letter-spacing: -0.01em; }
.form-note { font-size: 16px; line-height: 1.55; color: var(--cobalt-text); max-width: 640px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }
.form-grid label { display: flex; flex-direction: column; gap: 6px; font-size: 15px; font-weight: 500; color: #fff; }
.form-grid .span { grid-column: 1 / -1; }
.contact-form input, .contact-form select, .contact-form textarea {
  font: inherit; font-size: 16px; font-weight: 400; color: var(--ink); background: #fff;
  border: 1px solid transparent; border-radius: 0; min-height: 48px; padding: 10px 12px; width: 100%;
}
.contact-form select { -webkit-appearance: none; appearance: none; padding-right: 36px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%231a1a1a' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 14px center; }
.contact-form textarea { resize: vertical; min-height: 150px; line-height: 1.5; }
.contact-form :where(input, select, textarea):focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
/* A field the server sent back as missing: a dashed white ring that shows on the blue */
.contact-form [aria-invalid="true"] { outline: 2px dashed #fff; outline-offset: 3px; }
.form-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.form-foot .btn { border: 0; cursor: pointer; font-family: inherit; }
.form-foot .btn:disabled { opacity: 0.6; cursor: default; }
.form-status { font-size: 16px; line-height: 1.5; color: #fff; }
.form-status.is-error { color: #ffd9d9; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
@media (max-width: 600px) { .form-grid { grid-template-columns: minmax(0, 1fr); } }

/* Footer */
.site-footer .wrap.footer-row {
  display: flex; justify-content: space-between; gap: 8px 24px; flex-wrap: wrap;
  padding-top: 20px; padding-bottom: 20px; font-size: 15px; color: var(--faint);
}
.footer-links { display: flex; flex-wrap: wrap; gap: 0 20px; }
.footer-note { align-self: center; }

/* Tablet */
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .hero-figure { max-width: 440px; }
  /* The portrait leads on narrow screens: face and name first, then the headline */
  .hero-portrait { order: -1; max-width: 520px; }
  .about-grid { grid-template-columns: minmax(0, 1fr); }
  .facts { max-width: 640px; }
  .work-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .section .wrap { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .section-title { position: static; flex-direction: row; align-items: baseline; gap: 14px; font-size: 32px; }
}
@media (max-width: 760px) {
  .cards--3 { grid-template-columns: minmax(0, 1fr); }
}

/* Phone: the header scrolls away, name and Collaborate on top, menu below */
@media (max-width: 600px) {
  .site-header { position: static; }
  html { scroll-padding-top: 0; }
  .two, .cards--2 { grid-template-columns: minmax(0, 1fr); }
  .nav { order: 3; width: 100%; margin-left: 0; gap: 0 16px; font-size: 16px; }
  .header-cta { font-size: 16px; }
  .card { padding: 20px; }
  .hero { padding-top: 20px; }
  .hero-portrait img { aspect-ratio: 5 / 4; }
  .facts div { grid-template-columns: 84px minmax(0, 1fr); }
}

/* Small phone: keep the menu on one line */
@media (max-width: 380px) {
  .nav { justify-content: space-between; gap: 0 8px; font-size: 15px; }
  .header-cta { font-size: 15px; }
}

/* Talks page */
.talks-hero { padding-bottom: clamp(32px, 4vw, 48px); display: flex; flex-direction: column; gap: 20px; }
.talks-hero h1 { font-weight: 400; font-size: clamp(42px, 6.4vw, 96px); line-height: 1; letter-spacing: -0.035em; }
.talks-body { padding-bottom: var(--section); display: flex; flex-direction: column; gap: 40px; }
.talk-controls { display: flex; flex-direction: column; gap: 14px; padding-bottom: 24px; border-bottom: 1px solid var(--ink); }
.talk-search {
  font: inherit; font-size: 18px; width: 100%; max-width: 560px; min-height: 48px; padding: 0 14px;
  border: 1px solid var(--line); background: #fff; color: var(--ink);
}
.talk-search:focus { outline: 2px solid var(--cobalt); outline-offset: 1px; border-color: transparent; }
.talk-count { font-size: 15px; color: var(--muted); }
.talk-count b { font-weight: 500; color: var(--ink); }
.talks { display: flex; flex-direction: column; border-bottom: 1px solid var(--line); }
/* Each year is a row that opens to show its talks */
.talk-year { border-top: 1px solid var(--line); }
.talk-year > summary { display: flex; align-items: center; gap: 20px; min-height: 60px; cursor: pointer; list-style: none; }
.talk-year > summary::-webkit-details-marker { display: none; }
.talk-year > summary::after { content: "+"; margin-left: auto; font-size: 20px; color: var(--cobalt); }
.talk-year[open] > summary::after { content: "–"; }
.talk-year > summary:hover h2 { text-decoration: underline; text-underline-offset: 4px; }
.talk-year.is-bare { border-top: 0; }
.talk-year.is-bare > summary { display: none; }
.talk-year.is-bare ul { margin-left: 0; }
.talks-prompt { padding: 20px 0; border-top: 1px solid var(--line); font-size: 17px; color: var(--muted); }
.talks-prompt[hidden] { display: none; }
.talk-year-count { font-family: var(--mono); font-size: 12px; color: var(--faint); white-space: nowrap; }
.talk-year ul { margin-left: 144px; padding-bottom: 24px; }
.talk-year[hidden] { display: none; }
/* Each group is a topic; the name sets the width, at least as wide as the indent of the talks below it */
.talk-year h2 { font-size: 22px; min-width: 124px; }
.talk-year ul { list-style: none; margin-top: 0; margin-right: 0; margin-bottom: 0; padding-left: 0; padding-top: 0; }
/* Inside an open year: talks grouped under small topic headings, each talk two short lines */
.talk-group { display: flex; align-items: baseline; gap: 10px; padding: 18px 0 6px; font-family: var(--mono); font-size: 12px; color: var(--cobalt); }
.talk-group:first-child { padding-top: 4px; }
.talk-group-count { color: var(--faint); }
.talk-group[hidden] { display: none; }
.talk { padding: 9px 0 10px; border-top: 1px solid #eeece6; display: flex; flex-direction: column; gap: 2px; }
.talk-group + .talk { border-top-color: var(--line); }
.talk[hidden] { display: none; }
.talk-name { font-size: 16px; line-height: 1.35; }
.talk-meta { font-size: 13px; line-height: 1.45; color: var(--muted); }
.talk-kind { color: var(--ink); }
/* Grand rounds stand out by weight, not colour: blue on this page means "chosen" */
.talk--gr .talk-kind { font-weight: 500; }
/* The topic is the heading above; the place is on the map. The tags stay in the page for search only. */
.talk-tags { display: none; }
.talks-empty { font-size: 17px; color: var(--muted); }
@media (max-width: 600px) {
  .talk-year ul { margin-left: 0; }
  .talk-year h2 { width: auto; }
}

/* Talks page: topic cards with a line drawing each; choosing one filters the list */
.topic-chooser { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.topic {
  font: inherit; text-align: left; border: 0; padding: 0 0 12px; background: none; cursor: pointer;
  display: flex; flex-direction: column; gap: 8px; color: var(--ink); outline: 1px solid transparent; outline-offset: 4px;
}
.topic-art { display: block; width: 100%; height: auto; aspect-ratio: 5 / 3; }
.topic:hover .topic-art { outline: 1px solid var(--cobalt); }
.topic[aria-pressed="true"] .topic-art { outline: 2px solid var(--cobalt); }
.topic[aria-pressed="true"] .topic-name { color: var(--cobalt); }
.topic:focus-visible { outline-color: var(--cobalt); }
.topic-name { font-size: 16px; font-weight: 500; line-height: 1.3; }
.topic-count { font-family: var(--mono); font-size: 12px; color: var(--faint); }
@media (max-width: 960px) { .topic-chooser { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
/* Phones: the topic cards become one row you swipe through (the next card peeks in), so the list starts sooner */
@media (max-width: 600px) {
  .topic-chooser { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; margin-right: calc(-1 * var(--gutter)); padding-right: var(--gutter); scrollbar-width: none; }
  .topic-chooser::-webkit-scrollbar { display: none; }
  .topic { flex: 0 0 40%; scroll-snap-align: start; }
}
/* Narrow phones: all five topics in view at once, two across, each a small drawing beside its name, so none is hidden
   off the edge of a sideways row */
@media (max-width: 440px) {
  .topic-chooser { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; overflow: visible; margin-right: 0; padding-right: 0; }
  .topic { display: grid; grid-template-columns: 56px minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 10px; row-gap: 2px; padding: 0; align-content: start; }
  .topic-art { grid-row: 1 / span 2; width: 56px; }
  .topic-name { font-size: 15px; }
}
/* The narrowest phones: "neuromodulation" won't fit beside a drawing, so the drawing sits above the name */
@media (max-width: 380px) {
  .topic { grid-template-columns: minmax(0, 1fr); }
  .topic-art { grid-row: auto; width: 100%; aspect-ratio: 5 / 2; object-fit: cover; }
}

/* Talks page, Fig. 2a: a world map with a dot for each place a talk was given. Choosing a dot filters the list. */
.talk-map { display: flex; flex-direction: column; gap: 10px; }
.talk-map[hidden] { display: none; }
.talk-map-scroll { overflow-x: auto; background: #f1f0ec; }
.talk-map-stage { position: relative; min-width: 720px; }
.talk-map-stage img { width: 100%; height: auto; }
.talk-map-dots { position: absolute; inset: 0; width: 100%; height: 100%; }
.talk-dot { cursor: pointer; outline: none; }
.talk-dot-hit { fill: transparent; }
.talk-dot-mark { fill: var(--cobalt); fill-opacity: 0.85; stroke: #fff; stroke-width: 1.2; transition: fill-opacity 0.15s; }
.talk-dot:hover .talk-dot-mark, .talk-dot:focus-visible .talk-dot-mark { fill: var(--cobalt-dark); fill-opacity: 1; stroke: var(--ink); }
.talk-map-dots.has-choice .talk-dot-mark { fill-opacity: 0.25; }
.talk-map-dots.has-choice .talk-dot[aria-pressed="true"] .talk-dot-mark { fill-opacity: 1; stroke: var(--ink); stroke-width: 1.6; }
/* The map sits after the list, set apart by a rule; its dots appear year by year as it scrolls into view (site.js) */
.map-track { margin-top: 24px; padding-top: 32px; border-top: 1px solid var(--line); }
/* Pinned while its years play (site.js sets the track's height): below the sticky header on wide screens, at the top on phones */
/* Arcs from Boston to every place. They draw out, and the dots land, once when the map first comes into view
   (site.js: .is-waiting, then .is-arriving, each with its own delay --d); places that don't match the controls
   above the map fade back (.is-quiet) */
.talk-dot { transform-box: fill-box; transform-origin: center; transition: opacity 0.3s; }
.talk-arc { fill: none; stroke: var(--cobalt); stroke-width: 1; stroke-opacity: 0.28; vector-effect: non-scaling-stroke; stroke-dasharray: 1; stroke-dashoffset: 0; transition: stroke-opacity 0.3s; pointer-events: none; }
.talk-arc--abroad { stroke: #e0702a; stroke-opacity: 0.35; }
.talk-map-dots.is-waiting .talk-arc { stroke-dashoffset: 1; }
.talk-map-dots.is-waiting .talk-dot { opacity: 0; transform: scale(0); }
.talk-map-dots.is-arriving .talk-arc { animation: arc-draw 0.9s calc(var(--d) - 0.5s) cubic-bezier(0.4, 0, 0.2, 1) both; }
.talk-map-dots.is-arriving .talk-dot { animation: dot-land 0.45s var(--d) cubic-bezier(0.16, 1, 0.3, 1) both; }
@keyframes arc-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes dot-land { from { opacity: 0; transform: scale(0); } to { opacity: 1; transform: scale(1); } }
.talk-dot.is-quiet { opacity: 0.18; }
.talk-arc.is-quiet { stroke-opacity: 0.05; }
.talk-map.is-zoomed .talk-arc { stroke-opacity: 0.12; }
.talk-map figcaption { line-height: 1.5; }
/* Zooming into a crowd of dots: the land is drawn in the page, dots keep their size, and each place is named */
.talk-map { position: relative; }
.talk-map-land { display: block; width: 100%; height: auto; aspect-ratio: 1000 / 260; }
.talk-map-land path { fill: #fbfaf7; stroke: #1a1a1a; stroke-width: 0.8; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.talk-map-land rect { fill: #f1f0ec; }
.land-coarse, .land-fine { transition: opacity 0.3s; }
.land-fine { opacity: 0; }
.talk-dot-mark { vector-effect: non-scaling-stroke; }
.talk-dot-label { display: none; font-family: var(--mono); fill: var(--ink); stroke: #fbfaf7; paint-order: stroke; stroke-linejoin: round; pointer-events: none; }
.talk-map.is-zoomed .talk-dot-label { display: inline; }
.talk-map.is-zoomed .talk-dot-label.is-off { display: none; }
.map-back { position: absolute; top: 10px; left: 10px; z-index: 5; min-height: 36px; padding: 0 12px; border: 1px solid var(--ink); background: #fff; font: inherit; font-size: 14px; color: var(--ink); cursor: pointer; }
.map-back:hover { background: var(--ink); color: #fff; }
.map-back[hidden] { display: none; }
/* Talks given outside the United States are marked in a warm orange, with a small key in the caption */
.talk-dot--abroad .talk-dot-mark { fill: #e0702a; }
.talk-dot--abroad:hover .talk-dot-mark, .talk-dot--abroad:focus-visible .talk-dot-mark { fill: #b9541a; }
.map-key { display: inline-flex; align-items: center; gap: 6px; margin-left: 14px; white-space: nowrap; }
.map-key i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; }
.map-key i + i, .map-key i:nth-of-type(2) { margin-left: 10px; }
.key-us { background: var(--cobalt); }
.key-abroad { background: #e0702a; }
@media (max-width: 600px) { .map-key { display: flex; margin: 4px 0 0; } }
.map-clear { font: inherit; background: none; border: 0; padding: 0 0 0 8px; min-height: 44px; cursor: pointer; color: var(--cobalt); text-decoration: underline; text-underline-offset: 4px; }
.map-clear[hidden] { display: none; }
/* Search and the running count share one row */
.talk-find { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px; }
.talk-find .talk-search { flex: 1 1 320px; }

/* Hidden hellos (site.js): line-drawn people pop up from the bottom edge; pulled out, they swap to a second drawing */
.hello { position: fixed; bottom: 0; z-index: 80; width: calc(min(154px, 31vw) * var(--hello-size, 1) * var(--hello-fit, 1)); padding: 0; border: 0; background: none; cursor: grab; transform: translateY(112%); transition: transform 0.45s cubic-bezier(0.5, 0, 0.75, 0); pointer-events: none; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
.hello.is-up { transform: none; transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), right 0.3s ease; pointer-events: auto; }
.hello.is-held { transition: none; cursor: grabbing; }
.hello.is-falling { transition: transform 0.5s cubic-bezier(0.5, 0, 1, 0.6); pointer-events: none; }
.hello-body { display: block; position: relative; margin-bottom: -10%; transform-origin: 50% 8%; transition: transform 0.45s cubic-bezier(0.34, 1.8, 0.64, 1); }
.hello-body img { display: block; height: auto; filter: drop-shadow(0 6px 18px rgba(26, 26, 26, 0.12)); pointer-events: none; }
.hello-up { width: 100%; transform-origin: 50% 100%; }
.hello.is-up:not(.is-held) .hello-up { animation: hello-sway 1.1s ease-in-out 0.55s 2; }
.hello-held { position: absolute; top: 0; max-width: none; visibility: hidden; }
.hello.is-held .hello-up { visibility: hidden; animation: none; }
.hello.is-held .hello-held { visibility: visible; }
.hello-say { position: absolute; left: 50%; bottom: 100%; margin-bottom: 6px; padding: 7px 11px; white-space: nowrap; font-family: var(--mono); font-size: 12px; line-height: 1.3; color: var(--ink); background: var(--paper); border: 1px solid var(--ink); border-radius: 14px 14px 14px 2px; opacity: 0; transform: translate(-50%, 6px); transition: opacity 0.15s, transform 0.15s; }
.hello.is-up .hello-say { opacity: 1; transform: translate(-50%, 0); transition: opacity 0.25s 0.5s, transform 0.25s 0.5s; }
.hello.is-held .hello-say { transition: none; }
.hello-say.is-long { white-space: normal; width: max-content; max-width: min(200px, 60vw); }
/* Harmony's dog: a four-frame gallop (hello-harmony-dog-run.png) carried round a flattened circle, facing the way it runs */
.hello-dog { position: absolute; right: 104%; bottom: 0; width: 84%; aspect-ratio: 240 / 153; cursor: pointer; transition: translate 0.45s ease-out; }
.hello-dog img { position: absolute; left: 22%; bottom: 3%; width: 50%; height: auto; }
.hello-dog-run { position: absolute; inset: 0; background: url("images/hello-harmony-dog-run.png") 0 0 / 400% 100% no-repeat; visibility: hidden; }
.hello-dog.is-running { animation: hello-lap 0.62s linear infinite; }
.hello-dog.is-running img { visibility: hidden; }
.hello-dog.is-running .hello-dog-run { visibility: visible; animation: hello-gallop 0.22s steps(4) infinite; }
.hello.is-held .hello-dog { visibility: hidden; }
.hello-drop, .hello-ball, .hello-look { position: fixed; top: 0; z-index: 82; --w: min(150px, 34vw); width: var(--w); margin-left: calc(var(--w) / -2); }
.hello-drop img, .hello-ball img, .hello-look img { display: block; width: 100%; height: auto; filter: drop-shadow(0 6px 18px rgba(26, 26, 26, 0.12)); pointer-events: none; }
.hello-drop { pointer-events: none; }
.hello-drop, .hello-ball { animation: hello-drop 1.6s cubic-bezier(0.45, 0, 0.9, 0.55) both; }
.hello-drop .hello-say, .hello-look .hello-say { opacity: 1; transform: translate(-50%, 0); }
.hello-drop .hello-say { left: 75%; }
.hello-ball { --w: calc(min(150px, 34vw) * 0.214); cursor: grab; touch-action: none; }
.hello-ball::before { content: ""; position: absolute; inset: -60%; } /* a bigger target to catch */
.hello-ball.is-caught { transform: none; cursor: grabbing; }
.hello-look.is-sad img { width: 76.5%; margin-inline: auto; }
}
.hello-ball.is-returning { transition: top 0.6s cubic-bezier(0.45, 0, 0.9, 0.55), left 0.6s ease; }
.hello-look { --w: calc(min(150px, 34vw) * 0.755); top: auto; bottom: 0; transform: translateY(105%); transition: transform 0.45s cubic-bezier(0.5, 0, 0.75, 0); pointer-events: none; }
.hello-look.is-up { transform: translateY(12%); transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes hello-drop { from { transform: translateY(calc(var(--fall, 300px) * -1)); } to { transform: translateY(100vh); } }
.hello.has-dog { z-index: 81; } /* the dog runs in front of whoever stands next to her */
@keyframes hello-gallop { to { background-position-x: 133.333%; } }
@keyframes hello-lap {
  0% { transform: translate(calc(var(--lap, 50) * 1%), 0) scale(1, 1); }
  12.5% { transform: translate(calc(var(--lap, 50) * 0.7%), 9%) scale(1.085, 1.085); }
  25% { transform: translate(0, 13%) scale(1.12, 1.12); }
  37.5% { transform: translate(calc(var(--lap, 50) * -0.7%), 9%) scale(1.085, 1.085); }
  49.9% { transform: translate(calc(var(--lap, 50) * -1%), 0) scale(1, 1); }
  50% { transform: translate(calc(var(--lap, 50) * -1%), 0) scale(-1, 1); }
  62.5% { transform: translate(calc(var(--lap, 50) * -0.7%), -9%) scale(-0.915, 0.915); }
  75% { transform: translate(0, -13%) scale(-0.88, 0.88); }
  87.5% { transform: translate(calc(var(--lap, 50) * 0.7%), -9%) scale(-0.915, 0.915); }
  99.9% { transform: translate(calc(var(--lap, 50) * 1%), 0) scale(-1, 1); }
  100% { transform: translate(calc(var(--lap, 50) * 1%), 0) scale(1, 1); }
}
@keyframes hello-sway { 0%, 100% { transform: rotate(0); } 30% { transform: rotate(-3deg); } 70% { transform: rotate(2.5deg); } }
@media (prefers-reduced-motion: reduce) {
  .hello { transition: opacity 0.2s; transform: none; opacity: 0; }
  .hello.is-up { transition: opacity 0.2s; opacity: 1; }
  .hello.is-up:not(.is-held) .hello-up { animation: none; }
  .hello-body { transition: none; }
  .hello-drop, .hello-ball { animation: hello-blink 1.6s ease both; }
  .hello-drop { top: 15vh; }
  .hello-look, .hello-look.is-up { transition: opacity 0.2s; transform: translateY(12%); opacity: 0; }
  .hello-look.is-up { opacity: 1; }
  }
@keyframes hello-blink { 0%, 100% { opacity: 0; } 15%, 80% { opacity: 1; } }
/* Smaller hidden things (site.js). The © in the footer is a button that rolls the credits; it looks like plain text. */
.footer-c { padding: 0; border: 0; background: none; font: inherit; color: inherit; cursor: inherit; }
/* Care: the needle, while Shift is held over the spine drawing, and the glow when it reaches the target */
.care-fig { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; } /* a long press brings the needle, not a menu */
.care-fig.is-needling { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32'%3E%3Cpath d='M30 2L20 12' stroke='%231a1a1a' stroke-width='5' stroke-linecap='round'/%3E%3Cpath d='M21 11L3 29' stroke='%23213DA8' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") 3 29, crosshair; }
.care-glow { fill: var(--cobalt); fill-opacity: 0.35; stroke: var(--cobalt); stroke-width: 3; transform-box: fill-box; transform-origin: center; pointer-events: none; }
/* A speech bubble on its own, above a point on the page */
.hello-say.egg-say { position: fixed; bottom: auto; z-index: 85; margin: 0; opacity: 1; transform: translate(-50%, -100%); pointer-events: none; animation: egg-say 1.6s ease both; }
@keyframes egg-say { 0% { opacity: 0; } 12%, 80% { opacity: 1; } 100% { opacity: 0; } }
/* Fig. 6 with the soccer ball in the middle */
.spin-soccer { pointer-events: none; }
/* The talks map: departures from Boston, every arc at once */
.talk-map-dots.is-departing .talk-arc { animation: arc-draw 1s cubic-bezier(0.4, 0, 0.2, 1) both; }
.talk-map-dots.is-departing .talk-dot:not([data-place="boston"]) { animation: dot-land 0.45s 0.85s cubic-bezier(0.16, 1, 0.3, 1) both; }
@media print { .hello, .hello-drop, .hello-ball, .hello-look { display: none; } }

/* No single word stranded on a paragraph’s last line */
p { text-wrap: pretty; }
.pub-show-more { align-self: flex-start; }
.pub-atlas { align-self: flex-start; }
.talk-when { font-variant-numeric: tabular-nums; }
