.animated .story {
  --foreground-gutter: clamp(28px, 5vw, 106px);
  --foreground-width: min(53vw, 880px);
}

.animated .story .chapter {
  --gains: inherit;
}

.animated .story .experience {
  --arrive: var(--experience-in, 0);
  --leave: var(--experience-out, 0);
}

.animated .story .results {
  --arrive: var(--results-in, 0);
  --leave: var(--results-out, 0);
}

.animated .story .lesson {
  --arrive: var(--lesson-in, 0);
  --leave: var(--lesson-out, 0);
}

.animated .story :is(.experience, .results, .lesson) {
  --prop-opacity: min(1, calc(var(--arrive) * 4), calc((1 - var(--leave)) * 4));
}

.animated .story .chapter-view {
  position: relative;
  display: grid;
  align-content: center;
  pointer-events: none;
}

.animated .story :is(.intro-copy, .experience-layout, .results-layout, .lesson-scene, .rates-paper) {
  width: var(--foreground-width);
  max-width: none;
  margin: 0 0 0 var(--foreground-gutter);
}

.animated .story :is(.experience-layout, .results-layout, .lesson-scene) {
  padding: 0;
  clip-path: inset(-100svh -2vw -100svh -100vw);
}

.animated .story .intro-copy {
  padding: 0;
  color: var(--cream);
  opacity: min(1, calc((1 - var(--intro-out, 0)) * 4));
  transform: translateX(calc(var(--intro-out, 0) * -66vw));
}

.animated .story .intro-copy h1 {
  font-size: clamp(77px, 10.6vw, 184px);
}

.animated .story .experience-layout {
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(13px, 2vw, 30px);
}

.animated .story .profile-paper {
  padding: clamp(19px, 2.5vw, 41px);
  border-radius: 0 9px 9px 0;
  border-left: 6px solid #ad5946;
  box-shadow: 8px 10px 0 #3e302c47;
  opacity: var(--prop-opacity);
  transform: translateX(calc(((1 - var(--arrive)) * -42 - var(--leave) * 42) * 1vw))
    rotate(calc((var(--arrive) - 1) * 8deg + var(--leave) * -6deg));
}

.animated .story .profile-paper h2 {
  font-size: clamp(28px, 3.3vw, 54px);
  line-height: .98;
  margin: 0.25em 0 0.4em;
}

.animated .story .profile-paper p:not(.eyebrow) {
  font-size: clamp(13px, 1.06vw, 17px);
  line-height: 1.48;
}

.animated .story .course-notes {
  width: 100%;
  margin: 0;
  padding: clamp(14px, 1.6vw, 24px);
  opacity: var(--prop-opacity);
  transform: translate(calc(var(--leave) * 36vw), calc((1 - var(--arrive)) * 71svh + var(--leave) * 42svh))
    rotate(calc(1.3deg + (1 - var(--arrive)) * 12deg + var(--leave) * 9deg));
}

.animated .story .course-notes dl { margin-top: 9px; }
.animated .story .course-notes dl div + div { margin-top: 8px; padding-top: 8px; }
.animated .story .course-notes dt { font-size: clamp(12px, 1vw, 15px); }
.animated .story .course-notes dd { font-size: clamp(11px, .88vw, 14px); line-height: 1.34; }

.animated .story .results-header {
  width: fit-content;
  margin-bottom: clamp(11px, 2vh, 20px);
  padding: 10px 16px 12px;
  color: var(--ink);
  background: #f1c981;
  border-radius: 3px 12px 0 0;
  box-shadow: 5px 6px 0 #503b2c45;
  opacity: var(--prop-opacity);
  transform: translateY(calc((1 - var(--arrive)) * -38svh + var(--leave) * -48svh));
}

.animated .story .results-header .eyebrow { color: #7c3b30; }
.animated .story .results-header h2 {
  margin-top: 3px;
  font-size: clamp(33px, 4vw, 67px);
}

.animated .story .report-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(10px, 1.6vw, 26px);
}

.animated .story .report {
  min-width: 0;
  padding: clamp(12px, 1.7vw, 25px);
  opacity: var(--prop-opacity);
}



.animated .story .report h3 { font-size: clamp(14px, 1.4vw, 23px); }
.animated .story .report-outcome { gap: clamp(8px, 1.2vw, 15px); }
.animated .story .report-outcome > strong { font-size: clamp(41px, 5.1vw, 83px); }
.animated .story .report-outcome > span { font-size: clamp(12px, 1.05vw, 17px); }
.animated .story .ums { font-size: clamp(12px, 1vw, 15px); }
.animated .story .gain-label { font-size: 10px; }
.animated .story .gain-caption { font-size: 12px; }

.animated .story .lesson-scene {
  isolation: auto;
  grid-template-columns: minmax(0, 1fr);
  justify-items: start;
  align-content: center;
  min-height: 0;
  gap: 12px;
}

.animated .story .lesson-scene::before,
.animated .story .lesson-scene::after { content: none; }

.animated .story .lesson-copy {
  width: min(100%, 42rem);
  max-width: none;
  padding: 11px clamp(13px, 1.7vw, 24px) 13px;
  color: var(--ink);
  background: #f7deb0;
  border-left: 4px solid #ad5946;
  box-shadow: 5px 6px 0 #513a2c38;
  opacity: var(--prop-opacity);
  transform: translateX(calc((1 - var(--arrive)) * -59vw - var(--leave) * 66vw));
}

.animated .story .lesson-copy h2 {
  max-width: none;
  margin: 3px 0 5px;
  font-size: clamp(27px, 3.05vw, 51px);
  text-wrap: initial;
}

.animated .story .lesson-copy p {
  max-width: none;
  margin: 0.35em 0 0;
  font-size: clamp(13px, 1.03vw, 17px);
  line-height: 1.36;
}

.animated .story .lesson-copy .lesson-eyebrow { font-size: 10px; }
.animated .story .lesson-tools {
  width: min(100%, 42rem);
  max-width: none;
  opacity: var(--prop-opacity);
  transform-origin: left center;
  transform: translate(calc((1 - var(--arrive)) * 48vw + var(--leave) * 47vw), calc((1 - var(--arrive)) * 34svh + var(--leave) * 28svh))
    scale(calc(.24 + .76 * var(--arrive) - .73 * var(--leave)));
}

.animated .story .lesson-whiteboard {
  opacity: min(1, calc((1 - var(--handoff, 0)) * 4));
  transform: translateX(calc(var(--handoff, 0) * -92%)) rotate(calc(var(--handoff, 0) * -7deg));
}

.animated .story .lesson-doc {
  opacity: min(1, calc(var(--handoff, 0) * 4));
  transform-origin: bottom right;
  transform: perspective(700px) translateX(calc((1 - var(--handoff, 0)) * 92%))
    rotate(calc((1 - var(--handoff, 0)) * 7deg)) rotateX(calc(54deg * var(--leave)));
}

.animated .story .lesson-graph { height: clamp(148px, 29svh, 290px); }
.animated .story .lesson-board { padding-top: 0.4rem; }
.animated .story .lesson-window-bar { min-height: 2rem; }
.animated .story .lesson-window figcaption { padding-block: 0.44rem; }

.animated .story .rates-paper {
  width: min(var(--foreground-width), 31rem);
  padding: clamp(21px, 3vw, 46px);
  border-top: 7px solid #a4513d;
  border-bottom: 2px dashed #9d7861;
  opacity: min(1, calc(var(--rates-in, 0) * 4));
  transform-origin: left center;
  transform: translate(calc((1 - var(--rates-in, 0)) * 53vw), calc((1 - var(--rates-in, 0)) * 38svh))
    rotate(calc((1 - var(--rates-in, 0)) * -15deg)) scale(calc(.22 + .78 * var(--rates-in, 0)));
}

.animated .story .rates-paper h2 { font-size: clamp(42px, 5vw, 73px); }

@media (min-width: 761px) and (max-width: 960px) {
  .animated .story .experience-layout { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .animated .story .course-notes { width: min(95%, 23rem); justify-self: end; }
}

@media (max-width: 760px), (max-width: 1050px) and (max-aspect-ratio: 6/5) {
  .animated .story {
    --foreground-gutter: clamp(15px, 5vw, 36px);
    --foreground-width: min(calc(100% - var(--foreground-gutter) * 2), 34rem);
  }

  .animated .story .chapter-view {
    align-content: start;
    align-items: start;
    padding-block: calc(var(--mobile-art-height, 27svh) + 12px) 14px;
  }

  .animated .story :is(.intro-copy, .experience-layout, .results-layout, .lesson-scene, .rates-paper) {
    margin-inline: auto;
  }

  .animated .story :is(.experience-layout, .results-layout, .lesson-scene) {
    clip-path: inset(-12px -100vw -100svh -100vw);
  }

  .animated .story .intro-copy { margin-top: 16px; }
  .animated .story .intro-copy h1 { font-size: clamp(62px, 17vw, 111px); }
  .animated .story .intro-links { margin-top: 14px; gap: 16px; }

  .animated .story .experience-layout { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .animated .story .profile-paper { padding: 15px 17px; }
  .animated .story .profile-paper h2 { font-size: clamp(28px, 7.5vw, 46px); }
  .animated .story .profile-paper p + p { margin-top: 7px; }
  .animated .story .course-notes { width: min(96%, 27rem); justify-self: end; padding: 13px 15px; }
  .animated .story .course-notes dt,
  .animated .story .course-notes dd { font-size: 12px; }
  .animated .story .course-notes dl div + div { margin-top: 5px; padding-top: 5px; }

  .animated .story .results-header { margin-bottom: 9px; padding: 7px 11px; }
  .animated .story .results-header h2 { font-size: clamp(29px, 7.4vw, 47px); }
  .animated .story .report-grid { grid-template-columns: minmax(0, 1fr); gap: 9px; }
  .animated .story .report { padding: 9px 12px; }
  .animated .story .report-outcome { margin: 2px 0 4px; }
  .animated .story .report-outcome > strong { font-size: clamp(40px, 10vw, 57px); }
  .animated .story .ums { margin: 5px 0 0; }
  .animated .story .gain { padding-top: 5px; }
  .animated .story .gain-label { padding-top: 4px; }
  .animated .story .gain-steps { margin-top: 3px; }
  .animated .story .gain-steps > span:not(.gain-arrow) { min-width: 24px; min-height: 24px; }
  .animated .story .gain-caption { margin-top: 3px; }

  .animated .story .lesson-scene { gap: 8px; }
  .animated .story .lesson-copy { padding: 8px 11px 10px; }
  .animated .story .lesson-copy h2 { font-size: clamp(26px, 7vw, 42px); }
  .animated .story .lesson-copy p { line-height: 1.32; }
  .animated .story .lesson-graph { height: clamp(132px, 20svh, 184px); }
  .animated .story .lesson-window figcaption { font-size: 11px; }

  .animated .story .rates-paper { padding: 18px 20px; }
  .animated .story .rates-paper h2 { font-size: clamp(36px, 8.5vw, 52px); }
  .animated .story .rates-paper h2 br { display: none; }
}

@media (max-width: 390px) {
  .animated .story .lesson-whiteboard-content { grid-template-columns: minmax(0, 1fr) 3.35rem; }
  .animated .story .lesson-call { grid-template-columns: 1fr; }
}

.animated .story .syllabus-props {
  display: grid;
  min-width: 0;
  gap: 13px;
}
.animated .story .credential-mark {
  display: block;
  width: fit-content;
  justify-self: center;
  padding: 9px 14px;
  color: #342f29;
  background: #f8d797;
  border: 4px solid #694138;
  box-shadow: 4px 5px 0 #39282e52, inset 0 0 0 1px #a97751;
  font: 700 clamp(13px, 1.6vw, 25px)/1 var(--serif);
  text-align: center;
  opacity: var(--prop-opacity);
  transform: translateX(calc(((1 - var(--arrive)) * 48 + var(--leave) * 42) * 1vw))
    rotate(calc(-4deg + (1 - var(--arrive)) * 8deg));
}
.animated .story .credential-mark span {
  display: block;
  margin-top: 4px;
  font: 650 10px/1.15 var(--sans);
}
.animated .story .report-ib {
  transform: translate(calc((1 - var(--arrive)) * -40vw - var(--leave) * 31vw), calc(var(--leave) * 44svh))
    rotate(calc((1 - var(--arrive)) * -9deg + var(--leave) * -7deg));
}
.animated .story .report-a {
  transform: translateX(calc((1 - var(--arrive)) * 34vw + var(--leave) * 39vw))
    rotate(calc((1 - var(--arrive)) * 9deg + var(--leave) * 7deg));
}

@media (max-width: 760px), (max-width: 1050px) and (max-aspect-ratio: 6/5) {
  .animated .story .syllabus-props { gap: 0; }
  .animated .story .credential-mark {
    justify-self: start;
    margin: -5px 0 -2px 10px;
    z-index: 2;
    padding: 4px 7px;
    font-size: 13px;
  }
  .animated .story .credential-mark span { display: inline; margin: 0 0 0 4px; }
  .animated .story .syllabus-props .course-notes { justify-self: center; }
  .animated .story .lesson-tools {
    transform-origin: center top;
    transform: translate(calc((1 - var(--arrive)) * 28vw + var(--leave) * 35vw), calc(((1 - var(--arrive)) * -19 + var(--leave) * -17) * 1svh))
      scale(calc(.28 + .72 * var(--arrive) - .72 * var(--leave)));
  }
  .animated .story .rates-paper {
    transform: translate(calc((1 - var(--rates-in, 0)) * 34vw), calc((1 - var(--rates-in, 0)) * -20svh))
      rotate(calc((1 - var(--rates-in, 0)) * -15deg)) scale(calc(.25 + .75 * var(--rates-in, 0)));
  }
}

@media (max-width: 760px) and (max-height: 739px),
       (max-width: 1050px) and (max-aspect-ratio: 6/5) and (max-height: 739px) {
  .animated .story .chapter-view { padding-block: calc(var(--mobile-art-height) + 10px) 10px; }
  .animated .story .experience-layout { gap: 10px; }
  .animated .story .profile-paper { padding: 13px 15px; }
  .animated .story .profile-paper h2 { font-size: clamp(27px, 6.6vw, 40px); }
  .animated .story .profile-paper p:not(.eyebrow) { line-height: 1.38; }
  .animated .story .course-notes { padding: 10px 13px; }
  .animated .story .lesson-copy p { font-size: 12px; line-height: 1.3; }
  .animated .story .lesson-window figcaption { padding-block: 5px; }
}

@media (max-width: 430px) and (max-height: 739px) {
  .animated .story .profile-paper { padding-block: 10px; }
  .animated .story .profile-paper p:not(.eyebrow) { font-size: 12px; line-height: 1.33; }
  .animated .story .syllabus-props .course-notes { padding-block: 8px; }
}
