@scope (.hero) {
  :scope {
    --scene-height: clamp(580px, calc(100svh - 210px), 940px);
    overflow: clip;
  }
  .eyebrow,
  .panel-label,
  .recipe-top,
  .computer-inset span,
  .computer-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.1em;
  }
  .stage {
    position: relative;
    isolation: isolate;
    container-type: size;
    height: var(--scene-height);
    overflow: hidden;
    background: var(--cream);
  }
  .frame,
  .confrontation {
    position: absolute;
    inset: 0;
    pointer-events: none;
  }
  .frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
  }
  .cooking,
  .payoff,
  .confrontation {
    opacity: 0;
  }
  .payoff {
    opacity: 1;
  }
  .confrontation {
    z-index: 2;
  }
  .landlord-left {
    clip-path: polygon(0 0, 62% 0, 44% 100%, 0 100%);
  }
  .landlord-right {
    clip-path: polygon(62% 0, 100% 0, 100% 100%, 44% 100%);
  }
  /* Matches the plates' object-fit: cover box, so labels can be placed
     in image percentages and stay on the artwork at any stage size. */
  .art-labels {
    position: absolute;
    top: 50%;
    left: 50%;
    width: max(100cqw, 100cqh * 1672 / 941);
    aspect-ratio: 1672 / 941;
    transform: translate(-50%, -50%);
  }
  /* Sits on the bottom edge of the computer panel, parallel to it. */
  .computer-label {
    position: absolute;
    left: 69.5%;
    bottom: 70.6%;
    padding: 6px 10px;
    background: var(--lime);
    color: var(--navy);
    white-space: nowrap;
    transform-origin: 0 100%;
    transform: rotate(11deg);
  }
  .payoff .computer-label {
    left: 75.9%;
    bottom: 79.1%;
    transform: rotate(9deg);
  }
  .headline {
    position: absolute;
    z-index: 3;
    top: 5%;
    left: 3.5%;
    width: 38%;
    padding: 16px;
    background: var(--cream);
    clip-path: polygon(0 0, 100% 1%, 97% 100%, 1% 97%);
  }
  .eyebrow {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 0 0 24px;
  }
  .story-step {
    background: var(--blue);
    color: var(--cream);
    padding: 6px 8px;
    white-space: nowrap;
  }
  h1 {
    font-family: "Rctngl Display", "IBM Plex Mono", monospace;
    font-weight: 400;
    font-size: clamp(60px, 6.4cqw, 110px);
    line-height: 1.1;
    letter-spacing: -0.015em;
    margin: 0;
    white-space: pre-line;
  }
  .lease-note {
    position: absolute;
    z-index: 4;
    left: 52%;
    top: 56%;
    transform: rotate(9deg);
    padding: 20px 24px;
    background: var(--cream);
    border: 2px solid var(--blue);
    box-shadow: 5px 5px 0 var(--pink);
    opacity: 0;
  }
  .lease-note span {
    display: block;
    font-size: 9px;
    letter-spacing: 0.1em;
  }
  .lease-note strong {
    display: block;
    font-family: "Rctngl Display", "IBM Plex Mono", monospace;
    font-weight: 400;
    font-size: clamp(28px, 3cqw, 48px);
    line-height: 1.1;
    margin: 10px 0 14px;
  }
  .choice {
    position: absolute;
    z-index: 5;
    top: 46%;
    left: 3.5%;
    width: min(36%, 460px);
    padding: 20px 24px;
    background: var(--cream);
    color: var(--navy);
    border: 3px solid var(--navy);
    box-shadow: 7px 7px 0 var(--pink);
    transform: rotate(-2deg);
    visibility: hidden;
  }
  .choice ol {
    list-style: none;
    margin: 14px 0 0;
    padding: 0;
    display: grid;
    gap: 6px;
  }
  .choice li {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 6px 10px;
    font-size: clamp(20px, 2.3cqw, 36px);
    font-weight: 600;
    letter-spacing: -0.025em;
  }
  .choice li span {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 1.5em;
    height: 1.5em;
    border: 2px solid var(--navy);
    font-size: 0.55em;
    letter-spacing: 0;
  }
  .ask-panel {
    position: absolute;
    z-index: 5;
    top: 44%;
    left: 30%;
    width: fit-content;
    max-width: 56%;
    background: var(--lime);
    color: var(--navy);
    padding: 26px 40px 30px 36px;
    border: 3px solid var(--navy);
    box-shadow: 8px 8px 0 var(--pink);
    transform: rotate(-4deg);
    visibility: hidden;
  }
  /* One line per <br>, so the quote never strands a word. */
  .ask-panel p {
    font-size: clamp(22px, 2.7cqw, 46px);
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.025em;
    margin: 16px 0 0;
    padding-right: 1.6em;
    white-space: nowrap;
  }
  .ask-mark {
    position: absolute;
    right: 22px;
    bottom: 22px;
    font-size: clamp(28px, 2.6cqw, 42px);
    line-height: 1;
  }
  .computer-inset {
    display: none;
    position: absolute;
    z-index: 3;
    right: 5%;
    top: 27%;
    width: 155px;
    height: 120px;
    overflow: hidden;
    border: 3px solid var(--blue);
    background: var(--cream);
    transform: rotate(5deg);
  }
  .computer-inset img {
    position: absolute;
    right: 0;
    top: 0;
    width: 470px;
    height: auto;
    max-width: none;
  }
  .computer-inset span {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 6px;
    background: var(--lime);
    font-size: 7px;
  }
  .recipe {
    position: absolute;
    z-index: 3;
    top: 28%;
    left: 47%;
    width: 34%;
    max-width: 480px;
    padding: 24px 30px;
    background: var(--cream);
    border: 3px solid var(--blue);
    box-shadow: 7px 7px 0 var(--lime);
    transform: rotate(2deg);
  }
  .recipe-top {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid var(--blue);
    padding-bottom: 12px;
  }
  .recipe h2 {
    font-family: "Rctngl Display", "IBM Plex Mono", monospace;
    font-weight: 400;
    font-size: clamp(32px, 3.7cqw, 58px);
    line-height: 1.1;
    letter-spacing: -0.025em;
    margin: 20px 0;
  }
  .recipe dl {
    margin: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 24px;
  }
  .recipe dl div {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    border-bottom: 1px solid #0b2d7440;
    padding-bottom: 6px;
  }
  .recipe dt {
    font-size: 13px;
  }
  .recipe dd {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
  }
  .recipe > p {
    margin: 20px 0 0;
    font-size: 12px;
  }
  .sound-effect {
    position: absolute;
    z-index: 4;
    right: 7%;
    top: 12%;
    font-family: "Rctngl Display", "IBM Plex Mono", monospace;
    font-weight: 400;
    font-size: clamp(60px, 8cqw, 130px);
    color: var(--lime);
    -webkit-text-stroke: 2px var(--navy);
    text-shadow: 5px 5px 0 var(--pink);
    transform: rotate(12deg);
    opacity: 0;
  }
  .story-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 62px;
    gap: 24px;
    padding: 12px 4%;
    border-top: 2px solid var(--blue);
    background: var(--blue);
    color: var(--cream);
  }
  .scene-caption {
    font-size: 13px;
    line-height: 1.4;
    margin: 0;
  }
  .playback {
    display: flex;
    gap: 18px;
    flex-shrink: 0;
  }
  .playback button {
    background: transparent;
    color: inherit;
    border: 0;
    padding: 8px 0;
    font-size: 12px;
  }
  .playback button:hover {
    color: var(--lime);
  }
  .progress {
    display: flex;
    gap: 3px;
    background: var(--blue);
  }
  .progress span {
    flex: 1;
    height: 4px;
    background: #e9e2d340;
  }
  .progress .complete {
    background: var(--lime);
  }
  .colophon {
    padding: 24px 4%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
  }
  .product-line {
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 6px;
  }
  .product-detail {
    font-size: 12px;
    line-height: 1.5;
    margin: 0;
  }
  .signup {
    flex-shrink: 0;
  }
  .join {
    display: flex;
    gap: 28px;
    justify-content: space-between;
    background: var(--blue);
    color: var(--cream);
    padding: 13px 18px;
    text-decoration: none;
    font-size: 14px;
  }
  .join:hover {
    background: var(--navy);
  }
  .join span {
    color: var(--lime);
  }
  .signup p {
    font-size: 9px;
    margin: 8px 0 0;
  }
  :scope:not([data-scene="5"]) .payoff,
  :scope:not([data-scene="5"]) .recipe {
    opacity: 0;
    visibility: hidden;
  }
  :scope[data-scene="0"] .cooking,
  :scope[data-scene="3"] .cooking {
    opacity: 1;
  }
  :scope[data-scene="0"] .choice,
  :scope[data-scene="3"] .choice {
    visibility: visible;
  }
  :scope[data-scene="3"] .pick-phone {
    opacity: 0.45;
    text-decoration: line-through;
  }
  :scope[data-scene="3"] .pick-rctngl {
    background: var(--lime);
  }
  :scope[data-scene="1"] .confrontation,
  :scope[data-scene="2"] .confrontation,
  :scope[data-scene="3"] .confrontation {
    opacity: 1;
  }
  :scope[data-scene="2"] .lease-note {
    opacity: 1;
  }
  :scope[data-scene="4"] .payoff {
    opacity: 1;
    visibility: visible;
  }
  :scope[data-scene="4"] .ask-panel {
    visibility: visible;
  }
  :scope.motion[data-scene="0"] .cooking {
    animation: kitchen-drift 5000ms linear both;
  }
  :scope.motion[data-scene="0"] .choice {
    animation: choice-pops-in 450ms 700ms both;
  }
  :scope.motion[data-scene="0"] .pick-phone {
    animation: option-picked 500ms 3500ms both;
  }
  :scope.motion[data-scene="1"] .confrontation {
    animation: landlord-arrives 650ms cubic-bezier(0.16, 1, 0.3, 1) both;
  }
  :scope.motion[data-scene="2"] .confrontation {
    animation: lease-push 4200ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
    transform-origin: 62% 62%;
  }
  :scope.motion[data-scene="2"] .lease-note {
    animation: stamp-slam 550ms 500ms both;
  }
  :scope.motion[data-scene="3"] .landlord-left {
    animation: tear-left 1400ms 200ms cubic-bezier(0.6, 0, 0.4, 1) both;
  }
  :scope.motion[data-scene="3"] .landlord-right {
    animation: tear-right 1400ms 200ms cubic-bezier(0.6, 0, 0.4, 1) both;
  }
  :scope.motion[data-scene="3"] .sound-effect {
    animation: rip-lettering 1800ms 100ms both;
  }
  :scope.motion[data-scene="3"] .choice {
    animation: choice-pops-in 450ms 1400ms both;
  }
  :scope.motion[data-scene="3"] .computer-inset {
    animation: fade-in 450ms 1400ms both;
  }
  :scope.motion[data-scene="3"] .pick-rctngl {
    animation: option-picked 500ms 2800ms both;
  }
  :scope.motion[data-scene="4"] .ask-panel {
    animation: ask-cuts-in 450ms both;
  }
  :scope.motion[data-scene="5"] .recipe {
    animation: recipe-unfolds 900ms both;
  }
  @keyframes kitchen-drift {
    from {
      transform: scale(1.03);
    }
    to {
      transform: scale(1.08) translate(-0.5%, -0.5%);
    }
  }
  @keyframes landlord-arrives {
    from {
      transform: translate(12%, 28%) scale(0.82) rotate(4deg);
    }
    to {
      transform: none;
    }
  }
  @keyframes choice-pops-in {
    from {
      transform: translateY(60px) rotate(-8deg);
      opacity: 0;
    }
    to {
      transform: rotate(-2deg);
      opacity: 1;
    }
  }
  @keyframes option-picked {
    from {
      background: transparent;
    }
    50% {
      transform: scale(1.06) rotate(-1deg);
    }
    to {
      background: var(--lime);
      transform: none;
    }
  }
  @keyframes fade-in {
    from {
      opacity: 0;
    }
  }
  @keyframes lease-push {
    from {
      transform: scale(1);
    }
    to {
      transform: scale(1.23) rotate(-2deg);
    }
  }
  @keyframes stamp-slam {
    from {
      transform: scale(2.5) rotate(-18deg);
      opacity: 0;
    }
    65% {
      transform: scale(0.92) rotate(9deg);
      opacity: 1;
    }
    to {
      transform: rotate(9deg);
      opacity: 1;
    }
  }
  @keyframes ask-cuts-in {
    from {
      transform: translateY(100px) rotate(-12deg);
      opacity: 0;
    }
    to {
      transform: rotate(-4deg);
      opacity: 1;
    }
  }
  @keyframes tear-left {
    from {
      transform: none;
    }
    to {
      transform: perspective(1000px) translateX(-105%) rotateY(-30deg)
        rotate(-12deg);
    }
  }
  @keyframes tear-right {
    from {
      transform: none;
    }
    to {
      transform: perspective(1000px) translateX(105%) rotateY(30deg)
        rotate(12deg);
    }
  }
  @keyframes rip-lettering {
    0% {
      opacity: 0;
      transform: scale(2) rotate(12deg);
    }
    15%,
    75% {
      opacity: 1;
      transform: rotate(12deg);
    }
    100% {
      opacity: 0;
    }
  }
  @keyframes recipe-unfolds {
    from {
      transform: perspective(900px) rotateX(-75deg) rotate(2deg);
      opacity: 0;
    }
    to {
      transform: rotate(2deg);
      opacity: 1;
    }
  }
  :scope.resetting .stage * {
    animation: none !important;
  }
  /* Narrow stages crop the artwork's computer panel; show the framed
     inset instead of labelling the panel. */
  @container (aspect-ratio < 3 / 2) {
    .art-labels {
      display: none;
    }
    .computer-inset {
      display: block;
    }
    :scope[data-scene="1"] .computer-inset,
    :scope[data-scene="2"] .computer-inset,
    :scope[data-scene="4"] .computer-inset {
      display: none;
    }
  }
  @media (min-width: 1001px) and (min-aspect-ratio: 2 / 1) {
    :scope {
      max-width: calc(var(--scene-height) * 1672 / 941);
      margin-inline: auto;
    }
  }
  @media (max-width: 1000px) {
    .headline {
      width: 42%;
    }
    h1 {
      font-size: clamp(60px, 8vw, 85px);
    }
    .eyebrow {
      gap: 10px;
      font-size: 8px;
    }
    .recipe {
      width: 39%;
      left: 49%;
      padding: 22px;
    }
    .recipe dl {
      gap: 10px 16px;
    }
    .scene-kicker {
      max-width: 15ch;
    }
  }
  @media (max-width: 600px) {
    .stage {
      height: 710px;
    }
    .frame img {
      object-position: 57% center;
    }
    .cooking img {
      object-position: 38% center;
    }
    .payoff img {
      object-position: 44% center;
    }
    .headline {
      top: 16px;
      left: 12px;
      width: calc(100% - 24px);
      padding: 14px;
      background: transparent;
      clip-path: none;
    }
    .eyebrow {
      margin-bottom: 18px;
      gap: 12px;
    }
    h1 {
      font-size: clamp(54px, 16vw, 88px);
      max-width: 7ch;
    }
    :scope[data-scene="1"] .headline,
    :scope[data-scene="2"] .headline {
      width: 70%;
      padding: 14px;
      left: 12px;
      top: auto;
      bottom: 18%;
      background: var(--cream);
      clip-path: polygon(0 0, 100% 0, 94% 100%, 0 96%);
    }
    :scope[data-scene="1"] h1,
    :scope[data-scene="2"] h1,
    :scope[data-scene="4"] h1 {
      font-size: clamp(32px, 10vw, 42px);
      max-width: none;
    }
    :scope[data-scene="3"] .headline,
    :scope[data-scene="4"] .headline {
      width: 83%;
      background: var(--cream);
      clip-path: polygon(0 0, 100% 0, 94% 100%, 0 96%);
    }
    :scope[data-scene="1"] .scene-kicker,
    :scope[data-scene="2"] .scene-kicker {
      display: none;
    }
    .lease-note {
      left: 40%;
      top: 40%;
      padding: 12px;
    }
    .lease-note strong {
      font-size: 30px;
    }
    .choice {
      top: 54%;
      left: 7%;
      width: 72%;
      padding: 16px 18px;
    }
    .choice li {
      font-size: clamp(22px, 7vw, 30px);
    }
    .ask-panel {
      top: 43%;
      left: 5%;
      width: auto;
      max-width: 90%;
      padding: 22px 18px 24px;
    }
    .ask-panel p {
      font-size: min(22px, 5.6vw);
      padding-right: 0;
    }
    .ask-mark {
      right: 14px;
      bottom: 10px;
      font-size: 26px;
    }
    .panel-label {
      font-size: 8px;
    }
    .computer-inset {
      top: 35%;
      right: 6%;
      width: 130px;
      height: 104px;
    }
    .computer-inset img {
      width: 405px;
    }
    .recipe {
      top: 53%;
      left: 8%;
      width: 84%;
      padding: 20px;
    }
    .recipe h2 {
      font-size: clamp(32px, 10vw, 39px);
      margin: 16px 0;
    }
    .recipe dl {
      gap: 8px 16px;
    }
    .recipe > p {
      margin-top: 14px;
    }
    .recipe-top {
      font-size: 9px;
    }
    .sound-effect {
      right: 10%;
      top: 28%;
      font-size: 65px;
    }
    .story-bar {
      min-height: 92px;
      padding: 14px 20px;
      gap: 8px;
      align-items: flex-start;
      flex-direction: column;
    }
    .scene-caption {
      font-size: 12px;
    }
    .playback {
      gap: 24px;
    }
    .playback button {
      padding: 4px 0;
    }
    .colophon {
      padding: 24px 20px;
      flex-direction: column;
      align-items: stretch;
      gap: 20px;
    }
    .product-line {
      font-size: 18px;
    }
    .signup {
      align-self: flex-start;
    }
  }
  @media (max-width: 600px) and (max-height: 700px) {
    .stage {
      height: max(450px, calc(100svh - 164px));
    }
    h1 {
      font-size: 48px;
    }
    :scope[data-scene="1"] .headline,
    :scope[data-scene="2"] .headline {
      bottom: 10%;
    }
    :scope[data-scene="1"] h1,
    :scope[data-scene="2"] h1,
    :scope[data-scene="4"] h1 {
      font-size: 32px;
    }
    .lease-note {
      top: 34%;
    }
    .choice {
      top: 46%;
    }
    .ask-panel {
      top: 40%;
      padding: 18px 18px 20px;
    }
    .computer-inset {
      top: 25%;
      width: 112px;
      height: 84px;
    }
    .computer-inset img {
      width: 350px;
    }
    .recipe {
      top: 44%;
      padding: 16px;
    }
    .recipe h2 {
      font-size: 32px;
      margin: 12px 0;
    }
    .recipe-top {
      padding-bottom: 8px;
    }
    .recipe dl {
      gap: 6px 16px;
    }
    .recipe dl div {
      padding-bottom: 4px;
    }
    .recipe > p {
      margin-top: 12px;
    }
  }
  @media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
      animation: none !important;
    }
  }
}
