#study .slow-feature-study {
  --slow-static: #315a73;
  --slow-motion: #9c472b;
  --slow-rule: #dce4e6;
  --slow-muted: #495c65;
  max-width: 1030px;
  margin-inline: auto;
}

#study .slow-feature-scene + .slow-feature-scene {
  margin-top: clamp(14px, 2.4vw, 24px);
  padding-top: clamp(14px, 2.4vw, 24px);
  border-top: 1px solid var(--slow-rule);
}

#study .slow-feature-scene h5 {
  margin: 0 0 12px;
  color: var(--recipe-ink);
  font-size: clamp(17px, 1.85vw, 23px);
  line-height: 1.25;
}


#study .slow-feature-panel-label {
  display: block;
  margin-block-end: .24em;
  color: var(--slow-muted);
  font-size: .875rem;
  font-weight: 600;
  line-height: 1.3;
}

#study .slow-feature-heading {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  column-gap: 16px;
}

#study .slow-feature-heading .story-replay {
  flex: none;
  margin: 0;
  font-size: .8rem;
}

#study .slow-feature-heading .story-replay[hidden] { display: none; }

#study .slow-feature-study img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 4px;
}

#study .slow-feature-diagnosis,
#study .slow-feature-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: clamp(12px, 2.6vw, 28px);
}

#study .slow-feature-diagnosis {
  align-items: stretch;
  column-gap: clamp(12px, 3vw, 30px);
}

#study .slow-feature-diagnosis figure {
  display: grid;
  justify-items: start;
}

#study .slow-feature-diagnosis .slow-feature-variance { grid-template-rows: auto 1fr; }

#study .slow-feature-diagnosis figcaption {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 .65em;
  margin: 0 0 7px;
  color: var(--recipe-ink);
  font-size: clamp(13px, 1.35vw, 16px);
  font-weight: 650;
}

#study .slow-feature-frames {
  display: grid;
  width: min(100%, 355px);
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: .45rem;
  align-items: center;
  align-self: center;
  text-align: center;
  color: var(--slow-muted);
  font-size: .81rem;
}

#study .slow-feature-frames div > span {
  display: block;
  margin-top: 4px;
}

#study .slow-feature-transition {
  color: var(--slow-motion);
  font-size: clamp(16px, 2vw, 24px);
}

#study .slow-feature-compare {
  position: relative;
  isolation: isolate;
}

#study .slow-feature-compare :is(.slow-feature-early-overlay, .slow-feature-mask-overlay) {
  position: absolute;
  inset: 0;
  opacity: 0;
}

#study .slow-feature-variance svg {
  align-self: center;
  display: block;
  width: min(100%, 405px);
  height: auto;
  overflow: visible;
}

#study .slow-feature-gridline,
#study .slow-feature-axis {
  fill: none;
  stroke: var(--slow-rule);
  stroke-width: 1;
}

#study .slow-feature-axis { stroke: #9aabb0; }

#study .slow-feature-tick {
  fill: var(--slow-muted);
  font: 12.5px var(--font-sans, system-ui);
}

#study .slow-feature-trace {
  stroke: var(--slow-static);
  stroke-width: 1.85;
  fill: white;
}

#study .slow-feature-trace polyline {
  fill: none;
  stroke-linejoin: round;
}

#study .slow-feature-piece { min-width: 0; }

#study .slow-feature-piece h6 {
  margin: 0 0 8px;
  color: var(--slow-static);
  font-size: clamp(15px, 1.5vw, 19px);
  font-weight: 660;
  line-height: 1.25;
  text-wrap: balance;
}

#study .slow-feature-piece p {
  margin: 0;
  color: var(--slow-muted);
  font-size: clamp(13px, 1.38vw, 16px);
  line-height: 1.42;
}

#study .slow-feature-remedy {
  border-inline-start: 1px solid var(--slow-rule);
  padding-inline-start: clamp(12px, 2vw, 24px);
}

#study .slow-feature-remedy h6 { color: var(--slow-motion); }

#study .slow-feature-with-visual {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(8px, 1.5vw, 18px);
}

#study .slow-feature-with-visual > :is(img, .slow-feature-compare) {
  max-width: 172px;
  justify-self: end;
}

#study .slow-feature-ratio {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .28em .43em;
  margin-bottom: .6em;
  font-size: clamp(13px, 1.23vw, 15px);
  font-weight: 650;
}

#study .slow-feature-static { color: var(--slow-static); }
#study .slow-feature-dynamic { color: var(--slow-motion); }

#study .slow-feature-ratio :is(.slow-feature-static, .slow-feature-dynamic) {
  display: inline-flex;
  align-items: center;
  gap: .4em;
  white-space: nowrap;
}

#study .slow-feature-ratio :is(.slow-feature-static, .slow-feature-dynamic)::before,
#study .slow-feature-swatch {
  display: inline-block;
  content: '';
  width: .48em;
  height: .48em;
  background: currentColor;
}

#study .slow-feature-predictable .slow-feature-swatch {
  margin-inline-end: .15em;
  vertical-align: .1em;
}

#study .slow-feature-piece .slow-feature-copy-shortcut {
  margin-block-start: .45em;
}

#study .slow-feature-piece .slow-feature-bias {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 68px minmax(0, 1fr);
  align-items: center;
  width: min(100%, 480px);
  gap: 10px;
  margin-top: 10px;
}

#study .slow-feature-bias-arrow {
  display: grid;
  justify-items: center;
  color: var(--slow-motion);
  font-size: .8rem;
  font-weight: 650;
  line-height: 1.2;
}

#study .slow-feature-bias-arrow svg {
  display: block;
  width: 100%;
  height: auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.35;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#study .slow-feature-spectral {
  --slow-static: #2f5d8a;
  --slow-motion: #c8782a;
  --slow-muted: #5f6368;
}

#study .slow-feature-spectral-steps {
  margin: 0;
  padding-inline-start: 1.25em;
  list-style: decimal;
  color: var(--recipe-ink);
  font-size: clamp(13px, 1.35vw, 16px);
}

#study .slow-feature-spectral-steps li + li { margin-block-start: .85rem; }
#study .slow-feature-spectral-steps li::marker { color: var(--slow-muted); }
#study .slow-feature-spectral-steps li:first-child::marker { content: "① "; }
#study .slow-feature-spectral-steps li:nth-child(2)::marker { content: "② "; }

#study .slow-feature-frequency {
  display: block;
  width: 100%;
  height: auto;
  margin-top: .35em;
  color: var(--slow-muted);
  font-family: var(--font-sans, system-ui);
}

#study .slow-feature-frequency text {
  fill: currentColor;
  font-size: 27px;
}

#study .slow-feature-frequency .slow-feature-dct-label {
  font-size: 25px;
  font-weight: 600;
}

#study .slow-feature-frequency .slow-feature-axis-caption {
  font-size: 29px;
  font-weight: 600;
}

#study .slow-feature-frequency .slow-feature-mode-label { font-size: 23px; }

#study .slow-feature-plot-axis,
#study .slow-feature-cosine {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#study .slow-feature-plot-axis {
  stroke: currentColor;
  stroke-width: 2.4;
}

#study .slow-feature-cosine {
  stroke: url(#slow-feature-cosine-gradient);
  stroke-width: 4;
}

#study .slow-feature-loss-figure {
  width: max-content;
  max-width: 100%;
  margin-inline: auto;
}

#study .slow-feature-loss {
  margin-block: .36em 0;
  color: var(--slow-muted);
  font-size: clamp(16px, 1.6vw, 18px);
}

#study .slow-feature-loss mtext { font-family: var(--font-sans, system-ui); }

#study .slow-feature-upweight-note {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: .3em;
  margin-block-start: .15em;
  margin-inline-start: 55%;
  font-size: .8em;
  font-weight: 650;
}

#study .slow-feature-upweight-note svg {
  width: .85em;
  height: 1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (max-width: 730px) {
  #study .slow-feature-pair {
    grid-template-columns: 1fr;
    gap: 11px;
  }

  #study .slow-feature-remedy {
    padding-inline-start: 0;
    padding-block-start: 10px;
    border-inline-start: 0;
    border-block-start: 1px solid var(--slow-rule);
  }

  #study .slow-feature-with-visual {
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  }

  #study .slow-feature-with-visual > :is(img, .slow-feature-compare) {
    max-width: 147px;
  }
}

@media (max-width: 520px) {
  #study .slow-feature-heading { column-gap: 9px; }
  #study .slow-feature-heading .story-replay { font-size: .72rem; }
  #study .slow-feature-diagnosis { grid-template-columns: 1fr; }
  #study .slow-feature-diagnosis figure { width: 100%; }
  #study .slow-feature-frames { max-width: 260px; }
  #study .slow-feature-variance svg { max-width: 330px; }
  #study .slow-feature-loss { font-size: clamp(14px, 3.85vw, 16px); }
  #study .slow-feature-frequency text { font-size: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  #study .slow-feature-heading .story-replay { display: none; }
}

@media (prefers-reduced-motion: no-preference) {
  #study .slow-feature-scene.is-playing .slow-feature-late {
    animation: slow-feature-reveal .53s .65s both;
  }

  #study .slow-feature-scene.is-playing .slow-feature-early-overlay {
    animation: slow-feature-dissolve .65s 1.3s both;
  }

  #study .slow-feature-scene.is-playing .slow-feature-trace {
    animation: slow-feature-chart 1.8s .28s linear both;
  }

  #study .slow-feature-scene.is-playing .slow-feature-problem {
    animation: slow-feature-slide 1.55s both;
  }

  #study .slow-feature-scene.is-playing .slow-feature-remedy {
    animation: slow-feature-reveal .55s 1.1s both;
  }

  #study .slow-feature-scene.is-playing .slow-feature-mask-overlay {
    animation: slow-feature-dissolve .75s 1.45s both;
  }

  #study .slow-feature-scene.is-paused :is(.slow-feature-late, .slow-feature-early-overlay,
    .slow-feature-trace, .slow-feature-problem, .slow-feature-remedy, .slow-feature-mask-overlay) {
    animation-play-state: paused;
  }
}

@keyframes slow-feature-reveal {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slow-feature-dissolve {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes slow-feature-chart {
  from { clip-path: inset(0 100% 0 0); }
  to { clip-path: inset(0 0 0 0); }
}


@keyframes slow-feature-slide {
  0% { opacity: 0; transform: translate(var(--slow-entry, 18%), 0); }
  21%, 63% { opacity: 1; transform: translate(var(--slow-entry, 18%), 0); }
  100% { opacity: 1; transform: translate(0, 0); }
}

@media (max-width: 730px) {
  #study .slow-feature-problem { --slow-entry: 0px; }
}
