.story-layout .research-overview {
  padding-block: clamp(32px, 4.4vw, 62px);
}

.story-layout .research-overview .section-title {
  margin: 0;
  font-size: clamp(27px, 3.35vw, 45px);
  line-height: 1.08;
  letter-spacing: -.047em;
  text-wrap: balance;
}

.research-overview-defs {
  position: absolute;
  width: 0;
  height: 0;
  pointer-events: none;
}

.research-overview-stages {
  margin-top: clamp(18px, 3vw, 34px);
  border-block: 1px solid var(--story-line);
}

.research-stage {
  display: grid;
  grid-template-columns: minmax(120px, .9fr) minmax(0, 4fr);
  gap: clamp(16px, 2.8vw, 38px);
  align-items: start;
  padding-block: clamp(17px, 2.5vw, 30px);
}

.research-stage + .research-stage {
  border-top: 1px solid var(--story-line);
}

.research-stage-heading > span {
  color: var(--story-blue);
  font-size: .875rem;
  font-weight: 650;
}

.research-stage-heading h3 {
  margin: 4px 0 0;
  font-size: clamp(17px, 1.75vw, 23px);
  font-weight: 650;
  line-height: 1.22;
  text-wrap: balance;
}

.research-pretraining {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(14px, 3vw, 38px);
}

.research-pretraining figure {
  display: grid;
  grid-template-rows: minmax(3.1rem, auto) auto auto;
  justify-items: center;
  align-items: center;
  gap: 8px;
  margin: 0;
  text-align: center;
}

.research-pretraining figcaption {
  align-self: start;
  color: var(--story-ink);
  font-size: clamp(16px, 1.5vw, 19px);
  font-weight: 650;
  line-height: 1.22;
  text-wrap: balance;
}

.research-pretraining figcaption span {
  display: block;
  margin-top: 3px;
  color: var(--story-muted);
  font-size: .875rem;
  font-weight: 550;
}

.research-pretraining-example {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: clamp(4px, .7vw, 10px);
}

.research-pretraining-example img,
.research-wam-image {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 4px;
}

.research-pretraining-example > img { width: clamp(42px, 6vw, 72px); min-width: 0; }
.research-pretraining-example > .research-connector { flex: 0 0 14px; }

.research-pretraining-stage {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  justify-content: center;
  gap: clamp(4px, .55vw, 8px);
  font-size: clamp(10px, 1.05vw, 14px);
}

.research-latent-stack {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: clamp(1px, .18vw, 3px);
}

.research-latent-stack i,
.research-latent-output {
  display: block;
  width: clamp(3px, .45vw, 7px);
  height: 36px;
  border: 1px solid #b9ad91;
  border-radius: 3px;
  background: #f4f1e9;
}

.research-latent-output { width: clamp(8px, 1.12vw, 16px); justify-self: center; }

.research-latent-stack-compress i:nth-child(2),
.research-latent-stack-expand i:nth-child(2) { height: 27px; }

.research-latent-stack-compress i:nth-child(3),
.research-latent-stack-expand i:nth-child(1) { height: 18px; }

.research-pretraining figure p {
  margin: 3px 0 0;
  color: var(--story-muted);
  font-size: .9rem;
  font-weight: 600;
}

.research-wam-block {
  --research-input-width: clamp(38px, 5vw, 60px);
  --research-module-width: clamp(88px, 12vw, 140px);
  --research-wam-gap: clamp(4px, 1vw, 12px);

  display: grid;
  width: 100%;
  justify-items: center;
  text-align: center;
}

.research-stage.research-stage-policy {
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(12px, 1.8vw, 22px);
}

.research-frozen-term {
  position: relative;
  padding-inline-end: .55em;
  color: var(--story-blue);
}

.research-title-snowflake {
  position: absolute;
  inset-block-start: -.08em;
  inset-inline-end: -.06em;
  width: .63em;
  height: .63em;
}

.research-path-note {
  margin: 5px 0 0;
  color: var(--story-ink);
  font-size: clamp(15px, 1.45vw, 18px);
  font-weight: 650;
  line-height: 1.45;
  text-wrap: pretty;
}

.research-wam {
  display: grid;
  grid-template-columns: var(--research-input-width) 17px var(--research-module-width) 23px minmax(118px, 1fr);
  align-items: center;
  gap: var(--research-wam-gap);
  width: min(100%, 540px);
  color: var(--story-ink);
  font-size: clamp(12px, 1.3vw, 16px);
  line-height: 1.18;
}

.research-connector {
  display: block;
  width: 100%;
  height: 12px;
  fill: none;
  stroke: #638194;
  stroke-width: 1.45;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.research-wam-fork { height: 62px; }

.research-wam-outputs {
  display: grid;
  grid-template-rows: repeat(2, minmax(28px, auto));
  gap: 10px;
}

.research-wam-output {
  display: grid;
  grid-template-columns: minmax(128px, 1.25fr) 15px minmax(38px, 1fr);
  text-align: start;
  gap: 4px;
  align-items: center;
}

.research-module {
  display: grid;
  place-items: center;
  min-height: 28px;
  padding: 3px 6px;
  border: 1px solid var(--overview-border);
  border-radius: 5px;
  background: var(--overview-fill);
  font-weight: 600;
  text-align: center;
}

.research-encoder {
  --overview-fill: #f4f1e9;
  --overview-border: #b9ad91;
  position: relative;
}

.research-wam-block .research-encoder {
  --overview-fill: #edf4f7;
  --overview-border: #a1b6c4;
}

.research-predictor {
  --overview-fill: #edf4f7;
  --overview-border: #a1b6c4;
}

.research-expert {
  --overview-fill: #f8efe7;
  --overview-border: #bd9478;
}

.research-encoder-state {
  position: absolute;
  right: 3px;
  bottom: calc(100% + 2px);
  width: 17px;
  height: 17px;
}

.research-frozen {
  fill: none;
  stroke: #386184;
  stroke-width: 1.35;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.research-wam-output .research-module {
  height: 34px;
  white-space: nowrap;
}

.research-wam-block .research-encoder-state {
  right: 2px;
  bottom: calc(100% + 7px);
  width: 14px;
  height: 14px;
}

.research-training-transition {
  margin: 0 auto clamp(28px, 5vw, 60px);
  padding: clamp(24px, 4vw, 48px) 0;
  border-block: 1px solid var(--story-line);
  text-align: start;
}

.research-training-title {
  max-inline-size: 45ch;
  margin: 0;
  color: var(--story-ink);
  font-size: clamp(24px, 3.1vw, 42px);
  font-weight: 620;
  line-height: 1.16;
  letter-spacing: -.035em;
  text-wrap: balance;
}

.research-training-title strong {
  display: block;
  margin-block-end: .12em;
  color: #9c472b;
  font-weight: 760;
  white-space: nowrap;
}

.research-training-title em { color: #9c472b; }

@media (prefers-reduced-motion: no-preference) {
  .research-training-transition .is-playing .research-training-title {
    animation: research-text-enter .55s cubic-bezier(.22,.61,.36,1) both;
  }

  .research-training-transition .is-paused .research-training-title {
    animation-play-state: paused;
  }
}

@keyframes research-text-enter {
  from { opacity: .24; transform: translateY(9px); }
}

@media (max-width: 830px) {
  .research-stage { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .research-stage-heading h3 { text-wrap: pretty; }
}

@media (max-width: 580px) {
  .research-pretraining figure {
    grid-template-rows: minmax(2.7rem, auto) auto auto;
    gap: 6px;
    max-width: 400px;
    width: 100%;
    margin-inline: auto;
  }

  .research-pretraining-example { max-width: 370px; }

  .research-wam-block {
    --research-input-width: 37px;
    --research-module-width: 76px;
    --research-wam-gap: 4px;
  }

  .research-wam {
    grid-template-columns: var(--research-input-width) 14px var(--research-module-width) 16px minmax(0, 1fr);
    width: min(100%, 390px);
  }
  .research-wam-output { grid-template-columns: minmax(98px, 1.45fr) 10px minmax(25px, 1fr); }
}

@media (max-width: 460px) {
  .research-pretraining { grid-template-columns: minmax(0, 1fr); }
  .research-pretraining figure { grid-template-rows: auto auto auto; }
}

@media (max-width: 400px) {
  .research-wam-block {
    --research-input-width: 30px;
    --research-module-width: 65px;
  }
}
