.study-page, html[data-layout="minimal"] .footer-inner {
  max-width: 96rem;
  margin-inline: auto;
}
.study-page { padding-bottom: 1.8rem; }
.study-page [hidden] { display: none; }
.study-page .plain-intro { padding-bottom: clamp(1.4rem, 3.3vh, 2.4rem); }
.study-page .plain-list, .study-page .project-list { row-gap: 0; }
.study-page .study-row {
  grid-template-columns: minmax(0, 1fr) clamp(9.315rem, 12.96vw, 11.745rem);
  gap: .7rem clamp(.9rem, 2vw, 1.8rem);
  padding: .62rem .45rem .62rem .65rem;
  border: 0;
  border-bottom: 1px solid var(--rule);
}
.study-page .study-row::before { top: 1.35rem; }
.study-page .study-row.previewing::before { box-shadow: 0 0 0 3px var(--accent-wash); }
.study-page .study-row:is(:hover, :focus-within) { background: transparent; }
.study-page .study-row.previewing { background: color-mix(in srgb, var(--accent-wash) 58%, transparent); }
.study-row .plain-entry h3 {
  max-width: 51ch;
  font: 590 clamp(1rem, 1.15vw, 1.15rem)/1.25 var(--sans);
  letter-spacing: -.02em;
  margin-top: .28rem;
}
.study-row .plain-meta { font-size: .75rem; letter-spacing: .015em; }
.study-authors, .study-page .paper-links { font: 400 .875rem/1.55 var(--sans); }
.study-authors {
  max-width: 65ch;
  margin-top: .42rem;
  color: var(--muted);
}
.study-authors a { white-space: nowrap; text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 34%, transparent); }
.study-authors a:hover, .study-authors a:focus-visible { color: var(--accent); text-decoration-color: currentColor; }
.study-authors strong { font-weight: 690; color: var(--ink); }
.study-page .paper-links {
  display: flex;
  margin-top: .15rem;
}
.study-authors + .paper-links { margin-top: .4rem; }
.study-page .paper-links a {
  padding-block: .1rem;
  white-space: nowrap;
}
.study-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--media-radius);
  background: var(--accent-wash);
}
.study-thumb :is(img, video) { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.study-page .projects-section .study-row { grid-template-columns: minmax(0, 1fr) clamp(6.75rem, 10vw, 9.25rem); }
.study-sticky { position: sticky; top: 1.25rem; }
.study-tabs { display: flex; align-items: baseline; gap: 1.25rem; margin: .56rem 0 .78rem; border-bottom: 1px solid var(--rule); }
.study-tabs button {
  margin-bottom: -1px; padding: .48rem .02rem; border-bottom: 2px solid transparent;
  color: var(--muted); font: .875rem/1.3 var(--mono);
}
.study-tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.study-tabs button:hover { color: var(--ink); }
.study-tabs button:focus-visible, .study-panel [role="tabpanel"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.study-panel { max-width: 32rem; padding-bottom: .3rem; }
.study-panel-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; min-height: 2.85rem; padding: .25rem 0; }
.study-panel-head p, .study-dismiss { color: var(--muted); }
.study-panel-head p { font: .77rem/1.35 var(--mono); }
.study-dismiss { display: grid; place-items: center; flex: none; width: 1.9rem; height: 1.9rem; border-radius: .35rem; }
.study-dismiss:hover { color: var(--ink); background: var(--accent-wash); }
.study-dismiss .close-icon { width: .7rem; height: .7rem; }
.study-panel .study-question { max-width: 36ch; margin: 0; font: 460 clamp(1.3rem, 1.65vw, 1.6rem)/1.14 var(--serif); letter-spacing: -.025em; text-wrap: pretty; }
.study-answer, .study-result p, .study-steps p, .study-figure figcaption {
  max-width: 52ch; font: 400 .96rem/1.5 var(--sans); text-wrap: pretty;
}
.study-answer { margin: .42rem 0 0; }
.study-result { margin-top: .75rem; padding-left: .72rem; border-left: 2px solid var(--accent); }
.study-result strong { display: block; font: 560 1.03rem/1.22 var(--sans); }
.study-result p { margin-top: .16rem; color: var(--muted); font-size: .88rem; }
.study-steps { padding: 0; margin: 0; list-style: none; counter-reset: step; }
.study-steps li { position: relative; counter-increment: step; padding: .55rem 0 .55rem 1.8rem; border-top: 1px solid var(--rule); }
.study-steps li:first-child { border-top: 0; padding-top: 0; }
.study-steps li::before { position: absolute; left: 0; margin-top: .2rem; content: counter(step, decimal-leading-zero); font: .75rem/1.2 var(--mono); color: var(--muted); }
.study-steps strong { display: block; font: 600 1rem/1.25 var(--sans); }
.study-steps p { margin: .15rem 0 0; font-size: .94rem; }
.study-figure { margin: 0; }
.study-close-frame { position: relative; aspect-ratio: 16 / 9; border-radius: var(--media-radius); overflow: hidden; background: var(--accent-wash); }
.study-close-frame :is(img, canvas) { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.study-figure figcaption { margin-top: .55rem; font-size: .88rem; color: var(--muted); }
.study-credit { margin-top: .4rem; font: .7rem/1.4 var(--sans); color: var(--muted); }
.study-actions { display: flex; align-items: baseline; gap: .55rem 1rem; flex-wrap: wrap; margin-top: .85rem; }
.study-actions :is(a, button) { color: var(--accent); font: .78rem/1.5 var(--mono); text-decoration: underline; text-underline-offset: .22em; }
.study-page .front-foot { padding-block: 1rem 1.25rem; }
@media (min-width: 1001px) {
  .study-page {
    display: grid;
    /* Grid percentages exclude the page padding. Add one gutter for half the full width. */
    grid-template-columns: minmax(0, calc(50% + var(--minimal-gutter))) minmax(18.5rem, 1fr);
    column-gap: clamp(2.25rem, 5.4vw, 5.5rem);
  }
  .study-page .plain-intro { grid-area: 1 / 1; }
  .study-page #publications { grid-area: 2 / 1; }
  .study-page .front-foot { grid-area: 3 / 1; }
  .study-page .news-section { grid-area: 4 / 1; }
  .study-page .education-section { grid-area: 5 / 1; }
  .study-page .projects-section { grid-area: 6 / 1; }
  .study-rail { grid-area: 2 / 2 / 7 / 3; min-width: 0; }
  .study-sticky { max-height: calc(100dvh - 2.5rem); overflow-y: auto; scrollbar-width: thin; }
}
@media (max-width: 1000px) {
  .study-page { max-width: 53rem; }
  .study-rail { display: none; }
  .study-panel { grid-column: 1 / -1; width: 100%; max-width: none; margin: .16rem 0 .3rem; }
  .study-panel-head { border-top: 1px solid var(--rule); }
  .study-panel .study-close-frame { max-width: 32rem; }
}
@media (max-width: 600px) {
  .study-page { padding-inline: 1rem; }
  .study-page .plain-list, .study-page .project-list { padding-left: .62rem; margin-left: .1rem; }
  .study-page .study-row { grid-template-columns: minmax(0, 1fr) clamp(5.8725rem, 27.54vw, 9.315rem); column-gap: .65rem; padding: .65rem 0 .65rem .2rem; }
  .study-page .study-row::before { left: -.8rem; width: .3rem; height: .3rem; }
  .study-page .projects-section .study-row { grid-template-columns: minmax(0, 1fr) 6.25rem; }
  .study-authors, .study-page .paper-links { font-size: .8rem; line-height: 1.48; }
  .study-panel { padding: 0 .42rem .25rem; }
  .study-actions { margin-top: .8rem; }
}

[data-study="carbonfish"] .study-thumb img { object-fit: contain; background: white; }
