/* Art & research: a photographic identity beside an uninterrupted reading column. */
:root {
  color-scheme: light dark;
  --paper: light-dark(#f4f1e9, #202829);
  --ink: light-dark(#233d3c, #edf0e9);
  --muted: light-dark(#64716b, #b6c0b8);
  --rule: light-dark(#d4d8cf, #445251);
  --accent: light-dark(#566951, #b5caa6);
  --wash: light-dark(#e9e9df, #2a3433);
  --art-width: 38%;
  --sans: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --serif: "Source Serif 4", Georgia, serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body.art-research {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 15px/1.75 var(--sans);
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
a { color: inherit; text-underline-offset: .23em; text-decoration-thickness: 1px; }
a:hover { text-decoration-color: var(--accent); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
:is(a, button, summary, input, select, textarea):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 5px;
}
img, svg, canvas, video { max-width: 100%; }
figure, p, h1, h2, h3, h4 { margin: 0; }
strong { font-weight: 500; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; }
h2 { font-size: clamp(23px, 2.3vw, 29px); line-height: 1.3; letter-spacing: -.02em; }
h3 { font-size: 21px; line-height: 1.35; letter-spacing: -.015em; }
p + p { margin-top: 17px; }
::selection { background: light-dark(#d4ddce, #4a6057); color: var(--ink); }
.skip-link {
  position: fixed; z-index: 100; top: 12px; left: 12px;
  padding: 10px 16px; color: var(--ink); background: var(--paper);
  transform: translateY(-180%);
}
.skip-link:focus { transform: none; }

.art-panel {
  position: fixed; inset: 0 auto 0 0; width: var(--art-width);
  overflow: hidden; isolation: isolate; background: #253c3a; color: #f4f2e9;
}
.art-stage, .art-layer, .art-shade { position: absolute; inset: 0; }
.art-stage { z-index: -3; }
.art-layer {
  opacity: 0; background-position: center; background-size: cover;
  transition: opacity 1.2s ease;
}
.art-layer.is-active { opacity: 1; }
.art-shade {
  z-index: -2; pointer-events: none;
  background: linear-gradient(180deg, #0e1b1c26 12%, #0e1b1c52 52%, #0e1b1ca8 100%);
}
.art-identity { position: absolute; bottom: 124px; left: clamp(28px, 4vw, 70px); right: 28px; }
.brand {
  display: inline-block; color: inherit; text-decoration: none;
  font: 400 clamp(44px, 5.1vw, 77px)/1.04 var(--serif); letter-spacing: -.035em;
}
.brand:hover { text-decoration: none; }
.art-affiliation { max-width: 27ch; margin-top: 24px; font-size: 13px; line-height: 1.8; }
.art-footer {
  position: absolute; bottom: 29px; left: clamp(28px, 4vw, 70px); right: 28px;
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 20px;
}
.art-credit { max-width: 28ch; font-size: 10px; line-height: 1.6; text-decoration: none; opacity: .85; }
.art-credit:hover { opacity: 1; text-decoration: underline; }
.art-controls { display: flex; gap: 5px; }
.art-btn {
  display: inline-grid; place-items: center; min-width: 44px; height: 44px;
  padding: 8px; border: 1px solid #f4f2e966; border-radius: 50%;
  background: #0e1b1c12; color: #f4f2e9; font-size: 14px; line-height: 1;
}
.art-btn:hover { border-color: #f4f2e9; background: #0e1b1c40; }
.art-panel :is(a, button):focus-visible { outline-color: #f4f2e9; }

.site-reader { margin-left: var(--art-width); min-width: 0; min-height: 100dvh; }
.site-header { padding: 21px clamp(28px, 4.2vw, 65px); border-bottom: 1px solid var(--rule); }
.site-nav { display: flex; align-items: center; flex-wrap: wrap; column-gap: clamp(16px, 2vw, 28px); row-gap: 0; }
.site-nav a {
  display: inline-flex; align-items: center; min-height: 44px;
  color: var(--muted); font-size: 12px; line-height: 1.3; text-decoration: none; white-space: nowrap;
}
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--ink); }
.site-nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 7px; }
main { min-width: 0; }
.page { max-width: 1030px; padding: clamp(34px, 4.4vw, 66px) clamp(28px, 4.2vw, 65px) 0; }
.page:focus { outline: none; }
.eyebrow, .label {
  margin-bottom: 16px; color: var(--muted); font-size: 10px; line-height: 1.5;
  letter-spacing: .1em; text-transform: uppercase;
}
.hero-title {
  max-width: 17ch; font: 400 clamp(37px, 3.8vw, 58px)/1.1 var(--serif);
  letter-spacing: -.035em; text-wrap: balance;
}
.research-statement { max-width: 67ch; margin-top: 26px; font-size: 14px; line-height: 1.8; }
.research-statement p + p { margin-top: 15px; }
.statement-more { margin-top: 16px; font-size: 13px; }
.statement-more > summary { width: fit-content; color: var(--muted); cursor: pointer; }
.statement-more > summary:hover { color: var(--ink); }
.statement-more[open] > summary { margin-bottom: 15px; }
.statement-more p { font-size: 14px; line-height: 1.8; }
.project-index { list-style: none; margin: 36px 0 0; padding: 0; }
.project-index > li { border-top: 1px solid var(--rule); }
.project-link {
  display: grid; grid-template-columns: 24px minmax(0, 1fr) 18px;
  gap: 13px; align-items: baseline; min-height: 83px; padding: 23px 0;
  text-decoration: none;
}
.project-number, .project-arrow { color: var(--muted); font-size: 11px; }
.project-name { font: 400 clamp(22px, 2.1vw, 30px)/1.25 var(--serif); letter-spacing: -.025em; }
.project-arrow { justify-self: end; transition: transform .2s ease; }
.project-link:hover .project-name { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 6px; }
.project-link:hover .project-arrow { transform: translateX(4px); }
.project-index .project-question {
  grid-column: 2; max-width: 53ch; margin: 3px 0 0;
  color: var(--muted); font: 400 12px/1.7 var(--sans);
}
.site-footer {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px;
  margin: 40px clamp(28px, 4.2vw, 65px) 0; padding: 20px 0 28px;
  border-top: 1px solid var(--rule); color: var(--muted); font-size: 11px; line-height: 1.6;
}
.site-footer a { display: inline-flex; align-items: center; min-height: 32px; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.site-footer .copyright, .site-footer > span:last-child { margin-left: auto; }

.back-link { display: inline-flex; align-items: center; min-height: 44px; margin: -10px 0 22px; color: var(--muted); font-size: 12px; text-decoration: none; }
.back-link:hover { color: var(--ink); text-decoration: underline; }
.page-header h1 {
  max-width: 24ch; font: 400 clamp(32px, 3.4vw, 48px)/1.13 var(--serif);
  letter-spacing: -.03em; text-wrap: balance;
}
.page-header .project-question {
  max-width: 35ch; margin-top: 24px;
  font: 400 italic clamp(24px, 2.1vw, 31px)/1.4 var(--serif); letter-spacing: -.015em;
}
.project-intro { max-width: 68ch; margin-top: 23px; font-size: 14px; line-height: 1.85; }
.project-meta { max-width: 75ch; margin-top: 21px; color: var(--muted); font-size: 12px; line-height: 1.8; }
.project-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 24px; margin-top: 25px; }
.action-link {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  min-height: 46px; padding: 10px 16px; border: 1px solid var(--rule);
  color: var(--ink); font-size: 12px; line-height: 1.5; text-decoration: none;
}
.action-link:hover { border-color: var(--accent); background: var(--wash); }
.action-link.primary { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.action-link.primary:hover { opacity: .86; }
.paper-overview { margin-top: 36px; padding-top: 24px; border-top: 1px solid var(--rule); }
.paper-overview h2 { max-width: 36ch; font-size: clamp(24px, 2.5vw, 32px); }
.paper-overview p { max-width: 68ch; margin-top: 16px; font-size: 14px; line-height: 1.8; }
.paper-finding { margin-top: 28px; padding: 21px 0; border-block: 1px solid var(--rule); }
.paper-finding h3 { margin-bottom: 9px; }
.paper-finding p { max-width: 66ch; font-size: 14px; }
.paper-finding strong { font-weight: 500; }
.project-notes, .future-questions { margin-top: 34px; }
.project-notes article, .future-questions article { padding: 22px 0; border-top: 1px solid var(--rule); }
.project-notes h3, .future-questions h3 { margin-bottom: 9px; }
.project-notes p, .future-questions p { max-width: 66ch; color: var(--muted); font-size: 13px; line-height: 1.8; }
.project-contact, .contact { margin-top: 28px; font-size: 13px; }
.project-contact a, .contact a { display: inline-flex; align-items: center; min-height: 44px; }
.model-card { margin-top: 30px; min-width: 0; }
.simulation-details { margin-top: 28px; border-top: 1px solid var(--rule); padding-top: 20px; }
.simulation-details > summary { width: fit-content; cursor: pointer; font-size: 13px; }
.simulation-details[open] > summary { margin-bottom: 20px; }
.simulation-link-note { max-width: 62ch; margin-top: 11px; color: var(--muted); font-size: 12px; }

.writing-list, .recent { list-style: none; margin: 30px 0 0; padding: 0; }
.writing-list > li, .recent > li { padding: 23px 0; border-top: 1px solid var(--rule); }
.writing-list a { text-decoration: none; }
.writing-list a:hover h2, .writing-list a:hover h3 { text-decoration: underline; text-underline-offset: 5px; }
.writing-list h2, .writing-list h3 { font-size: 25px; }
.writing-list p { max-width: 63ch; margin-top: 8px; color: var(--muted); font-size: 13px; }
.writing-list .writing-meta { font-size: 11px; }
.recent > li { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 20px; font-size: 13px; }
.recent time { color: var(--muted); font-size: 11px; }
.recent p + p { margin-top: 8px; }
.about-layout {display:grid;grid-template-columns:minmax(0,1fr) clamp(260px,34vw,364px);gap:18px 40px;align-items:start;}
.about-copy {min-width:0;}
.about-body { max-width: 67ch; margin-top: 16px; font-size: 18px; line-height: 1.55; }
#about .about-body > .page-header + p { margin-top: 28px; }
.about-body h2 { margin-top: 31px; margin-bottom: 14px; }
.about-body figure { margin-top: 25px; }
.about-body img { display: block; width: 100%; height: auto; }
.about-portrait {width:100%;min-width:0;aspect-ratio:1;margin:6px 0 0;border-radius:50%;overflow:hidden;contain:inline-size;}
.about-portrait img {display:block;width:100%;height:100%;object-fit:cover;object-position:center 0%;}
.about-body figcaption { margin-top: 8px; color: var(--muted); font-size: 11px; }
.text-link { display: inline-flex; align-items: center; min-height: 44px; font-size: 12px; }
.link-row { display: flex; flex-wrap: wrap; gap: 8px 23px; margin-top: 17px; }
.link-row a { display: inline-flex; align-items: center; min-height: 44px; font-size: 12px; }
.quiet { color: var(--muted); }

@media (min-width: 1550px) {
  .page { padding-top: 62px; }
  .research-statement { font-size: 15px; }
  .project-index { margin-top: 42px; }
  .project-link { padding-block: 27px; }
}
@media (max-width: 1050px) and (min-width: 701px) {
  .art-identity { left: 26px; bottom: 151px; }
  .art-footer { left: 26px; right: 22px; }
  .art-affiliation { font-size: 12px; }
  .brand { font-size: clamp(43px, 5.1vw, 57px); }
}
@media (max-width: 900px) and (min-width: 701px) {
  :root { --art-width: 30%; }
  .art-identity { left: 22px; right: 18px; }
  .brand { font-size: 41px; }
  .art-footer { left: 22px; right: 18px; }
  .site-header { padding-inline: 28px; }
  .page { padding-inline: 28px; }
  .hero-title { font-size: 41px; }
  .site-footer { margin-inline: 28px; }
}
@media (max-width: 700px) {
  :root { --art-width: 100%; }
  .art-panel { position: relative; inset: auto; width: 100%; height: 260px; }
  .art-shade { background: linear-gradient(180deg, #0e1b1c20 0%, #0e1b1ca0 100%); }
  .art-identity { left: 24px; right: 24px; bottom: 79px; }
  .brand { font-size: 36px; line-height: 1.1; letter-spacing: -.03em; }
  .brand br { display: none; }
  .art-affiliation { max-width: none; margin-top: 11px; font-size: 11px; line-height: 1.7; }
  .art-footer { left: 24px; right: 24px; bottom: 17px; gap: 10px; }
  .art-credit { max-width: none; font-size: 9px; }
  .art-btn { min-width: 42px; height: 42px; }
  .site-reader { margin-left: 0; min-height: 0; }
  .site-header { padding: 10px 24px; }
  .site-nav a { font-size: 12px; }
  .page { padding: 32px 24px 0; }
  .eyebrow, .label { margin-bottom: 14px; font-size: 9px; }
  .hero-title { max-width: 18ch; font-size: clamp(36px, 8vw, 45px); }
  .research-statement { margin-top: 22px; font-size: 14px; }
  .project-index { margin-top: 29px; }
  .project-link { grid-template-columns: 19px minmax(0, 1fr) 14px; gap: 10px; min-height: 78px; padding: 22px 0; }
  .project-name { font-size: clamp(22px, 5.7vw, 27px); }
  .site-footer { gap: 8px 21px; margin: 31px 24px 0; padding-bottom: 21px; font-size: 10px; }
  .site-footer .copyright, .site-footer > span:last-child { margin-left: 0; }
  .back-link { margin-bottom: 18px; }
  .page-header h1 { font-size: clamp(32px, 8vw, 40px); }
  .page-header .project-question { margin-top: 21px; font-size: 25px; }
  .project-intro { margin-top: 21px; }
  .project-actions { align-items: stretch; gap: 11px; }
  .action-link { max-width: 100%; }
  .paper-overview { margin-top: 29px; }
  .recent > li { grid-template-columns: 1fr; gap: 6px; }
}
@media (max-width: 370px) {
  .art-identity, .art-footer { left: 20px; right: 20px; }
  .site-header, .page { padding-inline: 20px; }
  .site-footer { margin-inline: 20px; }
  .brand { font-size: 32px; }
  .hero-title { font-size: 35px; }
  .project-name { font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .art-layer, .project-arrow { transition: none; }
}
@media print {
  :root { color-scheme: light; }
  .art-panel, .site-header, .back-link, .site-footer, .project-actions { display: none; }
  .site-reader { margin: 0; }
  .page { padding: 0; }
  body.art-research { color: #152d2c; background: white; }
}

.kind { color: var(--muted); font-size: 10px; line-height: 1.6; margin-bottom: 8px; }
.aside { margin-top: 20px; color: var(--muted); font-size: 12px; }
.contact { border-top: 1px solid var(--rule); padding-top: 25px; }
.contact .email { font-family: var(--serif); font-size: 25px; }
.page-header + .project-intro { margin-top: 23px; }
.page-header .project-meta { margin-top: 21px; }

.site-nav a { gap: 4px; }
@media (max-width: 550px) {
  .site-nav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 12px; }
  .site-nav a { min-width: 0; white-space: normal; }
}

/* Research stays on the project page, beside the same photographic panel. */
#research .hero-title { max-width: 23ch; }
.interactive-page { max-width: none; padding-inline: clamp(20px, 2.4vw, 40px); }
.interactive-page .back-link { margin-bottom: 12px; }
.interactive-page .page-header h1 { font-size: clamp(32px, 3.2vw, 44px); }
.interactive-page .page-header .project-question { max-width: none; margin-top: 16px; font-size: clamp(21px, 2vw, 26px); }
.interactive-page .project-intro { margin-top: 14px; }
.interactive-loading { padding: 28px 0; color: var(--muted); font-size: 13px; }
/* Load after both lab stylesheets. Only the embedded research views are affected. */
body.art-research .interactive-page {
  max-width: none;
  padding-inline: clamp(20px, 2.4vw, 40px);
}
body.art-research :is(#model, #sleep) .page-header,
body.art-research :is(#model, #sleep) .paper-overview,
body.art-research :is(#model, #sleep) .paper-finding {
  max-width: 75ch;
}
body.art-research #ecoliLab {
  container: ecoli-lab / inline-size;
  color-scheme: inherit;
  min-width: 0;
  margin-top: 12px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  --elab-bg: var(--paper);
  --elab-ink: var(--ink);
  --elab-muted: var(--muted);
  --elab-soft: var(--wash);
  --elab-line: var(--rule);
  --elab-teal: light-dark(#416b61, #a1c5b6);
  --elab-teal-dark: light-dark(#416b61, #a1c5b6);
  --elab-orange-dark: light-dark(#90652f, #d4b181);
}
body.art-research :is(#sleepLab, #springLab) {
  container: sleep-lab / inline-size;
  color-scheme: inherit;
  min-width: 0;
}
body.art-research :is(#sleepLab, #springLab) .slab {
  --sl-ink: var(--ink);
  --sl-muted: var(--muted);
  --sl-line: var(--rule);
  --sl-teal: light-dark(#416b61, #a1c5b6);
  --sl-gold: light-dark(#90652f, #d4b181);
  --sl-rose: light-dark(#985770, #d199ae);
  margin-top: 12px;
  background: transparent;
  color: var(--ink);
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
body.art-research #sleepLab .slab h3 { font-size: 29px; font-weight: 400; }
body.art-research #ecoliLab .elab-head h3 { font-family: var(--serif); font-weight: 400; }
body.art-research #ecoliLab .elab-guide { min-width: 0; }
body.art-research #ecoliLab :is(.elab-btn, .elab-seg button, .elab-pick button) { min-height: 40px; }
body.art-research #ecoliLab .elab-g-nav > .elab-btn { min-height: 44px; }
body.art-research #ecoliLab .elab-stagecol { min-width: 0; }

/* Keep the live research view in reach before the longer step-by-step guide. */
@container ecoli-lab (max-width: 819px) {
  body.art-research #ecoliLab .elab-stagecol { grid-row: 1; }
  body.art-research #ecoliLab .elab-guide { grid-row: 2; }
}

/* The lab's existing ResizeObserver handles its main 820px two-column switch.
   These refinements follow the actual lab width, including a narrow desktop reader. */
@container ecoli-lab (max-width: 640px) {
  body.art-research #ecoliLab .elab-head { padding: 14px 14px 8px; }
  body.art-research #ecoliLab .elab-head h3 { font-size: 21px; }
  body.art-research #ecoliLab .elab-main { padding: 0 12px 12px; }
  body.art-research #ecoliLab .elab-foot { padding: 0 12px 14px; }
  body.art-research #ecoliLab .elab-lane-body { --elab-lane-h: 132px; }
  body.art-research #ecoliLab .elab-lane-tag {
    font-size: 11px; padding: 2px 8px; left: 6px; top: 6px; max-width: calc(100% - 12px);
  }
  body.art-research #ecoliLab .elab-pair { grid-template-columns: 1fr; }
  body.art-research #ecoliLab .elab-toolbar-end { margin-left: 0; }
  body.art-research #ecoliLab .elab-release { font-size: 13px; padding: 8px; }
  body.art-research #ecoliLab .elab-release kbd { display: none; }
}
@container ecoli-lab (max-width: 420px) {
  body.art-research #ecoliLab .elab-guide { padding: 13px; }
  body.art-research #ecoliLab .elab-lane-body { --elab-lane-h: 112px; gap: 6px; }
  body.art-research #ecoliLab .elab-lane-tag { max-width: calc(100% - 8px); left: 4px; top: 4px; padding: 2px 5px; font-size: 10px; }
  body.art-research #ecoliLab .elab-cycle { min-width: 150px; }
  body.art-research #ecoliLab .elab-seg button { padding-inline: 9px; }
}

/* Match the guided lab's existing mobile reading order, but switch according to
   its own width. The guide and main action precede the network in a narrow reader. */
@container sleep-lab (max-width: 820px) {
  body.art-research #sleepLab .sl-head { gap: 14px; padding: 22px 20px 20px; }
  body.art-research #sleepLab .sl-sub { font-size: 13px !important; }
  body.art-research #sleepLab .sl-reset { font-size: 11px !important; }
  body.art-research #sleepLab .sl-steps { gap: 11px; padding: 0 20px 18px; }
  body.art-research #sleepLab .sl-body { display: flex; flex-direction: column; }
  body.art-research #sleepLab .sl-right { display: contents; }
  body.art-research #sleepLab .sl-body .sl-eyebrow { order: 0; margin: 23px 22px 8px !important; }
  body.art-research #sleepLab .sl-body h4.sl-guide-title { order: 1; margin: 0 22px; font-size: 27px; }
  body.art-research #sleepLab .sl-body .sl-guide-copy { order: 2; margin: 10px 22px 0 !important; font-size: 15px !important; }
  body.art-research #sleepLab .sl-body .sl-action-row { order: 3; margin: 20px 22px 20px; }
  body.art-research #sleepLab .sl-body .sl-progress { order: 4; margin: 0 22px; }
  body.art-research #sleepLab .sl-body .sl-status { order: 5; margin: 10px 22px 18px !important; }
  body.art-research #sleepLab .sl-network {
    order: 6; padding: 20px 20px 18px; border-right: 0;
    border-top: 1px solid var(--sl-line); border-bottom: 1px solid var(--sl-line);
  }
  body.art-research #sleepLab .sl-body .sl-response-box { order: 7; margin: 21px 22px 0; padding-top: 0; border-top: 0; }
  body.art-research #sleepLab .sl-body .sl-capacity-box { order: 8; margin: 21px 22px 25px; }
  body.art-research #sleepLab .sl-body .sl-result { order: 9; margin: 0 22px 25px; }
  body.art-research #sleepLab .sl-netbar { margin-bottom: 8px; }
  body.art-research #sleepLab .sl-canvas { aspect-ratio: 1.4; max-height: 320px; }
  body.art-research #sleepLab .sl-caption { max-width: none; }
  body.art-research #sleepLab .sl-primary { flex: 1; }
  body.art-research #sleepLab .sl-gauge-labels { font-size: 11px; }
  body.art-research #sleepLab .sl-controls {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 10px; padding-inline: 20px;
  }
  body.art-research #sleepLab .sl-field { min-width: 0; }
  body.art-research #sleepLab .sl-field select { min-width: 0; font-size: 12px; }
  body.art-research #sleepLab .sl-controls .sl-undo { justify-self: start; grid-column: 1 / -1; }
  body.art-research #sleepLab .sl-free > summary { padding-inline: 20px; }
  body.art-research #sleepLab .sl-help { margin-inline: 20px !important; }
  body.art-research #sleepLab .sl-free-stats { margin-inline: 20px; gap: 8px 20px; }
  body.art-research #sleepLab .sl-charts { grid-template-columns: 1fr; gap: 17px; padding: 19px 20px 0; }
  body.art-research #sleepLab .sl-chart-title small { font-size: 10px; }
  body.art-research #sleepLab .sl-chart-key { margin-inline: 20px; }
  body.art-research #sleepLab .sl-foot { padding-inline: 20px; }
  body.art-research #sleepLab .sl-tooltip { max-width: 150px; }
}
@container sleep-lab (max-width: 500px) {
  body.art-research #sleepLab .slab h3 { font-size: 26px; }
  body.art-research #sleepLab .sl-steps li { flex-direction: column; align-items: flex-start; gap: 8px; font-size: 12px; }
  body.art-research #sleepLab .sl-steps li b { flex-basis: 25px; width: 25px; height: 25px; }
  body.art-research #sleepLab .sl-canvas { aspect-ratio: 1.4; max-height: 320px; }
}

/* Photography belongs to the same quiet reading column as the research. */
body.art-research .art-photo-link {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  cursor: pointer;
}
body.art-research .art-photo-link:focus-visible {
  outline: 2px solid #f4f2e9;
  outline-offset: -9px;
}
body.art-research :is(.art-identity, .art-footer) { z-index: 1; }

body.art-research #photography {
  container: photography-page / inline-size;
  max-width: none;
  padding-inline: clamp(20px, 2.4vw, 40px);
}
body.art-research #photography .page-header { max-width: 68ch; }
body.art-research #photography .project-intro { margin-top: 17px; }
body.art-research #photography .photo-instruction {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}
body.art-research #photography .photo-grid {
  column-count: 2;
  column-gap: 20px;
  margin-top: 32px;
}
body.art-research #photography .photo-tile {
  position: relative;
  display: block;
  width: 100%;
  min-height: 44px;
  break-inside: avoid;
  margin: 0 0 20px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  text-align: left;
  cursor: zoom-in;
}
body.art-research #photography .photo-tile img {
  display: block;
  width: 100%;
  height: auto;
  border: 0;
}
body.art-research #photography .photo-tile:hover img { opacity: .94; }
body.art-research #photography .photo-tile:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 5px;
}
body.art-research #photography .photo-number {
  display: block;
  margin-top: 7px;
  font: 400 10px/1.5 var(--sans);
  font-variant-numeric: tabular-nums;
}
@container photography-page (min-width: 1000px) {
  body.art-research #photography .photo-grid { column-count: 3; }
}
@container photography-page (max-width: 499px) {
  body.art-research #photography .photo-grid { column-count: 1; margin-top: 26px; }
  body.art-research #photography .photo-tile { margin-bottom: 18px; }
}

/* The native dialog enters the top layer; images retain their full proportions. */
body.art-research .photo-viewer {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 64px 30px 28px;
  border: 0;
  background: #101615;
  color: #f4f2e9;
  overflow: hidden;
}
body.art-research .photo-viewer::backdrop { background: #101615; }
body.art-research .photo-viewer[open] {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 48px;
  grid-template-rows: minmax(0, 1fr) 25px;
  align-items: center;
  gap: 14px 24px;
}
body.art-research .photo-viewer .viewer-figure {
  grid-column: 2;
  grid-row: 1;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  justify-items: center;
  align-items: center;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  margin: 0;
}
body.art-research .photo-viewer #viewerImage {
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  max-height: 85dvh;
  object-fit: contain;
}
body.art-research .photo-viewer #viewerCaption {
  max-width: 75ch;
  margin-top: 12px;
  color: #c0c9c2;
  font: 400 12px/1.5 var(--sans);
  text-align: center;
}
body.art-research .photo-viewer #viewerCaption:empty { display: none; }
body.art-research .photo-viewer .viewer-count {
  grid-column: 2;
  grid-row: 2;
  color: #c0c9c2;
  font: 400 11px/1.5 var(--sans);
  font-variant-numeric: tabular-nums;
  text-align: center;
}
body.art-research .photo-viewer :is(.viewer-close, .viewer-prev, .viewer-next) {
  display: inline-grid;
  place-items: center;
  min-width: 44px;
  min-height: 44px;
  padding: 8px;
  border: 1px solid #f4f2e94d;
  border-radius: 50%;
  background: transparent;
  color: #f4f2e9;
  font: 400 21px/1 var(--sans);
}
body.art-research .photo-viewer :is(.viewer-close, .viewer-prev, .viewer-next):hover { border-color: #f4f2e9; }
body.art-research .photo-viewer :is(.viewer-close, .viewer-prev, .viewer-next):focus-visible {
  outline: 2px solid #f4f2e9;
  outline-offset: 5px;
}
body.art-research .photo-viewer .viewer-close {
  position: absolute;
  top: 12px;
  right: 24px;
  padding: 10px 12px;
  border: 0;
  border-radius: 0;
  font-size: 13px;
}
body.art-research .photo-viewer .viewer-prev { grid-column: 1; grid-row: 1; }
body.art-research .photo-viewer .viewer-next { grid-column: 3; grid-row: 1; }
@media (max-width: 700px) {
  body.art-research .photo-viewer { padding: 62px 16px 18px; }
  body.art-research .photo-viewer[open] {
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    grid-template-rows: minmax(0, 1fr) 44px;
    gap: 18px 14px;
  }
  body.art-research .photo-viewer .viewer-figure { grid-column: 1 / -1; }
  body.art-research .photo-viewer #viewerImage { max-height: calc(100dvh - 165px); }
  body.art-research .photo-viewer #viewerCaption { margin-top: 10px; font-size: 11px; }
  body.art-research .photo-viewer .viewer-prev { grid-row: 2; }
  body.art-research .photo-viewer .viewer-next { grid-row: 2; }
  body.art-research .photo-viewer .viewer-close { top: 9px; right: 9px; }
}
@media print {
  body.art-research #photography .photo-grid { column-count: 2; }
  body.art-research .photo-viewer { display: none !important; }
}
html.photo-viewing { overflow: hidden; }
/* Icon controls keep their accessible names; the photograph links to the gallery. */
body.art-research .art-panel .art-footer {
  display: grid;
  justify-content: start;
  align-items: start;
  gap: 12px;
}
body.art-research .art-panel .art-credit { max-width: none; width: fit-content; }
body.art-research .art-panel .art-controls {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 6px;
  width: max-content;
  max-width: 100%;
}
body.art-research .art-panel .art-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 44px;
  width: 44px;
  min-width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid #f4f2e970;
  border-radius: 50%;
  background: #0e1b1c38;
  color: #f4f2e9;
  font: 400 18px/1 var(--sans);
  white-space: nowrap;
}
body.art-research .art-panel .art-btn:hover { border-color: #f4f2e9; background: #0e1b1c65; }
body.art-research .art-panel .art-btn:focus-visible { outline: 2px solid #f4f2e9; outline-offset: 4px; }
body.art-research .art-panel .art-identity { bottom: 150px; }
@media (max-width: 700px) {
  body.art-research .art-panel .art-identity { bottom: 125px; }
  body.art-research .art-panel .art-footer { gap: 10px; }
}

/* The experiments use the same paper, typography, and rules as the reading pages. */
body.art-research :is(#ecoliLab, #sleepLab) :is(h3, h4) {
  font-family: var(--serif);
  font-weight: 400;
  color: var(--ink);
}
body.art-research :is(#ecoliLab, #sleepLab) :is(button, select, summary):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}
body.art-research #ecoliLab :is(.elab-btn, .elab-pick button, .elab-release),
body.art-research #sleepLab :is(.sl-primary, .sl-pause, .sl-wake, .sl-sleep, select) {
  border-color: var(--rule);
  border-radius: 2px;
  background: transparent;
  color: var(--ink);
  box-shadow: none;
}
body.art-research #ecoliLab :is(.elab-btn, .elab-pick button, .elab-release):hover:not(:disabled),
body.art-research #sleepLab :is(.sl-pause, .sl-wake, .sl-sleep):hover:not(:disabled) { background: var(--wash); }
body.art-research #ecoliLab .elab-btn.primary,
body.art-research #sleepLab .sl-primary { background: var(--ink); color: var(--paper) !important; border-color: var(--ink); }
body.art-research #sleepLab .sl-primary:hover:not(:disabled) { background: var(--accent); border-color: var(--accent); }
body.art-research #ecoliLab :is(.elab-seg, .elab-readouts.focus, .elab-banner, .elab-countdown, .elab-card) {
  border-color: var(--rule); border-radius: 2px; background: var(--paper); color: var(--ink); box-shadow: none;
}
body.art-research #ecoliLab .elab-seg button { border-radius: 0; color: var(--muted); }
body.art-research #ecoliLab .elab-seg button[aria-pressed=true],
body.art-research #ecoliLab .elab-pick button[aria-pressed=true] { background: var(--wash); color: var(--ink); }
body.art-research #ecoliLab :is(.elab-lane-stage, .elab-lane-net, .elab-netwrap, .elab-chart, .elab-clockchart, .elab-stage) {
  border-color: var(--rule); border-radius: 2px; background: var(--wash);
}
body.art-research #ecoliLab .elab-quick .elab-lane-stage { border-left-width: 1px; }
body.art-research #ecoliLab .elab-lane-tag {
  border-radius: 2px; border-color: var(--rule); background: var(--paper); color: var(--ink); font-weight: 500;
}
body.art-research #ecoliLab .elab-lane-tag[data-tone=good] { color: var(--elab-teal); border-color: var(--elab-teal); }
body.art-research #ecoliLab .elab-lane-tag[data-tone=bad] { color: var(--elab-orange-dark); border-color: var(--elab-orange-dark); }
body.art-research #ecoliLab :is(.elab-view-title, .elab-guide h4, .elab-g-line, .elab-net-note, .elab-readout b, .elab-readout small, .elab-link) { color: var(--ink); }
body.art-research #ecoliLab :is(.elab-more > summary, .elab-about > summary) { color: var(--muted); }
body.art-research #sleepLab .sl-network { background: var(--wash); }
body.art-research #sleepLab :is(.sl-guide-copy, .sl-result-copy, .sl-free > summary, .sl-foot summary) { color: var(--ink); }
body.art-research #sleepLab .sl-steps li { color: var(--muted); }
body.art-research #sleepLab .sl-steps li b {
  flex-basis: auto; min-width: 22px; height: auto; border: 0; border-radius: 0;
  background: transparent; color: inherit; font: 400 23px/1.2 var(--serif);
}
body.art-research #sleepLab .sl-steps li[data-state=current] { color: var(--ink); }
body.art-research #sleepLab .sl-steps li[data-state=done] { color: var(--sl-teal); }
body.art-research #sleepLab .sl-result { background: var(--wash); border-color: var(--sl-teal); border-radius: 0; }
body.art-research #sleepLab :is(.sl-progress, .sl-gauge, .sl-cap-row > i) { background: var(--wash); border-radius: 1px; }
body.art-research #sleepLab .sl-current { border-color: var(--paper); }
body.art-research #sleepLab .sl-target-zone { background: color-mix(in srgb, var(--sl-teal) 25%, var(--wash)); border-radius: 1px; }
body.art-research #sleepLab .sl-target-line { border-color: var(--sl-teal); }
body.art-research #sleepLab .sl-cap-row > i > i { border-radius: 1px; }
body.art-research #sleepLab .sl-tooltip { background: var(--ink); color: var(--paper); border-radius: 2px; }

/* Inside a project, a slim switcher. The three-project chooser lives in photographic.css. */
.embody-labs { display:flex; flex-wrap:wrap; gap:10px 22px; margin-top:25px; border-bottom:1px solid var(--rule); }
.embody-labs a { display:inline-flex; align-items:center; min-height:48px; padding:8px 0; border-bottom:2px solid transparent; font-size:12px; text-decoration:none; color:var(--muted); }
.embody-labs a[aria-current=page] { color:var(--ink); border-bottom-color:var(--ink); }
#embody [data-embody-panel=bacteria] { margin-top:25px; }
#embody .page-header h1 { max-width:23ch; }
body.art-research #embody { max-width:1100px; }
