#study .study-lead {
  margin: 0 0 clamp(17px, 3vw, 36px);
  color: var(--story-muted);
  font-size: clamp(17px, 1.6vw, 20px);
  line-height: 1.5;
  text-wrap: pretty;
}

.story-layout #study { padding-block: clamp(36px, 5.4vw, 76px); }
.story-layout #study > .section-title { max-width: 28ch; margin-block-end: .34em; }

#study .recipe-progression {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin: 0;
  padding: 1px;
  background: var(--recipe-line);
  list-style: none;
}

#study .recipe-progression > li { min-width: 0; }

#study .recipe-topic {
  display: grid;
  align-content: space-between;
  align-items: start;
  grid-template-columns: minmax(0, 1fr) 11px;
  grid-template-areas: "title indicator" "diagram diagram";
  gap: 8px;
  width: 100%;
  height: 100%;
  padding: clamp(10px, 1.45vw, 18px);
  border: 0;
  background: #fff;
  color: var(--recipe-ink);
  text-align: start;
  transition: color .18s ease, background-color .18s ease;
}

#study .recipe-topic:is(:hover, :focus-visible, [aria-expanded="true"]) {
  background: #f5f8fa;
  color: var(--story-blue);
}

#study .recipe-topic[aria-expanded="true"] { box-shadow: inset 0 2px var(--story-blue); }

.recipe-topic-title {
  grid-area: title;
  font-size: clamp(14px, 1.32vw, 18px);
  font-weight: 650;
  line-height: 1.24;
  letter-spacing: -.02em;
  text-wrap: pretty;
}

.recipe-topic-icon {
  position: relative;
  grid-area: indicator;
  align-self: center;
  justify-self: end;
  width: 11px;
  height: 11px;
  color: var(--story-blue);
}

.recipe-topic-icon::before,
.recipe-topic-icon::after {
  position: absolute;
  inset: 5px 0 auto;
  height: 1px;
  background: currentColor;
  content: "";
}

.recipe-topic-icon::after { rotate: 90deg; }
.recipe-topic[aria-expanded="true"] .recipe-topic-icon::after { display: none; }

#study .recipe-hover-detail { scroll-margin-top: 78px; }

#study .action-route-lead {
  max-width: 70ch;
  margin: 4px 0 12px;
  color: var(--story-muted);
  line-height: 1.5;
}

.story-layout #study .action-routes {
  display: grid;
  grid-template-columns: minmax(260px, .88fr) minmax(0, 1.4fr);
  align-items: center;
  gap: clamp(18px, 2.4vw, 38px);
  max-width: none;
}

#study .action-study-model {
  width: min(100%, 480px);
  margin: 0 auto;
}

#study .action-study-model svg {
  display: block;
  width: 100%;
  height: auto;
  font: 650 15px/1 var(--font-sans, system-ui);
  text-anchor: middle;
}

#study .action-model-module { fill: var(--story-ink); }
#study .action-model-caption { fill: var(--story-muted); font-size: 13px; font-weight: 550; }
#study .action-model-small { font-size: 11px; }
#study .action-model-ground-truth { fill: #e7e9eb; stroke: #7d878f; stroke-width: 1.25; }
#study .action-model-predicted { fill: #fff; stroke: #a9704b; stroke-width: 1.25; }
#study .action-model-action-loss-line { fill: none; stroke: #a9704b; stroke-width: 1.25; }
#study .action-model-action-loss-label { fill: var(--story-rust); }
#study .action-model-target { fill: #f2f5f5; stroke: #b4c5ca; }
#study .action-model-predictor { fill: #e2eef0; stroke: #9cb8bf; }
#study .action-model-encoder { fill: #eeecd9; stroke: #c5c0a4; }
#study .action-model-expert { fill: #f0e6d8; stroke: #cdb497; }
#study :is(.action-model-context path, .action-model-loss) { fill: none; stroke: #78959f; stroke-width: 1.25; }
#study .action-model-context path { marker-end: url(#action-model-context-arrow); }
#study .action-model-ema { stroke-dasharray: 3 2; }

#study .action-study-variants {
  min-width: 0;
  padding-inline-start: clamp(16px, 2.35vw, 32px);
  border-inline-start: 1px solid var(--story-line);
}

@media (max-width: 900px) {
  .story-layout #study .action-routes { grid-template-columns: minmax(0, 1fr); }
  #study .action-study-variants {
    padding: 16px 0 0;
    border-inline: 0;
    border-block-start: 1px solid var(--story-line);
  }
}

@media (max-width: 820px) {
  #study .recipe-progression { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  #study .recipe-topic { transition: none; }
}
